Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sam/15 16 nix package, build and test of 15.8 and 16.3 #1266

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

samrose
Copy link
Contributor

@samrose samrose commented Oct 7, 2024

What kind of change does this PR introduce?

This makes all the necessary changes to package, build and test in the nix/pg_regress context our psql bundles with 15.8 and 16.3

We attempt to change no versions, and as much as possible to keep 1 pg_regress test suite, and one set of extensions and wrappers.

There will be a follow up PR to address the packer/ansible/gh action work for integration tests and releasing images.

It includes the changes to packer/ansible/gh actions to allow for a matrix build of pg versions on release.

Significant changes

This PR moves the source of truth for data about postgres major and semver back to ansible/vars.yml, which are then read at time of release in the ami-release gh action. The common-vars.nix.yml file is no longer under source control, but instead is generated duing the ci run for ami release or testinfra runs. The version is now controlled in this allows us to avoid making too many changes to our release and test tooling for AMI)

To bump the versions of postgres it is proposed to update these values that are now in anisble/vars.yml

These versions cover both release and testinfra

postgres_major:
  - "15"
  - "16"

# Full version strings for each major version
postgres_release:
  postgres15: "15.8.1.003-staging-5"
  postgres16: "16.3.1.000-staging-5"

@samrose samrose requested a review from a team as a code owner October 7, 2024 21:00
@samrose samrose self-assigned this Oct 9, 2024
@samrose samrose changed the title Sam/15 16 latest Sam/15 16 nix package, build and test of 15.8 and 16.3 Oct 9, 2024
samrose and others added 2 commits October 10, 2024 13:01
* fix: reformat ec2 cleanup commands (#1267)

Co-authored-by: Sam Rose <samuel@supabase.io>

* feat: build and flake check of pg 16.3 with exts/wrappers

* pg_partman test 15/16 compat

* merge sql interface test

* tests: build test and cache both versions

* chore: run checks individually

* feat: realease 15 and 16 to staging

* chore: update versions

* chore: make yq available

* chore: run yq from nix

* chore: more setup for staging AMI

* fix: yq usage

* chore: shell vars

* fix: When --init none is used, only users who can elevate to sudo privileges can run Nix

* fix: no -i

* fix: quote correction

* fix: newline extra quotes

* fix: no need for pg major version on packer

* fix: postgresql_major

* fix: ql

* fix: no ansible args in stage to invocation

* fix: unique val

* fix: adjustments to build scripts

* chore: env var handling

* fix: bump to build

* chore: set up more required vars

* chore: bump var

* feat: pg 16 debug symbols

* feat: matrix pg versions build on testinfra

* feat: matrix on Test Database

* chore: running nix in the right context

* feat: just use existing Dockerfile + pg version

* chore: refer to var

* fix: read name without including quotes

* chore: try format function

* fix: strip quotes from version number

* chore: env var

* fix: pg client

* fix

* fix: try to use psql from our own corresponding pkg

* fix: try psql from ppa

* fix: dbmate per pg version

* build dbmate and then install client

* fix: account for architecture

* chore: limit changes detection migrations/schema.sql

* missing docker compose call

* ore: drop tests while investigating

* test: try on pg15 only

* chore: schema needs update

* chore: now run on all versions in matrix

* test: trying a version of schema per major pg version as there are type diffs

---------

Co-authored-by: Sam Rose <samuel@supabase.io>
Co-authored-by: Oliver Rice <github@oliverrice.com>
@pcnc
Copy link
Member

pcnc commented Oct 14, 2024

How do these workflow changes impact the workflows which are tightly bound to the common-nix-vars.pkr.hcl file? Should we parse ansible/vars.yml outputs to ensure they continue working as intended?

i.e.

https://github.com/supabase/postgres/blob/develop/.github/workflows/publish-nix-pgupgrade-scripts.yml
https://github.com/supabase/postgres/blob/develop/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml
https://github.com/supabase/postgres/blob/develop/.github/workflows/test.yml


The current workflow generates a git tag for every AMI release - do these changes maintain this behaviour?

@samrose
Copy link
Contributor Author

samrose commented Oct 14, 2024

How do these workflow changes impact the workflows which are tightly bound to the common-nix-vars.pkr.hcl file? Should we parse ansible/vars.yml outputs to ensure they continue working as intended?

i.e.

https://github.com/supabase/postgres/blob/develop/.github/workflows/publish-nix-pgupgrade-scripts.yml https://github.com/supabase/postgres/blob/develop/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml https://github.com/supabase/postgres/blob/develop/.github/workflows/test.yml

The current workflow generates a git tag for every AMI release - do these changes maintain this behaviour?

Good point thank you!

I did adjust https://github.com/supabase/postgres/blob/develop/.github/workflows/test.yml but I did not address

https://github.com/supabase/postgres/blob/develop/.github/workflows/publish-nix-pgupgrade-scripts.yml https://github.com/supabase/postgres/blob/develop/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml

...so I will take a look at those today

The general approach I was taking was to generate the hcl file at build time, and move the values to vars.yml

@samrose
Copy link
Contributor Author

samrose commented Oct 14, 2024

The current workflow generates a git tag for every AMI release - do these changes maintain this behaviour?

Yes they do as demonstrated when I ran a staging release they are visible at https://github.com/supabase/postgres/releases (those with -staging-)

create a matrix build for 15 16 (or how ever many versions there are)
@samrose
Copy link
Contributor Author

samrose commented Oct 15, 2024

@pcnc I believe these changes will handle the pg upgrade actions. Although I am not sure if it is enough to go across major versions, or if more changes are needed to achieve sam 15.8 or 15.6 -> 16.3 nix -> nix pg_upgrade process with these changes so please let me know 3454b62

In addition, I realized we need coverage in the Docker release action, and possibly dockerfiles so I am going to address that today too.

@samrose samrose requested a review from pcnc October 15, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants