From 53673b7331da4cb55b6629a31686c071179d574f Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Tue, 13 May 2025 11:53:43 -0700 Subject: [PATCH 1/4] releng: ignore `prev-git-branch.txt` This file is created by `python -m releng tag`. Change-Id: I85090f4c6d9c2ba9a991b47df6a7382b80f7ff52 --- releng/.gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 releng/.gitignore diff --git a/releng/.gitignore b/releng/.gitignore new file mode 100644 index 000000000..8d033f940 --- /dev/null +++ b/releng/.gitignore @@ -0,0 +1,2 @@ +# Created by `python -m releng tag` +/prev-git-branch.txt From 2e25580d8de83feb68270d3786ec83e4759217b0 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Tue, 13 May 2025 11:54:06 -0700 Subject: [PATCH 2/4] releng: remove unused variables `lib` and `config` were unused here. In the future maybe we should integrate `deadnix` or something similar for linting. Change-Id: I2f08bd2f87f74b90a5f76ea7db7e6d4db1663450 --- releng/local/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/releng/local/default.nix b/releng/local/default.nix index 64c617a57..48d710dd2 100644 --- a/releng/local/default.nix +++ b/releng/local/default.nix @@ -1,8 +1,6 @@ { self, system, - lib, - config, pkgs, ... }: From 4611d1f33193a56516c128b070c9671d78ce15a6 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Tue, 13 May 2025 11:55:12 -0700 Subject: [PATCH 3/4] releng/docker_assemble.py: fix empty `auths` error I had a `~/.docker/config.json` which was missing an `auths` key, which caused an error. The release automation succesfully ignored the error, but it was noisy. Using `json_obj.get('auths', {})` instead of `json_obj['auths']` fixes this `KeyError`. Change-Id: I022583e9e668bf8ad7bdc1fa5a3305aee2f18d85 --- releng/docker_assemble.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/releng/docker_assemble.py b/releng/docker_assemble.py index d5b47c328..21754336b 100644 --- a/releng/docker_assemble.py +++ b/releng/docker_assemble.py @@ -248,7 +248,8 @@ class AuthState: with path.open() as fh: try: json_obj = json.load(fh) - return {k: v['auth'] for k, v in json_obj['auths'].items()} + auths = json_obj.get('auths', {}) + return {k: v['auth'] for k, v in auths.items()} except (json.JSONDecodeError, KeyError) as e: log.exception('JSON decode error in %s', path, exc_info=e) return {} From a3b3b06a216b9c287b6615fb3871ce96f38a1182 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Tue, 13 May 2025 11:59:51 -0700 Subject: [PATCH 4/4] aws s3 cp: Note issue with `--checksum-algorithm=SHA256` There may or may not be a bug in `garage` here. Previously we added `--checksum-algorithm=SHA256` here to fix it, but when @rbt was running the release for 2.93.0, she found it actually made the S3 uploads fail. If this command is failing, here are some links to investigate. See: https://git.deuxfleurs.fr/Deuxfleurs/garage/issues/963 See: https://git.deuxfleurs.fr/Deuxfleurs/garage/issues/1017 See: https://github.com/boto/boto3/issues/4392 See: https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-envvars.html#envvars-list-AWS_REQUEST_CHECKSUM_CALCULATION Change-Id: Id732c31aa715191e78c7f0246e1b74cc202e675c --- releng/create_release.xsh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/releng/create_release.xsh b/releng/create_release.xsh index 0091a6728..41fc84c19 100644 --- a/releng/create_release.xsh +++ b/releng/create_release.xsh @@ -32,9 +32,6 @@ RELENG_MSG = "Release created with releng/create_release.xsh" BUILD_CORES = 16 MAX_JOBS = 2 -# Workaround for bug in garage: https://git.deuxfleurs.fr/Deuxfleurs/garage/issues/963 -S3_ARGS = ['--checksum-algorithm=SHA256'] - def setup_creds(env: RelengEnvironment): key = keys.get_ephemeral_key(env) @@ -240,7 +237,20 @@ def upload_artifacts(env: RelengEnvironment, noconfirm=False, no_check_git=False docker.upload_docker_images(target, docker_images) print('[+] Upload to release bucket') - aws s3 cp @(S3_ARGS) --recursive @(ARTIFACTS)/ @(env.releases_bucket)/ + + # There may or may not be a bug in `garage` here. Previously we added + # `--checksum-algorithm=SHA256` here to fix it, but when @9999years was + # running the release for 2.93.0, she found it actually made the S3 uploads + # fail. + # + # If this command is failing, here are some links to investigate. + # + # See: https://git.deuxfleurs.fr/Deuxfleurs/garage/issues/963 + # See: https://git.deuxfleurs.fr/Deuxfleurs/garage/issues/1017 + # See: https://github.com/boto/boto3/issues/4392 + # See: https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-envvars.html#envvars-list-AWS_REQUEST_CHECKSUM_CALCULATION + aws s3 cp --recursive @(ARTIFACTS)/ @(env.releases_bucket)/ + print('[+] Upload manual') upload_manual(env) @@ -287,9 +297,9 @@ def upload_manual(env: RelengEnvironment): version = 'nightly' print('[+] aws s3 sync manual') - aws s3 sync @(S3_ARGS) --delete @(MANUAL)/ @(env.docs_bucket)/manual/lix/@(version)/ + aws s3 sync --delete @(MANUAL)/ @(env.docs_bucket)/manual/lix/@(version)/ if OFFICIAL_RELEASE: - aws s3 sync @(S3_ARGS) --delete @(MANUAL)/ @(env.docs_bucket)/manual/lix/stable/ + aws s3 sync --delete @(MANUAL)/ @(env.docs_bucket)/manual/lix/stable/ def build_artifacts(build_profile, no_check_git=False):