1 all: api-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 JOBS_DEPS = jobs/Dockerfile
29 JAVA_BWA_SAMTOOLS_DEPS = java-bwa-samtools/Dockerfile
31 API_DEPS = api/Dockerfile $(API_GENERATED)
33 DOC_DEPS = doc/Dockerfile doc/apache2_vhost
35 WORKBENCH_DEPS = workbench/Dockerfile \
36 $(WORKBENCH_GENERATED)
38 KEEP_DEPS = keep/Dockerfile
40 SSO_DEPS = $(SSO_GENERATED)
42 BCBIO_NEXTGEN_DEPS = bcbio-nextgen/Dockerfile
44 BASE_GENERATED = base/generated/arvados.tar.gz
47 api/generated/apache2_vhost \
48 api/generated/config_databases.sh \
49 api/generated/database.yml \
50 api/generated/omniauth.rb \
51 api/generated/application.yml \
52 api/generated/superuser_token
55 api/apache2_vhost.in \
56 api/config_databases.sh.in \
59 api/application.yml.in \
60 api/superuser_token.in
62 WORKBENCH_GENERATED = \
63 workbench/generated/apache2_vhost \
64 workbench/generated/application.yml
66 WORKBENCH_GENERATED_IN = \
67 workbench/apache2_vhost.in \
68 workbench/application.yml.in
71 sso/generated/apache2_vhost \
72 sso/generated/seeds.rb \
73 sso/generated/secret_token.rb
76 sso/apache2_vhost.in \
78 sso/secret_token.rb.in
82 rsync -rlp --exclude=docker/ --exclude='**/log/*' --exclude='**/tmp/*' \
83 --chmod=Da+rx,Fa+rX ../ build/
84 find build/ -name \*.gem -delete
85 cd build/services/fuse/ && python setup.py build
86 cd build/sdk/python/ && python setup.py build
87 cd build/sdk/cli && gem build arvados-cli.gemspec
88 cd build/sdk/ruby && gem build arvados.gemspec
89 touch build/.buildstamp
91 $(BASE_GENERATED): config.yml $(BUILD)
93 mkdir -p base/generated
94 tar -czf base/generated/arvados.tar.gz -C build .
96 $(API_GENERATED): config.yml $(API_GENERATED_IN)
99 $(WORKBENCH_GENERATED): config.yml $(WORKBENCH_GENERATED_IN)
102 $(WAREHOUSE_GENERATED): config.yml $(WAREHOUSE_GENERATED_IN)
105 $(SSO_GENERATED): config.yml $(SSO_GENERATED_IN)
108 # The docker build -q option suppresses verbose build output.
109 # Necessary to prevent failure on building warehouse; see
110 # https://github.com/dotcloud/docker/issues/3172
111 DOCKER_BUILD = $(DOCKER) build -q --rm=true
113 # ============================================================
114 # The main Arvados servers: api, doc, workbench, warehouse
116 api-image: passenger-image $(BUILD) $(API_DEPS)
117 mkdir -p api/generated
118 tar -czf api/generated/api.tar.gz -C build/services api
119 $(DOCKER_BUILD) -t arvados/api api
122 doc-image: base-image $(BUILD) $(DOC_DEPS)
123 mkdir -p doc/generated
124 tar -czf doc/generated/doc.tar.gz -C build doc
125 $(DOCKER_BUILD) -t arvados/doc doc
128 keep-image: debian-image $(BUILD) $(KEEP_DEPS)
129 $(DOCKER_BUILD) -t arvados/keep keep
132 jobs-image: base-image $(BUILD) $(JOBS_DEPS)
133 $(DOCKER_BUILD) -t arvados/jobs jobs
136 java-bwa-samtools-image: jobs-image $(BUILD) $(JAVA_BWA_SAMTOOLS_DEPS)
137 $(DOCKER_BUILD) -t arvados/jobs-java-bwa-samtools java-bwa-samtools
138 date >java-bwa-samtools-image
140 bcbio-nextgen-image: $(BUILD) $(BASE_GENERATED) $(BCBIO_NEXTGEN_DEPS)
141 rm -rf bcbio-nextgen/generated
142 cp -r base/generated bcbio-nextgen
143 $(DOCKER_BUILD) -t arvados/bcbio-nextgen bcbio-nextgen
144 date >bcbio-nextgen-image
146 workbench-image: passenger-image $(BUILD) $(WORKBENCH_DEPS)
147 mkdir -p workbench/generated
148 tar -czf workbench/generated/workbench.tar.gz -C build/apps workbench
149 $(DOCKER_BUILD) -t arvados/workbench workbench
150 date >workbench-image
152 warehouse-image: base-image $(WAREHOUSE_DEPS)
153 $(DOCKER_BUILD) -t arvados/warehouse warehouse
154 date >warehouse-image
156 sso-image: passenger-image $(SSO_DEPS)
157 $(DOCKER_BUILD) -t arvados/sso sso
160 # ============================================================
161 # The arvados/base image is the base Debian image plus packages
162 # that are dependencies for every Arvados service.
164 passenger-image: base-image
165 $(DOCKER_BUILD) -t arvados/passenger passenger
166 date >passenger-image
168 base-image: debian-image $(BASE_DEPS)
169 $(DOCKER_BUILD) -t arvados/base base
173 ./mkimage-debootstrap.sh arvados/debian wheezy ftp://ftp.us.debian.org/debian/