1 all: api-image doc-image workbench-image warehouse-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 -q`
15 -docker rmi `docker images -q`
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 JOBS_DEPS = jobs/Dockerfile
29 API_DEPS = api/Dockerfile $(API_GENERATED)
31 DOC_DEPS = doc/Dockerfile doc/apache2_vhost
33 WORKBENCH_DEPS = workbench/Dockerfile \
34 workbench/passenger.conf \
35 $(WORKBENCH_GENERATED)
37 WAREHOUSE_DEPS = warehouse/Dockerfile \
38 warehouse/supervisor.conf \
39 $(WAREHOUSE_GENERATED)
41 SSO_DEPS = sso/passenger.conf $(SSO_GENERATED)
43 BASE_GENERATED = base/generated/arvados.tar.gz
46 api/generated/apache2_vhost \
47 api/generated/config_databases.sh \
48 api/generated/database.yml \
49 api/generated/omniauth.rb \
50 api/generated/production.rb \
51 api/generated/secret_token.rb \
52 api/generated/superuser_token
55 api/apache2_vhost.in \
56 api/config_databases.sh.in \
59 api/production.rb.in \
60 api/secret_token.rb.in \
61 api/superuser_token.in
63 WORKBENCH_GENERATED = \
64 workbench/generated/apache2_vhost \
65 workbench/generated/production.rb \
66 workbench/generated/secret_token.rb
68 WORKBENCH_GENERATED_IN = \
69 workbench/apache2_vhost.in \
70 workbench/production.rb.in \
71 workbench/secret_token.rb.in
73 WAREHOUSE_GENERATED = warehouse/generated/warehouse.conf
75 WAREHOUSE_GENERATED_IN = warehouse/warehouse.conf.in
78 sso/generated/apache2_vhost \
79 sso/generated/seeds.rb \
80 sso/generated/secret_token.rb
83 sso/apache2_vhost.in \
85 sso/secret_token.rb.in
89 rsync -rlp --exclude=docker/ --exclude='**/log/*' --exclude='**/tmp/*' \
90 --chmod=Da+rx,Fa+rX ../ build/
91 find build/ -name \*.gem -delete
92 cd build/services/fuse/ && python setup.py build
93 cd build/sdk/python/ && python setup.py build
94 cd build/sdk/cli && gem build arvados-cli.gemspec
95 cd build/sdk/ruby && gem build arvados.gemspec
96 touch build/.buildstamp
98 $(BASE_GENERATED): config.yml $(BUILD)
100 mkdir -p base/generated
101 tar -czf base/generated/arvados.tar.gz -C build .
103 $(API_GENERATED): config.yml $(API_GENERATED_IN)
106 $(WORKBENCH_GENERATED): config.yml $(WORKBENCH_GENERATED_IN)
109 $(WAREHOUSE_GENERATED): config.yml $(WAREHOUSE_GENERATED_IN)
112 $(SSO_GENERATED): config.yml $(SSO_GENERATED_IN)
115 # The docker build -q option suppresses verbose build output.
116 # Necessary to prevent failure on building warehouse; see
117 # https://github.com/dotcloud/docker/issues/3172
118 DOCKER_BUILD = docker build -q
120 # ============================================================
121 # The main Arvados servers: api, doc, workbench, warehouse
123 api-image: passenger-image $(BUILD) $(API_DEPS)
124 mkdir -p api/generated
125 tar -czf api/generated/api.tar.gz -C build/services api
126 $(DOCKER_BUILD) -t arvados/api api
129 doc-image: base-image $(BUILD) $(DOC_DEPS)
130 mkdir -p doc/generated
131 tar -czf doc/generated/doc.tar.gz -C build doc
132 $(DOCKER_BUILD) -t arvados/doc doc
135 jobs-image: base-image $(BUILD) $(JOBS_DEPS)
136 $(DOCKER_BUILD) -t arvados/jobs jobs
139 workbench-image: passenger-image $(BUILD) $(WORKBENCH_DEPS)
140 mkdir -p workbench/generated
141 tar -czf workbench/generated/workbench.tar.gz -C build/apps workbench
142 $(DOCKER_BUILD) -t arvados/workbench workbench
143 date >workbench-image
145 warehouse-image: base-image $(WAREHOUSE_DEPS)
146 $(DOCKER_BUILD) -t arvados/warehouse warehouse
147 date >warehouse-image
149 sso-image: passenger-image $(SSO_DEPS)
150 $(DOCKER_BUILD) -t arvados/sso sso
153 # ============================================================
154 # The arvados/base image is the base Debian image plus packages
155 # that are dependencies for every Arvados service.
157 passenger-image: base-image
158 $(DOCKER_BUILD) -t arvados/passenger passenger
159 date >passenger-image
161 base-image: debian-image $(BASE_DEPS)
162 $(DOCKER_BUILD) -t arvados/base base
166 ./mkimage-debootstrap.sh arvados/debian wheezy ftp://ftp.us.debian.org/debian/