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,46 +35,145 @@ 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
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
49
+
50
+ .PHONY : check-pip-requirements
51
+ check-pip-requirements :
52
+ ./check_pip_requirements.sh \
53
+ hail/python/hailtop \
54
+ hail/python \
55
+ hail/python/dev \
56
+ gear \
57
+ web_common \
58
+ auth \
59
+ batch \
60
+ ci \
61
+ memory
62
+
63
+ .PHONY : install-dev-requirements
64
+ install-dev-requirements :
65
+ python3 -m pip install \
66
+ -r hail/python/pinned-requirements.txt \
67
+ -r hail/python/dev/pinned-requirements.txt \
68
+ -r gear/pinned-requirements.txt \
69
+ -r web_common/pinned-requirements.txt \
70
+ -r auth/pinned-requirements.txt \
71
+ -r batch/pinned-requirements.txt \
72
+ -r ci/pinned-requirements.txt \
73
+ -r memory/pinned-requirements.txt \
74
+
75
+ hail/python/hailtop/pinned-requirements.txt : hail/python/hailtop/requirements.txt
76
+ ./generate-linux-pip-lockfile.sh hail/python/hailtop
77
+
78
+ hail/python/pinned-requirements.txt : hail/python/requirements.txt hail/python/hailtop/pinned-requirements.txt
79
+ ./generate-linux-pip-lockfile.sh hail/python
80
+
81
+ hail/python/dev/pinned-requirements.txt : hail/python/dev/requirements.txt hail/python/pinned-requirements.txt
82
+ ./generate-linux-pip-lockfile.sh hail/python/dev
83
+
84
+ gear/pinned-requirements.txt : hail/python/hailtop/pinned-requirements.txt gear/requirements.txt
85
+ ./generate-linux-pip-lockfile.sh gear
86
+
87
+ web_common/pinned-requirements.txt : gear/pinned-requirements.txt web_common/requirements.txt
88
+ ./generate-linux-pip-lockfile.sh web_common
89
+
90
+ auth/pinned-requirements.txt : web_common/pinned-requirements.txt auth/requirements.txt
91
+ ./generate-linux-pip-lockfile.sh auth
92
+
93
+ batch/pinned-requirements.txt : web_common/pinned-requirements.txt batch/requirements.txt
94
+ ./generate-linux-pip-lockfile.sh batch
95
+
96
+ ci/pinned-requirements.txt : web_common/pinned-requirements.txt ci/requirements.txt
97
+ ./generate-linux-pip-lockfile.sh ci
98
+
99
+ memory/pinned-requirements.txt : gear/pinned-requirements.txt memory/requirements.txt
100
+ ./generate-linux-pip-lockfile.sh memory
101
+
102
+ .PHONY : generate-pip-lockfiles
103
+ generate-pip-lockfiles : hail/python/hailtop/pinned-requirements.txt
104
+ generate-pip-lockfiles : hail/python/pinned-requirements.txt
105
+ generate-pip-lockfiles : hail/python/dev/pinned-requirements.txt
106
+ generate-pip-lockfiles : gear/pinned-requirements.txt
107
+ generate-pip-lockfiles : web_common/pinned-requirements.txt
108
+ generate-pip-lockfiles : auth/pinned-requirements.txt
109
+ generate-pip-lockfiles : batch/pinned-requirements.txt
110
+ generate-pip-lockfiles : ci/pinned-requirements.txt
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 ) > $@
18
121
19
- .PHONY : check-auth
20
- check-auth :
21
- $(MAKE ) -C auth check
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 ) > $@
22
127
23
- .PHONY : check-batch
24
- check-batch :
25
- $(MAKE ) -C batch check
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 ) > $@
26
138
27
- .PHONY : check-ci
28
- check-ci :
29
- $(MAKE ) -C ci check
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 .
30
147
31
- .PHONY : check-gear
32
- check-gear :
33
- $(MAKE ) -C gear check
148
+ website-image : docs
34
149
35
- .PHONY : check-memory
36
- check-memory :
37
- $(MAKE ) -C memory check
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 ) > $@
38
155
39
- .PHONY : check-notebook
40
- check-notebook :
41
- $(MAKE ) -C notebook check
156
+ ci-utils-image : base-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 ' {"base_image":{"image":"' $$(cat base-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 ) > $@
42
161
43
- .PHONY : check-monitoring
44
- $(MAKE ) -C monitoring check
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 ) > $@
45
167
46
- .PHONY : check-web-common
47
- check-web-common :
48
- $( MAKE ) -C web_common check
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
49
171
50
- .PHONY : check-website
51
- check-website :
52
- $(MAKE ) -C website check
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 $<
53
174
54
- .PHONY : check-pip-dependencies
55
- check-pip-dependencies :
56
- ./check_pip_requirements.sh hail/python/requirements.txt hail/python/pinned-requirements.txt
57
- ./check_pip_requirements .sh hail/python/dev/requirements.txt hail/python/dev/pinned-requirements.txt
58
- ./check_pip_requirements.sh docker/requirements.txt docker/linux-pinned-requirements.txt
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