Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
93e983c
feat: log ddl by default
soedirgo Feb 5, 2025
ba21d04
chore: only gitignore schema.sql
soedirgo Feb 6, 2025
4de4563
feat: Build and publish a QEMU image artifact (#1430)
darora Feb 7, 2025
9b50c8e
Sam/pgroonga release (#1436)
samrose Feb 7, 2025
8713050
chore: increase files limit for Postgres (#1429)
samrose Feb 8, 2025
3cd81a2
chore: a new release version to cover ulimit -n change for postgres (…
samrose Feb 9, 2025
45e80ac
chore: create a workflow_dispatch only method with input, for docker …
samrose Feb 10, 2025
7207d7a
feat: vault sans pgsodium
soedirgo Feb 5, 2025
c77821d
chore: this substitution no longer needed
samrose Feb 5, 2025
9b2c570
fix: nix flake check
samrose Feb 5, 2025
50374e1
chore: need schema files in proper place for tests
samrose Feb 5, 2025
d442769
chore: try with flake url to target current changes
samrose Feb 5, 2025
e8d2342
fix: a better cleanup process
samrose Feb 5, 2025
ca74fb1
chore: more attempts at graceful shutdown
samrose Feb 5, 2025
5c65fa9
chore: more attempts to handle shutdown across arch
samrose Feb 5, 2025
36ed328
chore: revert to earlier
samrose Feb 5, 2025
65b947b
fix: gh actions oom try without overmind
samrose Feb 5, 2025
83dff18
chore: more tweaks to run in gh actions
samrose Feb 5, 2025
58db6a3
chore: already in background
samrose Feb 5, 2025
c7c30de
chore: this line may be causing segfault
samrose Feb 5, 2025
9d6b154
chore: do nothing if not running
samrose Feb 5, 2025
cf17ce0
chore: too many trap exits
samrose Feb 5, 2025
fc9e8b2
chore: mod stop_postgres for daemon
samrose Feb 5, 2025
1a45609
chore: adjust cleanup
samrose Feb 5, 2025
2e4b0ae
chore: allow other scripts to stop the start-server cluster
samrose Feb 6, 2025
1559c2d
chore: also deactivate supabase_vault in test (#1439)
samrose Feb 10, 2025
4a7790c
fix: revert migrations
pcnc Feb 12, 2025
5509917
move orioledb to extensions schema by default
olirice Feb 5, 2025
61351b9
update readme
olirice Feb 10, 2025
d5837d1
chore: must update the schema
samrose Feb 15, 2025
c1bfa83
chore: rebase develop
samrose Feb 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ami-release-nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
run: |
packer init amazon-arm64-nix.pkr.hcl
GIT_SHA=${{github.sha}}
# why is postgresql_major defined here instead of where the _three_ other postgresql_* variables are defined?
packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl

- name: Build AMI stage 2
Expand Down Expand Up @@ -143,7 +144,7 @@ jobs:
aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz

- name: Create release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
name: ${{ steps.process_release_version.outputs.version }}
tag_name: ${{ steps.process_release_version.outputs.version }}
Expand Down
250 changes: 250 additions & 0 deletions .github/workflows/manual-docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@
name: Manual Docker Artifacts Release

on:
workflow_dispatch:
inputs:
postgresVersion:
description: 'Optional. Postgres version to publish against, i.e. 15.1.1.78'
required: false

jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix_config: ${{ steps.set-matrix.outputs.matrix_config }}
steps:
- uses: DeterminateSystems/nix-installer-action@main
- name: Checkout Repo
uses: actions/checkout@v3
- name: Generate build matrix
id: set-matrix
run: |
nix run nixpkgs#nushell -- -c 'let versions = (open ansible/vars.yml | get postgres_major)
let matrix = ($versions | each { |ver|
let version = ($ver | str trim)
let dockerfile = $"Dockerfile-($version)"
if ($dockerfile | path exists) {
{
version: $version,
dockerfile: $dockerfile
}
} else {
null
}
} | compact)

let matrix_config = {
include: $matrix
}

$"matrix_config=($matrix_config | to json -r)" | save --append $env.GITHUB_OUTPUT'
build:
needs: prepare
strategy:
matrix: ${{ fromJson(needs.prepare.outputs.matrix_config) }}
runs-on: ubuntu-latest
outputs:
build_args: ${{ steps.args.outputs.result }}
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- name: Set PostgreSQL version environment variable
run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.version }}" >> $GITHUB_ENV

- id: args
run: |
nix run nixpkgs#nushell -- -c '
open ansible/vars.yml
| items { |key value| {name: $key, item: $value} }
| where { |it| ($it.item | describe) == "string" }
| each { |it| $"($it.name)=($it.item)" }
| str join "\n"
| save --append $env.GITHUB_OUTPUT
'
build_release_image:
needs: [prepare, build]
strategy:
matrix:
postgres: ${{ fromJson(needs.prepare.outputs.matrix_config).include }}
arch: [amd64, arm64]
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'arm-runner' }}
timeout-minutes: 180
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- run: docker context create builders
- uses: docker/setup-buildx-action@v3
with:
endpoint: builders
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get image tag
id: image
run: |
if [[ "${{ matrix.arch }}" == "arm64" ]]; then
pg_version=$(sudo nix run nixpkgs#nushell -- -c '
let version = "${{ matrix.postgres.version }}"
let release_key = if ($version | str contains "orioledb") {
$"postgresorioledb-17"
} else {
$"postgres($version)"
}
let base_version = (open ansible/vars.yml | get postgres_release | get $release_key | str trim)
let final_version = if "${{ inputs.postgresVersion }}" != "" {
"${{ inputs.postgresVersion }}"
} else {
$base_version
}
$final_version | str trim
')
echo "pg_version=supabase/postgres:$pg_version" >> $GITHUB_OUTPUT
else
pg_version=$(nix run nixpkgs#nushell -- -c '
let version = "${{ matrix.postgres.version }}"
let release_key = if ($version | str contains "orioledb") {
$"postgresorioledb-17"
} else {
$"postgres($version)"
}
let base_version = (open ansible/vars.yml | get postgres_release | get $release_key | str trim)
let final_version = if "${{ inputs.postgresVersion }}" != "" {
"${{ inputs.postgresVersion }}"
} else {
$base_version
}
$final_version | str trim
')
echo "pg_version=supabase/postgres:$pg_version" >> $GITHUB_OUTPUT
fi
- id: build
uses: docker/build-push-action@v5
with:
push: true
build-args: |
${{ needs.build.outputs.build_args }}
target: production
tags: ${{ steps.image.outputs.pg_version }}_${{ matrix.arch }}
platforms: linux/${{ matrix.arch }}
cache-from: type=gha,scope=${{ github.ref_name }}-latest-${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-latest-${{ matrix.arch }}
file: ${{ matrix.postgres.dockerfile }}
merge_manifest:
needs: [prepare, build, build_release_image]
strategy:
matrix:
include: ${{ fromJson(needs.prepare.outputs.matrix_config).include }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get image tag
id: get_version
run: |
nix run nixpkgs#nushell -- -c '
let version = "${{ matrix.version }}"
let release_key = if ($version | str contains "orioledb") {
$"postgresorioledb-17"
} else {
$"postgres($version)"
}
let pg_version = (open ansible/vars.yml | get postgres_release | get $release_key | str trim)
$"pg_version=supabase/postgres:($pg_version)" | save --append $env.GITHUB_OUTPUT
'
- name: Output version
id: output_version
run: |
echo "result=${{ steps.get_version.outputs.pg_version }}" >> $GITHUB_OUTPUT
- name: Collect versions
id: collect_versions
run: |
echo "${{ steps.output_version.outputs.result }}" >> results.txt # Append results
- name: Upload Results Artifact
uses: actions/upload-artifact@v4
with:
name: merge_results-${{ matrix.version }}
path: results.txt
if-no-files-found: warn
- name: Merge multi-arch manifests
run: |
docker buildx imagetools create -t ${{ steps.get_version.outputs.pg_version }} \
${{ steps.get_version.outputs.pg_version }}_amd64 \
${{ steps.get_version.outputs.pg_version }}_arm64
combine_results:
needs: [prepare, merge_manifest]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main

- name: Debug Input from Prepare
run: |
echo "Raw matrix_config output:"
echo "${{ needs.prepare.outputs.matrix_config }}"
- name: Get Versions from Matrix Config
id: get_versions
run: |
nix run nixpkgs#nushell -- -c '
# Parse the matrix configuration directly
let matrix_config = (${{ toJson(needs.prepare.outputs.matrix_config) }} | from json)

# Get versions directly from include array
let versions = ($matrix_config.include | get version)

echo "Versions: $versions"

# Convert the versions to a comma-separated string
let versions_str = ($versions | str join ",")
$"versions=$versions_str" | save --append $env.GITHUB_ENV
'
- name: Download Results Artifacts
uses: actions/download-artifact@v4
with:
pattern: merge_results-*
- name: Combine Results
id: combine
run: |
nix run nixpkgs#nushell -- -c '
# Get all results files and process them in one go
let files = (ls **/results.txt | get name)
echo $"Found files: ($files)"

let matrix = {
include: (
$files
| each { |file| open $file } # Open each file
| each { |content| $content | lines } # Split into lines
| flatten # Flatten the nested lists
| where { |line| $line != "" } # Filter empty lines
| each { |line|
# Extract just the version part after the last colon
let version = ($line | parse "supabase/postgres:{version}" | get version.0)
{version: $version}
}
)
}

let json_output = ($matrix | to json -r) # -r for raw output
echo $"Debug output: ($json_output)"

$"matrix=($json_output)" | save --append $env.GITHUB_OUTPUT
'
- name: Debug Combined Results
run: |
echo "Combined Results: '${{ steps.combine.outputs.matrix }}'"
outputs:
matrix: ${{ steps.combine.outputs.matrix }}
publish:
needs: combine_results
strategy:
matrix: ${{ fromJson(needs.combine_results.outputs.matrix) }}
uses: ./.github/workflows/mirror.yml
with:
version: ${{ inputs.postgresVersion != '' && inputs.postgresVersion || matrix.version }}
secrets: inherit
Loading
Loading