From f6d881a9758ffb720e045632d733357209f76269 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Tue, 22 Sep 2026 18:10:57 +0200 Subject: [PATCH 1/3] CI: pre-compress assembler preview S3 upload Same gzip-in-place + --content-encoding gzip pattern as the local docs preview upload. The assembler tree is ~2 GiB of uncompressed HTML; pre-compressing before aws s3 sync cuts wire cost to ~120 MB. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/assembler-preview.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/assembler-preview.yml b/.github/workflows/assembler-preview.yml index 3cecdef8c3..6adf76f5ed 100644 --- a/.github/workflows/assembler-preview.yml +++ b/.github/workflows/assembler-preview.yml @@ -115,7 +115,17 @@ jobs: aws configure set default.s3.max_concurrent_requests "${AWS_S3_MAX_CONCURRENT_REQUESTS}" aws configure set default.s3.max_queue_size "${AWS_S3_MAX_QUEUE_SIZE}" - aws s3 sync .artifacts/assembly/${ASSEMBLER_PREVIEW_PATH_PREFIX} "s3://elastic-docs-v3-website-preview/${ASSEMBLER_PREVIEW_PATH_PREFIX}" --delete --no-follow-symlinks + # Pre-compress all non-zip files so aws s3 sync ships ~120 MB instead of ~2 GiB. + # Zip bundles (llm.zip, okf.zip) are already compressed; syncing them with + # content-encoding:gzip would prevent clients from decoding them correctly. + find ".artifacts/assembly/${ASSEMBLER_PREVIEW_PATH_PREFIX}" -type f ! -name "*.zip" -print0 \ + | xargs -0 -P "$(nproc)" -I{} sh -c 'tmp=$(mktemp "$1.tmp.XXXXXX") && gzip -9 -n -c "$1" > "$tmp" && mv -f "$tmp" "$1"' _ {} + + # Sync compressed files with gzip content-encoding; sync zip downloads separately. + aws s3 sync ".artifacts/assembly/${ASSEMBLER_PREVIEW_PATH_PREFIX}" "s3://elastic-docs-v3-website-preview/${ASSEMBLER_PREVIEW_PATH_PREFIX}" \ + --delete --no-follow-symlinks --content-encoding gzip --exclude "*.zip" + aws s3 sync ".artifacts/assembly/${ASSEMBLER_PREVIEW_PATH_PREFIX}" "s3://elastic-docs-v3-website-preview/${ASSEMBLER_PREVIEW_PATH_PREFIX}" \ + --delete --no-follow-symlinks --exclude "*" --include "*.zip" aws cloudfront create-invalidation \ --distribution-id EKT7LT5PM8RKS \ --paths "/${ASSEMBLER_PREVIEW_PATH_PREFIX}" "/${ASSEMBLER_PREVIEW_PATH_PREFIX}/*" From ff5fe69c1df87999cf1857f9adf2388da2e9272f Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Tue, 29 Sep 2026 13:55:23 +0200 Subject: [PATCH 2/3] CI: enable pipefail before the find|xargs gzip pre-compression pipeline GitHub Actions runs bash -e but not pipefail by default. In 'find ... | xargs gzip', the pipeline exit status comes from xargs, so a partial find failure is masked. Without pipefail, some files can be left uncompressed while aws s3 sync still applies --content-encoding gzip, publishing non-gzip bytes with incorrect encoding metadata. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/assembler-preview.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/assembler-preview.yml b/.github/workflows/assembler-preview.yml index 6adf76f5ed..7573e51555 100644 --- a/.github/workflows/assembler-preview.yml +++ b/.github/workflows/assembler-preview.yml @@ -111,6 +111,7 @@ jobs: AWS_S3_MAX_CONCURRENT_REQUESTS: 50 AWS_S3_MAX_QUEUE_SIZE: 20000 run: | + set -o pipefail aws configure set default.s3.preferred_transfer_client classic aws configure set default.s3.max_concurrent_requests "${AWS_S3_MAX_CONCURRENT_REQUESTS}" aws configure set default.s3.max_queue_size "${AWS_S3_MAX_QUEUE_SIZE}" From 957487c4446398ea23a5fcf8b644aca9b1f50ab7 Mon Sep 17 00:00:00 2001 From: Andrea De Pirro Date: Tue, 27 Oct 2026 17:36:00 +0100 Subject: [PATCH 3/3] CI: silence SC2016 for the intentional single-quoted gzip script Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/assembler-preview.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/assembler-preview.yml b/.github/workflows/assembler-preview.yml index b3b73fe0e4..0e33b3c8b4 100644 --- a/.github/workflows/assembler-preview.yml +++ b/.github/workflows/assembler-preview.yml @@ -122,6 +122,8 @@ jobs: # Pre-compress all non-zip files so aws s3 sync ships ~120 MB instead of ~2 GiB. # Zip bundles (llm.zip, okf.zip) are already compressed; syncing them with # content-encoding:gzip would prevent clients from decoding them correctly. + # The inner sh -c script is intentionally single-quoted so it expands per file, not here. + # shellcheck disable=SC2016 find ".artifacts/assembly/${ASSEMBLER_PREVIEW_PATH_PREFIX}" -type f ! -name "*.zip" -print0 \ | xargs -0 -P "$(nproc)" -I{} sh -c 'tmp=$(mktemp "$1.tmp.XXXXXX") && gzip -9 -n -c "$1" > "$tmp" && mv -f "$tmp" "$1"' _ {}