-
Notifications
You must be signed in to change notification settings - Fork 81
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
Publish Release Images #15013
Publish Release Images #15013
Changes from all commits
5e1486b
f4be696
d6d7ea1
37aba34
3224e38
cfea754
aa1ed65
f03054b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,8 @@ runs: | |
- name: Determine Full Docker Image Tag | ||
shell: bash | ||
run: | | ||
echo "TT_METAL_DOCKER_IMAGE_TAG=ghcr.io/${{ github.repository }}/tt-metalium/${{ inputs.image }}:${{ env.IMAGE_TAG }}" >> $GITHUB_ENV | ||
echo "TT_METAL_REF_IMAGE_TAG=ghcr.io/${{ github.repository }}/tt-metalium/${{ inputs.image }}:latest" >> $GITHUB_ENV | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not allow us to use images that follow the convention outlined in: |
||
echo "TT_METAL_DOCKER_IMAGE_TAG=ghcr.io/${{ github.repository }}/${{ inputs.image }}:${{ env.IMAGE_TAG }}" >> $GITHUB_ENV | ||
echo "TT_METAL_REF_IMAGE_TAG=ghcr.io/${{ github.repository }}/${{ inputs.image }}:latest" >> $GITHUB_ENV | ||
- name: Output Docker Image Tag | ||
shell: bash | ||
run: | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,32 @@ | ||
name: "Create and Publish Release Docker Image" | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
to_be_filled_out: | ||
steps: | ||
- name: This workflow will be filled out in https://github.com/tenstorrent/tt-metal/pull/15013 | ||
run: | | ||
echo "NOOP" | ||
static-checks: | ||
uses: ./.github/workflows/all-static-checks.yaml | ||
secrets: inherit | ||
build-artifact: | ||
needs: static-checks | ||
uses: ./.github/workflows/build-artifact.yaml | ||
secrets: inherit | ||
build-wheels: | ||
needs: build-artifact | ||
strategy: | ||
matrix: | ||
# Since pre-compiled builds only run on 20.04, we can only test on 20.04 for now | ||
# The full 22.04 flow can be tested without precompiled | ||
os: [ubuntu-20.04] | ||
arch: [grayskull, wormhole_b0] | ||
uses: ./.github/workflows/_build-wheels-impl.yaml | ||
with: | ||
os: ${{ matrix.os }} | ||
arch: ${{ matrix.arch }} | ||
from-precompiled: true | ||
publish-release-image: | ||
needs: build-wheels | ||
uses: ./.github/workflows/publish-release-image.yaml | ||
secrets: inherit | ||
with: | ||
version: dev-${GITHUB_REF_NAME//\//-} | ||
is_major_version: false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
name: "[internal] Create and Publish Release Docker Image" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
is_major_version: | ||
required: true | ||
type: boolean | ||
default: false | ||
timeout: | ||
required: false | ||
type: number | ||
default: 35 | ||
jobs: | ||
create-docker-image: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04] | ||
arch: [grayskull, wormhole_b0] | ||
runs-on: | ||
- build-docker | ||
- in-service | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: https://ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Download wheels | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: eager-dist-${{ matrix.os }}-${{ matrix.arch }} | ||
- name: Get the name of the wheel and set up env variables | ||
id: generate-tag-name | ||
run: | | ||
echo "WHEEL_FILENAME=$(ls -1 *.whl)" >> $GITHUB_ENV | ||
REPO_IMAGE_NAME=ghcr.io/${{ github.repository }}/tt-metalium-${{ matrix.os }}-amd64-dev/${{ matrix.arch }} | ||
echo "REPO_IMAGE_NAME=$REPO_IMAGE_NAME" >> $GITHUB_ENV | ||
TAG_NAME=$REPO_IMAGE_NAME:${{ inputs.version }} | ||
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV | ||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
build-args: | | ||
WHEEL_FILENAME=${{ env.WHEEL_FILENAME }} | ||
BASE_IMAGE_NAME=tt-metalium/${{ matrix.os }}-amd64 | ||
tags: ${{ env.TAG_NAME }} | ||
context: . | ||
file: dockerfile/release.Dockerfile | ||
smoke-test-docker-image: | ||
needs: create-docker-image | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04] | ||
test_group: | ||
[ | ||
{ | ||
arch: grayskull, | ||
runs-on: ["cloud-virtual-machine", "E150", "in-service"], | ||
cmd: pytest tests/end_to_end_tests, | ||
}, | ||
{ | ||
arch: wormhole_b0, | ||
runs-on: ["cloud-virtual-machine", "N150", "in-service"], | ||
cmd: pytest tests/end_to_end_tests, | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not N300? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I picked the machine that seemed to have a lesser demand. |
||
] | ||
env: | ||
TT_METAL_ENV: ${{ vars.TT_METAL_ENV }} | ||
ARCH_NAME: ${{ matrix.test_group.arch }} | ||
LOGURU_LEVEL: INFO | ||
LD_LIBRARY_PATH: ${{ github.workspace }}/build/lib | ||
runs-on: ${{ matrix.test_group.runs-on }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Run smoke test on the image | ||
timeout-minutes: ${{ inputs.timeout }} | ||
uses: ./.github/actions/docker-run | ||
with: | ||
docker_os_arch: tt-metalium-${{ matrix.os }}-amd64-release/${{ matrix.test_group.arch }} | ||
docker_password: ${{ secrets.GITHUB_TOKEN }} | ||
run_args: | | ||
${{ matrix.test_group.cmd }} | ||
tag-docker-image-as-latest: | ||
needs: [smoke-test-docker-image, create-docker-image] | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04] | ||
arch: [grayskull, wormhole_b0] | ||
runs-on: | ||
- build-docker | ||
- in-service | ||
steps: | ||
- name: Tag latest if this is a major version release | ||
if: ${{ inputs.is_major_version }} | ||
run: | | ||
REPO_IMAGE_NAME=ghcr.io/${{ github.repository }}/tt-metalium-${{ matrix.os }}-amd64-release/${{ matrix.arch }} | ||
TAG_NAME=$REPO_IMAGE_NAME:${{ inputs.version }} | ||
docker pull $TAG_NAME | ||
docker tag $TAG_NAME $REPO_IMAGE_NAME:latest | ||
docker push $REPO_IMAGE_NAME:latest |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
ARG BASE_IMAGE_NAME=tt-metalium/ubuntu-20.04-amd64 | ||
# | ||
# Currently the release image uses the base image which is also the build image. | ||
# However, in the future, we could point a true base image that is a base for both releases and builds. | ||
# This work is described in https://github.com/tenstorrent/tt-metal/issues/11974 | ||
FROM ghcr.io/tenstorrent/tt-metal/$BASE_IMAGE_NAME | ||
|
||
ARG WHEEL_FILENAME | ||
ADD $WHEEL_FILENAME $WHEEL_FILENAME | ||
RUN pip3 install $WHEEL_FILENAME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the issue where the wheel was always installed.