1 all: api-image compute-image doc-image workbench-image keep-image sso-image
3 # `make clean' removes the files generated in the build directory
4 # but does not remove any docker images generated in previous builds
7 -rm *-image */generated/*
10 # `make realclean' will also remove the docker images and force
11 # subsequent makes to build the entire chain from the ground up
13 -[ -n "`$(DOCKER) ps -q`" ] && $(DOCKER) stop `$(DOCKER) ps -q`
14 -$(DOCKER) rm `$(DOCKER) ps -a |grep -e arvados -e api_server -e keep_server -e doc_server -e workbench_server |cut -f 1 -d' '`
15 -$(DOCKER) rmi `$(DOCKER) images -q arvados/*`
17 # ============================================================
18 # Dependencies for */generated files which are prerequisites
19 # for building docker images.
21 CONFIG_RB = build_tools/config.rb
23 BUILD = build/.buildstamp
25 BASE_DEPS = base/Dockerfile $(BASE_GENERATED)
27 SLURM_DEPS = slurm/Dockerfile $(SLURM_GENERATED)
29 JOBS_DEPS = jobs/Dockerfile
31 JAVA_BWA_SAMTOOLS_DEPS = java-bwa-samtools/Dockerfile
33 API_DEPS = api/* $(API_GENERATED)
35 COMPUTE_DEPS = compute/* $(COMPUTE_GENERATED)
37 DOC_DEPS = doc/Dockerfile doc/apache2_vhost
39 WORKBENCH_DEPS = workbench/Dockerfile \
40 $(WORKBENCH_GENERATED)
42 KEEP_DEPS = keep/Dockerfile
44 SSO_DEPS = $(SSO_GENERATED)
46 BCBIO_NEXTGEN_DEPS = bcbio-nextgen/Dockerfile
48 BASE_GENERATED = base/generated/arvados.tar.gz
50 SLURM_GENERATED = slurm/generated/*
52 COMPUTE_GENERATED = compute/generated/setup.sh
54 COMPUTE_GENERATED_IN = compute/setup.sh.in
57 api/generated/apache2_vhost \
58 api/generated/config_databases.sh \
59 api/generated/database.yml \
60 api/generated/omniauth.rb \
61 api/generated/application.yml \
62 api/generated/setup.sh \
63 api/generated/slurm.conf \
64 api/generated/superuser_token
67 api/apache2_vhost.in \
68 api/config_databases.sh.in \
71 api/application.yml.in \
74 api/superuser_token.in
77 slurm/generated/slurm.conf
79 SLURM_GENERATED_IN = \
82 WORKBENCH_GENERATED = \
83 workbench/generated/apache2_vhost \
84 workbench/generated/application.yml
86 WORKBENCH_GENERATED_IN = \
87 workbench/apache2_vhost.in \
88 workbench/application.yml.in
91 sso/generated/apache2_vhost \
92 sso/generated/seeds.rb \
93 sso/generated/secret_token.rb
96 sso/apache2_vhost.in \
98 sso/secret_token.rb.in
102 rsync -rlp --exclude=docker/ --exclude='**/log/*' --exclude='**/tmp/*' \
103 --chmod=Da+rx,Fa+rX ../ build/
104 find build/ -name \*.gem -delete
105 cd build/services/fuse/ && python setup.py build
106 cd build/sdk/python/ && python setup.py build
107 cd build/sdk/cli && gem build arvados-cli.gemspec
108 cd build/sdk/ruby && gem build arvados.gemspec
109 touch build/.buildstamp
111 $(SLURM_GENERATED): config.yml $(BUILD)
113 mkdir -p slurm/generated
115 $(BASE_GENERATED): config.yml $(BUILD)
117 mkdir -p base/generated
118 tar -czf base/generated/arvados.tar.gz -C build .
120 $(API_GENERATED): config.yml $(API_GENERATED_IN)
123 $(WORKBENCH_GENERATED): config.yml $(WORKBENCH_GENERATED_IN)
126 $(COMPUTE_GENERATED): config.yml $(COMPUTE_GENERATED_IN)
128 $(WAREHOUSE_GENERATED): config.yml $(WAREHOUSE_GENERATED_IN)
131 $(SSO_GENERATED): config.yml $(SSO_GENERATED_IN)
134 # The docker build -q option suppresses verbose build output.
135 # Necessary to prevent failure on building warehouse; see
136 # https://github.com/dotcloud/docker/issues/3172
137 DOCKER_BUILD = $(DOCKER) build -q --rm=true
139 # ============================================================
140 # The main Arvados servers: api, doc, workbench, warehouse
142 api-image: passenger-image $(BUILD) $(API_DEPS)
143 mkdir -p api/generated
144 tar -czf api/generated/api.tar.gz -C build/services api
145 chmod 755 api/generated/setup.sh
146 $(DOCKER_BUILD) -t arvados/api api
149 slurm-image: base-image $(SLURM_DEPS)
151 compute-image: slurm-image $(BUILD) $(COMPUTE_DEPS)
152 chmod 755 compute/generated/setup.sh
153 $(DOCKER_BUILD) -t arvados/compute compute
156 doc-image: base-image $(BUILD) $(DOC_DEPS)
157 mkdir -p doc/generated
158 tar -czf doc/generated/doc.tar.gz -C build doc
159 $(DOCKER_BUILD) -t arvados/doc doc
162 keep-image: debian-image $(BUILD) $(KEEP_DEPS)
163 $(DOCKER_BUILD) -t arvados/keep keep
166 jobs-image: base-image $(BUILD) $(JOBS_DEPS)
167 $(DOCKER_BUILD) -t arvados/jobs jobs
170 java-bwa-samtools-image: jobs-image $(BUILD) $(JAVA_BWA_SAMTOOLS_DEPS)
171 $(DOCKER_BUILD) -t arvados/jobs-java-bwa-samtools java-bwa-samtools
172 date >java-bwa-samtools-image
174 bcbio-nextgen-image: $(BUILD) $(BASE_GENERATED) $(BCBIO_NEXTGEN_DEPS)
175 rm -rf bcbio-nextgen/generated
176 cp -r base/generated bcbio-nextgen
177 $(DOCKER_BUILD) -t arvados/bcbio-nextgen bcbio-nextgen
178 date >bcbio-nextgen-image
180 workbench-image: passenger-image $(BUILD) $(WORKBENCH_DEPS)
181 mkdir -p workbench/generated
182 tar -czf workbench/generated/workbench.tar.gz -C build/apps workbench
183 $(DOCKER_BUILD) -t arvados/workbench workbench
184 date >workbench-image
186 warehouse-image: base-image $(WAREHOUSE_DEPS)
187 $(DOCKER_BUILD) -t arvados/warehouse warehouse
188 date >warehouse-image
190 sso-image: passenger-image $(SSO_DEPS)
191 $(DOCKER_BUILD) -t arvados/sso sso
194 # ============================================================
195 # The arvados/base image is the base Debian image plus packages
196 # that are dependencies for every Arvados service.
198 passenger-image: base-image
199 $(DOCKER_BUILD) -t arvados/passenger passenger
200 date >passenger-image
202 slurm-image: base-image $(SLURM_DEPS)
203 $(DOCKER_BUILD) -t arvados/slurm slurm
206 base-image: debian-image $(BASE_DEPS)
207 $(DOCKER_BUILD) -t arvados/base base
211 ./mkimage-debootstrap.sh arvados/debian wheezy ftp://ftp.us.debian.org/debian/