Skip to content

Commit

Permalink
#12496: Rework how the tag/version is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitri-tenstorrent committed Dec 10, 2024
1 parent e4ca0d6 commit 8447b61
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
11 changes: 3 additions & 8 deletions .github/actions/docker-run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ inputs:
description: 'Docker image architecture'
required: false
default: tt-metalium/ubuntu-20.04-amd64
docker_image_tag:
description: 'Specify exact Docker image tag to use. `docker_os_arch` will be ignored when this value is supplied.'
docker_version:
description: 'Specify version for the Docker image tag to use.'
required: false
docker_username:
description: docker login username
Expand Down Expand Up @@ -39,14 +39,9 @@ runs:
steps:
- name: Determine docker image tag
uses: ./.github/actions/generate-docker-tag
if: ${{ inputs.docker_image_tag == '' }}
with:
image: ${{ inputs.docker_os_arch }}
- name: Set the docker image tag if provided
shell: bash
if: ${{ inputs.docker_image_tag != '' }}
run: |
echo "TT_METAL_DOCKER_IMAGE_TAG=${{ inputs.docker_image_tag }}" >> $GITHUB_ENV
version: ${{ inputs.docker_version }}
- name: Set
shell: bash
run: |
Expand Down
15 changes: 11 additions & 4 deletions .github/actions/generate-docker-tag/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,24 @@ inputs:
description: 'Docker image to run commands in - follows os-arch format'
required: false
default: ubuntu-20.04-amd64

version:
description: 'Docker image version'
required: false
runs:
using: "composite"
steps:
- name: Determine Docker Tag
shell: bash
run: |
if [[ "${GITHUB_REF_NAME}" == "main" ]]; then
echo "IMAGE_TAG=latest" >> $GITHUB_ENV
# If the version was provided use it, otherwise, determine what the version should be.
if [ "${{ inputs.version }}" != "" ]; then
echo "IMAGE_TAG=${{ inputs.version }}" >> $GITHUB_ENV
else
echo "IMAGE_TAG=dev-${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV
if [[ "${GITHUB_REF_NAME}" == "main" ]]; then
echo "IMAGE_TAG=latest" >> $GITHUB_ENV
else
echo "IMAGE_TAG=dev-${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV
fi
fi
- name: Determine Full Docker Image Tag
shell: bash
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/publish-release-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get the name of the wheel and set up env variables
id: generate-tag-name
run: |
REPO_IMAGE_NAME=ghcr.io/${{ github.repository }}/tt-metalium-${{ matrix.os }}-amd64-release/${{ matrix.test_group.arch }}
TAG_NAME=$REPO_IMAGE_NAME:${{ inputs.version }}
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
- name: Run smoke test on the image
timeout-minutes: ${{ inputs.timeout }}
uses: ./.github/actions/docker-run
with:
docker_image_tag: ${{ env.TAG_NAME }}
docker_os_arch: tt-metalium-${{ matrix.os }}-amd64-release/${{ matrix.test_group.arch }}
docker_version: ${{ inputs.version }}
docker_password: ${{ secrets.GITHUB_TOKEN }}
run_args: |
${{ matrix.test_group.cmd }}
Expand Down

0 comments on commit 8447b61

Please sign in to comment.