Skip to content
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

#0: Workflow to test compatibility with TTNN Project Template #14442

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/workflows/cpp-ttnn-project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
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-metal/metal-workflows/.github/actions/[email protected]
- name: Generate docker tag
id: generate-docker-tag
uses: ./.github/actions/generate-docker-tag
with:
image: 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 --disable-unity-builds --build-type Release

# TTNN project
- name: Checkout cpp-ttnn-project-template
uses: actions/checkout@v3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to use v3?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oversight.

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
Loading