From 364e3fd177bf3a2c487d14036504cfaf85468970 Mon Sep 17 00:00:00 2001 From: Raymond Kim Date: Tue, 26 Nov 2024 17:14:19 -0500 Subject: [PATCH] #0: Revert "Publish Release Images (#15013)" because docker image name is not being passed properly for release image This reverts commit 845ddf891002d510e1894674da4b8502c9734ae0. --- .github/actions/docker-run/action.yml | 2 +- .../actions/generate-docker-tag/action.yml | 4 +- .github/workflows/build-artifact.yaml | 2 +- .github/workflows/build-docker-artifact.yaml | 2 +- .github/workflows/code-analysis.yaml | 2 +- .github/workflows/cpp-ttnn-project.yaml | 2 +- .github/workflows/package-and-release.yaml | 26 +++- .../publish-release-image-wrapper.yaml | 34 ++---- .github/workflows/publish-release-image.yaml | 111 ------------------ INSTALLING.md | 23 +--- dockerfile/release.Dockerfile | 10 -- 11 files changed, 37 insertions(+), 181 deletions(-) delete mode 100644 .github/workflows/publish-release-image.yaml delete mode 100644 dockerfile/release.Dockerfile diff --git a/.github/actions/docker-run/action.yml b/.github/actions/docker-run/action.yml index c7d39d6a846..22240bc95c8 100644 --- a/.github/actions/docker-run/action.yml +++ b/.github/actions/docker-run/action.yml @@ -86,7 +86,7 @@ runs: ${{ inputs.device }} -w ${{ github.workspace }} run: | - if [ "${{ inputs.install_wheel }}" == "true" ]; then + if [ ${{ inputs.install_wheel }} ]; then WHEEL_FILENAME=$(ls -1 *.whl) pip3 install $WHEEL_FILENAME fi diff --git a/.github/actions/generate-docker-tag/action.yml b/.github/actions/generate-docker-tag/action.yml index 4c8c0a1f3e4..65c5038289c 100644 --- a/.github/actions/generate-docker-tag/action.yml +++ b/.github/actions/generate-docker-tag/action.yml @@ -24,8 +24,8 @@ runs: - name: Determine Full Docker Image Tag shell: bash run: | - 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 + 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 - name: Output Docker Image Tag shell: bash run: | diff --git a/.github/workflows/build-artifact.yaml b/.github/workflows/build-artifact.yaml index f280a91a84d..50a044f843b 100644 --- a/.github/workflows/build-artifact.yaml +++ b/.github/workflows/build-artifact.yaml @@ -99,7 +99,7 @@ jobs: id: generate-docker-tag uses: ./.github/actions/generate-docker-tag with: - image: tt-metalium/${{ inputs.os }} + image: ${{ inputs.os }} - name: Docker login uses: docker/login-action@v3 with: diff --git a/.github/workflows/build-docker-artifact.yaml b/.github/workflows/build-docker-artifact.yaml index 6f67c29db68..dd4a966de10 100644 --- a/.github/workflows/build-docker-artifact.yaml +++ b/.github/workflows/build-docker-artifact.yaml @@ -53,7 +53,7 @@ jobs: - name: Determine docker image tag uses: ./.github/actions/generate-docker-tag with: - image: tt-metalium/${{ inputs.os }} + image: ${{ inputs.os }} - name: Build Docker image and push to GHCR if: steps.changed-files-specific.outputs.any_changed == 'true' uses: docker/build-push-action@v6 diff --git a/.github/workflows/code-analysis.yaml b/.github/workflows/code-analysis.yaml index 462f250853f..27148104f44 100644 --- a/.github/workflows/code-analysis.yaml +++ b/.github/workflows/code-analysis.yaml @@ -54,7 +54,7 @@ jobs: id: generate-docker-tag uses: ./.github/actions/generate-docker-tag with: - image: tt-metalium/${{ inputs.os }} + image: ${{ inputs.os }} - name: Docker login uses: docker/login-action@v3 with: diff --git a/.github/workflows/cpp-ttnn-project.yaml b/.github/workflows/cpp-ttnn-project.yaml index 6dd7a25fc2a..874b9487569 100644 --- a/.github/workflows/cpp-ttnn-project.yaml +++ b/.github/workflows/cpp-ttnn-project.yaml @@ -27,7 +27,7 @@ jobs: id: generate-docker-tag uses: ./.github/actions/generate-docker-tag with: - image: tt-metalium/ubuntu-22.04-amd64 + image: ubuntu-22.04-amd64 - name: Docker login uses: docker/login-action@v3 with: diff --git a/.github/workflows/package-and-release.yaml b/.github/workflows/package-and-release.yaml index ea348919c01..7ff55166adb 100644 --- a/.github/workflows/package-and-release.yaml +++ b/.github/workflows/package-and-release.yaml @@ -185,11 +185,27 @@ jobs: create-tag, create-and-upload-draft-release ] - uses: ./.github/workflows/publish-release-image.yaml - secrets: inherit - with: - version: ${{ needs.create-tag.outputs.version }} - is_major_version: ${{ needs.get-params.outputs.is-release-candidate !='true' && needs.get-params.outputs.should-create-release == 'true' }} + runs-on: ubuntu-latest + 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: Build and push + env: + TT_METAL_DOCKER_IMAGE: tt-metalium/ubuntu-20.04-amd64 + uses: docker/build-push-action@v6 + with: + push: true + tags: ghcr.io/${{ github.repository }}/tt-metalium/ubuntu-20.04-amd64:${{ needs.create-tag.outputs.version }}-dev + context: . + file: dockerfile/ubuntu-20.04-amd64.Dockerfile release-docs: needs: [ get-params, diff --git a/.github/workflows/publish-release-image-wrapper.yaml b/.github/workflows/publish-release-image-wrapper.yaml index 1156148708c..d6b0e20fcf4 100644 --- a/.github/workflows/publish-release-image-wrapper.yaml +++ b/.github/workflows/publish-release-image-wrapper.yaml @@ -1,32 +1,12 @@ name: "Create and Publish Release Docker Image" on: + workflow_call: workflow_dispatch: + jobs: - 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 + to_be_filled_out: + steps: + - name: This workflow will be filled out in https://github.com/tenstorrent/tt-metal/pull/15013 + run: | + echo "NOOP" diff --git a/.github/workflows/publish-release-image.yaml b/.github/workflows/publish-release-image.yaml deleted file mode 100644 index f92eff11ca7..00000000000 --- a/.github/workflows/publish-release-image.yaml +++ /dev/null @@ -1,111 +0,0 @@ -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, - } - ] - 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 diff --git a/INSTALLING.md b/INSTALLING.md index 524cd6502aa..a4ddd8608ab 100644 --- a/INSTALLING.md +++ b/INSTALLING.md @@ -66,14 +66,14 @@ sudo -E python3 setup_hugepages.py enable && sudo -E python3 setup_hugepages.py > [!NOTE] > -> You may choose to install from either source, a Python wheel, or Docker release image. +> You may choose to install from either source or a Python wheel. > > However, no matter your method, in order to use our pre-built models or to > follow along with the documentation and tutorials to get started, you will > still need the source code. > > If you do not want to use the models or follow the tutorials and want to -> immediately start using the API, you may install just the wheel or get the release Docker container. +> immediately start using the API, you may install just the wheel. 1. Install git and git-lfs. @@ -157,25 +157,6 @@ sudo apt-get install cpufrequtils sudo cpupower frequency-set -g performance ``` -### Option 3: From Docker Release Image - -Download the latest Docker release from our -[releases](https://github.com/tenstorrent/tt-metal/releases/latest) page for -the particular Tenstorrent card architecture that you have installed on your -system. (ie. Grayskull, Wormhole, etc) - -```sh -docker pull ghcr.io/tenstorrent/tt-metal/tt-metalium-ubuntu-20.04-amd64-release/:latest -docker run --it --rm -v /dev/hugepages-1G:/dev/hugepages-1G --device /dev/tenstorrent ghcr.io/tenstorrent/tt-metal/tt-metalium-ubuntu-20.04-amd64-release/:latest bash -``` -where `arch_name` is one of `grayskull`, `wormhole_b0`, or `blackhole`, -depending on your Tenstorrent card type. - -When inside of the container, -```sh -python3 -c "import ttnn" -``` - 5. Start coding To verify your installation, try the executing an example: diff --git a/dockerfile/release.Dockerfile b/dockerfile/release.Dockerfile deleted file mode 100644 index 4f6fc2dc951..00000000000 --- a/dockerfile/release.Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -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