From 85790a19a7fa9917733a9a4536e50057f8d513d8 Mon Sep 17 00:00:00 2001 From: Funtowicz Morgan Date: Mon, 17 Nov 2025 10:50:10 +0100 Subject: [PATCH] misc(gha): expose action cache url and runtime as secrets (#2964) * misc(gha): expose action cache url and runtime as secrets * (CI): Move S3 Auth to OIDC * Fix Typo * change bucket name * fix aws auth creds * misc(gha): fix invalid syntax for secrets * WIP: Add AWS session token * Increase session time * Remove actions_cache_url mount from Dockerfile Removed an unused mount for actions_cache_url in the Dockerfile. * WIP --------- Co-authored-by: Guillaume LEGENDRE --- .github/workflows/build.yaml | 15 +++++++++++++-- Dockerfile_trtllm | 8 ++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5b292890f..b6b00dc29 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -175,6 +175,14 @@ jobs: registry: docker.io username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: configure aws credentials + id: aws-creds + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 + with: + role-to-assume: ${{ secrets.AWS_ROLE_GITHUB_BUILDX_CACHE }} + role-duration-seconds: 18000 + aws-region: us-east-1 + output-credentials: true # If pull request - name: Extract metadata (tags, labels) for Docker if: ${{ github.event_name == 'pull_request' }} @@ -204,6 +212,8 @@ jobs: - name: Build and push Docker image id: build-and-push uses: docker/build-push-action@v4 + env: + DOCKER_BUILD_SUMMARY: false with: context: . file: ${{ env.DOCKERFILE }} @@ -215,13 +225,14 @@ jobs: PLATFORM=${{ env.PLATFORM }} build_type=${{ env.BUILD_TYPE }} sccache_gha_enabled=on + secrets: | actions_results_url=${{ env.ACTIONS_RESULTS_URL }} actions_runtime_token=${{ env.ACTIONS_RUNTIME_TOKEN }} target: ${{ env.TARGET }} tags: ${{ steps.meta.outputs.tags || steps.meta-pr.outputs.tags }} labels: ${{ steps.meta.outputs.labels || steps.meta-pr.outputs.labels }} - cache-from: type=s3,region=us-east-1,bucket=ci-docker-buildx-cache,name=text-generation-inference-cache${{ env.LABEL_EXTENSION }},mode=max,access_key_id=${{ secrets.S3_CI_DOCKER_BUILDX_CACHE_ACCESS_KEY_ID }},secret_access_key=${{ secrets.S3_CI_DOCKER_BUILDX_CACHE_SECRET_ACCESS_KEY }},mode=min - cache-to: type=s3,region=us-east-1,bucket=ci-docker-buildx-cache,name=text-generation-inference-cache${{ env.LABEL_EXTENSION }},mode=min,access_key_id=${{ secrets.S3_CI_DOCKER_BUILDX_CACHE_ACCESS_KEY_ID }},secret_access_key=${{ secrets.S3_CI_DOCKER_BUILDX_CACHE_SECRET_ACCESS_KEY }},mode=min + cache-from: type=s3,region=us-east-1,bucket=${{ vars.AWS_S3BUCKET_GITHUB_BUILDX_CACHE }},name=text-generation-inference-cache${{ env.LABEL }},mode=min,access_key_id=${{ steps.aws-creds.outputs.aws-access-key-id }},secret_access_key=${{ steps.aws-creds.outputs.aws-secret-access-key }},session_token=${{ steps.aws-creds.outputs.aws-session-token }},mode=max + cache-to: type=s3,region=us-east-1,bucket=${{ vars.AWS_S3BUCKET_GITHUB_BUILDX_CACHE }},name=text-generation-inference-cache${{ env.LABEL }},mode=min,access_key_id=${{ steps.aws-creds.outputs.aws-access-key-id }},secret_access_key=${{ steps.aws-creds.outputs.aws-secret-access-key }},session_token=${{ steps.aws-creds.outputs.aws-session-token }},mode=max - name: Final id: final run: | diff --git a/Dockerfile_trtllm b/Dockerfile_trtllm index c0cf90335..81f9512dc 100644 --- a/Dockerfile_trtllm +++ b/Dockerfile_trtllm @@ -65,8 +65,6 @@ WORKDIR /usr/src/text-generation-inference ARG cuda_arch_list ARG build_type ARG sccache_gha_enabled -ARG actions_results_url -ARG actions_runtime_token # Install Rust ENV PATH="/root/.cargo/bin:$PATH" @@ -84,8 +82,6 @@ ENV CUDA_ARCH_LIST=${cuda_arch_list} # SCCACHE Specifics args - before finding a better, more generic, way... ENV SCCACHE_GHA_ENABLED=${sccache_gha_enabled} -ENV ACTIONS_RESULTS_URL=${actions_results_url} -ENV ACTIONS_RUNTIME_TOKEN=${actions_runtime_token} COPY Cargo.lock Cargo.lock COPY Cargo.toml Cargo.toml @@ -99,8 +95,8 @@ COPY --from=mpi-builder /usr/local/mpi /usr/local/mpi ENV RUSTC_WRAPPER=sccache ENV CMAKE_INSTALL_PREFIX=$TGI_INSTALL_PREFIX -RUN export CC=gcc-14 \ - export CXX=g++-14 \ +RUN --mount=type=secret,id=actions_results_url,env=ACTIONS_RESULTS_URL \ + --mount=type=secret,id=actions_runtime_token,env=ACTIONS_RUNTIME_TOKEN \ export CMAKE_C_COMPILER_LAUNCHER=sccache && \ export CMAKE_CXX_COMPILER_LAUNCHER=sccache && \ export CMAKE_CUDA_COMPILER_LAUNCHER=sccache && \