mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 20:34:54 +00:00
Tmp
This commit is contained in:
parent
8dd2006cd8
commit
92189e821d
316
.github/workflows/build.yaml
vendored
316
.github/workflows/build.yaml
vendored
@ -18,160 +18,161 @@ on:
|
|||||||
type: boolean
|
type: boolean
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
# build-and-push:
|
||||||
outputs:
|
# outputs:
|
||||||
docker_image: ${{ steps.final.outputs.docker_image }}
|
# docker_image: ${{ steps.final.outputs.docker_image }}
|
||||||
docker_devices: ${{ steps.final.outputs.docker_devices }}
|
# docker_devices: ${{ steps.final.outputs.docker_devices }}
|
||||||
runs_on: ${{ steps.final.outputs.runs_on }}
|
# runs_on: ${{ steps.final.outputs.runs_on }}
|
||||||
label: ${{ steps.final.outputs.label }}
|
# label: ${{ steps.final.outputs.label }}
|
||||||
extra_pytest: ${{ steps.final.outputs.extra_pytest }}
|
# extra_pytest: ${{ steps.final.outputs.extra_pytest }}
|
||||||
concurrency:
|
# concurrency:
|
||||||
group: ${{ github.workflow }}-build-and-push-image-${{ inputs.hardware }}-${{ github.head_ref || github.run_id }}
|
# group: ${{ github.workflow }}-build-and-push-image-${{ inputs.hardware }}-${{ github.head_ref || github.run_id }}
|
||||||
cancel-in-progress: true
|
# cancel-in-progress: true
|
||||||
runs-on:
|
# runs-on:
|
||||||
group: aws-highmemory-32-plus-priv
|
# group: aws-highmemory-32-plus-priv
|
||||||
permissions:
|
# permissions:
|
||||||
contents: write
|
# contents: write
|
||||||
packages: write
|
# packages: write
|
||||||
steps:
|
# steps:
|
||||||
- name: Checkout repository
|
# - name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
# uses: actions/checkout@v4
|
||||||
- name: Inject slug/short variables
|
# - name: Inject slug/short variables
|
||||||
uses: rlespinasse/github-slug-action@v4.4.1
|
# uses: rlespinasse/github-slug-action@v4.4.1
|
||||||
- name: Construct harware variables
|
# - name: Construct harware variables
|
||||||
shell: bash
|
# shell: bash
|
||||||
run: |
|
# run: |
|
||||||
case ${{ inputs.hardware }} in
|
# case ${{ inputs.hardware }} in
|
||||||
cuda)
|
# cuda)
|
||||||
export dockerfile="Dockerfile"
|
# export dockerfile="Dockerfile"
|
||||||
export label_extension=""
|
# export label_extension=""
|
||||||
export docker_devices=""
|
# export docker_devices=""
|
||||||
export runs_on="aws-g6-12xl-plus-priv-cache"
|
# export runs_on="aws-g6-12xl-plus-priv-cache"
|
||||||
export platform=""
|
# export platform=""
|
||||||
export extra_pytest=""
|
# export extra_pytest=""
|
||||||
;;
|
# ;;
|
||||||
rocm)
|
# rocm)
|
||||||
export dockerfile="Dockerfile_amd"
|
# export dockerfile="Dockerfile_amd"
|
||||||
export label_extension="-rocm"
|
# export label_extension="-rocm"
|
||||||
export docker_devices="/dev/kfd,/dev/dri"
|
# export docker_devices="/dev/kfd,/dev/dri"
|
||||||
export runs_on="amd-gpu-runners"
|
# export runs_on="amd-gpu-runners"
|
||||||
export platform=""
|
# export platform=""
|
||||||
export extra_pytest="-k flash_llama_grammar_tools"
|
# export extra_pytest="-k flash_llama_grammar_tools"
|
||||||
;;
|
# ;;
|
||||||
intel-xpu)
|
# intel-xpu)
|
||||||
export dockerfile="Dockerfile_intel"
|
# export dockerfile="Dockerfile_intel"
|
||||||
export label_extension="-intel-xpu"
|
# export label_extension="-intel-xpu"
|
||||||
export docker_devices=""
|
# export docker_devices=""
|
||||||
export runs_on="ubuntu-latest"
|
# export runs_on="ubuntu-latest"
|
||||||
export platform="xpu"
|
# export platform="xpu"
|
||||||
export extra_pytest=""
|
# export extra_pytest=""
|
||||||
;;
|
# ;;
|
||||||
intel-cpu)
|
# intel-cpu)
|
||||||
export dockerfile="Dockerfile_intel"
|
# export dockerfile="Dockerfile_intel"
|
||||||
export label_extension="-intel-cpu"
|
# export label_extension="-intel-cpu"
|
||||||
export docker_devices=""
|
# export docker_devices=""
|
||||||
export runs_on="ubuntu-latest"
|
# export runs_on="ubuntu-latest"
|
||||||
export platform="cpu"
|
# export platform="cpu"
|
||||||
export extra_pytest=""
|
# export extra_pytest=""
|
||||||
;;
|
# ;;
|
||||||
esac
|
# esac
|
||||||
echo $dockerfile
|
# echo $dockerfile
|
||||||
echo "Dockerfile=${dockerfile}"
|
# echo "Dockerfile=${dockerfile}"
|
||||||
echo $label_extension
|
# echo $label_extension
|
||||||
echo $docker_devices
|
# echo $docker_devices
|
||||||
echo $runs_on
|
# echo $runs_on
|
||||||
echo $platform
|
# echo $platform
|
||||||
echo "DOCKERFILE=${dockerfile}" >> $GITHUB_ENV
|
# echo "DOCKERFILE=${dockerfile}" >> $GITHUB_ENV
|
||||||
echo "LABEL=${label_extension}" >> $GITHUB_ENV
|
# echo "LABEL=${label_extension}" >> $GITHUB_ENV
|
||||||
echo "PLATFORM=${platform}" >> $GITHUB_ENV
|
# echo "PLATFORM=${platform}" >> $GITHUB_ENV
|
||||||
echo "DOCKER_DEVICES=${docker_devices}" >> $GITHUB_ENV
|
# echo "DOCKER_DEVICES=${docker_devices}" >> $GITHUB_ENV
|
||||||
echo "RUNS_ON=${runs_on}" >> $GITHUB_ENV
|
# echo "RUNS_ON=${runs_on}" >> $GITHUB_ENV
|
||||||
echo "EXTRA_PYTEST=${extra_pytest}" >> $GITHUB_ENV
|
# echo "EXTRA_PYTEST=${extra_pytest}" >> $GITHUB_ENV
|
||||||
echo REGISTRY_MIRROR=$REGISTRY_MIRROR >> $GITHUB_ENV
|
# echo REGISTRY_MIRROR=$REGISTRY_MIRROR >> $GITHUB_ENV
|
||||||
- name: Initialize Docker Buildx
|
# - name: Initialize Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
# uses: docker/setup-buildx-action@v3
|
||||||
with:
|
# with:
|
||||||
install: true
|
# install: true
|
||||||
buildkitd-config: /tmp/buildkitd.toml
|
# buildkitd-config: /tmp/buildkitd.toml
|
||||||
- name: Login to internal Container Registry
|
# - name: Login to internal Container Registry
|
||||||
uses: docker/login-action@v3
|
# uses: docker/login-action@v3
|
||||||
with:
|
# with:
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
# username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
# password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
registry: registry.internal.huggingface.tech
|
# registry: registry.internal.huggingface.tech
|
||||||
- name: Login to GitHub Container Registry
|
# - name: Login to GitHub Container Registry
|
||||||
if: github.event_name != 'pull_request'
|
# if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v3
|
# uses: docker/login-action@v3
|
||||||
with:
|
# with:
|
||||||
registry: ghcr.io
|
# registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
# username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
# password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Login to Azure Container Registry
|
# - name: Login to Azure Container Registry
|
||||||
if: github.event_name != 'pull_request'
|
# if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v3
|
# uses: docker/login-action@v3
|
||||||
with:
|
# with:
|
||||||
username: ${{ secrets.AZURE_DOCKER_USERNAME }}
|
# username: ${{ secrets.AZURE_DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.AZURE_DOCKER_PASSWORD }}
|
# password: ${{ secrets.AZURE_DOCKER_PASSWORD }}
|
||||||
registry: db4c2190dd824d1f950f5d1555fbadf0.azurecr.io
|
# registry: db4c2190dd824d1f950f5d1555fbadf0.azurecr.io
|
||||||
# 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' }}
|
||||||
id: meta-pr
|
# id: meta-pr
|
||||||
uses: docker/metadata-action@v5
|
# uses: docker/metadata-action@v5
|
||||||
with:
|
# with:
|
||||||
images: |
|
# images: |
|
||||||
registry.internal.huggingface.tech/api-inference/community/text-generation-inference
|
# registry.internal.huggingface.tech/api-inference/community/text-generation-inference
|
||||||
tags: |
|
# tags: |
|
||||||
type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }}${{ env.LABEL }}
|
# type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }}${{ env.LABEL }}
|
||||||
# If main, release or tag
|
# # If main, release or tag
|
||||||
- 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' }}
|
||||||
id: meta
|
# id: meta
|
||||||
uses: docker/metadata-action@v4.3.0
|
# uses: docker/metadata-action@v4.3.0
|
||||||
with:
|
# with:
|
||||||
flavor: |
|
# flavor: |
|
||||||
latest=auto
|
# latest=auto
|
||||||
images: |
|
# images: |
|
||||||
registry.internal.huggingface.tech/api-inference/community/text-generation-inference
|
# registry.internal.huggingface.tech/api-inference/community/text-generation-inference
|
||||||
ghcr.io/huggingface/text-generation-inference
|
# ghcr.io/huggingface/text-generation-inference
|
||||||
db4c2190dd824d1f950f5d1555fbadf0.azurecr.io/text-generation-inference
|
# db4c2190dd824d1f950f5d1555fbadf0.azurecr.io/text-generation-inference
|
||||||
tags: |
|
# tags: |
|
||||||
type=semver,pattern={{version}}${{ env.LABEL }}
|
# type=semver,pattern={{version}}${{ env.LABEL }}
|
||||||
type=semver,pattern={{major}}.{{minor}}${{ 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=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 }}
|
# type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }}${{ env.LABEL }}
|
||||||
- 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
|
||||||
with:
|
# with:
|
||||||
context: .
|
# context: .
|
||||||
file: ${{ env.DOCKERFILE }}
|
# file: ${{ env.DOCKERFILE }}
|
||||||
push: true
|
# push: true
|
||||||
platforms: 'linux/amd64'
|
# platforms: 'linux/amd64'
|
||||||
build-args: |
|
# build-args: |
|
||||||
GIT_SHA=${{ env.GITHUB_SHA }}
|
# GIT_SHA=${{ env.GITHUB_SHA }}
|
||||||
DOCKER_LABEL=sha-${{ env.GITHUB_SHA_SHORT }}${{ env.LABEL }}
|
# DOCKER_LABEL=sha-${{ env.GITHUB_SHA_SHORT }}${{ env.LABEL }}
|
||||||
PLATFORM=${{ env.PLATFORM }}
|
# PLATFORM=${{ env.PLATFORM }}
|
||||||
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 }},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=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
|
# 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
|
# - name: Final
|
||||||
id: final
|
# id: final
|
||||||
run: |
|
# run: |
|
||||||
echo "docker_image=registry.internal.huggingface.tech/api-inference/community/text-generation-inference:sha-${{ env.GITHUB_SHA_SHORT}}${{ env.LABEL }}" >> "$GITHUB_OUTPUT"
|
# echo "docker_image=registry.internal.huggingface.tech/api-inference/community/text-generation-inference:sha-${{ env.GITHUB_SHA_SHORT}}${{ env.LABEL }}" >> "$GITHUB_OUTPUT"
|
||||||
echo "docker_devices=${{ env.DOCKER_DEVICES }}" >> "$GITHUB_OUTPUT"
|
# echo "docker_devices=${{ env.DOCKER_DEVICES }}" >> "$GITHUB_OUTPUT"
|
||||||
echo "runs_on=${{ env.RUNS_ON }}" >> "$GITHUB_OUTPUT"
|
# echo "runs_on=${{ env.RUNS_ON }}" >> "$GITHUB_OUTPUT"
|
||||||
echo "label=${{ env.LABEL }}" >> "$GITHUB_OUTPUT"
|
# echo "label=${{ env.LABEL }}" >> "$GITHUB_OUTPUT"
|
||||||
echo "extra_pytest=${{ env.EXTRA_PYTEST }}" >> "$GITHUB_OUTPUT"
|
# echo "extra_pytest=${{ env.EXTRA_PYTEST }}" >> "$GITHUB_OUTPUT"
|
||||||
integration_tests:
|
integration_tests:
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.job }}-${{ needs.build-and-push.outputs.label }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.job }}-${{ needs.build-and-push.outputs.label }}-${{ github.head_ref || github.run_id }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
needs: build-and-push
|
# needs: build-and-push
|
||||||
runs-on:
|
runs-on:
|
||||||
group: ${{ needs.build-and-push.outputs.runs_on }}
|
# group: ${{ needs.build-and-push.outputs.runs_on }}
|
||||||
if: needs.build-and-push.outputs.runs_on != 'ubuntu-latest'
|
group: amd-gpu-runners
|
||||||
|
# if: needs.build-and-push.outputs.runs_on != 'ubuntu-latest'
|
||||||
env:
|
env:
|
||||||
PYTEST_FLAGS: ${{ (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' || inputs.release-tests == true) && '--release' || '--release' }}
|
PYTEST_FLAGS: ${{ (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' || inputs.release-tests == true) && '--release' || '--release' }}
|
||||||
steps:
|
steps:
|
||||||
@ -188,11 +189,12 @@ jobs:
|
|||||||
make install-integration-tests
|
make install-integration-tests
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
export DOCKER_VOLUME=/mnt2/
|
docker run hello-world
|
||||||
export DOCKER_IMAGE=${{ needs.build-and-push.outputs.docker_image }}
|
# export DOCKER_VOLUME=/mnt2/
|
||||||
export DOCKER_DEVICES=${{ needs.build-and-push.outputs.docker_devices }}
|
# export DOCKER_IMAGE=${{ needs.build-and-push.outputs.docker_image }}
|
||||||
export EXTRA_PYTEST="${{ needs.build-and-push.outputs.extra_pytest }}"
|
# export DOCKER_DEVICES=${{ needs.build-and-push.outputs.docker_devices }}
|
||||||
export HF_TOKEN=${{ secrets.HF_TOKEN }}
|
# export EXTRA_PYTEST="${{ needs.build-and-push.outputs.extra_pytest }}"
|
||||||
export ROCR_VISIBLE_DEVICES=3,4
|
# export HF_TOKEN=${{ secrets.HF_TOKEN }}
|
||||||
echo $DOCKER_IMAGE
|
# export ROCR_VISIBLE_DEVICES=3,4
|
||||||
pytest -s -vv integration-tests ${PYTEST_FLAGS} ${EXTRA_PYTEST}
|
# echo $DOCKER_IMAGE
|
||||||
|
# pytest -s -vv integration-tests ${PYTEST_FLAGS} ${EXTRA_PYTEST}
|
||||||
|
Loading…
Reference in New Issue
Block a user