Skip to content

Commit 09f8004

Browse files
committed
Merge branch 'develop' into bump_pg_tle
2 parents 02ab1a8 + d29be66 commit 09f8004

Some content is hidden

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

69 files changed

+1068
-178
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
* @supabase/backend
22
migrations/ @supabase/cli @supabase/backend
33
docker/orioledb @supabase/postgres
4+
common.vars.pkr.hcl @supabase/postgres @supabase/backend

.github/workflows/ami-release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ jobs:
3030
- name: Checkout Repo
3131
uses: actions/checkout@v3
3232

33+
- name: Run checks if triggered manually
34+
if: ${{ github.event_name == 'workflow_dispatch' }}
35+
# Update `ci.yaml` too if changing constraints.
36+
run: |
37+
SUFFIX=$(sed -E 's/postgres-version = "[0-9\.]+(.*)"/\1/g' common.vars.pkr.hcl)
38+
if [[ -z $SUFFIX ]] ; then
39+
echo "Version must include non-numeric characters if built manually."
40+
exit 1
41+
fi
42+
3343
- id: args
3444
uses: mikefarah/yq@master
3545
with:

.github/workflows/ci.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@ on:
44
pull_request:
55

66
jobs:
7-
87
check-release-version:
98
timeout-minutes: 5
9+
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout Repo
1212
uses: actions/checkout@v3
1313

14-
run: |
15-
SUFFIX=$(sed -E 's/postgres-version = "[0-9\.]+(.*)"/\1/g' common.vars.pkr.hcl)
16-
if [[ -n $SUFFIX ]] ; then
17-
echo "We no longer allow merging RC versions to develop."
18-
exit 1
19-
fi
14+
- name: Run checks
15+
# Update `ami-release.yaml` too if changing constraints.
16+
run: |
17+
SUFFIX=$(sed -E 's/postgres-version = "[0-9\.]+(.*)"/\1/g' common.vars.pkr.hcl)
18+
if [[ -n $SUFFIX ]] ; then
19+
echo "We no longer allow merging RC versions to develop."
20+
exit 1
21+
fi

.github/workflows/dockerhub-release-aio.yml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
name: Release AIO image on Dockerhub
1+
name: Release AIO image
22

33
on:
44
push:
55
branches:
6-
- pcnc/trigger-build
6+
- develop
77
paths:
88
- ".github/workflows/dockerhub-release-aio.yml"
99
- "docker/all-in-one/*"
10-
- "common.vars*"
1110
workflow_run:
1211
workflows: [Release on Dockerhub]
1312
branches:
1413
- develop
1514
types:
1615
- completed
17-
16+
1817
jobs:
1918
settings:
2019
runs-on: ubuntu-latest
2120
outputs:
2221
docker_version: ${{ steps.settings.outputs.postgres-version }}
2322
image_tag: supabase/postgres:aio-${{ steps.settings.outputs.postgres-version }}
23+
fly_image_tag: supabase-postgres-image:aio-${{ steps.settings.outputs.postgres-version }}
2424
build_args: ${{ steps.args.outputs.result }}
2525
steps:
2626
- uses: actions/checkout@v3
@@ -108,3 +108,37 @@ jobs:
108108
with:
109109
version: aio-${{ needs.settings.outputs.docker_version }}
110110
secrets: inherit
111+
112+
publish_to_fly:
113+
needs: [settings, build_image]
114+
runs-on: ubuntu-latest
115+
steps:
116+
- uses: docker/setup-buildx-action@v3
117+
- uses: docker/login-action@v2
118+
with:
119+
username: ${{ secrets.DOCKER_USERNAME }}
120+
password: ${{ secrets.DOCKER_PASSWORD }}
121+
- name: Push to Fly
122+
uses: superfly/flyctl-actions/setup-flyctl@dfdfedc86b296f5e5384f755a18bf400409a15d0
123+
with:
124+
version: 0.1.64
125+
- run: |
126+
docker pull ${{ needs.settings.outputs.image_tag }}_amd64
127+
docker tag ${{ needs.settings.outputs.image_tag }}_amd64 "registry.fly.io/staging-${{ needs.settings.outputs.fly_image_tag }}"
128+
docker tag ${{ needs.settings.outputs.image_tag }}_amd64 "registry.fly.io/prod-${{ needs.settings.outputs.fly_image_tag }}"
129+
130+
flyctl auth docker
131+
docker push "registry.fly.io/staging-${{ needs.settings.outputs.fly_image_tag }}"
132+
docker push "registry.fly.io/prod-${{ needs.settings.outputs.fly_image_tag }}"
133+
env:
134+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
135+
136+
- name: Slack Notification
137+
if: ${{ failure() }}
138+
uses: rtCamp/action-slack-notify@v2
139+
env:
140+
SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }}
141+
SLACK_USERNAME: "gha-failures-notifier"
142+
SLACK_COLOR: "danger"
143+
SLACK_MESSAGE: "Failed pushing AIO image to Fly.io"
144+
SLACK_FOOTER: ""

