Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/testinfra-nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: |
packer init stage2-nix-psql.pkr.hcl
GIT_SHA=${{github.sha}}
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
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
- name: Run tests
timeout-minutes: 10
Expand Down
2 changes: 1 addition & 1 deletion ansible/tasks/stage2-setup-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- name: Install Postgres from nix binary cache
become: yes
shell: |
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"
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"
#TODO (samrose) switch pg_prove sourcing to develop branch once PR is merged
when: stage2_nix

Expand Down
2 changes: 1 addition & 1 deletion common-nix.vars.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
postgres-version = "15.6.1.90-nix-staged"
postgres-version = "15.6.1.91-nix-staged"
2 changes: 1 addition & 1 deletion nix/ext/timescaledb.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
owner = "timescale";
repo = "timescaledb";
rev = version;
hash = "sha256-gJViEWHtIczvIiQKuvvuwCfWJMxAYoBhCHhD75no6r0=";
hash = "sha256-fvVSxDiGZAewyuQ2vZDb0I6tmlDXl6trjZp8+qDBtb8=";
};

cmakeFlags = [ "-DSEND_TELEMETRY_DEFAULT=OFF" "-DREGRESS_CHECKS=OFF" "-DTAP_CHECKS=OFF" ]
Expand Down
4 changes: 2 additions & 2 deletions nix/ext/wrappers/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

buildPgrxExtension_0_11_3 rec {
pname = "supabase-wrappers";
version = "0.3.1";
version = "0.4.1";
inherit postgresql;

src = fetchFromGitHub {
owner = "supabase";
repo = "wrappers";
rev = "v${version}";
hash = "sha256-ZwTw0USJC/F/ZW5usX7p0CB8p2YzeUb6OLiMF3D1+J4=";
hash = "sha256-AU9Y43qEMcIBVBThu+Aor1HCtfFIg+CdkzK9IxVdkzM=";
};

nativeBuildInputs = [ pkg-config cargo ];
Expand Down
14 changes: 8 additions & 6 deletions scripts/nix-provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@ function install_nix() {


function execute_stage2_playbook {

sudo tee /etc/ansible/ansible.cfg <<EOF
sudo tee /etc/ansible/ansible.cfg <<EOF
[defaults]
callbacks_enabled = timer, profile_tasks, profile_roles
EOF
sed -i 's/- hosts: all/- hosts: localhost/' /tmp/ansible-playbook/ansible/playbook.yml
# Run Ansible playbook
export ANSIBLE_LOG_PATH=/tmp/ansible.log && export ANSIBLE_REMOTE_TEMP=/tmp
ansible-playbook /tmp/ansible-playbook/ansible/playbook.yml --extra-vars '{"nixpkg_mode": false, "stage2_nix": true, "debpkg_mode": false}' $ARGS
sed -i 's/- hosts: all/- hosts: localhost/' /tmp/ansible-playbook/ansible/playbook.yml
# Run Ansible playbook
export ANSIBLE_LOG_PATH=/tmp/ansible.log && export ANSIBLE_REMOTE_TEMP=/tmp
ansible-playbook /tmp/ansible-playbook/ansible/playbook.yml \
--extra-vars '{"nixpkg_mode": false, "stage2_nix": true, "debpkg_mode": false}' \
--extra-vars "git_commit_sha=${GIT_SHA}" \
$ARGS
}


Expand Down
7 changes: 7 additions & 0 deletions stage2-nix-psql.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ variable "force-deregister" {
type = bool
default = false
}
variable "git_sha" {
type = string
default = env("GIT_SHA")
}

packer {
required_plugins {
Expand Down Expand Up @@ -128,6 +132,9 @@ build {
}

provisioner "shell" {
environment_vars = [
"GIT_SHA=${var.git_sha}"
]
script = "scripts/nix-provision.sh"
}

Expand Down