Skip to content

Commit 1ebefa3

Browse files
committed
Adding notices.txt for container source archive in built images
1 parent e36599e commit 1ebefa3

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

docker/Dockerfile.multi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ RUN GITHUB_MIRROR=${GITHUB_MIRROR} bash ./install_nixl.sh && rm install_nixl.sh
8787
# Install etcd
8888
RUN bash ./install_etcd.sh && rm install_etcd.sh
8989

90+
# Generate OSS attribution file for devel image
91+
ARG TRT_LLM_VER
92+
ARG TARGETARCH
93+
COPY scripts/generate_oss_attribution.sh /tmp/generate_oss_attribution.sh
94+
RUN bash /tmp/generate_oss_attribution.sh "devel" "${TRT_LLM_VER}" "${TARGETARCH}" && \
95+
rm /tmp/generate_oss_attribution.sh
96+
9097
FROM ${TRITON_IMAGE}:${TRITON_BASE_TAG} AS triton
9198

9299
FROM devel AS tritondevel
@@ -175,6 +182,11 @@ ARG TRT_LLM_VER
175182
ENV TRT_LLM_GIT_COMMIT=${GIT_COMMIT} \
176183
TRT_LLM_VERSION=${TRT_LLM_VER}
177184

185+
# Generate OSS attribution file for release image
186+
COPY scripts/generate_oss_attribution.sh /tmp/generate_oss_attribution.sh
187+
RUN bash /tmp/generate_oss_attribution.sh "release" "${TRT_LLM_VER}" "${TARGETARCH}" && \
188+
rm /tmp/generate_oss_attribution.sh \
189+
178190
FROM wheel AS tritonbuild
179191

180192
WORKDIR /src/tensorrt_llm
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Generate open source attribution file with parameterized URL
6+
# Usage: ./generate_oss_attribution.sh <image_name> <tag> <arch> [output_file]
7+
8+
show_usage() {
9+
local error_msg="${1}"
10+
11+
if [ -n "${error_msg}" ]; then
12+
echo "ERROR: ${error_msg}"
13+
echo ""
14+
fi
15+
16+
echo "Usage: $0 <image_name> <tag> <arch> [output_file]"
17+
echo ""
18+
echo "Arguments:"
19+
echo " image_name - Name of the image (e.g., tensorrt-llm)"
20+
echo " tag - Image tag/version (e.g., 1.0.0)"
21+
echo " arch - Architecture (e.g., amd64, arm64)"
22+
echo " output_file - Optional output file path (default: /third-party-source/NOTICE.txt)"
23+
echo ""
24+
echo "Example:"
25+
echo " $0 tensorrt-llm 1.0.0 amd64"
26+
echo ""
27+
exit 1
28+
}
29+
30+
IMAGE_NAME="${1}"
31+
TAG="${2}"
32+
ARCH="${3}"
33+
OUTPUT_FILE="/NOTICE.txt"
34+
35+
# Validate required parameters
36+
[ -z "${IMAGE_NAME}" ] && show_usage "Missing required parameter IMAGE_NAME"
37+
[ -z "${TAG}" ] && show_usage "Missing required parameter TAG"
38+
[ -z "${ARCH}" ] && show_usage "Missing required parameter ARCH"
39+
40+
# Construct the URL
41+
ROOT_URL="https://opensource.nvidia.com/oss/teams/nvidia"
42+
OSS_URL="${ROOT_URL}/${IMAGE_NAME}/${TAG}:linux-${ARCH}/index.html"
43+
44+
# Create output directory if needed
45+
OUTPUT_DIR="$(dirname "${OUTPUT_FILE}")"
46+
mkdir -p "${OUTPUT_DIR}"
47+
48+
# Generate the attribution file
49+
cat > "${OUTPUT_FILE}" << EOF
50+
This distribution includes open source which is archived at the following URL: ${OSS_URL}
51+
52+
For further inquiries or assistance, contact us at [email protected]
53+
EOF
54+
55+
echo "✓ Attribution file generated: ${OUTPUT_FILE}"
56+
echo " URL: ${OSS_URL}"
57+

0 commit comments

Comments
 (0)