.github/workflows/dockerhub-release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
paths:
88
- ".github/workflows/dockerhub-release.yml"
99
- "common.vars*"
10-
10+
1111
jobs:
1212
settings:
1313
runs-on: ubuntu-latest
@@ -25,6 +25,7 @@ jobs:
2525
with:
2626
cmd: yq 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join("\n")' 'ansible/vars.yml'
2727

28+
2829
build_image:
2930
needs: settings
3031
strategy:

.github/workflows/testinfra.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- runner: arm-runner
1515
arch: arm64
1616
runs-on: ${{ matrix.runner }}
17-
timeout-minutes: 60
17+
timeout-minutes: 30
1818
steps:
1919
- uses: actions/checkout@v3
2020

@@ -27,7 +27,17 @@ jobs:
2727
run: |
2828
# TODO: use poetry for pkg mgmt
2929
pip3 install boto3 boto3-stubs[essential] docker ec2instanceconnectcli pytest pytest-testinfra[paramiko,docker] requests
30-
pytest -vv testinfra/test_all_in_one.py
30+
31+
32+
if ! pytest -vv testinfra/test_all_in_one.py; then
33+
# display container logs if the test fails
34+
35+
if [ -f testinfra-aio-container-logs.log ]; then
36+
echo "AIO container logs:"
37+
cat testinfra-aio-container-logs.log
38+
fi
39+
exit 1
40+
fi
3141
3242
test-ami:
3343
strategy:
@@ -132,9 +142,9 @@ jobs:
132142
- name: Cleanup resources on build cancellation
133143
if: ${{ cancelled() }}
134144
run: |
135-
aws ec2 --region ap-southeast-1 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -I {} aws ec2 terminate-instances --instance-ids {}
145+
aws ec2 --region ap-southeast-1 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -I {} aws ec2 terminate-instances --region ap-southeast-1 --instance-ids {}
136146
137147
- name: Cleanup resources on build cancellation
138148
if: ${{ always() }}
139149
run: |
140-
aws ec2 --region ap-southeast-1 describe-instances --filters "Name=tag:testinfra-run-id,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -I {} aws ec2 terminate-instances --instance-ids {} || true
150+
aws ec2 --region ap-southeast-1 describe-instances --filters "Name=tag:testinfra-run-id,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -I {} aws ec2 terminate-instances --region ap-southeast-1 --instance-ids {} || true

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ARG pg_jsonschema_release=0.1.4
3030
ARG vault_release=0.2.8
3131
ARG groonga_release=12.0.8
3232
ARG pgroonga_release=2.4.0
33-
ARG wrappers_release=0.1.19
33+
ARG wrappers_release=0.2.0
3434
ARG hypopg_release=1.3.1
3535
ARG pg_repack_release=1.4.8
3636
ARG pgvector_release=0.4.0

amazon-arm64.pkr.hcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ build {
243243
"DOCKER_USER=${var.docker_user}",
244244
"DOCKER_PASSWD=${var.docker_passwd}",
245245
"DOCKER_IMAGE=${var.docker_image}",
246-
"DOCKER_IMAGE_TAG=${var.docker_image_tag}"
246+
"DOCKER_IMAGE_TAG=${var.docker_image_tag}",
247+
"POSTGRES_SUPABASE_VERSION=${var.postgres-version}"
247248
]
248249
use_env_var_file = true
249250
script = "ebssurrogate/scripts/surrogate-bootstrap.sh"

ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
# them depending on regtypes referencing system OIDs or outdated library files.
1212
EXTENSIONS_TO_DISABLE=(
1313
"pg_graphql"
14-
"plv8"
15-
"plcoffee"
16-
"plls"
1714
)
1815

