Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI workflow to push NeuronX TGI docker images #699

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/build-neuronx-tgi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build and push NeuronX docker image to ghcr.io

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
docker:
runs-on:
group: aws-general-8-plus
permissions:
contents: write
packages: write
steps:
-
name: Checkout sources
uses: actions/checkout@v4
-
name: Install python and create venv
run: |
sudo apt update
sudo apt install python3-venv python3-dev -y
python3 -m venv aws_neuron_venv_pytorch
source aws_neuron_venv_pytorch/bin/activate
python -m pip install -U pip
python -m pip install build
python -m pip config set global.extra-index-url https://pip.repos.neuron.amazonaws.com
python -m build .
-
name: Extract version
run: |
pkg=$(ls dist/optimum_neuron*.tar.gz); tmp=${pkg#*-}; echo "ON_VERSION=${tmp%.tar.gz*}">> $GITHUB_ENV
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: text-generation-inference/Dockerfile
push: true
build-args: VERSION=${{ env.ON_VERSION }}
tags: ghcr.io/huggingface/neuronx-tgi:${{ env.ON_VERSION }}, ghcr.io/huggingface/neuronx-tgi:latest