From 89560ef87f5146a53cf3d0df704ee3eede88dd3f Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Tue, 2 Apr 2024 19:25:46 +0200 Subject: [PATCH] fix(ci): manually tag latest images (#1948) fix(ci): manually tag images Signed-off-by: Ettore Di Giacinto --- .github/workflows/image.yml | 8 ++++++++ .github/workflows/image_build.yml | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 79a38fc5fc95..0c708b1d3a65 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -28,6 +28,7 @@ jobs: base-image: ${{ matrix.base-image }} aio: ${{ matrix.aio }} makeflags: ${{ matrix.makeflags }} + latest-image: ${{ matrix.latest-image }} secrets: dockerUsername: ${{ secrets.DOCKERHUB_USERNAME }} dockerPassword: ${{ secrets.DOCKERHUB_PASSWORD }} @@ -92,6 +93,7 @@ jobs: runs-on: 'arc-runner-set' base-image: "ubuntu:22.04" aio: "-aio-gpu-nvidia-cuda-11" + latest-image: 'latest-aio-gpu-nvidia-cuda-11' makeflags: "--jobs=3 --output-sync=target" - build-type: 'cublas' cuda-major-version: "12" @@ -104,6 +106,7 @@ jobs: runs-on: 'arc-runner-set' base-image: "ubuntu:22.04" aio: "-aio-gpu-nvidia-cuda-12" + latest-image: 'latest-aio-gpu-nvidia-cuda-12' makeflags: "--jobs=3 --output-sync=target" - build-type: '' #platforms: 'linux/amd64,linux/arm64' @@ -123,6 +126,7 @@ jobs: image-type: 'extras' aio: "-aio-gpu-hipblas" base-image: "rocm/dev-ubuntu-22.04:6.0-complete" + latest-image: 'latest-aio-gpu-hipblas' runs-on: 'arc-runner-set' makeflags: "--jobs=3 --output-sync=target" - build-type: 'hipblas' @@ -143,6 +147,7 @@ jobs: image-type: 'extras' runs-on: 'arc-runner-set' aio: "-aio-gpu-intel-f16" + latest-image: 'latest-aio-gpu-intel-f16' makeflags: "--jobs=3 --output-sync=target" - build-type: 'sycl_f32' platforms: 'linux/amd64' @@ -153,6 +158,7 @@ jobs: image-type: 'extras' runs-on: 'arc-runner-set' aio: "-aio-gpu-intel-f32" + latest-image: 'latest-aio-gpu-intel-f32' makeflags: "--jobs=3 --output-sync=target" # Core images - build-type: 'sycl_f16' @@ -225,6 +231,7 @@ jobs: aio: ${{ matrix.aio }} base-image: ${{ matrix.base-image }} makeflags: ${{ matrix.makeflags }} + latest-image: ${{ matrix.latest-image }} secrets: dockerUsername: ${{ secrets.DOCKERHUB_USERNAME }} dockerPassword: ${{ secrets.DOCKERHUB_PASSWORD }} @@ -242,6 +249,7 @@ jobs: base-image: "ubuntu:22.04" runs-on: 'ubuntu-latest' aio: "-aio-cpu" + latest-image: 'latest-aio-cpu' makeflags: "--jobs=5 --output-sync=target" - build-type: 'cublas' cuda-major-version: "11" diff --git a/.github/workflows/image_build.yml b/.github/workflows/image_build.yml index d07df44161bb..affa03bfbff6 100644 --- a/.github/workflows/image_build.yml +++ b/.github/workflows/image_build.yml @@ -29,6 +29,10 @@ on: description: 'Tag latest' default: '' type: string + latest-image: + description: 'Tag latest' + default: '' + type: string tag-suffix: description: 'Tag suffix' default: '' @@ -266,6 +270,23 @@ jobs: tags: ${{ steps.meta_aio_dockerhub.outputs.tags }} labels: ${{ steps.meta_aio_dockerhub.outputs.labels }} + - name: Latest tag + # run this on branches, when it is a tag and there is a latest-image defined + if: github.event_name != 'pull_request' && inputs.latest-image != '' && github.ref_type == 'tag' + run: | + docker pull localai/localai:${{ steps.meta.outputs.version }} + docker tag localai/localai:${{ steps.meta.outputs.version }} localai/localai:${{ inputs.latest-image }} + docker pull quay.io/go-skynet/local-ai:${{ steps.meta.outputs.version }} + docker tag quay.io/go-skynet/local-ai:${{ steps.meta.outputs.version }} quay.io/go-skynet/local-ai:${{ inputs.latest-image }} + - name: Latest AIO tag + # run this on branches, when it is a tag and there is a latest-image defined + if: github.event_name != 'pull_request' && inputs.latest-image != '' && github.ref_type == 'tag' + run: | + docker pull localai/localai:${{ steps.meta_aio_dockerhub.outputs.version }} + docker tag localai/localai:${{ steps.meta_aio_dockerhub.outputs.version }} localai/localai:${{ inputs.latest-image }} + docker pull quay.io/go-skynet/local-ai:${{ steps.meta_aio.outputs.version }} + docker tag quay.io/go-skynet/local-ai:${{ steps.meta_aio.outputs.version }} quay.io/go-skynet/local-ai:${{ inputs.latest-image }} + - name: job summary run: | echo "Built image: ${{ steps.meta.outputs.labels }}" >> $GITHUB_STEP_SUMMARY