Skip to content

Commit 3e24342

Browse files
authored
Merge branch 'develop' into automate-flake-updates
2 parents 4d895a7 + 7daa987 commit 3e24342

72 files changed

Lines changed: 2834 additions & 540 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coderabbit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# configuration reference: https://docs.coderabbit.ai/reference/configuration
33
reviews:
44
auto_review:
5-
enabled: true
5+
enabled: false
66
drafts: false
77
base_branches:
88
- develop

.github/actions/nix-install-ephemeral/action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ runs:
2727
sudo -H aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
2828
sudo -H aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
2929
sudo -H aws configure set aws_session_token $AWS_SESSION_TOKEN
30+
sudo -H aws configure set region ${{ inputs.aws-region }}
3031
sudo mkdir -p /etc/nix
3132
sudo -E python -c "import os; file = open('/etc/nix/nix-secret-key', 'w'); file.write(os.environ['NIX_SIGN_SECRET_KEY']); file.close()"
3233
cat << 'EOF' | sudo tee /etc/nix/upload-to-cache.sh > /dev/null
@@ -35,16 +36,15 @@ runs:
3536
set -f
3637
3738
export IFS=' '
38-
/nix/var/nix/profiles/default/bin/nix copy --to 's3://nix-postgres-artifacts?secret-key=/etc/nix/nix-secret-key' $OUT_PATHS
39+
/nix/var/nix/profiles/default/bin/nix copy --max-jobs 5 --to 's3://nix-postgres-artifacts?secret-key=/etc/nix/nix-secret-key' $OUT_PATHS
3940
EOF
4041
sudo chmod +x /etc/nix/upload-to-cache.sh
4142
env:
4243
NIX_SIGN_SECRET_KEY: ${{ env.NIX_SIGN_SECRET_KEY }}
43-
- name: Install nix
44-
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
44+
- uses: NixOS/nix-installer-action@d6ef7ecd8f685af89869e5aca0580a33e3e3150c
4545
with:
46-
install_url: https://releases.nixos.org/nix/nix-2.32.2/install
47-
extra_nix_config: |
46+
installer-version: 2.33.2
47+
extra-conf: |
4848
substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com
4949
trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
5050
${{ inputs.push-to-cache == 'true' && 'post-build-hook = /etc/nix/upload-to-cache.sh' || '' }}

.github/workflows/ami-release-nix.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,7 @@ jobs:
7272
- name: Generate common-nix.vars.pkr.hcl
7373
run: |
7474
PG_VERSION="$(nix run nixpkgs#yq -- -r '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)"
75-
BRANCH_NAME="$(echo "${{ github.ref }}" | sed 's|refs/heads/||')"
76-
if [[ "${{ github.event_name }}" == "workflow_dispatch" && "$BRANCH_NAME" != "develop" && "$BRANCH_NAME" != release/* ]]; then
77-
SUFFIX="${BRANCH_NAME//[^a-zA-Z0-9._-]/-}-${{ github.run_id }}"
78-
PG_VERSION="${PG_VERSION}-${SUFFIX}"
79-
echo "Added branch suffix to version: $SUFFIX"
80-
fi
8175
echo "postgres-version = \"$PG_VERSION\"" > common-nix.vars.pkr.hcl
82-
# Ensure there's a newline at the end of the file
83-
echo "" >> common-nix.vars.pkr.hcl
8476
8577
- name: Build AMI stage 1
8678
env:
@@ -89,13 +81,13 @@ jobs:
8981
GIT_SHA=${{github.sha}}
9082
nix run github:supabase/postgres/${GIT_SHA}#packer -- init amazon-arm64-nix.pkr.hcl
9183
# why is postgresql_major defined here instead of where the _three_ other postgresql_* variables are defined?
92-
nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${EXECUTION_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
84+
nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${EXECUTION_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" -var "region=us-east-1" -var 'ami_regions=["us-east-1"]' amazon-arm64-nix.pkr.hcl
9385
9486
- name: Find stage 1 AMI
9587
run: |
9688
GIT_SHA=${{github.sha}}
9789
PG_VERSION=$(sed -n 's/postgres-version = "\(.*\)"/\1/p' common-nix.vars.pkr.hcl)
98-
REGION=$(grep '^region=' development-arm.vars.pkr.hcl | cut -d'=' -f2 | tr -d ' "')
90+
REGION="us-east-1"
9991
10092
echo "Looking for stage 1 AMI with postgresVersion=${PG_VERSION}-stage1 and sourceSha=${GIT_SHA} in region ${REGION}"
10193
@@ -124,7 +116,7 @@ jobs:
124116
GIT_SHA=${{github.sha}}
125117
nix run github:supabase/postgres/${GIT_SHA}#packer -- init stage2-nix-psql.pkr.hcl
126118
POSTGRES_MAJOR_VERSION=${{ env.POSTGRES_MAJOR_VERSION }}
127-
nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${EXECUTION_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var "source_ami=${STAGE1_AMI_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl
119+
nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${EXECUTION_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var "source_ami=${STAGE1_AMI_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "region=us-east-1" stage2-nix-psql.pkr.hcl
128120
129121
- name: Grab release version
130122
id: process_release_version

.github/workflows/base-image-nightly.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,13 @@ jobs:
2626
with:
2727
ref: ${{ github.event.inputs.branch || 'develop' }}
2828

29-
- name: Configure AWS credentials
30-
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
29+
- name: Install nix (ephemeral)
30+
uses: ./.github/actions/nix-install-ephemeral
3131
with:
32-
role-to-assume: ${{ secrets.DEV_AWS_ROLE }}
33-
aws-region: "us-east-1"
34-
output-credentials: true
35-
role-duration-seconds: 7200
36-
37-
- name: Install nix
38-
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
39-
with:
40-
install_url: https://releases.nixos.org/nix/nix-2.29.1/install
41-
extra_nix_config: |
42-
substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com
43-
trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
32+
push-to-cache: 'true'
33+
env:
34+
DEV_AWS_ROLE: ${{ secrets.DEV_AWS_ROLE }}
35+
NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }}
4436

4537
- name: Set execution ID and timestamp
4638
run: |

0 commit comments

Comments
 (0)