Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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') }}
_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
9 changes: 9 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 @@ -236,6 +241,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
- 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
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)
5 changes: 5 additions & 0 deletions utils/build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ build() {
if [ -f "$BINARIES_FILENAME" ]; then
echo "Loading image from $BINARIES_FILENAME"
zstd -d -c "$BINARIES_FILENAME" | docker load
fi

if docker image inspect system_tests/weblog >/dev/null 2>&1; then
Comment thread
rochdev marked this conversation as resolved.
Outdated
echo "Using pre-loaded weblog image"
else

if [[ $TEST_LIBRARY == python ]]; then
Expand Down Expand Up @@ -341,6 +345,7 @@ build() {
echo "Saving image to $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
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
41 changes: 41 additions & 0 deletions utils/build/docker/nodejs/docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Docker Buildx bake file for Node.js base images

group "default" {
targets = [
"express4",
"express5",
"fastify",
"express4-typescript",
"nextjs",
]
}

target "express4" {
context = "."
dockerfile = "utils/build/docker/nodejs/express4.base.Dockerfile"
tags = ["datadog/system-tests:express4.base-v1"]
}

target "express5" {
context = "."
dockerfile = "utils/build/docker/nodejs/express5.base.Dockerfile"
tags = ["datadog/system-tests:express5.base-v1"]
}

target "fastify" {
context = "."
dockerfile = "utils/build/docker/nodejs/fastify.base.Dockerfile"
tags = ["datadog/system-tests:fastify.base-v1"]
}

target "express4-typescript" {
context = "."
dockerfile = "utils/build/docker/nodejs/express4-typescript.base.Dockerfile"
tags = ["datadog/system-tests:express4-typescript.base-v1"]
}

target "nextjs" {
context = "."
dockerfile = "utils/build/docker/nodejs/nextjs.base.Dockerfile"
tags = ["datadog/system-tests:nextjs.base-v1"]
}
18 changes: 3 additions & 15 deletions utils/build/docker/nodejs/express4-typescript.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
FROM node:18-alpine

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

WORKDIR /usr/app
FROM datadog/system-tests:express4-typescript.base-v1

COPY utils/build/docker/nodejs/express4-typescript /usr/app
RUN npm ci || (sleep 30 && npm ci)

EXPOSE 7777

Expand All @@ -26,13 +14,13 @@ ENV DD_DATA_STREAMS_ENABLED=true

COPY utils/build/docker/nodejs/install_ddtrace.sh binaries* /binaries/
RUN /binaries/install_ddtrace.sh
RUN npm run build
RUN bun run build

# docker startup
COPY utils/build/docker/nodejs/app.sh app.sh
RUN printf 'node dist/app.js' >> app.sh
CMD ./app.sh
ENV DD_TRACE_HEADER_TAGS=user-agent

# docker build -f utils/build/docker/nodejs.datadog.Dockerfile -t test .
# docker build -f utils/build/docker/nodejs/express4-typescript.Dockerfile -t test .
# docker run -ti -p 7777:7777 test
15 changes: 15 additions & 0 deletions utils/build/docker/nodejs/express4-typescript.base.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:18-alpine

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 node --version && npm --version && bun --version && curl --version

WORKDIR /usr/app

COPY utils/build/docker/nodejs/express4-typescript/package.json utils/build/docker/nodejs/express4-typescript/bun.lock ./
RUN bun install --frozen-lockfile --network-concurrency 8 --linker=hoisted

# docker build --progress=plain -f utils/build/docker/nodejs/express4-typescript.base.Dockerfile -t datadog/system-tests:express4-typescript.base-v1 .
# docker push datadog/system-tests:express4-typescript.base-v1
Loading
Loading