Skip to content

Commit

Permalink
Revert "#11762: build docker image and build tt-metal artifacts"
Browse files Browse the repository at this point in the history
This reverts commit ddfc57f.
  • Loading branch information
ttmchiou committed Sep 23, 2024
1 parent ddfc57f commit 0adc624
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 236 deletions.
24 changes: 14 additions & 10 deletions .github/actions/docker-run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ inputs:
run_args:
description: 'Commands to run in docker'
required: true
docker_os_arch:
description: 'Docker image architecture'
docker_image:
description: 'Docker image to run commands in'
required: false
default: ubuntu-20.04-amd64
default: tt-metalium/ubuntu-20.04-amd64
docker_image_arch:
description: 'Is this a wormhole.b0, grayskull, or blackhole image'
required: true
docker_username:
description: docker login username
required: true
Expand All @@ -28,27 +31,27 @@ inputs:
runs:
using: "composite"
steps:
- name: Determine docker image tag
uses: ./.github/actions/generate-docker-tag
with:
image: ${{ inputs.docker_os_arch }}
- name: Determine Docker Tag to use
shell: bash
run: |
echo "IMAGE_TAG=latest" >> $GITHUB_ENV
- name: Docker login
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ inputs.docker_username }}
password: ${{ inputs.docker_password }}
- name: Pull docker image
- name: Pull the latest version of the image
shell: bash
run: |
docker pull ${{ env.TT_METAL_DOCKER_IMAGE_TAG }}
docker pull ghcr.io/${{ github.repository }}/${{ inputs.docker_image }}:${{ env.IMAGE_TAG }}
- uses: addnab/docker-run-action@v3
with:
shell: bash
username: ${{ inputs.docker_username }}
password: ${{ inputs.docker_password }}
registry: ghcr.io
image: ${{ env.TT_METAL_DOCKER_IMAGE_TAG }}
image: ghcr.io/${{ github.repository }}/${{ inputs.docker_image }}:${{ env.IMAGE_TAG }}
# The most important option below is `--rm`. The machines will fill up with containers.
options: |
--rm
Expand All @@ -61,4 +64,5 @@ runs:
run: |
cp -r /github_workspace/* /usr/app/
cd /usr/app/
rm -rf tt_metal tt_eager
${{ inputs.run_args }}
33 changes: 0 additions & 33 deletions .github/actions/generate-docker-tag/action.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/all-post-commit-workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,13 @@ jobs:
with:
from-precompiled: true
secrets: inherit
build-docker-image-2004:
uses: ./.github/workflows/build-docker-artifact.yaml
secrets: inherit
with:
os: ubuntu-20.04-amd64
build-docker-image-2204:
uses: ./.github/workflows/build-docker-artifact.yaml
secrets: inherit
with:
os: ubuntu-22.04-amd64
build-artifact:
needs: build-docker-image-2004
uses: ./.github/workflows/build-artifact.yaml
secrets: inherit
with:
build-docker: false
build-artifact-profiler:
needs: build-docker-image-2004
uses: ./.github/workflows/build-artifact.yaml
with:
tracy: true
build-docker: false
secrets: inherit
# UMD Unit Tests
umd-unit-tests:
Expand Down Expand Up @@ -164,7 +149,6 @@ jobs:
uses: ./.github/workflows/docs-latest-public.yaml
secrets: inherit
build:
needs: [build-artifact, build-docker-image-2204]
uses: ./.github/workflows/build.yaml
secrets: inherit
# We used to use this for post-commit, but we didn't have enough runners
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/blackhole-post-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,16 @@ permissions:
contents: read
pages: write
id-token: write
packages: write

jobs:
static-checks:
uses: ./.github/workflows/all-static-checks.yaml
secrets: inherit
build-docker-image:
uses: ./.github/workflows/build-docker-artifact.yaml
secrets: inherit
build-artifact:
needs: build-docker-image
uses: ./.github/workflows/build-artifact.yaml
secrets: inherit
with:
arch: '["blackhole"]'
build-docker: false
build-wheels:
needs: build-artifact
uses: ./.github/workflows/_build-wheels-impl.yaml
Expand Down
64 changes: 10 additions & 54 deletions .github/workflows/build-artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,52 +16,27 @@ on:
type: boolean
default: false
description: "Build with tracy enabled"
os:
required: false
type: string
default: "ubuntu-20.04-amd64"
build-docker:
required: false
type: boolean
default: true
description: "Build docker image"
workflow_dispatch:
inputs:
build-docker:
required: false
type: boolean
default: true
description: "Build docker image"
arch:
required: false
type: string
default: '["grayskull", "wormhole_b0"]'
build-type:
required: false
type: string
default: "Release"
type: choice
options:
- Release
- Debug
- RelWithDebInfo
- CI
tracy:
required: false
type: boolean
default: false
description: "Build with tracy enabled"
os:
required: false
type: string
default: "ubuntu-20.04-amd64"


jobs:
build-docker-image:
if: ${{ inputs.build-docker == true }}
uses: ./.github/workflows/build-docker-artifact.yaml
secrets: inherit
with:
os: ${{ inputs.os }}

build-artifact:
needs: build-docker-image
if: always()
strategy:
matrix:
arch: ${{ fromJson(inputs.arch || '["grayskull", "wormhole_b0", "blackhole"]') }}
Expand All @@ -79,33 +54,14 @@ jobs:
- name: Set up dynamic env vars for build
run: |
echo "TT_METAL_HOME=$(pwd)" >> $GITHUB_ENV
echo "RUNNER_UID=$(id -u)" >> $GITHUB_ENV
echo "RUNNER_GID=$(id -g)" >> $GITHUB_ENV
- name: Update submodules
run: |
git submodule update --init --recursive
- name: Generate docker tag
id: generate-docker-tag
uses: ./.github/actions/generate-docker-tag
with:
image: ${{ inputs.os }}
- name: Build tt-metal and libs
uses: addnab/docker-run-action@v3
with:
image: ${{ env.TT_METAL_DOCKER_IMAGE_TAG }}
options: |
-u ${{ env.RUNNER_UID }}:${{ env.RUNNER_GID }}
-v ${{ github.workspace }}:${{ github.workspace }}
-v /etc/passwd:/etc/passwd:ro
-v /etc/shadow:/etc/shadow:ro
-v /etc/bashrc:/etc/bashrc:ro
-e ARCH_NAME=${{ matrix.arch }}
-w ${{ github.workspace }}
run: |
nice -n 19 cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ inputs.build-type }} -DENABLE_TRACY=${{ inputs.tracy }}
nice -n 19 cmake --build build --target tests
nice -n 19 cmake --build build --target install
run: |
nice -n 19 cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ inputs.build-type }} -DENABLE_TRACY=${{ inputs.tracy }}
nice -n 19 cmake --build build --target tests
nice -n 19 cmake --build build --target install
- name: 'Tar files'
run: tar -cvf ttm_${{ matrix.arch }}.tar build/lib ttnn/ttnn/*.so build/programming_examples build/test build/tools runtime
- name: 'Upload Artifact'
Expand Down
70 changes: 22 additions & 48 deletions .github/workflows/build-docker-artifact.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
name: "Build tt-metal docker artifact"

on:
workflow_call:
inputs:
os:
required: false
type: string
default: "ubuntu-20.04-amd64"
workflow_dispatch:
inputs:
os:
required: false
type: choice
default: "ubuntu-20.04-amd64"
options:
- "ubuntu-20.04-amd64"
- "ubuntu-22.04-amd64"
push:
branches:
- main
paths:
- dockerfile/ubuntu-20.04-amd64.Dockerfile
- scripts/docker/requirements*
- pyproject.toml
- scripts/docker/install_test_deps.sh
- tt_metal/python_env/requirements-dev.txt
jobs:
build-docker-image:
env:
TT_METAL_ENV: ${{ vars.TT_METAL_ENV }}
CONFIG: ci
SILENT: 0
VERBOSE: 1
TT_METAL_DOCKER_IMAGE: ${{ inputs.os }}
IMAGE: tt-metalium/ubuntu-20.04-amd64
DOCKERFILE: ubuntu-20.04-amd64
environment: dev
Expand All @@ -32,45 +26,25 @@ jobs:
- in-service
steps:
- uses: tenstorrent-metal/metal-workflows/.github/actions/[email protected]
with:
fetch-depth: 0
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get all test, doc and src files that have changed
id: changed-files-specific
uses: tj-actions/changed-files@v45
with:
files: |
dockerfile/**.Dockerfile
scripts/docker/install_test_deps.sh
scripts/docker/requirements*
pyproject.toml
tt_metal/python_env/requirements-dev.txt
base_sha: 'main'
- name: Determine docker image tag
uses: ./.github/actions/generate-docker-tag
with:
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
with:
context: ${{ github.workspace }}
file: dockerfile/${{ inputs.os }}.Dockerfile
push: true
tags: ${{ env.TT_METAL_DOCKER_IMAGE_TAG}}
cache-from: type=registry,ref=${{ env.TT_METAL_REF_IMAGE_TAG }}
cache-to: type=inline
pull: true
- name: Tag Docker main image as current image
if: steps.changed-files-specific.outputs.any_changed != 'true'
- name: Determine Docker Image Tag
id: set-image
run: |
if [[ "${GITHUB_REF_NAME}" == "main" ]]; then
echo "IMAGE_TAG=latest" >> $GITHUB_ENV
else
echo "IMAGE_TAG=dev-${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV
fi
- name: Build Docker image
run: |
docker pull ghcr.io/${{ github.repository }}/${{ env.TT_METAL_DOCKER_IMAGE }}:latest
docker tag ghcr.io/${{ github.repository }}/${{ env.TT_METAL_DOCKER_IMAGE }}:latest ${{ env.TT_METAL_DOCKER_IMAGE_TAG}}
./scripts/docker/build_docker_image.sh ${{ env.DOCKERFILE}} ${{ env.IMAGE }}:${{ env.IMAGE_TAG }}
- name: Push Docker image to GitHub Container Registry
run: |
docker push ${{ env.TT_METAL_DOCKER_IMAGE_TAG }}
GITHUB_REPO_DOCKER_IMAGE_TAG=ghcr.io/${{ github.repository }}/${{ env.IMAGE }}:${{ env.IMAGE_TAG }}
docker tag ${{ env.IMAGE }}:${{ env.IMAGE_TAG }} $GITHUB_REPO_DOCKER_IMAGE_TAG
docker push $GITHUB_REPO_DOCKER_IMAGE_TAG
31 changes: 0 additions & 31 deletions .github/workflows/build-wrapper.yaml

This file was deleted.

Loading

0 comments on commit 0adc624

Please sign in to comment.