Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
e0d26c3
feat(nodejs): add base images for Node.js weblogs
rochdev May 12, 2026
f8a7362
ci(nodejs): publish base images to GHCR automatically
rochdev May 16, 2026
756bb2c
ci(nodejs): version base images by PR number
rochdev May 16, 2026
ed1386a
fix(ci): add packages:write permission to build_end_to_end job
rochdev May 16, 2026
a7be447
fix(ci): move nodejs base image push to dedicated ci.yml job
rochdev May 16, 2026
22385e7
fix(nodejs): update parametric Dockerfile to use GHCR base image
rochdev May 16, 2026
060da04
docs: update base image guide for Node.js GHCR workflow
rochdev May 16, 2026
f168564
fix(nodejs): add OCI source label to link packages to repo in GHCR
rochdev May 16, 2026
40615a6
refactor(nodejs): scope base images to weblog/nodejs in GHCR
rochdev May 16, 2026
1fde96d
refactor(ci): extract nodejs base image push to reusable workflow
rochdev May 17, 2026
082de4b
refactor(nodejs): follow Python/PHP pattern for base image publishing
rochdev May 17, 2026
116a336
fix(ci): add nodejs base image build step to parametric workflow
rochdev May 17, 2026
64b3558
fix(nodejs): remove base images from integration framework weblogs
rochdev May 17, 2026
9fc4669
perf(build): avoid docker save | gzip recompression when saving weblog
rochdev May 17, 2026
e33cca2
revert(build): revert --output type=docker, not supported by docker d…
rochdev May 17, 2026
8ed1483
perf(build): use pigz instead of gzip when saving weblog image
rochdev May 17, 2026
ed85e01
perf(build): use zstd instead of pigz for weblog image compression
rochdev May 17, 2026
50659d1
perf(nodejs): use bun for express4 dependency installation
rochdev May 17, 2026
7931ff3
fix(lint): use bash array for bun args to satisfy shellcheck SC2086
rochdev May 17, 2026
ff9bd22
fix(nodejs): use alpine bun image to match musl libc on node:alpine
rochdev May 17, 2026
eec453c
fix(nodejs): remove hoisted linker from dd-trace install
rochdev May 17, 2026
feef5a3
fix(nodejs): add --trust to bun add for dd-trace lifecycle scripts
rochdev May 17, 2026
0b51fa7
feat(nodejs): switch all weblogs to bun, use GHCR for weblog images
rochdev May 17, 2026
7544e2d
revert(ci): revert GHCR weblog image sharing, restore artifact approach
rochdev May 17, 2026
af8c1fc
perf(ci): rebuild nodejs weblogs in run job, skip build+artifact step
rochdev May 17, 2026
d25adfc
fix(ci): use shared binaries artifact for nodejs build_in_run weblogs
rochdev May 17, 2026
a5bc840
perf(ci): save/load base image artifact instead of full weblog image
rochdev May 17, 2026
4ae8461
fix(ci): handle unset TEST_LIBRARY/WEBLOG_VARIANT in load_base_image
rochdev May 17, 2026
314ab7e
perf(nodejs): increase bun network-concurrency to 16 for dd-trace ins…
rochdev May 17, 2026
27d1212
fix(ci): skip image pre-pull when base image artifact exists
rochdev May 17, 2026
170d610
fix(ci): skip weblog build for nodejs when saving artifact
rochdev May 17, 2026
53f8f10
fix(ci): pass TEST_LIBRARY from libraries array in run.sh for parametric
rochdev May 17, 2026
8ad0968
fix(ci): revert parametric Dockerfile to node:18.10-slim
rochdev May 17, 2026
b2ac87f
revert: undo unauthorized commit bed1702f0
rochdev May 17, 2026
e1feb55
fix(ci): revert parametric to original npm-based Dockerfile
rochdev May 17, 2026
d47f330
fix(nodejs): switch parametric tests to bun, add bun binary
rochdev May 17, 2026
77135c3
feat(ci): add _build_nodejs_base_images option to skip build jobs
rochdev May 17, 2026
6b98b42
fix(lint): make build_weblog_images keyword-only to satisfy ruff FBT0…
rochdev May 17, 2026
1bea95d
fix(ci): default build_weblog_images to true, only false for nodejs w…
rochdev May 17, 2026
eac24bc
fix(ci): default build_weblog_images to True in workflow_data.py
rochdev May 17, 2026
329ce66
fix(ci): restore correct condition for Build nodejs weblog base image…
rochdev May 17, 2026
cdb6ccf
fix(ci): revert accidental _system_tests_dev_mode default change, fix…
rochdev May 17, 2026
33bbf85
refactor(ci): unify weblog artifact naming for nodejs base images
rochdev May 17, 2026
6e9ab75
fix: remove Node.js mention from generic --build-weblog-images help text
rochdev May 17, 2026
887241e
fix(ci): restore missing fi closing docker inspect block in build.sh
rochdev May 17, 2026
8095913
style: apply ruff formatting to compute-workflow-parameters.py
rochdev May 17, 2026
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
_build_proxy_image: ${{ contains(github.event.pull_request.labels.*.name, 'build-proxy-image') }}
_build_python_base_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-python-base-images') }}
_build_php_base_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-php-base-images') }}
_build_nodejs_base_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-nodejs-base-images') }}
Comment thread
rochdev marked this conversation as resolved.
_enable_replay_scenarios: true
_system_tests_dev_mode: ${{ matrix.version == 'dev' }}
_system_tests_library_target_branch_map: ${{ needs.compute_libraries_and_scenarios.outputs.target-branch-map }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/compute-workflow-parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ on:
default: ''
required: false
type: string
_build_weblog_images:
description: "When true, weblogs get a build job to save artifacts. When false, parallel_weblogs is empty and run jobs rebuild from Docker Hub."
default: true
required: false
type: boolean

# Map the workflow outputs to job outputs
outputs:
Expand Down Expand Up @@ -137,6 +142,7 @@ jobs:
--parametric-job-count ${{ inputs.parametric_job_count }} \
--explicit-binaries-artifact "${{ inputs.binaries_artifact }}" \
--system-tests-dev-mode "${{ inputs._system_tests_dev_mode }}" \
--build-weblog-images "${{ inputs._build_weblog_images }}" \
--output $GITHUB_OUTPUT
- name: log
run: |
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ on:
default: false
required: false
type: boolean
_build_nodejs_base_images:
description: "Shall we build Node.js base images for tests on Node.js tracer"
default: false
required: false
type: boolean
_build_buddies_images:
description: "Shall we build buddies images"
default: false
Expand Down Expand Up @@ -168,6 +173,7 @@ jobs:
binaries_artifact: ${{ inputs.binaries_artifact }}
_system_tests_dev_mode: ${{ inputs._system_tests_dev_mode }}
_system_tests_library_target_branch_map: ${{ inputs._system_tests_library_target_branch_map }}
_build_weblog_images: ${{ inputs.library != 'nodejs' || inputs._build_nodejs_base_images }}

parametric:
needs:
Expand Down Expand Up @@ -236,6 +242,10 @@ jobs:
if: inputs.library == 'php' && inputs._build_php_base_images
run: |
./utils/build/build_php_base_images.sh
- name: Build nodejs weblog base images
if: inputs.library == 'nodejs' && inputs._build_nodejs_base_images
run: |
./utils/build/build_nodejs_base_images.sh
Comment thread
rochdev marked this conversation as resolved.
- name: Build weblog
id: build
run: SYSTEM_TEST_BUILD_ATTEMPTS=3 ./build.sh ${{ inputs.library }} -i weblog -w ${{ matrix.weblog.name }} -s --github-token-file "$RUNNER_TEMP/github_token.txt"
Expand Down
2 changes: 1 addition & 1 deletion .shellcheck
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TODO=(
utils/scripts/docker_base_image.sh
utils/build/docker/postgres-init-db.sh
utils/build/docker/nodejs/app.sh
utils/build/docker/nodejs/install_ddtrace.sh

utils/build/docker/set-uds-transport.sh
utils/build/docker/python/flask/app.sh
utils/build/docker/python/install_ddtrace.sh
Expand Down
1 change: 1 addition & 0 deletions docs/edit/update-docker-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ If you need to update them, you will need to follow those
2. create your PR, and add the relevant label to rebuild the image in the CI
* `build-python-base-images` for python weblogs
* `build-php-base-images` for PHP weblogs
* `build-nodejs-base-images` for Node.js weblogs
* `build-proxy-image` for proxy image
3. just before merging your PR, ping somebody from Reliability & Performance team to push your image to hub.docker.com (`#apm-shared-testing` on slack)
2 changes: 1 addition & 1 deletion utils/_context/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ def get_image_list(self, library: str | None, weblog: str | None) -> list[str]:
"""Returns images needed to build the weblog"""

# If an image is saved as a file in binaries, we don't need any image
filename = f"binaries/{library}-{weblog}-weblog.tar.gz"
filename = f"binaries/{library}-{weblog}-weblog.tar.zst"
if Path(filename).is_file():
return []

Expand Down
28 changes: 20 additions & 8 deletions utils/build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ readonly ALIAS_CACHE_TO="W" #write cache
readonly DEFAULT_TEST_LIBRARY=nodejs
readonly DEFAULT_BUILD_IMAGES=weblog,runner
readonly DEFAULT_DOCKER_MODE=0
readonly DEFAULT_SAVE_TO_BINARIES=0

# Define default weblog variants.
# XXX: Avoid associative arrays for Bash 3 compatibility.
readonly DEFAULT_SAVE_TO_BINARIES=0
readonly DEFAULT_nodejs=express4
readonly DEFAULT_python=flask-poc
readonly DEFAULT_ruby=rails72
Expand Down Expand Up @@ -72,7 +72,7 @@ print_usage() {
echo -e " ${CYAN}--default-weblog${NC} Prints the name of the default weblog for a given library and exits."
echo -e " ${CYAN}--binary-path${NC} Optional. Path of a directory binaries will be copied from. Should be used for local development only."
echo -e " ${CYAN}--binary-url${NC} Optional. Url of the client library redistributable. Should be used for local development only."
echo -e " ${CYAN}--save-to-binaries${NC} Optional. Save image in binaries folder as a tar.gz file."
echo -e " ${CYAN}--save-to-binaries${NC} Optional. Save image in binaries folder as a tar.zst file."
echo -e " ${CYAN}--help${NC} Prints this message and exits."
echo
echo -e "${WHITE_BOLD}EXAMPLES${NC}"
Expand Down Expand Up @@ -257,11 +257,22 @@ build() {
fi

# keep this name consistent with WeblogContainer.get_image_list()
BINARIES_FILENAME=binaries/${TEST_LIBRARY}-${WEBLOG_VARIANT}-weblog.tar.gz
BINARIES_FILENAME=binaries/${TEST_LIBRARY}-${WEBLOG_VARIANT}-weblog.tar.zst

if [[ $TEST_LIBRARY == nodejs ]] && [[ $SAVE_TO_BINARIES == 1 ]]; then
BASE_IMAGE=$(awk '/^FROM/{print $2; exit}' "utils/build/docker/nodejs/${WEBLOG_VARIANT}.Dockerfile")
echo "Saving base image $BASE_IMAGE to $BINARIES_FILENAME"
docker save "$BASE_IMAGE" | zstd > "$BINARIES_FILENAME"
continue
fi

if [ -f $BINARIES_FILENAME ]; then
if [ -f "$BINARIES_FILENAME" ]; then
echo "Loading image from $BINARIES_FILENAME"
docker load --input $BINARIES_FILENAME
zstd -d -c "$BINARIES_FILENAME" | docker load
fi

if docker image inspect system_tests/weblog >/dev/null 2>&1; then
echo "Using pre-loaded weblog image"
else

if [[ $TEST_LIBRARY == python ]]; then
Expand Down Expand Up @@ -339,8 +350,9 @@ build() {

if [[ $SAVE_TO_BINARIES == 1 ]]; then
echo "Saving image to $BINARIES_FILENAME"
docker save system_tests/weblog | gzip > $BINARIES_FILENAME
docker save system_tests/weblog | zstd > "$BINARIES_FILENAME"
fi

fi
elif [[ $IMAGE_NAME == lambda-proxy ]]; then
run_build_command docker buildx build \
Expand Down Expand Up @@ -370,13 +382,13 @@ while [[ "$#" -gt 0 ]]; do
-e|--extra-docker-args) EXTRA_DOCKER_ARGS="$2"; shift ;;
-c|--cache-mode) DOCKER_CACHE_MODE="$2"; shift ;;
-p|--docker-platform) DOCKER_PLATFORM="--platform $2"; shift ;;
-s|--save-to-binaries) SAVE_TO_BINARIES=1 ;;
--github-token-file) GITHUB_TOKEN_FILE="$2"; shift ;;
--binary-url) BINARY_URL="$2"; shift ;;
--binary-path) BINARY_PATH="$2"; shift ;;
--list-libraries) COMMAND=list-libraries ;;
--list-weblogs) COMMAND=list-weblogs ;;
--default-weblog) COMMAND=default-weblog ;;
-s|--save-to-binaries) SAVE_TO_BINARIES=1 ;;
-h|--help) print_usage; exit 0 ;;
--agent-base-image) AGENT_BASE_IMAGE="$2"; shift ;; # deprecated
*)
Expand All @@ -395,11 +407,11 @@ DOCKER_CACHE_MODE="${DOCKER_CACHE_MODE:-}"
EXTRA_DOCKER_ARGS="${EXTRA_DOCKER_ARGS:-}"
DOCKER_PLATFORM="${DOCKER_PLATFORM:-}"
DOCKER_MODE="${DOCKER_MODE:-${DEFAULT_DOCKER_MODE}}"
SAVE_TO_BINARIES="${SAVE_TO_BINARIES:-${DEFAULT_SAVE_TO_BINARIES}}"
BUILD_IMAGES="${BUILD_IMAGES:-${DEFAULT_BUILD_IMAGES}}"
TEST_LIBRARY="${TEST_LIBRARY:-${DEFAULT_TEST_LIBRARY}}"
BINARY_PATH="${BINARY_PATH:-}"
BINARY_URL="${BINARY_URL:-}"
SAVE_TO_BINARIES="${SAVE_TO_BINARIES:-${DEFAULT_SAVE_TO_BINARIES}}"
GITHUB_TOKEN_FILE="${GITHUB_TOKEN_FILE:-}"

