From 1d8a582af6f40f8bc3f3e2940c0d64541c40a5b7 Mon Sep 17 00:00:00 2001 From: Ishaan Sehgal Date: Wed, 25 Oct 2023 20:56:06 -0700 Subject: [PATCH 1/2] fix: Use runner 0 for git checkout (#109) currently anyone of the four runners can checkout the latest git repo. If we tie it to runner #0, then we have a reliable path the most up to date repo is for the docker pod. --- .github/workflows/preset-image-build.yml | 2 +- presets/test/docker.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preset-image-build.yml b/.github/workflows/preset-image-build.yml index 347728a75..643c2524e 100644 --- a/.github/workflows/preset-image-build.yml +++ b/.github/workflows/preset-image-build.yml @@ -31,7 +31,7 @@ permissions: jobs: setup: - runs-on: self-hosted + runs-on: [self-hosted, username:runner-0] outputs: image_tag: ${{ steps.set_tag.outputs.image_tag }} FALCON_MODIFIED: ${{ steps.check_modified_paths.outputs.FALCON_MODIFIED }} diff --git a/presets/test/docker.yaml b/presets/test/docker.yaml index ef4e152a4..ae1f4ee62 100644 --- a/presets/test/docker.yaml +++ b/presets/test/docker.yaml @@ -27,7 +27,7 @@ spec: volumes: - name: host-volume hostPath: - path: /actions-runner/_work/kdm/kdm + path: /home/runner-0/runner/_work/kaito/kaito type: Directory - name: llama-volume hostPath: From 1815baac549073e9cfcf993de421b181010bc46f Mon Sep 17 00:00:00 2001 From: Ishaan Sehgal Date: Wed, 25 Oct 2023 20:59:31 -0700 Subject: [PATCH 2/2] fix: aimodelsregistry ACR Push on Dispatch (#110) This PR simplifies the ACR push process. Only if triggered by workflow dispatch do we push to registry `AIMODELSREGISTRY` with a tag specified by user In all other cases we push to `AIMODELSREGISTRYTEST` with this environment variable tag (e.g. 0.0.1) - this includes pushes to main and PR commits pulled against main. --------- Signed-off-by: Fei Guo Co-authored-by: Fei Guo --- .github/workflows/preset-image-build.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/preset-image-build.yml b/.github/workflows/preset-image-build.yml index 643c2524e..c0c7ef498 100644 --- a/.github/workflows/preset-image-build.yml +++ b/.github/workflows/preset-image-build.yml @@ -17,10 +17,6 @@ on: - 'presets/llama-2-chat/**' workflow_dispatch: inputs: - release: - description: 'Release (yes/no)' - required: true - default: 'no' image_tag: description: 'Image Tag' required: true @@ -29,6 +25,9 @@ permissions: id-token: write contents: read +env: + VERSION: 0.0.1 + jobs: setup: runs-on: [self-hosted, username:runner-0] @@ -97,12 +96,9 @@ jobs: if [[ "${{ github.event_name }}" == "workflow_dispatch" && -n "${{ github.event.inputs.image_tag }}" ]]; then echo "Using workflow dispatch to set image tag" echo "image_tag=${{ github.event.inputs.image_tag }}" >> $GITHUB_OUTPUT - elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then - echo "Setting image tag to be latest" - echo "image_tag=latest" >> $GITHUB_OUTPUT else - echo "Setting image tag based on latest commit" - echo "image_tag=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + echo "Setting image tag based on version set" + echo "image_tag=${{ env.VERSION }}" >> $GITHUB_OUTPUT fi - name: Print Image Tag @@ -179,7 +175,7 @@ jobs: - name: 'Attach and Login to ACR' id: acr_login run: | - if [[ "${{ needs.setup.outputs.image_tag }}" == "latest" ]]; then + if [[ "${{ github.event_name }}" == "workflow_dispatch" && -n "${{ github.event.inputs.image_tag }}" ]]; then ACR_NAME="aimodelsregistry" else ACR_NAME="aimodelsregistrytest"