forked from vantage6/vantage6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
207 lines (185 loc) · 7.23 KB
/
Makefile
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# `make` is expected to be called from the directory that contains
# this Makefile
# docker image tag
TAG ?= cotopaxi
REGISTRY ?= harbor2.vantage6.ai
PLATFORMS ?= linux/arm64,linux/amd64
# infrastructure base image version
BASE ?= 4.0
help:
@echo "Available commands to 'make':"
@echo " set-version : set version (e.g set-version FLAGS=\"--version 2.0.0 --build 0 --spec alpha\")"
@echo " uninstall : uninstall all vantage6 packages"
@echo " install : do a regular install of all vantage6 packages"
@echo " install-dev : do an editable install of all vantage6 packages"
@echo " image : build the node/server docker image"
@echo " base-image : build the infrastructure base image"
@echo " algorithm-base-image : build the algorithm base image"
@echo " support-image : build the supporing images"
@echo " rebuild : rebuild all python packages"
@echo " publish : publish built python packages to pypi.org (BE CAREFUL!)"
@echo " community : notify community FLAGS="--version 99.99.88 --notes 'I should have done more!' --post-notes 'Oh.. Maybe not'""
@echo " test : run all unittests and compute coverage"
@echo " devdocs : run a documentation development server"
@echo ""
@echo "Using "
@echo " tag: ${TAG}"
@echo " registry: ${REGISTRY}"
@echo " base: ${BASE}"
@echo " platforms: ${PLATFORMS}"
set-version:
# --version --build --spec --post
cd tools && ls
cd tools && python update-version.py ${FLAGS}
community:
# make community FLAGS="--version 99.99.88 --notes 'I should have done more!' --post-notes 'Oh.. Maybe not'"
cd tools && python update-discord.py ${FLAGS}
uninstall:
pip uninstall -y vantage6
pip uninstall -y vantage6-client
pip uninstall -y vantage6-algorithm-tools
pip uninstall -y vantage6-common
pip uninstall -y vantage6-node
pip uninstall -y vantage6-server
install:
cd vantage6-common && pip install .
cd vantage6-client && pip install .
cd vantage6-algorithm-tools && pip install .
cd vantage6 && pip install .
cd vantage6-node && pip install .
cd vantage6-server && pip install .
install-dev:
cd vantage6-common && pip install -e .
cd vantage6-client && pip install -e .
cd vantage6-algorithm-tools && pip install -e .
cd vantage6 && pip install -e .[dev]
cd vantage6-node && pip install -e .[dev]
cd vantage6-server && pip install -e .[dev]
base-image:
@echo "Building ${REGISTRY}/infrastructure/infrastructure-base:${TAG}"
@echo "Building ${REGISTRY}/infrastructure/infrastructure-base:latest"
docker buildx build \
--tag ${REGISTRY}/infrastructure/infrastructure-base:${TAG} \
--tag ${REGISTRY}/infrastructure/infrastructure-base:latest \
--platform ${PLATFORMS} \
-f ./docker/infrastructure-base.Dockerfile \
--push .
algorithm-base-image:
@echo "Building ${REGISTRY}/algorithms/algorithm-base:${TAG}"
docker buildx build \
--tag ${REGISTRY}/infrastructure/algorithm-base:${TAG} \
--tag ${REGISTRY}/infrastructure/algorithm-base:latest \
--platform ${PLATFORMS} \
--build-arg TAG=${TAG} \
-f ./docker/algorithm-base.Dockerfile \
--push .
# FIXME FM 17-10-2023: This fails to build for arm64, this is because of
# the r-base image.
algorithm-omop-base-image:
@echo "Building ${REGISTRY}/algorithms/algorithm-ohdsi-base:${TAG}"
docker buildx build \
--tag ${REGISTRY}/infrastructure/algorithm-ohdsi-base:${TAG} \
--tag ${REGISTRY}/infrastructure/algorithm-ohdsi-base:latest \
--build-arg BASE=${BASE} \
--build-arg TAG=${TAG} \
--platform linux/amd64 \
-f ./docker/algorithm-ohdsi-base.Dockerfile \
--push .
support-image:
@echo "Building support images"
@echo "All support images are also tagged with `latest`"
make support-alpine-image
make support-vpn-client-image
make support-vpn-configurator-image
make support-ssh-tunnel-image
make support-squid-image
support-squid-image:
@echo "Building ${REGISTRY}/infrastructure/squid:${TAG}"
docker buildx build \
--tag ${REGISTRY}/infrastructure/squid:${TAG} \
--tag ${REGISTRY}/infrastructure/squid:latest \
--platform ${PLATFORMS} \
-f ./docker/squid.Dockerfile \
--push .
support-alpine-image:
@echo "Building ${REGISTRY}/infrastructure/alpine:${TAG}"
docker buildx build \
--tag ${REGISTRY}/infrastructure/alpine:${TAG} \
--tag ${REGISTRY}/infrastructure/alpine:latest \
--platform ${PLATFORMS} \
-f ./docker/alpine.Dockerfile \
--push .
support-vpn-client-image:
@echo "Building ${REGISTRY}/infrastructure/vpn-client:${TAG}"
docker buildx build \
--tag ${REGISTRY}/infrastructure/vpn-client:${TAG} \
--tag ${REGISTRY}/infrastructure/vpn-client:latest \
--platform ${PLATFORMS} \
-f ./docker/vpn-client.Dockerfile \
--push .
support-vpn-configurator-image:
@echo "Building ${REGISTRY}/infrastructure/vpn-configurator:${TAG}"
docker buildx build \
--tag ${REGISTRY}/infrastructure/vpn-configurator:${TAG} \
--tag ${REGISTRY}/infrastructure/vpn-configurator:latest \
--platform ${PLATFORMS} \
-f ./docker/vpn-configurator.Dockerfile \
--push .
support-ssh-tunnel-image:
@echo "Building ${REGISTRY}/infrastructure/ssh-tunnel:${TAG}"
docker buildx build \
--tag ${REGISTRY}/infrastructure/ssh-tunnel:${TAG} \
--tag ${REGISTRY}/infrastructure/ssh-tunnel:latest \
--platform ${PLATFORMS} \
-f ./docker/ssh-tunnel.Dockerfile \
--push .
image:
@echo "Building ${REGISTRY}/infrastructure/node:${TAG}"
@echo "Building ${REGISTRY}/infrastructure/server:${TAG}"
docker buildx build \
--tag ${REGISTRY}/infrastructure/node:${TAG} \
--tag ${REGISTRY}/infrastructure/server:${TAG} \
--build-arg TAG=${TAG} \
--build-arg BASE=${BASE} \
--platform ${PLATFORMS} \
-f ./docker/node-and-server.Dockerfile \
--push .
rebuild:
@echo "------------------------------------"
@echo " BUILDING PROJECT "
@echo "------------------------------------"
@echo "------------------------------------"
@echo " VANTAGE6 COMMON "
@echo "------------------------------------"
cd vantage6-common && make rebuild
@echo "------------------------------------"
@echo " VANTAGE6 CLIENT "
@echo "------------------------------------"
cd vantage6-client && make rebuild
@echo "------------------------------------"
@echo " VANTAGE6 ALGORITHM TOOLS "
@echo "------------------------------------"
cd vantage6-algorithm-tools && make rebuild
@echo "------------------------------------"
@echo " VANTAGE6 CLI "
@echo "------------------------------------"
cd vantage6 && make rebuild
@echo "------------------------------------"
@echo " VANTAGE6 NODE "
@echo "------------------------------------"
cd vantage6-node && make rebuild
@echo "------------------------------------"
@echo " VANTAGE6 SERVER "
@echo "------------------------------------"
cd vantage6-server && make rebuild
publish:
cd vantage6-common && make publish
cd vantage6-client && make publish
cd vantage6-algorithm-tools && make publish
cd vantage6 && make publish
cd vantage6-node && make publish
cd vantage6-server && make publish
test:
coverage run --source=vantage6 --omit="utest.py","*.html","*.htm","*.txt","*.yml","*.yaml" utest.py
devdocs:
sphinx-autobuild docs docs/_build/html --watch .