if [[ "${BUILD_IMAGES}" =~ /weblog/ && ! -d "${SCRIPT_DIR}/docker/${TEST_LIBRARY}" ]]; then
Expand Down
8 changes: 8 additions & 0 deletions utils/build/build_nodejs_base_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -e

if [ "$1" = "--push" ]; then
exec docker buildx bake --progress=plain -f "utils/build/docker/nodejs/docker-bake.hcl" "$@"
else
exec docker buildx bake --progress=plain --load -f "utils/build/docker/nodejs/docker-bake.hcl" "$@"
fi
12 changes: 7 additions & 5 deletions utils/build/docker/nodejs/anthropic-js.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
FROM node:22-alpine
ARG FRAMEWORK_VERSION

COPY --from=oven/bun:1.3.13-alpine /usr/local/bin/bun /usr/local/bin/bun

RUN apk add --no-cache bash curl git jq

RUN uname -r

# print versions
RUN node --version && npm --version && curl --version
RUN node --version && npm --version && bun --version && curl --version

WORKDIR /usr/app

COPY utils/build/docker/nodejs/anthropic_app /usr/app
RUN npm ci || (sleep 30 && npm ci)
RUN bun install --frozen-lockfile --network-concurrency 8 --linker=hoisted

RUN if [ "$FRAMEWORK_VERSION" = "latest" ]; then \
npm install @anthropic-ai/sdk; \
bun add --network-concurrency 8 @anthropic-ai/sdk; \
else \
npm install @anthropic-ai/sdk@$FRAMEWORK_VERSION; \
bun add --network-concurrency 8 @anthropic-ai/sdk@$FRAMEWORK_VERSION; \
fi

COPY utils/build/docker/nodejs/install_ddtrace.sh binaries* /binaries/
Expand All @@ -25,4 +27,4 @@ RUN /binaries/install_ddtrace.sh
# docker startup
COPY utils/build/docker/nodejs/app.sh app.sh
RUN printf 'node app.js' >> app.sh
CMD ./app.sh
CMD ./app.sh
Loading
Loading