mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 04:14:52 +00:00
misc(ci): give everything aws needs
This commit is contained in:
parent
7c9ee5655f
commit
d0b8e2eb25
23
.github/workflows/build.yaml
vendored
23
.github/workflows/build.yaml
vendored
@ -79,7 +79,6 @@ jobs:
|
||||
export sccache_s3_key_prefix="trtllm"
|
||||
export sccache_region="us-east-1"
|
||||
export build_type="dev"
|
||||
export is_gha_build="TRUE"
|
||||
;;
|
||||
rocm)
|
||||
export dockerfile="Dockerfile_amd"
|
||||
@ -132,7 +131,6 @@ jobs:
|
||||
echo "SCCACHE_S3_KEY_PREFIX=${sccache_s3_key_prefix}" >> $GITHUB_ENV
|
||||
echo "SCCACHE_REGION=${sccache_region}" >> $GITHUB_ENV
|
||||
echo "BUILD_TYPE=${build_type}" >> $GITHUB_ENV
|
||||
echo "IS_GHA_BUILD=${is_gha_build}" >> $GITHUB_ENV
|
||||
- name: Initialize Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
@ -198,7 +196,7 @@ jobs:
|
||||
DOCKER_LABEL=sha-${{ env.GITHUB_SHA_SHORT }}${{ env.LABEL }}
|
||||
PLATFORM=${{ env.PLATFORM }}
|
||||
build_type=${{ env.BUILD_TYPE }}
|
||||
is_gha_build=${{ env.IS_GHA_BUILD }}
|
||||
is_gha_build=true
|
||||
aws_access_key_id=${{ steps.aws-creds.outputs.aws-access-key-id }}
|
||||
aws_secret_access_key=${{ steps.aws-creds.outputs.aws-secret-access-key }}
|
||||
aws_session_token=${{ steps.aws-creds.outputs.aws-session-token }}
|
||||
@ -250,3 +248,22 @@ jobs:
|
||||
echo $DOCKER_IMAGE
|
||||
docker pull $DOCKER_IMAGE
|
||||
pytest -s -vv integration-tests ${PYTEST_FLAGS} ${EXTRA_PYTEST}
|
||||
|
||||
backend_trtllm_cxx_tests:
|
||||
needs: build-and-push
|
||||
if: needs.build-and-push.outputs.label == '-trtllm'
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.job }}-trtllm-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
runs-on:
|
||||
group: aws-g6-12xl-plus-priv-cache
|
||||
container:
|
||||
image: ${{ needs.build-and-push.outputs.docker_image }}
|
||||
credentials:
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
options: --gpus all --shm-size=8g
|
||||
|
||||
steps:
|
||||
- name: Run C++/CUDA tests
|
||||
run: /usr/local/tgi/bin/tgi_trtllm_backend_tests
|
||||
|
145
.github/workflows/build_trtllm.yaml
vendored
145
.github/workflows/build_trtllm.yaml
vendored
@ -1,145 +0,0 @@
|
||||
name: Build TensorRT-LLM
|
||||
on:
|
||||
workflow_call:
|
||||
outputs:
|
||||
docker_image:
|
||||
description: "Reference to the Docker Image build by this workflow"
|
||||
value: ${{ jobs.build-and-push.outputs.docker_image }}
|
||||
label:
|
||||
description: "Label generated for this build"
|
||||
value: ${{ jobs.build-and-push.outputs.label }}
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
permissions:
|
||||
contents: read # Required to check out repository.
|
||||
id-token: write # Required to authenticate via OIDC.
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.job }}-build-and-push-${{ github.head_ref || github.run_id }}
|
||||
outputs:
|
||||
docker_image: ${{ steps.final.outputs.docker_image }}
|
||||
label: ${{ steps.final.outputs.label }}
|
||||
runs-on:
|
||||
group: ${{ inputs.runs-on }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: Inject slug/short variables
|
||||
uses: rlespinasse/github-slug-action@v4.4.1
|
||||
|
||||
- name: Extract TensorRT-LLM version
|
||||
run: |
|
||||
echo "TENSORRT_LLM_VERSION=$(grep -oP '([a-z,0-9]{40})' $GITHUB_WORKSPACE/backends/trtllm/cmake/trtllm.cmake)" >> $GITHUB_ENV
|
||||
echo "TensorRT-LLM version: ${{ env.TENSORRT_LLM_VERSION }}"
|
||||
|
||||
- name: Set LABEL
|
||||
run: |
|
||||
echo "LABEL=trtllm" >> $GITHUB_ENV
|
||||
|
||||
- name: "Configure AWS Credentials"
|
||||
id: aws-creds
|
||||
uses: aws-actions/configure-aws-credentials@v4
|
||||
with:
|
||||
aws-region: us-east-1
|
||||
role-to-assume: ${{ secrets.AWS_ROLE_GITHUB_TGI_TEST }}
|
||||
role-duration-seconds: 7200
|
||||
output-credentials: true
|
||||
|
||||
- name: Initialize Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
install: true
|
||||
buildkitd-config: /tmp/buildkitd.toml
|
||||
|
||||
- name: Login to internal Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
registry: registry.internal.huggingface.tech
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# If pull request
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
id: meta-pr
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
registry.internal.huggingface.tech/api-inference/community/text-generation-inference/tensorrt-llm
|
||||
tags: |
|
||||
type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }}-${{ env.LABEL }}
|
||||
|
||||
# If main, release or tag
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
flavor: |
|
||||
latest=auto
|
||||
images: |
|
||||
registry.internal.huggingface.tech/api-inference/community/text-generation-inference/tensorrt-llm
|
||||
# ghcr.io/huggingface/text-generation-inference
|
||||
tags: |
|
||||
type=semver,pattern={{version}}${{ env.LABEL }}
|
||||
type=semver,pattern={{major}}.{{minor}}${{ env.LABEL }}
|
||||
type=raw,value=latest${{ env.LABEL }},enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
|
||||
type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }}-${{ env.LABEL }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
id: build-and-push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile_trtllm
|
||||
target: ci-runtime
|
||||
push: true
|
||||
load: true
|
||||
tags: ${{ steps.meta.outputs.tags || steps.meta-pr.outputs.tags }}
|
||||
platforms: 'linux/amd64'
|
||||
build-args: |
|
||||
build_type=dev
|
||||
is_gha_build=TRUE
|
||||
aws_access_key_id=${{ steps.aws-creds.outputs.aws-access-key-id }}
|
||||
aws_secret_access_key=${{ steps.aws-creds.outputs.aws-secret-access-key }}
|
||||
aws_session_token=${{ steps.aws-creds.outputs.aws-session-token }}
|
||||
sccache_bucket=${{ secrets.AWS_S3_BUCKET_GITHUB_TGI_TEST }}
|
||||
sccache_s3_key_prefix=trtllm-${{ env.TENSORRT_LLM_VERSION }}
|
||||
sccache_region=us-east-1
|
||||
cache-from: type=s3,region=us-east-1,bucket=ci-docker-buildx-cache,name=text-generation-inference-cache-${{ env.LABEL }},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=ci-docker-buildx-cache,name=text-generation-inference-cache-${{ env.LABEL }},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
|
||||
- name: Final
|
||||
id: final
|
||||
run: |
|
||||
echo "docker_image=registry.internal.huggingface.tech/api-inference/community/text-generation-inference/tensorrt-llm:sha-${{ env.GITHUB_SHA_SHORT }}-${{ env.LABEL }}" >> "$GITHUB_OUTPUT"
|
||||
echo "label=${{ env.LABEL }}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
run-tests:
|
||||
needs: build-and-push
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.job }}-trtllm-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
runs-on:
|
||||
group: aws-g6-12xl-plus-priv-cache
|
||||
container:
|
||||
image: ${{ needs.build-and-push.outputs.docker_image }}
|
||||
credentials:
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
options: --gpus all --shm-size=8g
|
||||
|
||||
steps:
|
||||
- name: Run C++/CUDA tests
|
||||
run: /usr/local/tgi/bin/tgi_trtllm_backend_tests
|
||||
|
Loading…
Reference in New Issue
Block a user