diff --git a/CONTAINER_SOURCE.md b/CONTAINER_SOURCE.md new file mode 100644 index 00000000000..51ae4ac1060 --- /dev/null +++ b/CONTAINER_SOURCE.md @@ -0,0 +1,8 @@ +# Container Source Notices + +A `NOTICES.txt` file containing a link to the open source archive for a given container can be found at `/` in both the `release` and `devel` images. + +Generally, source archives for each image and its tags can be found at the below links: + +* [TensorRT-LLM Release](https://opensource.nvidia.com/oss/teams/nvidia/release/index.html) +* [TensorRT-LLM Develop](https://opensource.nvidia.com/oss/teams/nvidia/devel/index.html) diff --git a/docker/Dockerfile.multi b/docker/Dockerfile.multi index 32d5af85ced..3d5aee7268b 100644 --- a/docker/Dockerfile.multi +++ b/docker/Dockerfile.multi @@ -80,6 +80,13 @@ RUN GITHUB_MIRROR=${GITHUB_MIRROR} bash ./install_ucx.sh && \ rm install_nixl.sh && \ rm install_etcd.sh +# Generate OSS attribution file for devel image +ARG TRT_LLM_VER +ARG TARGETARCH +COPY scripts/generate_container_oss_attribution.sh /tmp/generate_container_oss_attribution.sh +RUN bash /tmp/generate_container_oss_attribution.sh "devel" "${TRT_LLM_VER}" "${TARGETARCH}" && \ + rm /tmp/generate_container_oss_attribution.sh + FROM ${TRITON_IMAGE}:${TRITON_BASE_TAG} AS triton FROM devel AS tritondevel @@ -167,9 +174,14 @@ RUN chmod -R a+w examples && \ ARG GIT_COMMIT ARG TRT_LLM_VER +ARG TARGETARCH ENV TRT_LLM_GIT_COMMIT=${GIT_COMMIT} \ TRT_LLM_VERSION=${TRT_LLM_VER} +# Generate OSS attribution file for release image +COPY scripts/generate_container_oss_attribution.sh /tmp/generate_container_oss_attribution.sh +RUN bash /tmp/generate_container_oss_attribution.sh "release" "${TRT_LLM_VER}" "${TARGETARCH}" && rm /tmp/generate_container_oss_attribution.sh + FROM wheel AS tritonbuild WORKDIR /src/tensorrt_llm diff --git a/docker/common/install_ucx.sh b/docker/common/install_ucx.sh index 2807182bd8e..55da81e2c2c 100644 --- a/docker/common/install_ucx.sh +++ b/docker/common/install_ucx.sh @@ -6,8 +6,11 @@ UCX_INSTALL_PATH="/usr/local/ucx/" CUDA_PATH="/usr/local/cuda" UCX_REPO="https://github.com/openucx/ucx.git" +mkdir -p /third-party-source + rm -rf ${UCX_INSTALL_PATH} git clone --depth 1 -b ${UCX_VERSION} ${UCX_REPO} +tar -czf /third-party-source/ucx-${UCX_VERSION}.tar.gz ucx cd ucx ./autogen.sh ./contrib/configure-release \ diff --git a/scripts/generate_container_oss_attribution.sh b/scripts/generate_container_oss_attribution.sh new file mode 100755 index 00000000000..f81a5127e2e --- /dev/null +++ b/scripts/generate_container_oss_attribution.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +set -e + +# Generate open source attribution file with parameterized URL +# Usage: ./generate_container_oss_attribution.sh [output_file] + +show_usage() { + local error_msg="${1}" + + if [ -n "${error_msg}" ]; then + echo "ERROR: ${error_msg}" + echo "" + fi + + echo "Usage: $0 [output_file]" + echo "" + echo "Arguments:" + echo " image_name - Name of the image (e.g., tensorrt-llm)" + echo " tag - Image tag/version (e.g., 1.0.0)" + echo " arch - Architecture (e.g., amd64, arm64)" + echo " output_file - Optional output file path (default: /third-party-source/NOTICE.txt)" + echo "" + echo "Example:" + echo " $0 tensorrt-llm 1.0.0 amd64" + echo "" + exit 1 +} + +IMAGE_NAME="${1}" +TAG="${2}" +ARCH="${3}" +OUTPUT_FILE="/NOTICE.txt" + +# Validate required parameters +[ -z "${IMAGE_NAME}" ] && show_usage "Missing required parameter IMAGE_NAME" +[ -z "${TAG}" ] && show_usage "Missing required parameter TAG" +[ -z "${ARCH}" ] && show_usage "Missing required parameter ARCH" + +# Construct the URL +ROOT_URL="https://opensource.nvidia.com/oss/teams/nvidia" +OSS_URL="${ROOT_URL}/${IMAGE_NAME}/${TAG}:linux-${ARCH}/index.html" + +# Create output directory if needed +OUTPUT_DIR="$(dirname "${OUTPUT_FILE}")" +mkdir -p "${OUTPUT_DIR}" + +# Generate the attribution file +cat > "${OUTPUT_FILE}" << EOF +This container image includes open-source software whose source code is archived in the /third-party-source directory or at ${OSS_URL}. + +For further inquiries or assistance, contact us at oss-requests@nvidia.com +EOF + +echo "✓ Attribution file generated: ${OUTPUT_FILE}" +echo " URL: ${OSS_URL}"