From e879b2d2c16353d106fb205a9a0a98d12504bb28 Mon Sep 17 00:00:00 2001 From: Ping Xiang <64551395+pxaws@users.noreply.github.com> Date: Tue, 8 Oct 2024 15:38:48 -0700 Subject: [PATCH 1/2] use public ecr images (#94) *Issue #, if available:* *Description of changes:* Replace the docker hub images with public ECR images. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --- Dockerfile | 4 ++-- contract-tests/images/applications/aws-sdk/Dockerfile | 3 +-- contract-tests/images/applications/http/Dockerfile | 3 +-- contract-tests/images/applications/mongodb/Dockerfile | 2 +- contract-tests/images/applications/mongoose/Dockerfile | 2 +- contract-tests/images/applications/mysql2/Dockerfile | 2 +- 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index df41146..33e0b8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Stage 1: Install ADOT nodejs instrumentation in the /operator-build folder -FROM node:20 AS build +FROM public.ecr.aws/docker/library/node:20 AS build # Build the ADOT JS SDK Tarball: aws-aws-distro-opentelemetry-node-autoinstrumentation-x.y.z.tgz WORKDIR /adot-js-build @@ -18,7 +18,7 @@ RUN npm install aws-aws-distro-opentelemetry-node-autoinstrumentation-$(node -p RUN npm install # Stage 2: Build the cp-utility binary -FROM rust:1.75 as builder +FROM public.ecr.aws/docker/library/rust:1.75 as builder WORKDIR /usr/src/cp-utility COPY ./tools/cp-utility . diff --git a/contract-tests/images/applications/aws-sdk/Dockerfile b/contract-tests/images/applications/aws-sdk/Dockerfile index c4f3c62..1867b3c 100644 --- a/contract-tests/images/applications/aws-sdk/Dockerfile +++ b/contract-tests/images/applications/aws-sdk/Dockerfile @@ -1,6 +1,5 @@ # Use an official Node.js runtime as the base image -FROM node:20-alpine -#FROM node:20 +FROM public.ecr.aws/docker/library/node:20-alpine # Set the working directory inside the container WORKDIR /aws-sdk diff --git a/contract-tests/images/applications/http/Dockerfile b/contract-tests/images/applications/http/Dockerfile index 70a52de..9dad7e0 100644 --- a/contract-tests/images/applications/http/Dockerfile +++ b/contract-tests/images/applications/http/Dockerfile @@ -1,6 +1,5 @@ # Use an official Node.js runtime as the base image -FROM node:20-alpine -#FROM node:20 +FROM public.ecr.aws/docker/library/node:20-alpine # Set the working directory inside the container WORKDIR /http diff --git a/contract-tests/images/applications/mongodb/Dockerfile b/contract-tests/images/applications/mongodb/Dockerfile index 968c825..a1d192a 100644 --- a/contract-tests/images/applications/mongodb/Dockerfile +++ b/contract-tests/images/applications/mongodb/Dockerfile @@ -1,5 +1,5 @@ # Use an official Node.js runtime as the base image -FROM node:20-alpine +FROM public.ecr.aws/docker/library/node:20-alpine # Set the working directory inside the container WORKDIR /mongodb diff --git a/contract-tests/images/applications/mongoose/Dockerfile b/contract-tests/images/applications/mongoose/Dockerfile index ee6a8a7..e8fd855 100644 --- a/contract-tests/images/applications/mongoose/Dockerfile +++ b/contract-tests/images/applications/mongoose/Dockerfile @@ -1,5 +1,5 @@ # Use an official Node.js runtime as the base image -FROM node:20-alpine +FROM public.ecr.aws/docker/library/node:20-alpine #FROM node:20 # Set the working directory inside the container diff --git a/contract-tests/images/applications/mysql2/Dockerfile b/contract-tests/images/applications/mysql2/Dockerfile index 2e6ff46..f24939a 100644 --- a/contract-tests/images/applications/mysql2/Dockerfile +++ b/contract-tests/images/applications/mysql2/Dockerfile @@ -1,5 +1,5 @@ # Use an official Node.js runtime as the base image -FROM node:20-alpine +FROM public.ecr.aws/docker/library/node:20-alpine # Set the working directory inside the container WORKDIR /mysql2 From 445031ba687321f632f26f3e44faedb8c6096fe6 Mon Sep 17 00:00:00 2001 From: Ping Xiang <64551395+pxaws@users.noreply.github.com> Date: Tue, 8 Oct 2024 15:51:06 -0700 Subject: [PATCH 2/2] use public ecr images (#95) *Issue #, if available:* *Description of changes:* Replace the docker hub images with public ECR images. This commit also fix a lint error. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. *Issue #, if available:* *Description of changes:* By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --- .../src/aws-opentelemetry-configurator.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aws-distro-opentelemetry-node-autoinstrumentation/src/aws-opentelemetry-configurator.ts b/aws-distro-opentelemetry-node-autoinstrumentation/src/aws-opentelemetry-configurator.ts index 654a85a..906ead5 100644 --- a/aws-distro-opentelemetry-node-autoinstrumentation/src/aws-opentelemetry-configurator.ts +++ b/aws-distro-opentelemetry-node-autoinstrumentation/src/aws-opentelemetry-configurator.ts @@ -257,7 +257,10 @@ export class AwsOpentelemetryConfigurator { // Register BatchUnsampledSpanProcessor to export unsampled traces in Lambda // when Application Signals enabled if (isLambdaEnvironment() && !hasCustomOtlpTraceEndpoint()) { - const udpSpanExporter = new OTLPUdpSpanExporter(getXrayDaemonEndpoint(), FORMAT_OTEL_UNSAMPLED_TRACES_BINARY_PREFIX); + const udpSpanExporter = new OTLPUdpSpanExporter( + getXrayDaemonEndpoint(), + FORMAT_OTEL_UNSAMPLED_TRACES_BINARY_PREFIX + ); const configuredExporter = AwsMetricAttributesSpanExporterBuilder.create(udpSpanExporter, resource).build(); spanProcessors.push( new AwsBatchUnsampledSpanProcessor(configuredExporter, {