Skip to content

Commit 005a3fb

Browse files
feat: Use mirror to fix rate limit issue (#497)
* feat: Use mirror to fix rate limit issue * WIP: Use registry for build images * feat: Use mirror for buidl and units * feat: Pass major arg to build, as we're using those images now * feat: Strip minor version in test builds instead of ci to avoid renaming the zip * Update scripts/run_tests.sh Co-authored-by: Rey Abolofia <[email protected]> * Update scripts/build_layers.sh Co-authored-by: Rey Abolofia <[email protected]> --------- Co-authored-by: Rey Abolofia <[email protected]>
1 parent e09855b commit 005a3fb

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

Dockerfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ ARG image
22
FROM $image as builder
33
ARG image
44

5-
# Install git so we can specify a specific git ref (ie: refs/head/my-feature) in package.json
6-
# to install a specific dd-trace version for performance test
7-
RUN apk add git python3 make g++
8-
95
# Create the directory structure required for AWS Lambda Layer
106
RUN mkdir -p /nodejs/node_modules/
117

scripts/build_layers.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ function docker_build_zip {
3333
# Args: [node version] [zip destination]
3434

3535
destination=$(make_path_absolute $2)
36-
36+
node_image_version=$(echo $1 | cut -d '.' -f 1)
3737
# Install datadog node in a docker container to avoid the mess from switching
3838
# between different node runtimes.
3939
temp_dir=$(mktemp -d)
4040
docker buildx build -t datadog-lambda-layer-node:$1 . --no-cache \
41-
--build-arg image=node:$1-alpine --progress=plain -o $temp_dir/nodejs
41+
--build-arg image=registry.ddbuild.io/images/mirror/node:${node_image_version}-bullseye --progress=plain -o $temp_dir/nodejs
4242

4343
# Zip to destination, and keep directory structure as based in $temp_dir
4444
(cd $temp_dir && zip -q -r $destination ./)

scripts/run_tests.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@
66
# Copyright 2019 Datadog, Inc.
77

88
# Run unit tests in Docker
9+
# For local use only
910
set -e
1011

1112
NODE_VERSIONS=("16.14" "18.12" "20.9")
1213

1314
for node_version in "${NODE_VERSIONS[@]}"
1415
do
16+
node_major_version=$(echo $node_version | cut -d '.' -f 1)
1517
echo "Running tests against node${node_version}"
1618
docker build -t datadog-lambda-layer-node-test:$node_version \
1719
-f scripts/Dockerfile_test . \
1820
--quiet \
19-
--build-arg image=node:$node_version-alpine
21+
--build-arg image=registry.ddbuild.io/images/mirror/node:${node_major_version}-bullseye
2022
docker run --rm -v `pwd`:/datadog-lambda-layer-node \
2123
-w /datadog-lambda-layer-node \
2224
datadog-lambda-layer-node-test:$node_version \

0 commit comments

Comments
 (0)