-
Notifications
You must be signed in to change notification settings - Fork 75
189 lines (175 loc) · 6.71 KB
/
main.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: Testing (X86_64, GPU)
on:
push:
branches-ignore:
- "web"
pull_request:
branches-ignore:
- "web"
release:
jobs:
doc-url-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: halo
submodules: false
clean: false
- name: Check markdown for broken links
uses: ruzickap/action-my-markdown-link-checker@v1
with:
config_file: ./halo/.github/workflows/mlc_config.json
exclude: |
external/
.github/
third_party/
lint-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: halo
submodules: false
clean: false
- name: Lint
uses: DoozyX/[email protected]
with:
source: "./halo"
exclude: "./halo/third_party ./halo/external ./halo/ODLA/external ./halo/ODLA/platforms/odla_popart"
clangFormatVersion: 9
style: file
build_ubuntu:
runs-on: [self-hosted, gpu]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: halo
submodules: recursive
- name: Build
uses: ./halo/.github/actions/build
with:
docker_image_variant: cuda11.4.2-cudnn8
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: artifact
path: |
${{runner.workspace}}/heterogeneity-aware-lowering-and-optimization/output_ubuntu/*.bz2
if-no-files-found: error
build_centos7:
runs-on: [self-hosted]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: halo
submodules: recursive
clean: true
- name: Build
run: |
mkdir -p /tmp/centos.cache
rm -fr ${{runner.workspace}}/$repo_name/output_centos
mkdir -p ${{runner.workspace}}/$repo_name/output_centos
docker pull $image_registry/computation/halo:$image_tag
docker run --rm --runtime=nvidia -v /tmp/centos.cache:/cache --tmpfs /build:exec --user=$UID:$GID \
-v $poplar_sdk:/opt/poplar_sdk:ro \
-v ${{runner.workspace}}/$repo_name:/host \
$image_registry/computation/halo:$image_tag \
/bin/bash -c 'source scl_source enable devtoolset-7 && cd /build && source /opt/poplar_sdk/poplar/enable.sh && source /opt/poplar_sdk/popart/enable.sh && cmake -G Ninja /host/halo -DHALO_USE_TIDY_CHECK=OFF -DHALO_GEN_DOCS=OFF -DODLA_BUILD_POPART_USE_CXX11ABI=OFF -DODLA_BUILD_POPART_CUSTOM_OPS=ON -DODLA_BUILD_TRT=ON -DODLA_BUILD_XNNPACK=OFF -DODLA_BUILD_EIGEN=ON -DODLA_BUILD_DNNL=ON -DODLA_BUILD_ASCEND=ON -DHALO_BUILD_RTLIB=OFF -DHALO_USE_STATIC_PROTOBUF=ON -DCPACK_SYSTEM_NAME=centos-i686 && ninja && source /opt/poplar_sdk/poplar/enable.sh && ninja check-halo && ninja package && cp /build/*.bz2 /build/*.rpm /host/output_centos'
env:
poplar_sdk: /opt/poplar_sdk-centos_7_6-3.1.0-EA.1+1168-a2e17bf73e
repo_name : heterogeneity-aware-lowering-and-optimization
image_registry : registry-intl.us-west-1.aliyuncs.com
image_tag : 0.8.1-devel-cuda11.4.2-cudnn8-centos7
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: artifact
path: |
${{runner.workspace}}/heterogeneity-aware-lowering-and-optimization/output_centos/*.bz2
${{runner.workspace}}/heterogeneity-aware-lowering-and-optimization/output_centos/*.rpm
if-no-files-found: error
publish_images:
runs-on: [self-hosted]
needs: [build_ubuntu, build_centos7]
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: halo
clean: false
- name: Cleanup
run: rm -fr /tmp/download && mkdir -p /tmp/download
- name: Download
uses: actions/download-artifact@v2
with:
name: artifact
path: /tmp/download
- name: Prepare
id: prepare
run: |
echo "::set-output name=file::$(cd /tmp/download && ls HALO-*-ubuntu*.bz2)"
echo "::set-output name=date::$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
tag=latest
if [[ $GITHUB_REF == refs/tags/Release/* ]]; then
tag="Release-${GITHUB_REF#refs/tags/Release/}"
elif [[ $GITHUB_REF == refs/tags/* ]]; then
tag=${GITHUB_REF#refs/tags/}
elif [[ $GITHUB_REF == refs/heads/* ]]; then
tag=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
if [ "${{ github.event.repository.default_branch }}" = "$tag" ]; then
tag=latest
fi
elif [[ $GITHUB_REF == refs/pull/* ]]; then
tag=pr-${{ github.event.number }}
fi
ls /tmp/download
echo ::set-output name=tag::${tag}
- name: Login to aliyun
uses: docker/login-action@v1
if: ${{ startsWith(github.ref, 'refs/tags') || startsWith(github.ref, 'refs/heads/master') }}
with:
registry: registry-intl.us-west-1.aliyuncs.com
username: ${{ secrets.ALIYUN_CR_USER }}
password: ${{ secrets.ALIYUN_CR_PWD }}
- name: Build x86_64 runtime images
uses: docker/build-push-action@v2
with:
file: halo/utils/docker/runtime/Dockerfile.x86_64
context: /tmp/download
tags: |
localhost:5000/halo:sha-${{ github.sha }}
registry-intl.us-west-1.aliyuncs.com/computation/halo:${{steps.prepare.outputs.tag}}-runtime.x86_64-ubuntu18.04
push: ${{ startsWith(github.ref, 'refs/tags') || startsWith(github.ref, 'refs/heads/master') }}
build-args: |
BASE_IMAGE=ubuntu:18.04
HALO_PKG=${{ steps.prepare.outputs.file }}
labels: |
halo.name:runtime.x86_64
halo.build-date:${{ steps.prepare.outputs.date }}
halo.vcs_url:${{ github.repository }}
halo.vcs_ref:${{ github.ref }}
halo.vcs_sha:${{ github.sha }}
- name: Test
run: |
docker inspect localhost:5000/halo:sha-${{ github.sha }}
docker run --rm localhost:5000/halo:sha-${{ github.sha }} --version
docker rmi localhost:5000/halo:sha-${{ github.sha }}
docker image prune -f
- name: Publish release artifacts
if: startsWith(github.ref, 'refs/tags')
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: /tmp/download/*
name: ${{ steps.prepare.tag }}