Skip to content

Commit

Permalink
Merge pull request #98 from samansmink/remove-deploy-script
Browse files Browse the repository at this point in the history
remove deploy script
  • Loading branch information
samansmink authored Dec 13, 2024
2 parents c30195b + 78921da commit 0685030
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 184 deletions.
28 changes: 6 additions & 22 deletions .github/workflows/ExtensionTemplate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
name: Linux
if: ${{ vars.RUN_RENAME_TEST == 'true' || github.repository == 'duckdb/extension-template' }}
runs-on: ubuntu-latest
container: ubuntu:18.04
strategy:
matrix:
# Add commits/tags to build against other DuckDB versions
Expand All @@ -28,24 +27,11 @@ jobs:
shell: bash

steps:
- name: Install required ubuntu packages
run: |
apt-get update -y -qq
apt-get install -y -qq software-properties-common
add-apt-repository ppa:git-core/ppa
apt-get update -y -qq
apt-get install -y -qq ninja-build make gcc-multilib g++-multilib libssl-dev wget openjdk-8-jdk zip maven unixodbc-dev libc6-dev-i386 lib32readline6-dev libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip build-essential checkinstall libffi-dev curl libz-dev openssh-client
- name: Install Git 2.18.5
run: |
wget https://github.com/git/git/archive/refs/tags/v2.18.5.tar.gz
tar xvf v2.18.5.tar.gz
cd git-2.18.5
make
make prefix=/usr install
git --version
- name: Install Ninja
shell: bash
run: sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'true'
Expand All @@ -56,8 +42,6 @@ jobs:
cd duckdb
git checkout ${{ matrix.duckdb_version }}
- uses: ./duckdb/.github/actions/ubuntu_18_setup

- name: Setup vcpkg
uses: lukka/[email protected]
with:
Expand Down Expand Up @@ -93,7 +77,7 @@ jobs:
shell: bash

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'true'
Expand Down Expand Up @@ -144,7 +128,7 @@ jobs:
shell: bash

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'true'
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,4 @@ jobs:
with:
duckdb_version: v1.1.3
ci_tools_version: v1.1.3
extension_name: quack

duckdb-stable-deploy:
name: Deploy extension binaries
needs: duckdb-stable-build
uses: ./.github/workflows/_extension_deploy.yml
secrets: inherit
with:
duckdb_version: v1.1.3
extension_name: quack
deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
extension_name: quack
121 changes: 0 additions & 121 deletions .github/workflows/_extension_deploy.yml

This file was deleted.

60 changes: 30 additions & 30 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,42 +77,42 @@ For inspiration/examples on how to extend DuckDB in a more meaningful way, check
the [in-tree extensions](https://github.com/duckdb/duckdb/tree/main/extension), and the [out-of-tree extensions](https://github.com/duckdblabs).

## Distributing your extension
Easy distribution of extensions built with this template is facilitated using a similar process used by DuckDB itself.
Binaries are generated for various versions/platforms allowing duckdb to automatically install the correct binary.

This step requires that you pass the following 4 parameters to your GitHub repo as action secrets:

| secret name | description |
| ------------- | ----------------------------------- |
| S3_REGION | s3 region holding your bucket |
| S3_BUCKET | the name of the bucket to deploy to |
| S3_DEPLOY_ID | the S3 key id |
| S3_DEPLOY_KEY | the S3 key secret |

After setting these variables, all pushes to main will trigger a new (dev) release. Note that your AWS token should
have full permissions to the bucket, and you will need to have ACLs enabled.

### Installing the deployed binaries
To install your extension binaries from S3, you will need to do two things. Firstly, DuckDB should be launched with the
`allow_unsigned_extensions` option set to true. How to set this will depend on the client you're using. Some examples:
To distribute your extension binaries, there are a few options.

### Community extensions
The recommended way of distributing extensions is through the [community extensions repository](https://github.com/duckdb/community-extensions).
This repository is designed specifically for extensions that are built using this extension template, meaning that as long as your extension can be
built using the default CI in this template, submitting it to the community extensions is a very simple process. The process works similarly to popular
package managers like homebrew and vcpkg, where a PR containing a descriptor file is submitted to the package manager repository. After the CI in the
community extensions repository completes, the extension can be installed and loaded in DuckDB with:
```SQL
INSTALL <my_extension> FROM community;
LOAD <my_extension>
```
For more information, see the [community extensions documentation](https://duckdb.org/community_extensions/documentation).

CLI:
### Downloading artifacts from GitHub
The default CI in this template will automatically upload the binaries for every push to the main branch as GitHub Actions artifacts. These
can be downloaded manually and then loaded directly using:
```SQL
LOAD '/path/to/downloaded/extension.duckdb_extension';
```
Note that this will require starting DuckDB with the
`allow_unsigned_extensions` option set to true. How to set this will depend on the client you're using. For the CLI it is done like:
```shell
duckdb -unsigned
```

Secondly, you will need to set the repository endpoint in DuckDB to the HTTP url of your bucket + version of the extension
you want to install. To do this run the following SQL query in DuckDB:
```sql
SET custom_extension_repository='bucket.s3.eu-west-1.amazonaws.com/<your_extension_name>/latest';
```
Note that the `/latest` path will allow you to install the latest extension version available for your current version of
DuckDB. To specify a specific version, you can pass the version instead.
### Uploading to a custom repository
If for some reason distributing through community extensions is not an option, extensions can also be uploaded to a custom extension repository.
This will give some more control over where and how the extensions are distributed, but comes with the downside of requiring the `allow_unsigned_extensions`
option to be set. For examples of how to configure a manual GitHub Actions deploy pipeline, check out the extension deploy script in https://github.com/duckdb/extension-ci-tools.
Some examples of extensions that use this CI/CD workflow check out [spatial](https://github.com/duckdblabs/duckdb_spatial) or [aws](https://github.com/duckdb/duckdb_aws).

After running these steps, you can install and load your extension using the regular INSTALL/LOAD commands in DuckDB:
```sql
INSTALL <your_extension_name>
LOAD <your_extension_name>
Extensions in custom repositories can be installed and loaded using:
```SQL
INSTALL <my_extension> FROM 'http://my-custom-repo'
LOAD <my_extension>
```

### Versioning of your extension
Expand Down

0 comments on commit 0685030

Please sign in to comment.