From a5804ee6d0ac8c745b39d536eb41ab2232807cce Mon Sep 17 00:00:00 2001 From: David Corvoysier Date: Mon, 23 Sep 2024 10:51:37 +0200 Subject: [PATCH] ci: add workflow to push neuronx-tgi --- .github/workflows/build-neuronx-tgi.yml | 53 +++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/build-neuronx-tgi.yml diff --git a/.github/workflows/build-neuronx-tgi.yml b/.github/workflows/build-neuronx-tgi.yml new file mode 100644 index 000000000..4a58f4203 --- /dev/null +++ b/.github/workflows/build-neuronx-tgi.yml @@ -0,0 +1,53 @@ +name: Build and push NeuronX docker image to ghcr.io + +on: + workflow_dispatch: + pull_request: + branches: [ main ] + +jobs: + docker: + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + steps: + - + name: Checkout sources + uses: actions/checkout@v4 + - + name: Install python and create venv + run: | + 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: Display structure of downloaded files + run: ls -R + - + 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: neuronx-tgi:${{ env.ON_VERSION }}