From 46c7462d2ea70a7770ef7983d9d96259589f2f93 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 18 Nov 2024 09:06:18 -0500 Subject: [PATCH 01/14] fix: publish action --- .github/workflows/ami-release-nix.yml | 1 + .../workflows/publish-nix-pgupgrade-scripts.yml | 15 ++++++++++++--- ansible/vars.yml | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index 3242a4e1d..e528843d9 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -5,6 +5,7 @@ on: branches: - develop - release/* + - sam/publish-gh-actions paths: - '.github/workflows/ami-release-nix.yml' - 'common-nix.vars.pkr.hcl' diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index 6fb7f1830..de6f4e5ff 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -5,6 +5,13 @@ on: branches: - develop - release/* + paths: + - '.github/workflows/publish-nix-pgupgrade-scripts.yml' + - sam/publish-gh-actions + #TODO PR remove prior to merge + pull_request: + branches: + - sam/publish-gh-actions paths: - '.github/workflows/publish-nix-pgupgrade-scripts.yml' workflow_dispatch: @@ -49,7 +56,7 @@ jobs: - name: Grab release version id: process_release_version run: | - VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) + VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes if [[ "${{ inputs.postgresVersion }}" != "" ]]; then VERSION=${{ inputs.postgresVersion }} @@ -95,11 +102,13 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v3 - + + - uses: DeterminateSystems/nix-installer-action@main + - name: Grab release version id: process_release_version run: | - VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) + VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes if [[ "${{ inputs.postgresVersion }}" != "" ]]; then VERSION=${{ inputs.postgresVersion }} diff --git a/ansible/vars.yml b/ansible/vars.yml index d059b5f58..d3dae5a3f 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -11,8 +11,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgres15: "15.8.1.010" - postgres16: "16.3.1.016" + postgres15: "15.8.1.010-staging" + postgres16: "16.3.1.016-staging" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 941242f29147a0657a8fabde4e8da99a0ad34a39 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 18 Nov 2024 09:12:01 -0500 Subject: [PATCH 02/14] chore: cleanup --- .github/workflows/publish-nix-pgupgrade-scripts.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index de6f4e5ff..ef8737029 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -5,12 +5,6 @@ on: branches: - develop - release/* - paths: - - '.github/workflows/publish-nix-pgupgrade-scripts.yml' - - sam/publish-gh-actions - #TODO PR remove prior to merge - pull_request: - branches: - sam/publish-gh-actions paths: - '.github/workflows/publish-nix-pgupgrade-scripts.yml' From e0bb6c828c02fe51cc42ac396483dbe092c7f9f1 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 18 Nov 2024 09:19:14 -0500 Subject: [PATCH 03/14] chore : trigger build on push --- ansible/vars.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index d3dae5a3f..8cb01f6d6 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -11,8 +11,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgres15: "15.8.1.010-staging" - postgres16: "16.3.1.016-staging" + postgres15: "15.8.1.010-staging1" + postgres16: "16.3.1.016-staging1" # Non Postgres Extensions pgbouncer_release: "1.19.0" From a8c05b083f91f97abdca33650f5a59a6d3d72a2e Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 18 Nov 2024 09:23:44 -0500 Subject: [PATCH 04/14] chore: trigger build --- .github/workflows/publish-nix-pgupgrade-scripts.yml | 2 +- ansible/vars.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index ef8737029..1c6354f41 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -86,7 +86,7 @@ jobs: publish-prod: needs: prepare runs-on: ubuntu-latest - if: github.ref_name == 'develop' || contains( github.ref, 'release' ) + if: github.ref_name == 'sam/publish-gh-actions' || contains( github.ref, 'release' ) strategy: matrix: diff --git a/ansible/vars.yml b/ansible/vars.yml index 8cb01f6d6..5e17dcf08 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -11,8 +11,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgres15: "15.8.1.010-staging1" - postgres16: "16.3.1.016-staging1" + postgres15: "15.8.1.010-staging2" + postgres16: "16.3.1.016-staging2" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 7acd1ad28c72473118152523212d36c31ec6936d Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 18 Nov 2024 11:30:37 -0500 Subject: [PATCH 05/14] fix: correct the var in action --- .github/workflows/publish-nix-pgupgrade-scripts.yml | 2 +- ansible/vars.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index 1c6354f41..5015c7ad3 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -51,7 +51,7 @@ jobs: id: process_release_version run: | VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) - VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes + VERSION=$(echo $VERSION | tr -d '"') # Remove any surrounding quotes if [[ "${{ inputs.postgresVersion }}" != "" ]]; then VERSION=${{ inputs.postgresVersion }} fi diff --git a/ansible/vars.yml b/ansible/vars.yml index 5e17dcf08..852c2d7ce 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -11,8 +11,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgres15: "15.8.1.010-staging2" - postgres16: "16.3.1.016-staging2" + postgres15: "15.8.1.010-staging3" + postgres16: "16.3.1.016-staging3" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 8ef836faa28d8b94cc3d7eb715fc0e26820c9826 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 18 Nov 2024 14:08:43 -0500 Subject: [PATCH 06/14] fix: git should be a nativeBuildInput and not buildInput --- nix/ext/wrappers/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 85e00aff3..e2e5ca767 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -29,8 +29,8 @@ buildPgrxExtension_0_12_6 rec { hash = "sha256-CkoNMoh40zbQL4V49ZNYgv3JjoNWjODtTpHn+L8DdZA="; }; - nativeBuildInputs = [ pkg-config cargo ]; - buildInputs = [ openssl postgresql git ] ++ lib.optionals (stdenv.isDarwin) [ + nativeBuildInputs = [ pkg-config cargo git ]; + buildInputs = [ openssl postgresql ] ++ lib.optionals (stdenv.isDarwin) [ darwin.apple_sdk.frameworks.CoreFoundation darwin.apple_sdk.frameworks.Security darwin.apple_sdk.frameworks.SystemConfiguration From 66a3c9f646ac6b72d718ff372451a51e623cb6c3 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 18 Nov 2024 15:29:13 -0500 Subject: [PATCH 07/14] chore: trigger release and publish --- ansible/tasks/stage2-setup-postgres.yml | 17 ----------------- ansible/vars.yml | 4 ++-- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/ansible/tasks/stage2-setup-postgres.yml b/ansible/tasks/stage2-setup-postgres.yml index 4e9003ace..548f3ed94 100644 --- a/ansible/tasks/stage2-setup-postgres.yml +++ b/ansible/tasks/stage2-setup-postgres.yml @@ -4,14 +4,6 @@ # sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install nixpkgs#openjdk11" # It was decided to leave pljava disabled at https://github.com/supabase/postgres/pull/690 therefore removing this task -- name: Install Git for Nix package management - become: yes - apt: - name: git - state: present - update_cache: yes - when: stage2_nix - - name: Install Postgres from nix binary cache become: yes shell: | @@ -42,15 +34,6 @@ shell: | sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#{{postgresql_version}}_src" when: stage2_nix - -- name: Remove Git after Nix package installations - become: yes - apt: - name: git - state: absent - autoremove: yes - purge: yes - when: stage2_nix - name: Set ownership and permissions for /etc/ssl/private become: yes diff --git a/ansible/vars.yml b/ansible/vars.yml index 852c2d7ce..9a90e6316 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -11,8 +11,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgres15: "15.8.1.010-staging3" - postgres16: "16.3.1.016-staging3" + postgres15: "15.8.1.010-staging4" + postgres16: "16.3.1.016-staging4" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 0a59a23f80bae27140afa6c03ea57bf2aa5f9664 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 18 Nov 2024 16:19:14 -0500 Subject: [PATCH 08/14] chore: try to build and cache deps so that nix does not try to fetch on install --- nix/ext/wrappers/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index e2e5ca767..668b1d49c 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -52,7 +52,7 @@ buildPgrxExtension_0_12_6 rec { cargoLock = { lockFile = "${src}/Cargo.lock"; - allowBuiltinFetchGit = true; + allowBuiltinFetchGit = false; }; buildAndTestSubdir = "wrappers"; @@ -74,6 +74,7 @@ buildPgrxExtension_0_12_6 rec { doCheck = false; preBuild = '' + ${cargo}/bin/cargo vendor echo "Processing git tags..." echo '${builtins.concatStringsSep "," previousVersions}' | sed 's/,/\n/g' > git_tags.txt ''; From 1573b211791d770df1f025b21a0e392caba8637e Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 18 Nov 2024 17:10:55 -0500 Subject: [PATCH 09/14] fix: we can build and cache clickouse-rs this way so as to not fetch it --- nix/ext/wrappers/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 668b1d49c..54f2c275b 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -53,6 +53,9 @@ buildPgrxExtension_0_12_6 rec { cargoLock = { lockFile = "${src}/Cargo.lock"; allowBuiltinFetchGit = false; + outputHashes = { + "clickhouse-rs-1.1.0-alpha.1" = "sha256-G+v4lNP5eK2U45D1fL90Dq24pUSlpIysNCxuZ17eac0="; + }; }; buildAndTestSubdir = "wrappers"; @@ -74,7 +77,6 @@ buildPgrxExtension_0_12_6 rec { doCheck = false; preBuild = '' - ${cargo}/bin/cargo vendor echo "Processing git tags..." echo '${builtins.concatStringsSep "," previousVersions}' | sed 's/,/\n/g' > git_tags.txt ''; From b90993fd39400379edd79b428a0e5603b168d6f1 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 18 Nov 2024 19:04:06 -0500 Subject: [PATCH 10/14] chore: bump to release to staging --- ansible/vars.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 9a90e6316..bb383bdcc 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -11,8 +11,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgres15: "15.8.1.010-staging4" - postgres16: "16.3.1.016-staging4" + postgres15: "15.8.1.010-staging5" + postgres16: "16.3.1.016-staging5" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 6d267a15747304e38c30bde0f69c945fbf76e2d5 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 18 Nov 2024 19:07:21 -0500 Subject: [PATCH 11/14] chore: trugger upgrade script publish --- .github/workflows/publish-nix-pgupgrade-scripts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index 5015c7ad3..e3b7f978a 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -82,7 +82,7 @@ jobs: SLACK_COLOR: 'danger' SLACK_MESSAGE: 'Publishing pg_upgrade scripts failed' SLACK_FOOTER: '' - + #TODO Remove this comment publish-prod: needs: prepare runs-on: ubuntu-latest From 94c1e21c5f14d7779e1b555027116daa6b1db9d4 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 18 Nov 2024 19:11:14 -0500 Subject: [PATCH 12/14] ichore: trigger release and publish at same time --- .github/workflows/publish-nix-pgupgrade-scripts.yml | 2 +- ansible/vars.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index e3b7f978a..1ae0d2a5e 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -82,7 +82,7 @@ jobs: SLACK_COLOR: 'danger' SLACK_MESSAGE: 'Publishing pg_upgrade scripts failed' SLACK_FOOTER: '' - #TODO Remove this comment + #TODO Remove this comment publish-prod: needs: prepare runs-on: ubuntu-latest diff --git a/ansible/vars.yml b/ansible/vars.yml index bb383bdcc..113eb3035 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -11,8 +11,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgres15: "15.8.1.010-staging5" - postgres16: "16.3.1.016-staging5" + postgres15: "15.8.1.010-staging6" + postgres16: "16.3.1.016-staging6" # Non Postgres Extensions pgbouncer_release: "1.19.0" From d937d678748a37fabb3ef9715bea4d551574a598 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 25 Nov 2024 07:20:28 -0500 Subject: [PATCH 13/14] chore: cleanup pr testing lines --- .github/workflows/ami-release-nix.yml | 1 - .github/workflows/publish-nix-pgupgrade-scripts.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index e528843d9..3242a4e1d 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -5,7 +5,6 @@ on: branches: - develop - release/* - - sam/publish-gh-actions paths: - '.github/workflows/ami-release-nix.yml' - 'common-nix.vars.pkr.hcl' diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index 1ae0d2a5e..c4f9882b8 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -5,7 +5,6 @@ on: branches: - develop - release/* - - sam/publish-gh-actions paths: - '.github/workflows/publish-nix-pgupgrade-scripts.yml' workflow_dispatch: From d5ab856d398525e3fe6ec07baf33fbc163b3a42d Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 25 Nov 2024 09:54:13 -0500 Subject: [PATCH 14/14] chore: revert for post-pr --- .github/workflows/publish-nix-pgupgrade-scripts.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index c4f9882b8..a4aa4c3de 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -81,11 +81,10 @@ jobs: SLACK_COLOR: 'danger' SLACK_MESSAGE: 'Publishing pg_upgrade scripts failed' SLACK_FOOTER: '' - #TODO Remove this comment publish-prod: needs: prepare runs-on: ubuntu-latest - if: github.ref_name == 'sam/publish-gh-actions' || contains( github.ref, 'release' ) + if: github.ref_name == 'develop' || contains( github.ref, 'release' ) strategy: matrix: