forked from tenstorrent/tt-metal
-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (123 loc) · 3.83 KB
/
build-artifact.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: "Build tt-metal artifacts"
on:
workflow_call:
inputs:
arch:
required: false
type: string
default: '["grayskull", "wormhole_b0"]'
build-type:
required: false
type: string
default: "Release"
tracy:
required: false
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"
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()
timeout-minutes: 30
strategy:
matrix:
arch: ${{ fromJson(inputs.arch || '["grayskull", "wormhole_b0", "blackhole"]') }}
env:
TT_METAL_ENV: ${{ vars.TT_METAL_ENV }}
ARCH_NAME: ${{ matrix.arch }}
SILENT: 0
VERBOSE: 1
environment: dev
runs-on:
- build
- in-service
steps:
- uses: tenstorrent-metal/metal-workflows/.github/actions/[email protected]
- 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: 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: Build tt-metal and libs
uses: addnab/docker-run-action@v3
with:
image: ${{ env.TT_METAL_DOCKER_IMAGE_TAG }}
options: |
--rm
-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: |
build_command="./build_metal.sh --build-type ${{ inputs.build-type }} --build-tests --build-programming-examples"
echo "${{ inputs.tracy }}"
if [ "${{ inputs.tracy }}" = "true" ]; then
build_command="$build_command --enable-profiler"
fi
nice -n 19 $build_command
- 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'
uses: actions/upload-artifact@v4
with:
name: TTMetal_build_${{ matrix.arch }}${{ (inputs.tracy && '_profiler') || '' }}
path: ttm_${{ matrix.arch }}.tar