-
-
Notifications
You must be signed in to change notification settings - Fork 191
docs(CONTRIBUTING.md): update steps for adding a new extension #1691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
qiaofenlin
wants to merge
1
commit into
supabase:develop
Choose a base branch
from
qiaofenlin:patch-1
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+12
−7
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
# Welcome to Supabase Postgres contributing guide | ||
|
||
## Adding a new extension | ||
## Adding a New Extension | ||
|
||
Extensions can either be built from source or installed through a debian package. In general, you want to add the installation commands for your extension to the [Dockerfile](Dockerfile) following the steps below. | ||
Supabase Postgres supports multiple Dockerfiles for different versions and deployment scenarios (e.g., `Dockerfile-15`, `Dockerfile-17`, `Dockerfile-kubernetes`, `Dockerfile-orioledb-17`). | ||
**Please add your extension to each relevant Dockerfile according to the images you want to support.** | ||
|
||
1. Create a [build stage](Dockerfile#L777) named after your extension. | ||
2. Add build args that specify the extension's [release version](Dockerfile#L37). | ||
3. If your extension is published as a package, download it to `/tmp/<name>.deb` using the [ADD command](Dockerfile#L705). | ||
4. If you need to build the extensions from source, use [checkinstall](Dockerfile#L791) to create a `/tmp/<name>.deb` package. | ||
5. Copy your extension's package from build stage to [extensions stage](Dockerfile#L851). | ||
### Steps | ||
|
||
1. **Add a build stage** for your extension in the target Dockerfile, named after your extension. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All of these steps 1-4 are no longer accurate, as we no longer handle build/install of extension in Dockerfiles. Instead, the instructions are now here for adding extensions: https://github.com/supabase/postgres/blob/develop/nix/docs/adding-new-package.md |
||
_Tip: Search for `FROM base as` in the Dockerfile to find all extension build stages._ | ||
2. **Add build arguments** for your extension's release version if needed. | ||
3. **Download or build the extension package** (`.deb`) in your build stage and place it in `/tmp/`. | ||
- If your extension is published as a `.deb` package, use `ADD` or `COPY`. | ||
- If you need to build from source, use `checkinstall` or a similar tool to create a `.deb` package. | ||
4. **In the `extensions` stage**, use `COPY --from=your_stage` to copy your package into the final image. | ||
|
||
Here's a minimal example: | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggesting removing this line, because in the Dockerfile per major version, the installation of postgres and extensions happens as a "bundle" and there is already logic in the packaging that handles which packages should target which major version. Instead, if you want to target a major version with an extension, this needs to happen in the nix files.