1916
PG14_EXTENSIONS_TO_DISABLE=(

ansible/files/adminapi.sudoers.conf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
Cmnd_Alias KONG = /bin/systemctl start kong.service, /bin/systemctl stop kong.service, /bin/systemctl restart kong.service, /bin/systemctl disable kong.service, /bin/systemctl enable kong.service, /bin/systemctl reload kong.service
2-
Cmnd_Alias POSTGREST = /bin/systemctl start postgrest.service, /bin/systemctl stop postgrest.service, /bin/systemctl restart postgrest.service, /bin/systemctl disable postgrest.service, /bin/systemctl enable postgrest.service
3-
Cmnd_Alias GOTRUE = /bin/systemctl start gotrue.service, /bin/systemctl stop gotrue.service, /bin/systemctl restart gotrue.service, /bin/systemctl disable gotrue.service, /bin/systemctl enable gotrue.service
4-
Cmnd_Alias PGBOUNCER = /bin/systemctl start pgbouncer.service, /bin/systemctl stop pgbouncer.service, /bin/systemctl restart pgbouncer.service, /bin/systemctl disable pgbouncer.service, /bin/systemctl enable pgbouncer.service, /bin/systemctl reload pgbouncer.service
1+
Cmnd_Alias ENVOY = /bin/systemctl start envoy.service, /bin/systemctl stop envoy.service, /bin/systemctl restart envoy.service, /bin/systemctl disable envoy.service, /bin/systemctl enable envoy.service, /bin/systemctl reload envoy.service, /bin/systemctl try-restart envoy.service
2+
Cmnd_Alias KONG = /bin/systemctl start kong.service, /bin/systemctl stop kong.service, /bin/systemctl restart kong.service, /bin/systemctl disable kong.service, /bin/systemctl enable kong.service, /bin/systemctl reload kong.service, /bin/systemctl try-restart kong.service
3+
Cmnd_Alias POSTGREST = /bin/systemctl start postgrest.service, /bin/systemctl stop postgrest.service, /bin/systemctl restart postgrest.service, /bin/systemctl disable postgrest.service, /bin/systemctl enable postgrest.service, /bin/systemctl try-restart postgrest.service
4+
Cmnd_Alias GOTRUE = /bin/systemctl start gotrue.service, /bin/systemctl stop gotrue.service, /bin/systemctl restart gotrue.service, /bin/systemctl disable gotrue.service, /bin/systemctl enable gotrue.service, /bin/systemctl try-restart gotrue.service
5+
Cmnd_Alias PGBOUNCER = /bin/systemctl start pgbouncer.service, /bin/systemctl stop pgbouncer.service, /bin/systemctl restart pgbouncer.service, /bin/systemctl disable pgbouncer.service, /bin/systemctl enable pgbouncer.service, /bin/systemctl reload pgbouncer.service, /bin/systemctl try-restart pgbouncer.service
56

67
%adminapi ALL= NOPASSWD: /root/grow_fs.sh
78
%adminapi ALL= NOPASSWD: /root/manage_readonly_mode.sh
@@ -20,6 +21,7 @@ Cmnd_Alias PGBOUNCER = /bin/systemctl start pgbouncer.service, /bin/systemctl st
2021
%adminapi ALL= NOPASSWD: /bin/systemctl restart services.slice
2122
%adminapi ALL= NOPASSWD: /usr/sbin/nft -f /etc/nftables/supabase_managed.conf
2223
%adminapi ALL= NOPASSWD: /usr/bin/admin-mgr
24+
%adminapi ALL= NOPASSWD: ENVOY
2325
%adminapi ALL= NOPASSWD: KONG
2426
%adminapi ALL= NOPASSWD: POSTGREST
2527
%adminapi ALL= NOPASSWD: GOTRUE

0 commit comments

Comments
 (0)