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/sdk/python/ && ./build.sh
93 cd build/sdk/cli && gem build arvados-cli.gemspec
94 cd build/sdk/ruby && gem build arvados.gemspec
95 touch build/.buildstamp
97 $(BASE_GENERATED): config.yml $(BUILD)
99 mkdir -p base/generated
100 tar -czf base/generated/arvados.tar.gz -C build .
102 $(API_GENERATED): config.yml $(API_GENERATED_IN)
105 $(WORKBENCH_GENERATED): config.yml $(WORKBENCH_GENERATED_IN)
108 $(WAREHOUSE_GENERATED): config.yml $(WAREHOUSE_GENERATED_IN)
111 $(SSO_GENERATED): config.yml $(SSO_GENERATED_IN)
114 # The docker build -q option suppresses verbose build output.
115 # Necessary to prevent failure on building warehouse; see
116 # https://github.com/dotcloud/docker/issues/3172
117 DOCKER_BUILD = docker build -q
119 # ============================================================
120 # The main Arvados servers: api, doc, workbench, warehouse
122 api-image: passenger-image $(BUILD) $(API_DEPS)
123 mkdir -p api/generated
124 tar -czf api/generated/api.tar.gz -C build/services api
125 $(DOCKER_BUILD) -t arvados/api api
128 doc-image: base-image $(BUILD) $(DOC_DEPS)
129 mkdir -p doc/generated
130 tar -czf doc/generated/doc.tar.gz -C build doc
131 $(DOCKER_BUILD) -t arvados/doc doc
134 jobs-image: base-image $(BUILD) $(JOBS_DEPS)
135 $(DOCKER_BUILD) -t arvados/jobs jobs
138 workbench-image: passenger-image $(BUILD) $(WORKBENCH_DEPS)
139 mkdir -p workbench/generated
140 tar -czf workbench/generated/workbench.tar.gz -C build/apps workbench
141 $(DOCKER_BUILD) -t arvados/workbench workbench
142 date >workbench-image
144 warehouse-image: base-image $(WAREHOUSE_DEPS)
145 $(DOCKER_BUILD) -t arvados/warehouse warehouse
146 date >warehouse-image
148 sso-image: passenger-image $(SSO_DEPS)
149 $(DOCKER_BUILD) -t arvados/sso sso
152 # ============================================================
153 # The arvados/base image is the base Debian image plus packages
154 # that are dependencies for every Arvados service.
156 passenger-image: base-image
157 $(DOCKER_BUILD) -t arvados/passenger passenger
158 date >passenger-image
160 base-image: debian-image $(BASE_DEPS)
161 $(DOCKER_BUILD) -t arvados/base base
165 ./mkimage-debootstrap.sh arvados/debian wheezy ftp://ftp.us.debian.org/debian/