-
Notifications
You must be signed in to change notification settings - Fork 6
/
.gitlab-ci.yml
72 lines (65 loc) · 2.26 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
stages:
- prepare
- build
variables:
REGISTRY_GITLAB: $CI_REGISTRY/ion/ion-kit
REGISTRY_AWS: 10.242.20.37:5000 # This is private registry on AWS
.prepare-base: &prepare-base
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- |
cat <<EOF > buildkitd.toml
insecure-entitlements = [ "security.insecure" ]
[registry."10.242.20.37:5000"]
http = true
insecure = true
EOF
- docker buildx create --use --config buildkitd.toml
- docker buildx build --platform linux/${ARCH} --cache-to=${REGISTRY_URL}/builder-${ARCH}:cache --cache-from=${REGISTRY_URL}/builder-${ARCH}:cache -t ${REGISTRY_URL}/builder-${ARCH}:latest --build-arg HALIDE_GIT_URL=${HALIDE_GIT_URL} --build-arg HALIDE_GIT_BRANCH=${HALIDE_GIT_BRANCH} --push .
stage: prepare
only:
- tags
prepare-amd64:
<<: *prepare-base
image: $CI_REGISTRY/ion/ion-kit/docker-with-buildx
variables:
ARCH: amd64
REGISTRY_URL: $CI_REGISTRY/ion/ion-kit
tags:
- amd64
- docker
prepare-arm64:
<<: *prepare-base
image: 10.242.20.37:5000/docker-with-buildx
variables:
ARCH: arm64
REGISTRY_URL: 10.242.20.37:5000
tags:
- arm64
- docker
.build-base: &build-base
script:
- cmake -D CMAKE_BUILD_TYPE=Release -D ION_BUILD_TEST=off -D ION_BUILD_EXAMPLE=off -D ION_BUILD_ALL_BB=off -D ION_BUILD_DOC=off -D WITH_CUDA=off -D ION_BUNDLE_HALIDE=on .
- make -j4 package
- ION_KIT_VERSION=`git describe --tags | sed -e "s/^v//g"`
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file ion-kit-${ION_KIT_VERSION}-Linux.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/tar/${ION_KIT_VERSION}/ion-kit-${ION_KIT_VERSION}-Linux-${ARCH}.tar.gz"'
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file ion-kit_${ION_KIT_VERSION}_${ARCH}.deb "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/deb/${ION_KIT_VERSION}/ion-kit_${ION_KIT_VERSION}_${ARCH}.deb"'
stage: build
only:
- tags
build-amd64:
<<: *build-base
image: $CI_REGISTRY/ion/ion-kit/builder-amd64
variables:
ARCH: amd64
tags:
- amd64
- docker
build-arm64:
<<: *build-base
image: 10.242.20.37:5000/builder-arm64
variables:
ARCH: arm64
tags:
- arm64
- docker