Skip to content

Commit fbc4bf1

Browse files
authored
fix: create AWS config file to suppress post-build-hook errors (#2042)
* fix: create AWS config file to suppress post-build-hook errors The post-build-hook runs `nix copy --to s3://...` which now uses libcurl AWS authentication since the last 2.33 release (see https://releases.nixos.org/nix/nix-2.33.0/manual/release-notes/rl-2.33.html#s3-improvements). It attempts to read /root/.aws/config for profile configuration, but only /root/.aws/credentials was created by `aws configure set` (credential keys write to the credentials file, not the config file). This produced errors in CI logs: [ERROR] static: Failed to open file. path:'/root/.aws/config' [ERROR] Failed to build config profile collection from file Setting the region via `aws configure set region` creates the config file, resolving the missing file errors. * feat: upgrade nix to 2.33.2 2.33.2 has a fix to improve aws logs: NixOS/nix#15059 It should suppress logging error like: ``` [AuthCredentialsProvider] - Failed to resolve role arn during sts web identity provider initialization. ``` Note that it doesn't prevent the copy operation from succeeding, so it's not a critical issue, but it does make logs cleaner and easier to read.
1 parent 6a6be67 commit fbc4bf1

8 files changed

Lines changed: 9 additions & 8 deletions

File tree

.github/actions/nix-install-ephemeral/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ runs:
2727
sudo -H aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
2828
sudo -H aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
2929
sudo -H aws configure set aws_session_token $AWS_SESSION_TOKEN
30+
sudo -H aws configure set region ${{ inputs.aws-region }}
3031
sudo mkdir -p /etc/nix
3132
sudo -E python -c "import os; file = open('/etc/nix/nix-secret-key', 'w'); file.write(os.environ['NIX_SIGN_SECRET_KEY']); file.close()"
3233
cat << 'EOF' | sudo tee /etc/nix/upload-to-cache.sh > /dev/null
@@ -42,7 +43,7 @@ runs:
4243
NIX_SIGN_SECRET_KEY: ${{ env.NIX_SIGN_SECRET_KEY }}
4344
- uses: NixOS/nix-installer-action@d6ef7ecd8f685af89869e5aca0580a33e3e3150c
4445
with:
45-
installer-version: 2.33.1
46+
installer-version: 2.33.2
4647
extra-conf: |
4748
substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com
4849
trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=

Dockerfile-15

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ extra-experimental-features = nix-command flakes
106106
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
107107
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=
108108
EOF
109-
RUN curl -L https://releases.nixos.org/nix/nix-2.33.1/install | sh -s -- --daemon --no-channel-add --yes --nix-extra-conf-file /tmp/extra-nix.conf
109+
RUN curl -L https://releases.nixos.org/nix/nix-2.33.2/install | sh -s -- --daemon --no-channel-add --yes --nix-extra-conf-file /tmp/extra-nix.conf
110110
ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin"
111111

112112
COPY . /nixpg

Dockerfile-17

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ extra-experimental-features = nix-command flakes
108108
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
109109
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=
110110
EOF
111-
RUN curl -L https://releases.nixos.org/nix/nix-2.33.1/install | sh -s -- --daemon --no-channel-add --yes --nix-extra-conf-file /tmp/extra-nix.conf
111+
RUN curl -L https://releases.nixos.org/nix/nix-2.33.2/install | sh -s -- --daemon --no-channel-add --yes --nix-extra-conf-file /tmp/extra-nix.conf
112112

113113
ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin"
114114

Dockerfile-orioledb-17

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ extra-experimental-features = nix-command flakes
108108
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
109109
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=
110110
EOF
111-
RUN curl -L https://releases.nixos.org/nix/nix-2.33.1/install | sh -s -- --daemon --no-channel-add --yes --nix-extra-conf-file /tmp/extra-nix.conf
111+
RUN curl -L https://releases.nixos.org/nix/nix-2.33.2/install | sh -s -- --daemon --no-channel-add --yes --nix-extra-conf-file /tmp/extra-nix.conf
112112

113113
ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin"
114114

ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ function initiate_upgrade {
297297
--extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
298298
else
299299
echo "1.1.1. Installing Nix using the official installer"
300-
sh <(curl -L https://releases.nixos.org/nix/nix-2.33.1/install) --yes --daemon --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
300+
sh <(curl -L https://releases.nixos.org/nix/nix-2.33.2/install) --yes --daemon --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
301301
extra-experimental-features = nix-command flakes
302302
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
303303
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=

ebssurrogate/scripts/qemu-bootstrap-nix.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ execute_playbook
8282
####################
8383

8484
function install_nix() {
85-
sudo su -c "sh <(curl -L https://releases.nixos.org/nix/nix-2.33.1/install) --yes --daemon --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
85+
sudo su -c "sh <(curl -L https://releases.nixos.org/nix/nix-2.33.2/install) --yes --daemon --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
8686
extra-experimental-features = nix-command flakes
8787
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
8888
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=

nix/docs/start-here.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ extra-substituters =
8888
Run the following command to install Nix 2.33.1 (the version used in CI) with the custom configuration:
8989

9090
```bash
91-
curl -L https://releases.nixos.org/nix/nix-2.33.1/install | sh -s -- --daemon --yes --nix-extra-conf-file ./nix.conf
91+
curl -L https://releases.nixos.org/nix/nix-2.33.2/install | sh -s -- --daemon --yes --nix-extra-conf-file ./nix.conf
9292
```
9393

9494
This will install Nix with our build caches pre-configured, which should eliminate substituter-related errors.

scripts/nix-provision.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function install_packages {
2828

2929

3030
function install_nix() {
31-
sudo su -c "sh <(curl -L https://releases.nixos.org/nix/nix-2.33.1/install) --yes --daemon --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
31+
sudo su -c "sh <(curl -L https://releases.nixos.org/nix/nix-2.33.2/install) --yes --daemon --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
3232
extra-experimental-features = nix-command flakes
3333
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
3434
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=

0 commit comments

Comments
 (0)