Skip to content

Build TTNN C++ project #9

Build TTNN C++ project

Build TTNN C++ project #9

name: Build TTNN C++ project
on:
workflow_call:
workflow_dispatch:
jobs:
build-docker-image:
uses: ./.github/workflows/build-docker-artifact.yaml
secrets: inherit
with:
os: ubuntu-22.04-amd64
ttnn-project:
needs: build-docker-image
runs-on:
- ubuntu-22.04
env:
ARCH_NAME: wormhole_b0
steps:
# Metalium
- name: Clone Metalium
uses: tenstorrent/tt-metal/.github/actions/checkout-with-submodule-lfs@main
- name: Generate docker tag
id: generate-docker-tag
uses: ./.github/actions/generate-docker-tag
with:
image: tt-metalium/ubuntu-22.04-amd64
- name: Docker login
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull docker image
run: docker pull ${{ env.TT_METAL_DOCKER_IMAGE_TAG }}
- name: Move Repo A to Subdirectory
run: |
mkdir metalium
mv * metalium || true
mv .git metalium/.git
- name: Build Metalium
uses: addnab/docker-run-action@v3
with:
image: ${{ env.TT_METAL_DOCKER_IMAGE_TAG }}
options: |
--rm
--tmpfs /tmp
-u ${{ env.RUNNER_UID }}:${{ env.RUNNER_GID }}
-v ${{ github.workspace }}/metalium:${{ github.workspace }}
-v /etc/passwd:/etc/passwd:ro
-v /etc/shadow:/etc/shadow:ro
-v /etc/bashrc:/etc/bashrc:ro
-e ARCH_NAME=${{ env.ARCH_NAME }}
-w ${{ github.workspace }}
run: |
set -eu # basic shell hygiene
./build_metal.sh --build-type Release
# TTNN project
- name: Checkout cpp-ttnn-project-template
uses: actions/checkout@v4
with:
repository: tenstorrent/cpp-ttnn-project-template
path: project
- name: Build TTNN Project
uses: addnab/docker-run-action@v3
with:
image: ${{ env.TT_METAL_DOCKER_IMAGE_TAG }}
options: |
--rm
--tmpfs /tmp
-u ${{ env.RUNNER_UID }}:${{ env.RUNNER_GID }}
-v ${{ github.workspace }}/metalium:${{ github.workspace }}/metalium
-v ${{ github.workspace }}/project:${{ github.workspace }}/project
-v /etc/passwd:/etc/passwd:ro
-v /etc/shadow:/etc/shadow:ro
-v /etc/bashrc:/etc/bashrc:ro
-e ARCH_NAME=${{ env.ARCH_NAME }}
-e TT_METAL_HOME=${{ github.workspace }}/metalium
-w ${{ github.workspace }}/project
run: |
set -eu # basic shell hygiene
mkdir -p build && cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
ninja