-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
147 lines (133 loc) · 3.74 KB
/
.gitlab-ci.yml
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
##
## Copyright (c) 2024 hannah-tvm contributors.
##
## This file is part of hannah-tvm.
## See https://atreus.informatik.uni-tuebingen.de/ties/ai/hannah/hannah-tvm for further info.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
stages:
- build
- test
- deploy
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
POETRY_HOME: "$CI_PROJECT_DIR/.poetry"
GIT_SUBMODULE_STRATEGY: recursive
DEBIAN_FRONTEND: noninteractive
PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
before_script:
- apt-get update
- apt-get install -y wget build-essential pkg-config python3-dev curl ninja-build cmake g++ git python3-setuptools gcc libtinfo-dev zlib1g-dev build-essential cmake libedit-dev libxml2-dev llvm-dev libclang-dev
- curl -sSL https://install.python-poetry.org/ | python3 -
- export PATH=${POETRY_HOME}/bin:${PATH}
- poetry run pip install torch
- poetry install -E onnx -E tensorflow
sca:
stage: build
image: ubuntu:22.04
script:
- set -e
- poetry run pre-commit run -a
tags:
- docker
build_micro:
stage: build
image: ubuntu:22.04
script:
- set -e
- rm -f external/tvm/build/CMakeCache.txt
- poetry install -E micro -E tensorflow -E onnx
- poetry run ./scripts/install_micro.sh
- poetry run ./scripts/install_corstone_vfps.sh
- poetry run coverage run --source=hannah_tvm -m pytest test
- poetry run coverage report
- poetry run coverage xml
tags:
- docker
interruptible: true
coverage: '/TOTAL.*\s([.\d]+)%/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
cache:
key: tvm-micro
paths:
- external/tvm/build
build_full:
stage: build
image: ubuntu:22.04
script:
- set -e
- rm -f external/tvm/build/CMakeCache.txt
- poetry run ./scripts/install_full.sh
- poetry run coverage run --source=hannah_tvm -m pytest test
- poetry run coverage report
- poetry run coverage xml
tags:
- docker
interruptible: true
coverage: '/TOTAL.*\s([.\d]+)%/'
cache:
key: tvm-full
paths:
- external/tvm/build
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
#build_micro_pulp:
# stage: build
# image: ubuntu:latest
# script:
# - set -e
# - poetry run ./scripts/install_micro_pulp.sh
# tags:
# - docker
# interruptible: true
deploy to github:
stage: build
image: ubuntu:latest
before_script:
- apt update
- apt -y install openssh-client git git-lfs
variables:
# Prevent "shallow update not allowed" error.
# Set it to maximum possible count of *new* commits that you foresee being pushed to a remote.
GIT_DEPTH: 1000
only:
- main
script:
- echo "Pushing upstream"
- ./scripts/git-push [email protected]:ekut-es/hannah-tvm.git main
tags:
- docker
build_m3_image:
stage: build
before_script: ""
image:
name: gcr.io/kaniko-project/executor:v1.9.1-debug
entrypoint: [""]
script:
- env
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/docker/Dockerfile.m3"
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}-m3"
--cache=true
--compressed-caching=false
rules:
- if: $CI_COMMIT_TAG