21
21
steps :
22
22
- name : Checkout Repo
23
23
uses : actions/checkout@v3
24
-
24
+
25
25
- uses : DeterminateSystems/nix-installer-action@main
26
26
27
27
- name : Set PostgreSQL versions - only builds pg15 atm
35
35
strategy :
36
36
matrix :
37
37
postgres_version : ${{ fromJson(needs.prepare.outputs.postgres_versions) }}
38
- # include:
39
- # # TODO (darora): change to use non-self-hosted runners, since they now allow nested virtualization
40
- # - runner: arm-runner
41
- # arch: arm64
42
- # ubuntu_release: focal
43
- # ubuntu_version: 20.04
44
- # mcpu: neoverse-n1
45
- runs-on :
46
- group : pg-arm-large
38
+ runs-on : arm-native-runner
47
39
timeout-minutes : 150
48
40
permissions :
49
41
contents : write
56
48
57
49
- uses : DeterminateSystems/nix-installer-action@main
58
50
59
- # TODO (darora): might need to temporarily disable this
60
51
- name : Run checks if triggered manually
61
52
if : ${{ github.event_name == 'workflow_dispatch' }}
62
53
run : |
@@ -66,37 +57,55 @@ jobs:
66
57
exit 1
67
58
fi
68
59
60
+ - name : enable KVM support
61
+ run : |
62
+ sudo chown runner /dev/kvm
63
+ sudo chmod 666 /dev/kvm
64
+
65
+ # - name: Install dependencies
66
+ # run: |
67
+ # sudo apt-get update
68
+ # sudo apt-get install -y qemu-efi-aarch64 cloud-image-utils qemu-system-arm qemu-utils
69
+ # cd && curl -L "https://releases.hashicorp.com/packer/1.7.8/packer_1.7.8_linux_$(dpkg --print-architecture).zip" -o packer.zip && unzip packer.zip && rm -f packer.zip && sudo mv packer /usr/local/bin/
70
+
69
71
- name : Set PostgreSQL version environment variable
70
72
run : echo "POSTGRES_MAJOR_VERSION=${{ matrix.postgres_version }}" >> $GITHUB_ENV
71
73
72
74
- name : Generate common-nix.vars.pkr.hcl
73
75
run : |
74
- PG_VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)
76
+ curl -L https://github.com/mikefarah/yq/releases/download/v4.45.1/yq_linux_arm64 -o yq
77
+ chmod +x yq
78
+ PG_VERSION=$(./yq '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)
75
79
PG_VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes
76
80
echo 'postgres-version = "'$PG_VERSION'"' > common-nix.vars.pkr.hcl
77
- echo 'postgres_major_version = "'$POSTGRES_MAJOR_VERSION'"' >> common-nix.vars.pkr.hcl
78
- echo 'postgresql_major = "'$POSTGRES_MAJOR_VERSION'"' >> common-nix.vars.pkr.hcl
81
+ echo 'postgres-major-version = "'$POSTGRES_MAJOR_VERSION'"' >> common-nix.vars.pkr.hcl
82
+ # echo 'postgresql_major = "'$POSTGRES_MAJOR_VERSION'"' >> common-nix.vars.pkr.hcl
79
83
# Ensure there's a newline at the end of the file
80
84
echo "" >> common-nix.vars.pkr.hcl
81
85
82
- - name : Get binaries
86
+
87
+ - name : Install dependencies
83
88
run : |
84
- hash
89
+ sudo apt-get update
90
+ sudo apt-get remove -y qemu-efi-aarch64 cloud-image-utils qemu-system-arm qemu-utils
91
+ sudo apt-get install -y qemu-efi-aarch64 cloud-image-utils qemu-system-arm qemu-utils
85
92
86
93
- name : Build QEMU artifact
87
94
run : |
88
95
make init
89
96
GIT_SHA=${{github.sha}}
90
- # TODO (darora): possibly need to install qemu deps here
97
+ export PACKER_LOG=1
91
98
packer build -var "git_sha=$(UPSTREAM_NIX_GIT_SHA)" -var-file="common-nix.vars.pkr.hcl" qemu-arm64-nix.pkr.hcl
92
- # 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
93
99
94
- # TODO (darora): publishing things is temporarily disabled
95
- # - name: Grab release version
96
- # id: process_release_version
97
- # run: |
98
- # VERSION=$(cat common-nix.vars.pkr.hcl | sed -e 's/postgres-version = "\(.*\)"/\1/g')
99
- # echo "version=$VERSION" >> $GITHUB_OUTPUT
100
+ - name : Install dependencies
101
+ run : |
102
+ ls -lh output-cloudimg/
103
+
104
+ - name : Grab release version
105
+ id : process_release_version
106
+ run : |
107
+ VERSION=$(cat common-nix.vars.pkr.hcl | sed -e 's/postgres-version = "\(.*\)"/\1/g')
108
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
100
109
101
110
# - name: Create nix flake revision tarball
102
111
# run: |
@@ -107,11 +116,27 @@ jobs:
107
116
# echo "$GIT_SHA" >> "/tmp/pg_upgrade_bin/${MAJOR_VERSION}/nix_flake_version"
108
117
# tar -czf "/tmp/pg_binaries.tar.gz" -C "/tmp/pg_upgrade_bin" .
109
118
110
- # - name: configure aws credentials - staging
111
- # uses: aws-actions/configure-aws-credentials@v4
112
- # with:
113
- # role-to-assume: ${{ secrets.DEV_AWS_ROLE }}
114
- # aws-region: "us-east-1"
119
+ - name : configure aws credentials - staging
120
+ uses : aws-actions/configure-aws-credentials@v4
121
+ with :
122
+ role-to-assume : ${{ secrets.DEV_AWS_ROLE }}
123
+ aws-region : " us-east-1"
124
+
125
+ - uses : docker/setup-buildx-action@v3
126
+
127
+ - name : Login to ECR
128
+ uses : docker/login-action@v2
129
+ with :
130
+ registry : public.ecr.aws
131
+
132
+ - id : build
133
+ uses : docker/build-push-action@v5
134
+ with :
135
+ file : Dockerfile-kubernetes
136
+ push : true
137
+ tags : public.ecr.aws/w9p6e7k7/supabase/postgres-v3:${{ steps.process_release_version.outputs.version }}
138
+ platforms : linux/arm64
139
+ context : .
115
140
116
141
# - name: Upload software manifest to s3 staging
117
142
# run: |
0 commit comments