-
Notifications
You must be signed in to change notification settings - Fork 13
/
.gitlab-ci.yml
137 lines (121 loc) · 3.39 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
variables:
DOCKER_DRIVER: overlay
services:
- docker:stable-dind
stages:
- build-protos
- unit-test
- build
- integration-test
# --------
build-go-protos:
stage: build-protos
image: docker
before_script:
- apk update; apk add make
script:
- make -C src/protos go_protos
artifacts:
paths:
- src/protos/go_protos
expire_in: 0.5 days
build-python-protos:
stage: build-protos
image: docker
before_script:
- apk update; apk add make
script:
- make -C src/protos python_protos
artifacts:
paths:
- src/protos/python_protos
expire_in: 0.5 days
# --------
operator-unit-test:
stage: unit-test
image: golang:buster
script:
- make -C src/steward protos
- make -C src/steward unit_test
dependencies:
- build-go-protos
logserver-unit-test:
stage: unit-test
image: python
script:
- cp src/logserver/Makefile src/
- make -C src/ unit_test
# --------
build-operator:
stage: build
image: docker
before_script:
- apk update; apk add make
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- make -C src/steward
after_script:
- docker tag harmonia/operator $CI_REGISTRY_IMAGE/operator:$CI_COMMIT_REF_SLUG
- docker push $CI_REGISTRY_IMAGE/operator:$CI_COMMIT_REF_SLUG
dependencies:
- build-go-protos
build-fedavg:
stage: build
image: docker
before_script:
- apk update; apk add make
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $CI_REGISTRY_IMAGE/pytorch/pytorch
- docker tag $CI_REGISTRY_IMAGE/pytorch/pytorch pytorch/pytorch
script:
- make -C src/fedavg
after_script:
- docker tag harmonia/fedavg $CI_REGISTRY_IMAGE/fedavg:$CI_COMMIT_REF_SLUG
- docker push $CI_REGISTRY_IMAGE/fedavg:$CI_COMMIT_REF_SLUG
dependencies:
- build-python-protos
build-logserver:
stage: build
image: docker
before_script:
- apk update; apk add make
script:
- make -C src/logserver
after_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker tag harmonia/logserver $CI_REGISTRY_IMAGE/logserver:$CI_COMMIT_REF_SLUG
- docker push $CI_REGISTRY_IMAGE/logserver:$CI_COMMIT_REF_SLUG
# --------
# Dockerfile of image `docker-compose`
#######
# FROM docker
# RUN apk add --no-cache py3-pip python3-dev libffi-dev openssl-dev curl gcc libc-dev make && \
# pip3 install docker-compose
#######
integration-test:
stage: integration-test
image: $CI_REGISTRY_IMAGE/docker-compose
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $CI_REGISTRY_IMAGE/operator:$CI_COMMIT_REF_SLUG
- docker tag $CI_REGISTRY_IMAGE/operator:$CI_COMMIT_REF_SLUG harmonia/operator
- docker pull $CI_REGISTRY_IMAGE/fedavg:$CI_COMMIT_REF_SLUG
- docker tag $CI_REGISTRY_IMAGE/fedavg:$CI_COMMIT_REF_SLUG harmonia/fedavg
script:
- make -C test/integration-test test
dependencies:
- build-fedavg
- build-operator
fedavg-test:
stage: integration-test
image: $CI_REGISTRY_IMAGE/docker-compose
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $CI_REGISTRY_IMAGE/fedavg:$CI_COMMIT_REF_SLUG
- docker tag $CI_REGISTRY_IMAGE/fedavg:$CI_COMMIT_REF_SLUG harmonia/fedavg
script:
- make -C test/fedavg test
after_script:
- make -C test/fedavg clean
dependencies:
- build-fedavg