From eb233367d4781fc1dc5e9b7766b11a6f59e996a1 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Thu, 23 Apr 2026 09:43:48 -0400 Subject: [PATCH 1/4] [dd-trace-py]: dump s3 artifact metadata if it is available --- utils/build/docker/python/install_ddtrace.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/build/docker/python/install_ddtrace.sh b/utils/build/docker/python/install_ddtrace.sh index 97e3994e323..c7fa67356ce 100755 --- a/utils/build/docker/python/install_ddtrace.sh +++ b/utils/build/docker/python/install_ddtrace.sh @@ -18,6 +18,9 @@ elif [ "$(ls *.whl | wc -l)" = "1" ]; then elif [ $(ls python-load-from-s3 | wc -l) = 1 ]; then GIT_REF=$(cat python-load-from-s3) echo "Install ddtrace from S3, git ref: ${GIT_REF}" + # Try to fetch `metadata.txt` to display, but don't fail if we cannot + # This includes commit sha, pipeline id, etc that was used to build the artifact + curl -s https://dd-trace-py-builds.s3.amazonaws.com/${GIT_REF}/metadata.txt || true # Install from S3 bucket # NOTE: Artifacts age out after 2 weeks, if this fails then you need to first run the dd-trace-py GitLab CI for the desired commit again # NOTE: Must have `--no-index` otherwise `pip` will look for the highest available version between S3 and PyPI From e1c6f26107d428da980d19691e7d5ebf2ee0c171 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Thu, 23 Apr 2026 10:15:10 -0400 Subject: [PATCH 2/4] [all] support dumping Library metadata from /binaries/metadata.txt --- utils/_context/containers.py | 4 ++++ utils/build/docker/python/install_ddtrace.sh | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/utils/_context/containers.py b/utils/_context/containers.py index 327e9cfd151..b1210a4d3b8 100644 --- a/utils/_context/containers.py +++ b/utils/_context/containers.py @@ -1114,6 +1114,10 @@ def post_start(self): logger.stdout(f"Library: {self.library}") + exit_code, output = self.exec_run("cat /binaries/metadata.txt") + if exit_code == 0 and output: + logger.stdout(f"Library metadata:\n{output.decode('utf-8', errors='replace').strip()}") + if self.appsec_rules_file: logger.stdout("Using a custom appsec rules file") diff --git a/utils/build/docker/python/install_ddtrace.sh b/utils/build/docker/python/install_ddtrace.sh index c7fa67356ce..acec68d4a41 100755 --- a/utils/build/docker/python/install_ddtrace.sh +++ b/utils/build/docker/python/install_ddtrace.sh @@ -18,9 +18,12 @@ elif [ "$(ls *.whl | wc -l)" = "1" ]; then elif [ $(ls python-load-from-s3 | wc -l) = 1 ]; then GIT_REF=$(cat python-load-from-s3) echo "Install ddtrace from S3, git ref: ${GIT_REF}" - # Try to fetch `metadata.txt` to display, but don't fail if we cannot + # Try to fetch `metadata.txt` and save it so test output can display it, but don't fail if we cannot # This includes commit sha, pipeline id, etc that was used to build the artifact - curl -s https://dd-trace-py-builds.s3.amazonaws.com/${GIT_REF}/metadata.txt || true + curl -s https://dd-trace-py-builds.s3.amazonaws.com/${GIT_REF}/metadata.txt > metadata.txt || true + if [ -s metadata.txt ]; then + cat metadata.txt + fi # Install from S3 bucket # NOTE: Artifacts age out after 2 weeks, if this fails then you need to first run the dd-trace-py GitLab CI for the desired commit again # NOTE: Must have `--no-index` otherwise `pip` will look for the highest available version between S3 and PyPI From 812284eacc87fbac68f9e48526b924f658cc7c77 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Thu, 23 Apr 2026 10:26:02 -0400 Subject: [PATCH 3/4] make sure we have a container --- utils/_context/containers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/utils/_context/containers.py b/utils/_context/containers.py index b1210a4d3b8..382d1915a2b 100644 --- a/utils/_context/containers.py +++ b/utils/_context/containers.py @@ -1114,9 +1114,10 @@ def post_start(self): logger.stdout(f"Library: {self.library}") - exit_code, output = self.exec_run("cat /binaries/metadata.txt") - if exit_code == 0 and output: - logger.stdout(f"Library metadata:\n{output.decode('utf-8', errors='replace').strip()}") + if self._container is not None: + exit_code, output = self.exec_run("cat /binaries/metadata.txt") + if exit_code == 0 and output: + logger.stdout(f"Library metadata:\n{output.decode('utf-8', errors='replace').strip()}") if self.appsec_rules_file: logger.stdout("Using a custom appsec rules file") From a7257917033778fbedb74095e4c42abd9d36d0f7 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Thu, 23 Apr 2026 11:58:14 -0400 Subject: [PATCH 4/4] use curl --fail --- utils/build/docker/python/install_ddtrace.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/build/docker/python/install_ddtrace.sh b/utils/build/docker/python/install_ddtrace.sh index acec68d4a41..f6e43feda70 100755 --- a/utils/build/docker/python/install_ddtrace.sh +++ b/utils/build/docker/python/install_ddtrace.sh @@ -20,7 +20,7 @@ elif [ $(ls python-load-from-s3 | wc -l) = 1 ]; then echo "Install ddtrace from S3, git ref: ${GIT_REF}" # Try to fetch `metadata.txt` and save it so test output can display it, but don't fail if we cannot # This includes commit sha, pipeline id, etc that was used to build the artifact - curl -s https://dd-trace-py-builds.s3.amazonaws.com/${GIT_REF}/metadata.txt > metadata.txt || true + curl -sf https://dd-trace-py-builds.s3.amazonaws.com/${GIT_REF}/metadata.txt > metadata.txt || true if [ -s metadata.txt ]; then cat metadata.txt fi