mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-11-18 23:15:59 +00:00
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 <glegendre01@gmail.com>
This commit is contained in:
parent
efb94e0d3d
commit
85790a19a7
15
.github/workflows/build.yaml
vendored
15
.github/workflows/build.yaml
vendored
@ -175,6 +175,14 @@ jobs:
|
|||||||
registry: docker.io
|
registry: docker.io
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
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
|
# If pull request
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
- name: Extract metadata (tags, labels) for Docker
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
@ -204,6 +212,8 @@ jobs:
|
|||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
id: build-and-push
|
id: build-and-push
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
|
env:
|
||||||
|
DOCKER_BUILD_SUMMARY: false
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ${{ env.DOCKERFILE }}
|
file: ${{ env.DOCKERFILE }}
|
||||||
@ -215,13 +225,14 @@ jobs:
|
|||||||
PLATFORM=${{ env.PLATFORM }}
|
PLATFORM=${{ env.PLATFORM }}
|
||||||
build_type=${{ env.BUILD_TYPE }}
|
build_type=${{ env.BUILD_TYPE }}
|
||||||
sccache_gha_enabled=on
|
sccache_gha_enabled=on
|
||||||
|
secrets: |
|
||||||
actions_results_url=${{ env.ACTIONS_RESULTS_URL }}
|
actions_results_url=${{ env.ACTIONS_RESULTS_URL }}
|
||||||
actions_runtime_token=${{ env.ACTIONS_RUNTIME_TOKEN }}
|
actions_runtime_token=${{ env.ACTIONS_RUNTIME_TOKEN }}
|
||||||
target: ${{ env.TARGET }}
|
target: ${{ env.TARGET }}
|
||||||
tags: ${{ steps.meta.outputs.tags || steps.meta-pr.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags || steps.meta-pr.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels || steps.meta-pr.outputs.labels }}
|
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-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=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-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
|
- name: Final
|
||||||
id: final
|
id: final
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@ -65,8 +65,6 @@ WORKDIR /usr/src/text-generation-inference
|
|||||||
ARG cuda_arch_list
|
ARG cuda_arch_list
|
||||||
ARG build_type
|
ARG build_type
|
||||||
ARG sccache_gha_enabled
|
ARG sccache_gha_enabled
|
||||||
ARG actions_results_url
|
|
||||||
ARG actions_runtime_token
|
|
||||||
|
|
||||||
# Install Rust
|
# Install Rust
|
||||||
ENV PATH="/root/.cargo/bin:$PATH"
|
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...
|
# SCCACHE Specifics args - before finding a better, more generic, way...
|
||||||
ENV SCCACHE_GHA_ENABLED=${sccache_gha_enabled}
|
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.lock Cargo.lock
|
||||||
COPY Cargo.toml Cargo.toml
|
COPY Cargo.toml Cargo.toml
|
||||||
@ -99,8 +95,8 @@ COPY --from=mpi-builder /usr/local/mpi /usr/local/mpi
|
|||||||
|
|
||||||
ENV RUSTC_WRAPPER=sccache
|
ENV RUSTC_WRAPPER=sccache
|
||||||
ENV CMAKE_INSTALL_PREFIX=$TGI_INSTALL_PREFIX
|
ENV CMAKE_INSTALL_PREFIX=$TGI_INSTALL_PREFIX
|
||||||
RUN export CC=gcc-14 \
|
RUN --mount=type=secret,id=actions_results_url,env=ACTIONS_RESULTS_URL \
|
||||||
export CXX=g++-14 \
|
--mount=type=secret,id=actions_runtime_token,env=ACTIONS_RUNTIME_TOKEN \
|
||||||
export CMAKE_C_COMPILER_LAUNCHER=sccache && \
|
export CMAKE_C_COMPILER_LAUNCHER=sccache && \
|
||||||
export CMAKE_CXX_COMPILER_LAUNCHER=sccache && \
|
export CMAKE_CXX_COMPILER_LAUNCHER=sccache && \
|
||||||
export CMAKE_CUDA_COMPILER_LAUNCHER=sccache && \
|
export CMAKE_CUDA_COMPILER_LAUNCHER=sccache && \
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user