Skip to content

Commit b1100e8

Browse files
committed
chore: wrapup
1 parent 2e24298 commit b1100e8

File tree

9 files changed

+24
-20
lines changed

9 files changed

+24
-20
lines changed

.github/workflows/ami-build-ubuntu-18.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ on:
44
push:
55
branches:
66
- develop
7-
- pcnc/build-glibc227-bin
8-
# paths:
9-
# - '.github/workflows/ami-build-ubuntu-18.yml'
10-
# - 'common.vars.pkr.hcl'
7+
paths:
8+
- '.github/workflows/ami-build-ubuntu-18.yml'
9+
- 'common.vars.pkr.hcl'
1110
workflow_dispatch:
1211

1312
jobs:
@@ -26,8 +25,7 @@ jobs:
2625
- name: Build AMI
2726
run: |
2827
GIT_SHA=${{github.sha}}
29-
# packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=u18-${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common.vars.pkr.hcl" -var "ami=ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-arm64-server-*" -var "ami_name=builder-supabase-postgres-u18" -var ansible_arguments="ebssurrogate_mode='true' --skip-tags 'install-supabase-internal,migrations,unit-tests'" amazon-arm64.pkr.hcl
30-
packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=u18-${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common.vars.pkr.hcl" -var "ami=ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-arm64-server-*" -var "ami_name=builder-supabase-postgres-u18" -var ansible_arguments="ebssurrogate_mode='true' --skip-tags 'install-supabase-internal,ubuntu-18-incompatible'" amazon-arm64.pkr.hcl
28+
packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=u18-${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common.vars.pkr.hcl" -var-file="legacy.vars.pkr.hcl" amazon-arm64.pkr.hcl
3129
3230
- name: Grab release version
3331
id: process_release_version
@@ -68,11 +66,11 @@ jobs:
6866
SNAPSHOTS=$(aws ec2 describe-images --image-ids $IMAGE_ID --query "Images[*].BlockDeviceMappings[*].Ebs.SnapshotId" --output text)
6967
7068
echo "Deregistering image $IMAGE_ID"
71-
# aws ec2 deregister-image --image-id $IMAGE_ID
69+
aws ec2 deregister-image --image-id $IMAGE_ID
7270
7371
for SNAPSHOT in $SNAPSHOTS; do
7472
echo "Deleting snapshot $SNAPSHOT"
75-
# aws ec2 delete-snapshot --snapshot-id $SNAPSHOT
73+
aws ec2 delete-snapshot --snapshot-id $SNAPSHOT
7674
done
7775
done
7876

.github/workflows/ami-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Build AMI
2626
run: |
2727
GIT_SHA=${{github.sha}}
28-
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.vars.pkr.hcl" amazon-arm64.pkr.hcl
28+
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.vars.pkr.hcl" -var "ansible_arguments=''" amazon-arm64.pkr.hcl
2929
3030
- name: Grab release version
3131
id: process_release_version

amazon-arm64.pkr.hcl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ variable "ami_regions" {
2020

2121
variable "ansible_arguments" {
2222
type = string
23-
default = "--skip-tags,install-postgrest,--skip-tags,install-pgbouncer,--skip-tags,install-supabase-internal,ebssurrogate_mode='true'"
23+
default = "--skip-tags install-postgrest,install-pgbouncer,install-supabase-internal"
2424
}
2525

2626
variable "aws_access_key" {
@@ -239,8 +239,9 @@ build {
239239
"DOCKER_IMAGE=${var.docker_image}",
240240
"DOCKER_IMAGE_TAG=${var.docker_image_tag}"
241241
]
242+
use_env_var_file = true
242243
script = "ebssurrogate/scripts/surrogate-bootstrap.sh"
243-
execute_command = "sudo -S sh -c '{{ .Vars }} {{ .Path }}'"
244+
execute_command = "sudo -S sh -c '. {{.EnvVarFile}} && {{.Path}}'"
244245
start_retry_timeout = "5m"
245246
skip_clean = true
246247
}

ansible/playbook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,4 @@
172172
- name: Collect Postgres binaries
173173
import_tasks: tasks/internal/collect-pg-binaries.yml
174174
tags:
175-
- install-supabase-internal
175+
- collect-binaries

ansible/tasks/setup-extensions.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939

4040
- name: Install pljava
4141
import_tasks: tasks/postgres-extensions/12-pljava.yml
42+
tags:
43+
- legacy-incompatible
4244

4345
- name: Install pg_plan_filter
4446
import_tasks: tasks/postgres-extensions/14-pg_plan_filter.yml
@@ -58,7 +60,7 @@
5860
- name: Install pg_graphql
5961
import_tasks: tasks/postgres-extensions/19-pg_graphql.yml
6062
tags:
61-
- ubuntu-18-incompatible
63+
- legacy-incompatible
6264

6365
- name: Install pg_stat_monitor
6466
import_tasks: tasks/postgres-extensions/20-pg_stat_monitor.yml

common.vars.pkr.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
postgres-version = "15.1.0.67-versioned-bins-2"
1+
postgres-version = "15.1.0.67-versioned-bins-3"

ebssurrogate/scripts/surrogate-bootstrap.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ function install_packages {
4040
gdisk \
4141
e2fsprogs \
4242
debootstrap \
43-
nvme-cli \
44-
docker.io
45-
43+
nvme-cli
4644
}
4745

4846
# Partition the new root EBS volume
@@ -126,6 +124,7 @@ function format_build_partition {
126124
mkfs.ext4 -O ^has_journal /dev/xvdc
127125
}
128126
function pull_docker {
127+
apt-get install -y docker.io
129128
docker run -itd --name ccachedata "${DOCKER_IMAGE}:${DOCKER_IMAGE_TAG}" sh
130129
docker exec -itd ccachedata mkdir -p /build/ccache
131130
}
@@ -214,7 +213,7 @@ EOF
214213
# Run Ansible playbook
215214
#export ANSIBLE_LOG_PATH=/tmp/ansible.log && export ANSIBLE_DEBUG=True && export ANSIBLE_REMOTE_TEMP=/mnt/tmp
216215
export ANSIBLE_LOG_PATH=/tmp/ansible.log && export ANSIBLE_REMOTE_TEMP=/mnt/tmp
217-
ansible-playbook -c chroot -i '/mnt,' /tmp/ansible-playbook/ansible/playbook.yml --extra-vars " $ARGS"
216+
ansible-playbook -c chroot -i '/mnt,' /tmp/ansible-playbook/ansible/playbook.yml $ARGS
218217
}
219218

220219
function update_systemd_services {

legacy.vars.pkr.hcl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ansible_arguments="--skip-tags install-supabase-internal,install-pgbouncer,legacy-incompatible,migrations,unit-tests,aws-only"
2+
ami_name="builder-supabase-postgres-u18"
3+
ami="ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-arm64-server-*"

scripts/90-cleanup.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ elif [ -n "$(command -v apt-get)" ]; then
3636
libicu-dev \
3737
libcgal-dev \
3838
libgcc-9-dev \
39-
libgcc-8-dev \
40-
linux-headers-5.11.0-1021-aws
39+
libgcc-8-dev
40+
apt-get -y remove --purge linux-headers-5.11.0-1021-aws || true
41+
4142
apt-get -y update
4243
apt-get -y upgrade
4344
apt-get -y autoremove

0 commit comments

Comments
 (0)