[ARVADOS] created: cab9d1a8bd750638efbff292093624bf5bdb8767
git at public.curoverse.com
git at public.curoverse.com
Wed Apr 2 17:30:00 EDT 2014
at cab9d1a8bd750638efbff292093624bf5bdb8767 (commit)
commit cab9d1a8bd750638efbff292093624bf5bdb8767
Author: Brett Smith <brett at curoverse.com>
Date: Wed Apr 2 16:55:24 2014 -0400
docker: Install staged source on Docker images.
A separate build step to stage source makes it easier for us to fix
permissions and do other clean-up before installing it in a Docker
image. It also reduces code redundancy; for example, builders don't
have to worry about excluding log and tmp directories.
diff --git a/docker/.gitignore b/docker/.gitignore
index 66d1226..ff626a3 100644
--- a/docker/.gitignore
+++ b/docker/.gitignore
@@ -1,2 +1,2 @@
*-image
-
+build/
diff --git a/docker/build_tools/Makefile b/docker/build_tools/Makefile
index e41b183..9eac2ec 100644
--- a/docker/build_tools/Makefile
+++ b/docker/build_tools/Makefile
@@ -3,6 +3,7 @@ all: api-image doc-image workbench-image warehouse-image sso-image
# `make clean' removes the files generated in the build directory
# but does not remove any docker images generated in previous builds
clean:
+ -rm -rf build
-rm *-image */generated/*
- at rmdir */generated
@@ -19,6 +20,8 @@ realclean: clean
CONFIG_RB = build_tools/config.rb
+BUILD = build/.buildstamp
+
BASE_DEPS = base/Dockerfile $(BASE_GENERATED)
API_DEPS = api/Dockerfile $(API_GENERATED)
@@ -79,12 +82,16 @@ SSO_GENERATED_IN = \
sso/seeds.rb.in \
sso/secret_token.rb.in
-$(BASE_GENERATED): config.yml
+$(BUILD):
+ mkdir -p build
+ rsync -rlp --exclude=docker/ --exclude='**/log/*' --exclude='**/tmp/*' \
+ --chmod=Da+rx,Fa+rX ../ build/
+ touch build/.buildstamp
+
+$(BASE_GENERATED): config.yml $(BUILD)
$(CONFIG_RB)
mkdir -p base/generated
- tar -c -z -f base/generated/arvados.tar.gz -C .. . \
- --exclude=services/api/log/* --exclude=docker/*
-
+ tar -czf base/generated/arvados.tar.gz -C build .
$(API_GENERATED): config.yml $(API_GENERATED_IN)
$(CONFIG_RB)
@@ -106,21 +113,21 @@ DOCKER_BUILD = docker build -q
# ============================================================
# The main Arvados servers: api, doc, workbench, warehouse
-api-image: passenger-image $(API_DEPS)
+api-image: passenger-image $(BUILD) $(API_DEPS)
mkdir -p api/generated
- tar -c -z -f api/generated/api.tar.gz -C ../services api --exclude=api/log/*
+ tar -czf api/generated/api.tar.gz -C build/services api
$(DOCKER_BUILD) -t arvados/api api
date >api-image
-doc-image: base-image $(DOC_DEPS)
+doc-image: base-image $(BUILD) $(DOC_DEPS)
mkdir -p doc/generated
- tar -c -z -f doc/generated/doc.tar.gz -C .. doc
+ tar -czf doc/generated/doc.tar.gz -C build doc
$(DOCKER_BUILD) -t arvados/doc doc
date >doc-image
-workbench-image: passenger-image $(WORKBENCH_DEPS)
+workbench-image: passenger-image $(BUILD) $(WORKBENCH_DEPS)
mkdir -p workbench/generated
- tar -c -z -f workbench/generated/workbench.tar.gz -C ../apps workbench
+ tar -czf workbench/generated/workbench.tar.gz -C build/apps workbench
$(DOCKER_BUILD) -t arvados/workbench workbench
date >workbench-image
commit d12e6551586651ee5251f70fac1b1c086674a835
Author: Brett Smith <brett at curoverse.com>
Date: Wed Apr 2 16:41:50 2014 -0400
docker: Tolerate existing tmp in api-image.
diff --git a/docker/api/Dockerfile b/docker/api/Dockerfile
index e1bb978..3c1a5af 100644
--- a/docker/api/Dockerfile
+++ b/docker/api/Dockerfile
@@ -37,7 +37,7 @@ RUN bundle install --gemfile=/usr/src/arvados/services/api/Gemfile && \
./script/create_superuser_token.rb $(cat /tmp/superuser_token) && \
chown www-data:www-data config.ru && \
chown www-data:www-data log -R && \
- mkdir tmp && \
+ mkdir -p tmp && \
chown www-data:www-data tmp -R
# Configure Apache and Passenger.
commit 47d1fdfe8a1d7c4275f9b97f7ddf932e6671f0af
Author: Brett Smith <brett at curoverse.com>
Date: Wed Apr 2 16:33:59 2014 -0400
docker: `chmod go=rX` on generated files.
That's not how this is implemented, but the end result should be the
same.
diff --git a/docker/build_tools/config.rb b/docker/build_tools/config.rb
index ae69fe2..a31895b 100755
--- a/docker/build_tools/config.rb
+++ b/docker/build_tools/config.rb
@@ -24,7 +24,7 @@ end
# For each *.in file in the docker directories, substitute any
# @@variables@@ found in the file with the appropriate config
# variable. Support up to 10 levels of nesting.
-#
+#
# TODO(twp): add the *.in files directory to the source tree, and
# when expanding them, add them to the "generated" directory with
# the same tree structure as in the original source. Then all
@@ -58,6 +58,10 @@ Dir.glob('*/*.in') do |template_file|
output.write(line)
end
end
+ # Copy the owner's read+execute bits to group and other.
+ owner_perms = output.stat.mode & 0700
+ group_perms = (owner_perms & 0500) >> 3
+ output.chmod(owner_perms | group_perms | (group_perms >> 3))
output.close
end
commit 7449c28473b6a5f47148ee5ce321fa994db883cb
Author: Brett Smith <brett at curoverse.com>
Date: Wed Apr 2 15:32:12 2014 -0400
docker: Don't try shell expansion in Makefile.
The original syntax, at least, is not supported.
diff --git a/docker/build_tools/Makefile b/docker/build_tools/Makefile
index 7fdad91..e41b183 100644
--- a/docker/build_tools/Makefile
+++ b/docker/build_tools/Makefile
@@ -110,27 +110,27 @@ api-image: passenger-image $(API_DEPS)
mkdir -p api/generated
tar -c -z -f api/generated/api.tar.gz -C ../services api --exclude=api/log/*
$(DOCKER_BUILD) -t arvados/api api
- echo -n "Built at $(date)" > api-image
+ date >api-image
doc-image: base-image $(DOC_DEPS)
mkdir -p doc/generated
tar -c -z -f doc/generated/doc.tar.gz -C .. doc
$(DOCKER_BUILD) -t arvados/doc doc
- echo -n "Built at $(date)" > doc-image
+ date >doc-image
workbench-image: passenger-image $(WORKBENCH_DEPS)
mkdir -p workbench/generated
tar -c -z -f workbench/generated/workbench.tar.gz -C ../apps workbench
$(DOCKER_BUILD) -t arvados/workbench workbench
- echo -n "Built at $(date)" > workbench-image
+ date >workbench-image
warehouse-image: base-image $(WAREHOUSE_DEPS)
$(DOCKER_BUILD) -t arvados/warehouse warehouse
- echo -n "Built at $(date)" > warehouse-image
+ date >warehouse-image
sso-image: passenger-image $(SSO_DEPS)
$(DOCKER_BUILD) -t arvados/sso sso
- echo -n "Built at $(date)" > sso-image
+ date >sso-image
# ============================================================
# The arvados/base image is the base Debian image plus packages
@@ -138,13 +138,12 @@ sso-image: passenger-image $(SSO_DEPS)
passenger-image: base-image
$(DOCKER_BUILD) -t arvados/passenger passenger
- echo -n "Built at $(date)" > passenger-image
+ date >passenger-image
base-image: debian-image $(BASE_DEPS)
$(DOCKER_BUILD) -t arvados/base base
- echo -n "Built at $(date)" > base-image
+ date >base-image
debian-image:
./mkimage-debootstrap.sh arvados/debian wheezy ftp://ftp.us.debian.org/debian/
- echo -n "Built at $(date)" > debian-image
-
+ date >debian-image
commit d7d1117bbd5e2441a93c6563ba628debac82741a
Author: Brett Smith <brett at curoverse.com>
Date: Wed Apr 2 14:04:48 2014 -0400
docker: Improve build.sh's Makefile finding.
diff --git a/docker/build_tools/build.rb b/docker/build_tools/build.rb
index 65f44ad..b1c5543 100755
--- a/docker/build_tools/build.rb
+++ b/docker/build_tools/build.rb
@@ -163,7 +163,7 @@ def install_docker
linux_release = %x(lsb_release --release).split.last
linux_version = linux_distro + " " + linux_release
kernel_release = `uname -r`
-
+
case linux_distro
when 'Ubuntu'
if not linux_release.match '^1[234]\.'
@@ -209,7 +209,7 @@ end
if __FILE__ == $PROGRAM_NAME
- options = { :makefile => Dir.pwd + "/build_tools/Makefile" }
+ options = { :makefile => File.join(File.dirname(__FILE__), 'Makefile') }
OptionParser.new do |opts|
opts.on('-m', '--makefile MAKEFILE-PATH',
'Path to the Makefile used to build Arvados Docker images') do |mk|
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list