helm: Add the dockerfiles used by the helm charts.
authorWard Vandewege <wvandewege@veritasgenetics.com>
Fri, 25 May 2018 17:32:41 +0000 (13:32 -0400)
committerWard Vandewege <wvandewege@veritasgenetics.com>
Fri, 25 May 2018 17:32:41 +0000 (13:32 -0400)
No issue #

Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <wvandewege@veritasgenetics.com>

dockerfiles/Dockerfile.rails-runtime [new file with mode: 0644]
dockerfiles/Dockerfile.runtime [new file with mode: 0644]
dockerfiles/Dockerfile.shell_server-runtime [new file with mode: 0644]
dockerfiles/Dockerfile.slurm-runtime [new file with mode: 0644]
dockerfiles/Makefile [new file with mode: 0644]
dockerfiles/bootstrap.sh [new file with mode: 0755]

diff --git a/dockerfiles/Dockerfile.rails-runtime b/dockerfiles/Dockerfile.rails-runtime
new file mode 100644 (file)
index 0000000..62f02f6
--- /dev/null
@@ -0,0 +1,31 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+FROM phusion/passenger-ruby23
+
+# put nginx in daemon mode again; the arvados-workbench package restarts
+# nginx, which would lead to a hang otherwise...
+RUN sed -i 's/daemon off;/#daemon off;/' /etc/nginx/nginx.conf
+
+RUN /usr/bin/apt-key adv --keyserver pool.sks-keyservers.net --recv 1078ECD7
+
+RUN echo "deb http://apt.arvados.org/ xenial-dev main" | tee /etc/apt/sources.list.d/arvados.list
+
+RUN apt-get update && apt-get install -qqy tzdata
+
+# preinstall latest arvados rails packages, so that we have (most of) the gems
+# baked into this docker image. Then remove them so that this image is generic.
+# The bundles will remain installed.
+RUN apt-get install -qqy arvados-workbench arvados-sso-server arvados-api-server
+RUN apt-get remove -qqy arvados-workbench arvados-sso-server arvados-api-server
+
+# put nginx.conf back into the state it needs to be
+RUN sed -i 's/#daemon off;/daemon off;/' /etc/nginx/nginx.conf
+
+RUN apt-get install -qqy postgresql-client
+
+RUN rm /etc/nginx/sites-enabled/default
+RUN rm /etc/service/nginx/down
+
+COPY bootstrap.sh /usr/local/bin/bootstrap.sh
diff --git a/dockerfiles/Dockerfile.runtime b/dockerfiles/Dockerfile.runtime
new file mode 100644 (file)
index 0000000..078e03a
--- /dev/null
@@ -0,0 +1,15 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+FROM ubuntu:16.04
+
+RUN echo "deb http://apt.arvados.org/ xenial-dev main" > /etc/apt/sources.list.d/apt.arvados.org-dev.list
+
+RUN apt-key adv --keyserver pool.sks-keyservers.net --recv 1078ECD7
+
+RUN apt-get update
+
+COPY bootstrap.sh /usr/local/bin/bootstrap.sh
+
+ENTRYPOINT []
diff --git a/dockerfiles/Dockerfile.shell_server-runtime b/dockerfiles/Dockerfile.shell_server-runtime
new file mode 100644 (file)
index 0000000..2ac37d6
--- /dev/null
@@ -0,0 +1,31 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+FROM phusion/baseimage
+
+RUN /usr/bin/apt-key adv --keyserver pool.sks-keyservers.net --recv 1078ECD7
+
+RUN echo "deb http://apt.arvados.org/ xenial-dev main" | tee /etc/apt/sources.list.d/arvados.list
+
+RUN apt-get update && apt-get install -qqy tzdata
+
+RUN apt-get install -qqy \
+    apt-transport-https \
+    ca-certificates \
+    curl \
+    software-properties-common \
+    sudo
+RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
+RUN add-apt-repository \
+   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
+   $(lsb_release -cs) \
+   stable"
+RUN apt-get update
+RUN apt-get install -y docker-ce
+
+RUN apt-get install -y make gcc libcurl4-openssl-dev ruby-full git
+
+COPY bootstrap.sh /usr/local/bin/bootstrap.sh
+
+ENTRYPOINT []
diff --git a/dockerfiles/Dockerfile.slurm-runtime b/dockerfiles/Dockerfile.slurm-runtime
new file mode 100644 (file)
index 0000000..91b2f94
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+FROM cure/arvados-runtime
+
+RUN apt-get update && apt-get install -y \
+    apt-transport-https \
+    ca-certificates \
+    curl \
+    software-properties-common \
+    sudo
+RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
+RUN add-apt-repository \
+   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
+   $(lsb_release -cs) \
+   stable"
+RUN apt-get update
+RUN apt-get install -y slurm-llnl munge docker-ce
+RUN mkdir /var/run/munge
+RUN chown munge /var/run/munge
diff --git a/dockerfiles/Makefile b/dockerfiles/Makefile
new file mode 100644 (file)
index 0000000..dc0c9d4
--- /dev/null
@@ -0,0 +1,35 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+REPO = cure
+
+all: build push
+
+build: docker-build-arvados-runtime docker-build-arvados-rails-runtime docker-build-arvados-slurm-runtime docker-build-arvados-shell-server-runtime
+
+push: docker-push-arvados-runtime docker-push-arvados-rails-runtime docker-push-arvados-slurm-runtime docker-push-arvados-shell-server-runtime
+
+docker-build-arvados-runtime:
+       docker build -t ${REPO}/arvados-runtime -f Dockerfile.runtime .
+
+docker-push-arvados-runtime: docker-build-arvados-runtime
+       docker push ${REPO}/arvados-runtime
+
+docker-build-arvados-rails-runtime:
+       docker build -t ${REPO}/arvados-rails-runtime -f Dockerfile.rails-runtime .
+
+docker-push-arvados-rails-runtime: docker-build-arvados-rails-runtime
+       docker push ${REPO}/arvados-rails-runtime
+
+docker-build-arvados-slurm-runtime:
+       docker build -t ${REPO}/arvados-slurm-runtime -f Dockerfile.slurm-runtime .
+
+docker-push-arvados-slurm-runtime: docker-build-arvados-slurm-runtime
+       docker push ${REPO}/arvados-slurm-runtime
+
+docker-build-arvados-shell-server-runtime:
+       docker build -t ${REPO}/arvados-shell-server-runtime -f Dockerfile.shell_server-runtime .
+
+docker-push-arvados-shell-server-runtime: docker-build-arvados-shell-server-runtime
+       docker push ${REPO}/arvados-shell-server-runtime
diff --git a/dockerfiles/bootstrap.sh b/dockerfiles/bootstrap.sh
new file mode 100755 (executable)
index 0000000..c236b80
--- /dev/null
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+if [[ "$1" == "" ]]; then
+  echo "Syntax: $0 <package=version> [package=version] [gem:package=version] ..."
+  exit 1
+fi
+
+if [[ "$@" =~ "arvados-workbench=" ]] || [[ "$@" =~ "arvados-sso-server=" ]] || [[ "$@" =~ "arvados-api-server=" ]]; then
+  RESET_NGINX_DAEMON_FLAG=true
+else
+  RESET_NGINX_DAEMON_FLAG=false
+fi
+
+gems=()
+debs=()
+for var in "$@"; do
+  if [[ "$var" =~ "gem:" ]]; then
+    cleanvar=${var#gem:}
+    gems+=" $cleanvar"
+  else
+    debs+=" $var"
+  fi
+done
+
+if [[ "$RESET_NGINX_DAEMON_FLAG" == true ]]; then
+  # our packages restart nginx; with the 'daemon off' flag in place, 
+  # that makes package install hang. Arguably we shouldn't be restarting nginx on install.
+  sed -i 's/daemon off;/#daemon off;/' /etc/nginx/nginx.conf
+fi
+
+if [[ "$debs" != "" ]]; then
+  apt-get -qqy install $debs
+  if [[ "$?" != "0" ]]; then
+    # Maybe we need to update the apt cache first?
+    apt-get update
+    apt-get -qqy install $debs
+  fi
+fi
+
+if [[ "$gems" != "" ]]; then
+  for var in $gems; do
+    IFS='=' arr=($var)
+    gem install ${arr[0]} -v ${arr[1]} --no-rdoc --no-ri
+  done
+fi
+
+if [[ "$RESET_NGINX_DAEMON_FLAG" == true ]]; then
+  /etc/init.d/nginx stop
+  sed -i 's/#daemon off;/daemon off;/' /etc/nginx/nginx.conf
+fi