Skip to content

Commit 7eabe03

Browse files
authored
Sam/timescale and wrappers (#1052)
* fix: was using the wrong sha256 hash for version * chore: updating wrappers version * itests: make sure we run the current commit on psql bundle test --------- Co-authored-by: Sam Rose <[email protected]>
1 parent 4afe5f0 commit 7eabe03

File tree

7 files changed

+21
-12
lines changed

7 files changed

+21
-12
lines changed

.github/workflows/testinfra-nix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: |
4848
packer init stage2-nix-psql.pkr.hcl
4949
GIT_SHA=${{github.sha}}
50-
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 "postgres-version=ci-ami-test" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" stage2-nix-psql.pkr.hcl
50+
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 "postgres-version=ci-ami-test" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "git_sha=${GITHUB_SHA}" stage2-nix-psql.pkr.hcl
5151
5252
- name: Run tests
5353
timeout-minutes: 10

ansible/tasks/stage2-setup-postgres.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- name: Install Postgres from nix binary cache
77
become: yes
88
shell: |
9-
sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/sam/2-stage-ami-nix#psql_15/bin"
9+
sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#psql_15/bin"
1010
#TODO (samrose) switch pg_prove sourcing to develop branch once PR is merged
1111
when: stage2_nix
1212

common-nix.vars.pkr.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
postgres-version = "15.6.1.90-nix-staged"
1+
postgres-version = "15.6.1.91-nix-staged"

nix/ext/timescaledb.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
1111
owner = "timescale";
1212
repo = "timescaledb";
1313
rev = version;
14-
hash = "sha256-gJViEWHtIczvIiQKuvvuwCfWJMxAYoBhCHhD75no6r0=";
14+
hash = "sha256-fvVSxDiGZAewyuQ2vZDb0I6tmlDXl6trjZp8+qDBtb8=";
1515
};
1616

1717
cmakeFlags = [ "-DSEND_TELEMETRY_DEFAULT=OFF" "-DREGRESS_CHECKS=OFF" "-DTAP_CHECKS=OFF" ]

nix/ext/wrappers/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
buildPgrxExtension_0_11_3 rec {
1212
pname = "supabase-wrappers";
13-
version = "0.3.1";
13+
version = "0.4.1";
1414
inherit postgresql;
1515

1616
src = fetchFromGitHub {
1717
owner = "supabase";
1818
repo = "wrappers";
1919
rev = "v${version}";
20-
hash = "sha256-ZwTw0USJC/F/ZW5usX7p0CB8p2YzeUb6OLiMF3D1+J4=";
20+
hash = "sha256-AU9Y43qEMcIBVBThu+Aor1HCtfFIg+CdkzK9IxVdkzM=";
2121
};
2222

2323
nativeBuildInputs = [ pkg-config cargo ];

scripts/nix-provision.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@ function install_nix() {
2525

2626

2727
function execute_stage2_playbook {
28-
29-
sudo tee /etc/ansible/ansible.cfg <<EOF
28+
sudo tee /etc/ansible/ansible.cfg <<EOF
3029
[defaults]
3130
callbacks_enabled = timer, profile_tasks, profile_roles
3231
EOF
33-
sed -i 's/- hosts: all/- hosts: localhost/' /tmp/ansible-playbook/ansible/playbook.yml
34-
# Run Ansible playbook
35-
export ANSIBLE_LOG_PATH=/tmp/ansible.log && export ANSIBLE_REMOTE_TEMP=/tmp
36-
ansible-playbook /tmp/ansible-playbook/ansible/playbook.yml --extra-vars '{"nixpkg_mode": false, "stage2_nix": true, "debpkg_mode": false}' $ARGS
32+
sed -i 's/- hosts: all/- hosts: localhost/' /tmp/ansible-playbook/ansible/playbook.yml
33+
# Run Ansible playbook
34+
export ANSIBLE_LOG_PATH=/tmp/ansible.log && export ANSIBLE_REMOTE_TEMP=/tmp
35+
ansible-playbook /tmp/ansible-playbook/ansible/playbook.yml \
36+
--extra-vars '{"nixpkg_mode": false, "stage2_nix": true, "debpkg_mode": false}' \
37+
--extra-vars "git_commit_sha=${GIT_SHA}" \
38+
$ARGS
3739
}
3840

3941

stage2-nix-psql.pkr.hcl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ variable "force-deregister" {
4141
type = bool
4242
default = false
4343
}
44+
variable "git_sha" {
45+
type = string
46+
default = env("GIT_SHA")
47+
}
4448

4549
packer {
4650
required_plugins {
@@ -128,6 +132,9 @@ build {
128132
}
129133

130134
provisioner "shell" {
135+
environment_vars = [
136+
"GIT_SHA=${var.git_sha}"
137+
]
131138
script = "scripts/nix-provision.sh"
132139
}
133140

0 commit comments

Comments
 (0)