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/*
53 api/generated/apache2_vhost \
54 api/generated/config_databases.sh \
55 api/generated/database.yml \
56 api/generated/omniauth.rb \
57 api/generated/application.yml \
58 api/generated/slurm.conf \
59 api/generated/superuser_token
62 api/apache2_vhost.in \
63 api/config_databases.sh.in \
66 api/application.yml.in \
68 api/superuser_token.in
71 slurm/generated/slurm.conf
73 SLURM_GENERATED_IN = \
76 WORKBENCH_GENERATED = \
77 workbench/generated/apache2_vhost \
78 workbench/generated/application.yml
80 WORKBENCH_GENERATED_IN = \
81 workbench/apache2_vhost.in \
82 workbench/application.yml.in
85 sso/generated/apache2_vhost \
86 sso/generated/seeds.rb \
87 sso/generated/secret_token.rb
90 sso/apache2_vhost.in \
92 sso/secret_token.rb.in
96 rsync -rlp --exclude=docker/ --exclude='**/log/*' --exclude='**/tmp/*' \
97 --chmod=Da+rx,Fa+rX ../ build/
98 find build/ -name \*.gem -delete
99 cd build/services/fuse/ && python setup.py build
100 cd build/sdk/python/ && python setup.py build
101 cd build/sdk/cli && gem build arvados-cli.gemspec
102 cd build/sdk/ruby && gem build arvados.gemspec
103 touch build/.buildstamp
105 $(SLURM_GENERATED): config.yml $(BUILD)
107 mkdir -p slurm/generated
109 $(BASE_GENERATED): config.yml $(BUILD)
111 mkdir -p base/generated
112 tar -czf base/generated/arvados.tar.gz -C build .
114 $(API_GENERATED): config.yml $(API_GENERATED_IN)
117 $(WORKBENCH_GENERATED): config.yml $(WORKBENCH_GENERATED_IN)
120 $(WAREHOUSE_GENERATED): config.yml $(WAREHOUSE_GENERATED_IN)
123 $(SSO_GENERATED): config.yml $(SSO_GENERATED_IN)
126 # The docker build -q option suppresses verbose build output.
127 # Necessary to prevent failure on building warehouse; see
128 # https://github.com/dotcloud/docker/issues/3172
129 DOCKER_BUILD = $(DOCKER) build -q --rm=true
131 # ============================================================
132 # The main Arvados servers: api, doc, workbench, warehouse
134 api-image: passenger-image $(BUILD) $(API_DEPS)
135 mkdir -p api/generated
136 tar -czf api/generated/api.tar.gz -C build/services api
137 $(DOCKER_BUILD) -t arvados/api api
140 slurm-image: base-image $(SLURM_DEPS)
142 compute-image: slurm-image $(BUILD) $(COMPUTE_DEPS)
143 $(DOCKER_BUILD) -t arvados/compute compute
146 doc-image: base-image $(BUILD) $(DOC_DEPS)
147 mkdir -p doc/generated
148 tar -czf doc/generated/doc.tar.gz -C build doc
149 $(DOCKER_BUILD) -t arvados/doc doc
152 keep-image: debian-image $(BUILD) $(KEEP_DEPS)
153 $(DOCKER_BUILD) -t arvados/keep keep
156 jobs-image: base-image $(BUILD) $(JOBS_DEPS)
157 $(DOCKER_BUILD) -t arvados/jobs jobs
160 java-bwa-samtools-image: jobs-image $(BUILD) $(JAVA_BWA_SAMTOOLS_DEPS)
161 $(DOCKER_BUILD) -t arvados/jobs-java-bwa-samtools java-bwa-samtools
162 date >java-bwa-samtools-image
164 bcbio-nextgen-image: $(BUILD) $(BASE_GENERATED) $(BCBIO_NEXTGEN_DEPS)
165 rm -rf bcbio-nextgen/generated
166 cp -r base/generated bcbio-nextgen
167 $(DOCKER_BUILD) -t arvados/bcbio-nextgen bcbio-nextgen
168 date >bcbio-nextgen-image
170 workbench-image: passenger-image $(BUILD) $(WORKBENCH_DEPS)
171 mkdir -p workbench/generated
172 tar -czf workbench/generated/workbench.tar.gz -C build/apps workbench
173 $(DOCKER_BUILD) -t arvados/workbench workbench
174 date >workbench-image
176 warehouse-image: base-image $(WAREHOUSE_DEPS)
177 $(DOCKER_BUILD) -t arvados/warehouse warehouse
178 date >warehouse-image
180 sso-image: passenger-image $(SSO_DEPS)
181 $(DOCKER_BUILD) -t arvados/sso sso
184 # ============================================================
185 # The arvados/base image is the base Debian image plus packages
186 # that are dependencies for every Arvados service.
188 passenger-image: base-image
189 $(DOCKER_BUILD) -t arvados/passenger passenger
190 date >passenger-image
192 slurm-image: base-image $(SLURM_DEPS)
193 $(DOCKER_BUILD) -t arvados/slurm slurm
196 base-image: debian-image $(BASE_DEPS)
197 $(DOCKER_BUILD) -t arvados/base base
201 ./mkimage-debootstrap.sh arvados/debian wheezy ftp://ftp.us.debian.org/debian/