move gitlab-toolbox from AWS CLI v1 to v2
What does this MR do?
Moves the gitlab-toolbox image (Debian and UBI) from AWS CLI v1, installed with pip (awscli==1.46.1), to the official AWS CLI v2 bundle, pinned to 2.38.5 with an SHA256 checksum per architecture.
Changes
ci_files/variables.yml:AWSCLI_VERSIONis now2.38.5. AddsAWSCLI_CHECKSUM_SHA256_AMD64andAWSCLI_CHECKSUM_SHA256_ARM64, following the existing*_CHECKSUM_SHA256pins..gitlab/ci/common.gitlab-ci.yml: passesAWSCLI_VERSIONand both checksums as--build-argtobuild_asset_imageandbuild_final_imagefor.gitlab-toolbox-eeand.gitlab-toolbox-ce, following the CFSSL pattern. PreviouslyAWSCLI_VERSIONwas never passed in CI, so only the Dockerfile default took effect.gitlab-toolbox/Dockerfile(Debian):- Removes
awsclifrom the pip install in thepythonstage. s3cmd, gsutil, pyOpenSSL, cryptography and crcmod are unchanged. - Adds an
awsclistage modeled on theazcopystage. It downloadsawscli-exe-linux-<arch>-<version>.zip, verifies it withsha256sum -c, and runs the bundled installer into/usr/local/aws-cli. - The final image copies
/usr/local/aws-cliand recreates the/usr/local/bin/awsandaws_completersymlinks. ACOPYof the symlinks dereferences them into standalone launchers that can't find their install directory. - Sets
ENV AWS_PAGER=""so noawscommand blocks on a pager.
- Removes
gitlab-toolbox/Dockerfile.build.ubi: same pip removal and download, verify and install logic in thebuildstage. Adds/usr/local/aws-clito thecp -R --parentsassets list;cp -Rpreserves the symlinks.gitlab-toolbox/Dockerfile.ubi.erb: setsENV AWS_PAGER=""in the UBI final image.scripts/renovate/update-awscli-checksum.sh(new): Renovate post-upgrade script, mirroringupdate-gomplate-checksum.sh. It recomputes both architecture checksums in all three pin locations.
The consumers (backup-utility and object_storage_backup.rb) are unchanged. They only use s3 cp/ls/rm/sync and s3api head-bucket, with flags v2 supports (--endpoint-url, --region, --sse aws:kms, --sse-kms-key-id, --storage-class). The aws s3 ls column layout is the same in v2.
Version and checksums
AWS publishes GPG .sig files rather than SHA256 files, so the checksums were computed from the downloaded bundles. Both bundles were also verified against the AWS CLI Team signing key (FB5D B77F D5C1 18B8 0511 ADA8 A631 0ACC 4672 475C).
| Arch | Bundle | SHA256 |
|---|---|---|
| amd64 | awscli-exe-linux-x86_64-2.38.5.zip |
5def7d1b7e55d892f9a381bb2cb2081a685712464be0d36d5d706af0ac48d0d3 |
| arm64 | awscli-exe-linux-aarch64-2.38.5.zip |
07711a936e9d271045ab937d2c2c5390c25f419e4ba9e25adb9e996031e3f6be |
Test plan
Local builds, before the MR pipeline:
| Check | Debian amd64 | Debian arm64 | UBI arm64 |
|---|---|---|---|
aws --version reports aws-cli/2.38.5 |
|||
pip3 show awscli reports not found (v1 removed) |
|||
AWS_PAGER is set and empty |
|||
aws s3 ls runs (fails only on missing credentials) |
|||
s3cmd --version, gsutil version, azcopy --version still work |
|||
MinIO: head-bucket, cp (40 MB multipart, --storage-class), ls parsing, sync (up, down, bucket-to-bucket, --delete --exclude), rm --recursive |
— |
- The UBI asset (
Dockerfile.build.ubi) build also passed for amd64, with the checksum verified. - MinIO RELEASE.2025-07-23 accepted v2's default checksum headers, so
AWS_REQUEST_CHECKSUM_CALCULATION=when_requiredwas not needed. aws <cmd> helpfails with "Could not find executable named groff or mandoc". This is not a regression; the current v1 image fails the same way.- To do: FIPS and UBI validation through the
fips_pipelinebridge job on this MR, anddevelopment/tests/awscli/test.shagainst real S3.
Notes for reviewers
- FIPS: AWS CLI v2 bundles its own Python (3.14.8) and OpenSSL (3.5.9) and does not include a FIPS provider. It therefore does not use the system FIPS-validated crypto module in FIPS images, and this needs documenting.
AWS_USE_FIPS_ENDPOINTonly selects FIPS endpoints; it does not change the crypto module. - Renovate: a follow-up MR is needed in renovate-gitlab-bot (
renovate/distribution/cng.config.js):- Relax
allowedVersions: "<2.0.0"foraws/aws-clito"<3.0.0". Without this, Renovate won't propose v2 updates. - Add a
postUpgradeTasksrule running./scripts/renovate/update-awscli-checksum.sh, modeled on the gomplate rule. - The existing version patterns already match all three pin locations.
- Relax
- S3-compatible endpoints: older MinIO, Ceph or appliance endpoints may reject v2's default checksum headers. Users can opt out with
AWS_REQUEST_CHECKSUM_CALCULATION=when_requiredandAWS_RESPONSE_CHECKSUM_VALIDATION=when_required. - Image size: about +120 MB uncompressed. The v2 bundle is about 269 MB and replaces about 154 MB of v1 Python packages.
- Docs follow-up:
docs/development/test-plans/upgrade-awscli-test-plan.mdstill references the v1 Renovate branch and v1 output.
Signed-off-by: psingh29 psingh@gitlab.com
Related issues
Closes #2482
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion
Required
- Merge Request Title, and Description are up to date, accurate, and descriptive
- MR targeting the appropriate branch
- MR has a green pipeline on GitLab.com
- When ready for review, MR is labeled "~workflow::ready for review" per the Distribution MR workflow
Expected (please provide an explanation if not completing)
- Test plan indicating conditions for success has been posted and passes
- Documentation created/updated
- Integration tests added to GitLab QA
- The impact any change in container size has should be evaluated
- New dependencies are managed with GitLab forked renovatebot