1
1
.DEFAULT_GOAL := default
2
2
3
+ include config.mk
4
+
5
+ SERVICES := auth batch ci memory notebook monitoring website
6
+ SERVICES_IMAGES := $(patsubst % , % -image, $(SERVICES ) )
7
+ SERVICES_MODULES := $(SERVICES ) gear web_common
8
+ CHECK_SERVICES_MODULES := $(patsubst % , check-% , $(SERVICES_MODULES ) )
9
+
10
+ HAILTOP_VERSION := hail/python/hailtop/hail_version
11
+ SERVICES_IMAGE_DEPS = hail-ubuntu-image $(HAILTOP_VERSION ) $(shell git ls-files hail/python/hailtop gear web_common)
12
+
13
+ EMPTY :=
14
+ SPACE := $(EMPTY ) $(EMPTY )
15
+ EXTRA_PYTHONPATH := hail/python:$(subst $(SPACE ) ,:,$(SERVICES_MODULES ) )
16
+
17
+ PYTHONPATH ?= ""
18
+ ifeq ($(PYTHONPATH ) , "")
19
+ PYTHONPATH := $(EXTRA_PYTHONPATH )
20
+ else
21
+ PYTHONPATH := $(PYTHONPATH ) :$(EXTRA_PYTHONPATH )
22
+ endif
23
+ PYTHON := PYTHONPATH="$(PYTHONPATH ) " python3
24
+
3
25
default :
4
26
@echo Do not use this makefile to build hail, for information on how to \
5
27
build hail see: https://hail.is/docs/0.2/
@@ -13,43 +35,17 @@ check-hail:
13
35
$(MAKE ) -C hail/python check
14
36
15
37
.PHONY : check-services
16
- check-services : check-auth check-batch check-ci check-gear check-memory \
17
- check-notebook check-monitoring check-web-common check-website
18
-
19
- .PHONY : check-auth
20
- check-auth :
21
- $(MAKE ) -C auth check
22
-
23
- .PHONY : check-batch
24
- check-batch :
25
- $(MAKE ) -C batch check
26
-
27
- .PHONY : check-ci
28
- check-ci :
29
- $(MAKE ) -C ci check
30
-
31
- .PHONY : check-gear
32
- check-gear :
33
- $(MAKE ) -C gear check
34
-
35
- .PHONY : check-memory
36
- check-memory :
37
- $(MAKE ) -C memory check
38
-
39
- .PHONY : check-notebook
40
- check-notebook :
41
- $(MAKE ) -C notebook check
42
-
43
- .PHONY : check-monitoring
44
- $(MAKE ) -C monitoring check
45
-
46
- .PHONY : check-web-common
47
- check-web-common :
48
- $(MAKE ) -C web_common check
49
-
50
- .PHONY : check-website
51
- check-website :
52
- $(MAKE ) -C website check
38
+ check-services : $(CHECK_SERVICES_MODULES )
39
+
40
+ .PHONY : check-%
41
+ $(CHECK_SERVICES_MODULES ) : check-% :
42
+ $(PYTHON ) -m flake8 --config setup.cfg $*
43
+ $(PYTHON ) -m pylint --rcfile pylintrc --recursive=y $* --score=n
44
+ $(PYTHON ) -m mypy --config-file setup.cfg $*
45
+ $(PYTHON ) -m isort $* --check-only --diff
46
+ $(PYTHON ) -m black $* --line-length=120 --skip-string-normalization --check --diff
47
+ curlylint $*
48
+ cd $* && bash ../check-sql.sh
53
49
54
50
.PHONY : check-pip-requirements
55
51
check-pip-requirements :
@@ -113,3 +109,71 @@ generate-pip-lockfiles: auth/pinned-requirements.txt
113
109
generate-pip-lockfiles : batch/pinned-requirements.txt
114
110
generate-pip-lockfiles : ci/pinned-requirements.txt
115
111
generate-pip-lockfiles : memory/pinned-requirements.txt
112
+
113
+ $(HAILTOP_VERSION ) :
114
+ $(MAKE ) -C hail python/hailtop/hail_version
115
+
116
+ hail-ubuntu-image : $(shell git ls-files docker/hail-ubuntu)
117
+ $(eval HAIL_UBUNTU_IMAGE := $(DOCKER_PREFIX ) /hail-ubuntu:$(TOKEN ) )
118
+ python3 ci/jinja2_render.py ' {"global":{"docker_prefix":"$(DOCKER_PREFIX)"}}' docker/hail-ubuntu/Dockerfile docker/hail-ubuntu/Dockerfile.out
119
+ ./docker-build.sh docker/hail-ubuntu Dockerfile.out $(HAIL_UBUNTU_IMAGE )
120
+ echo $(HAIL_UBUNTU_IMAGE ) > $@
121
+
122
+ base-image : hail-ubuntu-image docker/Dockerfile.base
123
+ $(eval BASE_IMAGE := $(DOCKER_PREFIX ) /base:$(TOKEN ) )
124
+ python3 ci/jinja2_render.py ' {"hail_ubuntu_image":{"image":"' $$(cat hail-ubuntu-image ) ' "}}' docker/Dockerfile.base docker/Dockerfile.base.out
125
+ ./docker-build.sh . docker/Dockerfile.base.out $(BASE_IMAGE )
126
+ echo $(BASE_IMAGE ) > $@
127
+
128
+ private-repo-hailgenetics-hail-image : hail-ubuntu-image docker/hailgenetics/hail/Dockerfile $(shell git ls-files hail/src/main hail/python)
129
+ $(eval PRIVATE_REPO_HAILGENETICS_HAIL_IMAGE := $(DOCKER_PREFIX ) /hailgenetics/hail:$(TOKEN ) )
130
+ $(MAKE ) -C hail wheel
131
+ tar -cvf wheel-container.tar \
132
+ -C hail/build/deploy/dist \
133
+ hail-$$(cat hail/python/hail/hail_pip_version ) -py3-none-any.whl
134
+ python3 ci/jinja2_render.py ' {"hail_ubuntu_image":{"image":"' $$(cat hail-ubuntu-image ) ' "}}' docker/hailgenetics/hail/Dockerfile docker/hailgenetics/hail/Dockerfile.out
135
+ ./docker-build.sh . docker/hailgenetics/hail/Dockerfile.out $(PRIVATE_REPO_HAILGENETICS_HAIL_IMAGE )
136
+ rm wheel-container.tar
137
+ echo $(PRIVATE_REPO_HAILGENETICS_HAIL_IMAGE ) > $@
138
+
139
+ .PHONY : docs
140
+ docs :
141
+ $(MAKE ) -C hail hail-docs-no-test batch-docs
142
+ gcloud storage cp gs://hail-common/builds/0.1/docs/hail-0.1-docs-5a6778710097.tar.gz .
143
+ mkdir -p hail/build/www/docs/0.1
144
+ tar -xvf hail-0.1-docs-5a6778710097.tar.gz -C hail/build/www/docs/0.1 --strip-components 2
145
+ rm hail-0.1-docs-5a6778710097.tar.gz
146
+ tar czf docs.tar.gz -C hail/build/www .
147
+
148
+ website-image : docs
149
+
150
+ $(SERVICES_IMAGES ) : % -image: $(SERVICES_IMAGE_DEPS ) $(shell git ls-files $$* )
151
+ $(eval IMAGE := $(DOCKER_PREFIX ) /$* :$(TOKEN ) )
152
+ python3 ci/jinja2_render.py ' {"hail_ubuntu_image":{"image":"' $$(cat hail-ubuntu-image ) ' "}}' $* /Dockerfile $* /Dockerfile.out
153
+ ./docker-build.sh . $* /Dockerfile.out $(IMAGE )
154
+ echo $(IMAGE ) > $@
155
+
156
+ ci-utils-image : hail-ubuntu-image $(SERVICES_IMAGE_DEPS ) $(shell git ls-files ci)
157
+ $(eval CI_UTILS_IMAGE := $(DOCKER_PREFIX ) /ci-utils:$(TOKEN ) )
158
+ python3 ci/jinja2_render.py ' {"hail_ubuntu_image":{"image":"' $$(cat hail-ubuntu-image ) ' "}}' ci/Dockerfile.ci-utils ci/Dockerfile.ci-utils.out
159
+ ./docker-build.sh . ci/Dockerfile.ci-utils.out $(CI_UTILS_IMAGE )
160
+ echo $(CI_UTILS_IMAGE ) > $@
161
+
162
+ hail-buildkit-image : ci/buildkit/Dockerfile
163
+ $(eval HAIL_BUILDKIT_IMAGE := $(DOCKER_PREFIX ) /hail-buildkit:$(TOKEN ) )
164
+ python3 ci/jinja2_render.py ' {"global":{"docker_prefix":"$(DOCKER_PREFIX)"}}' ci/buildkit/Dockerfile ci/buildkit/Dockerfile.out
165
+ ./docker-build.sh ci buildkit/Dockerfile.out $(HAIL_BUILDKIT_IMAGE )
166
+ echo $(HAIL_BUILDKIT_IMAGE ) > $@
167
+
168
+ batch/jars/junixsocket-selftest-2.3.3-jar-with-dependencies.jar :
169
+ mkdir -p batch/jars
170
+ cd batch/jars && curl -LO https://github.com/kohlschutter/junixsocket/releases/download/junixsocket-parent-2.3.3/junixsocket-selftest-2.3.3-jar-with-dependencies.jar
171
+
172
+ batch/src/main/java/is/hail/JVMEntryway.class : batch/src/main/java/is/hail/JVMEntryway.java batch/jars/junixsocket-selftest-2.3.3-jar-with-dependencies.jar
173
+ javac -cp batch/jars/junixsocket-selftest-2.3.3-jar-with-dependencies.jar $<
174
+
175
+ batch-worker-image : batch/src/main/java/is/hail/JVMEntryway.class $(SERVICES_IMAGE_DEPS ) $(shell git ls-files batch)
176
+ $(eval BATCH_WORKER_IMAGE := $(DOCKER_PREFIX ) /batch-worker:$(TOKEN ) )
177
+ python3 ci/jinja2_render.py ' {"hail_ubuntu_image":{"image":"' $$(cat hail-ubuntu-image ) ' "},"global":{"cloud":"$(CLOUD)"}}' batch/Dockerfile.worker batch/Dockerfile.worker.out
178
+ ./docker-build.sh . batch/Dockerfile.worker.out $(BATCH_WORKER_IMAGE )
179
+ echo $(BATCH_WORKER_IMAGE ) > $@
0 commit comments