You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2016/08/21 07:58:19 UTC

airavata git commit: [AIRAVATA-2054][WIP] create docker images for airavata deployment components

Repository: airavata
Updated Branches:
  refs/heads/lahiru/airavata-docker a94e0efb5 -> 0c2ecdba1


[AIRAVATA-2054][WIP] create docker images for airavata deployment components

1. Introduce Docker images for each deployment component of airavata.
2. Deployed those in docker hub repository (scigap),
	try: docker search scigap
3. Use exhibitor docker images intead of zookeeper which is a much better
compare to using vanilla zookeeper.
http://techblog.netflix.com/2012/04/introducing-exhibitor-supervisor-system.html

4. IMHO we should never use docker images from public repository, Everything
we should create our own docker images from public images and test with those and
move to production.

5. Added a simple script(airavata/build.sh) to build airavata docker components.

      ./build.sh [component-name] - This will build a docker image for given component.

This is a temporary script we can use until AIRAVATA-2056 which integrates docker push with some CI tool like jenkins.


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/0c2ecdba
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/0c2ecdba
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/0c2ecdba

Branch: refs/heads/lahiru/airavata-docker
Commit: 0c2ecdba19ba8893ca9096202219173bee8c6923
Parents: a94e0ef
Author: Lahiru Ginnaliya Gamathige <la...@apache.org>
Authored: Sun Aug 21 00:49:58 2016 -0700
Committer: Lahiru Ginnaliya Gamathige <la...@apache.org>
Committed: Sun Aug 21 00:50:22 2016 -0700

----------------------------------------------------------------------
 build.sh                                     | 57 +++++++++++++++++++++++
 deploy/images/airavata/Dockerfile            | 16 +++++++
 deploy/images/exhibitor/Dockerfile           |  6 +++
 deploy/images/exhibitor/exhibitor.properties | 14 ++++++
 deploy/images/java/Dockerfile                | 32 +++++++++++++
 deploy/images/rabbitmq/Dockerfile            |  3 ++
 deploy/images/rabbitmq/rabbitmq.config       |  5 ++
 7 files changed, 133 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/0c2ecdba/build.sh
----------------------------------------------------------------------
diff --git a/build.sh b/build.sh
new file mode 100644
index 0000000..65caf79
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,57 @@
+#!/usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# todo Add environment specific docker image creation and create docker image per component (api-server, orchestrator, gfac etc)
+
+mvn clean install -Dmaven.test.skip=true
+if [ -d "docker-build" ]; then
+    printf '%s\n' "Removing old docker-build directory"
+    rm -rf docker-build
+fi
+
+mkdir docker-build
+cp distribution/target/apache-airavata-server*.zip docker-build
+
+unzip docker-build/apache-airavata-server*.zip -d docker-build/airavata
+rm docker-build/apache-airavata-server*.zip
+
+cp deploy/images/airavata/Dockerfile docker-build/airavata/*/
+
+cd docker-build/airavata/*/
+
+component_name="all"
+if [ $# -gt 0 ]
+  then
+      docker build --build-arg COMPONENT=${component_name} -t airavata-${component_name} .
+      docker push sgg/airavata-${component_name}
+fi
+
+docker build --build-arg COMPONENT=apiserver -t airavata-apiserver .
+docker push sgg/airavata-apiserver
+
+docker build --build-arg COMPONENT=gfac -t airavata-gfac .
+docker push sgg/airavata-gfac
+
+docker build --build-arg COMPONENT=orchestrator -t airavata-orchestrator .
+docker push sgg/airavata-orchestrator
+
+docker build --build-arg COMPONENT=credentialstore -t airavata-credentialstore .
+docker push sgg/airavata-credentialstore
+
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/0c2ecdba/deploy/images/airavata/Dockerfile
----------------------------------------------------------------------
diff --git a/deploy/images/airavata/Dockerfile b/deploy/images/airavata/Dockerfile
new file mode 100644
index 0000000..6b051ae
--- /dev/null
+++ b/deploy/images/airavata/Dockerfile
@@ -0,0 +1,16 @@
+#
+# To build from the airavata root dir until jenkins script or maven build to create docker image
+#
+FROM scigap/java:8
+ARG COMPONENT="all"
+
+ENV COMPONENT=$COMPONENT
+
+RUN mkdir /airavata
+COPY . /airavata
+
+WORKDIR /airavata
+
+RUN chmod +x ./bin/airavata-server-start.sh
+
+ENTRYPOINT ./bin/airavata-server-start.sh $COMPONENT

http://git-wip-us.apache.org/repos/asf/airavata/blob/0c2ecdba/deploy/images/exhibitor/Dockerfile
----------------------------------------------------------------------
diff --git a/deploy/images/exhibitor/Dockerfile b/deploy/images/exhibitor/Dockerfile
new file mode 100644
index 0000000..d1dae93
--- /dev/null
+++ b/deploy/images/exhibitor/Dockerfile
@@ -0,0 +1,6 @@
+FROM netflixoss/exhibitor:1.5.2
+
+ADD exhibitor.properties /exhibitor/exhibitor.properties
+
+ENTRYPOINT ["java", "-jar", "exhibitor-1.0-jar-with-dependencies.jar", "-c", "s3", "--defaultconfig", "/exhibitor/exhibitor.properties"]
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/0c2ecdba/deploy/images/exhibitor/exhibitor.properties
----------------------------------------------------------------------
diff --git a/deploy/images/exhibitor/exhibitor.properties b/deploy/images/exhibitor/exhibitor.properties
new file mode 100644
index 0000000..532dcc6
--- /dev/null
+++ b/deploy/images/exhibitor/exhibitor.properties
@@ -0,0 +1,14 @@
+java-environment=export JAVA_OPTS\="-Xms1000m -Xmx1000m"
+zookeeper-data-directory=/zookeeper/data
+cleanup-period-ms=200000
+zookeeper-install-directory=/zookeeper
+check-ms=2000
+client-port=2181
+cleanup-max-files=10
+connect-port=2888
+log4j-properties=
+observer-threshold=4
+election-port=3888
+zoo-cfg-extra=syncLimit\=5&tickTime\=2000&initLimit\=10
+auto-manage-instances-settling-period-ms=10000
+auto-manage-instances=1

http://git-wip-us.apache.org/repos/asf/airavata/blob/0c2ecdba/deploy/images/java/Dockerfile
----------------------------------------------------------------------
diff --git a/deploy/images/java/Dockerfile b/deploy/images/java/Dockerfile
new file mode 100644
index 0000000..e3a5dd6
--- /dev/null
+++ b/deploy/images/java/Dockerfile
@@ -0,0 +1,32 @@
+FROM debian:stable
+
+ENV JAVA_MAJOR 8
+ENV JAVA_MINOR 102
+ENV JAVA_BUILD 14
+
+ENV JAVA_HOME /opt/jdk
+ENV PATH ${PATH}:${JAVA_HOME}/bin
+
+RUN apt-get update \
+  && apt-get install --assume-yes curl ca-certificates \
+  && apt-get clean \
+  && rm -rf /var/lib/apt/lists/* /var/log/apt/*
+
+RUN curl -jksSLH "Cookie: oraclelicense=accept-securebackup-cookie" \
+  http://download.oracle.com/otn-pub/java/jdk/${JAVA_MAJOR}u${JAVA_MINOR}-b${JAVA_BUILD}/server-jre-${JAVA_MAJOR}u${JAVA_MINOR}-linux-x64.tar.gz \
+  | tar -zxvf - -C /opt && \
+  ln -s /opt/jdk1.${JAVA_MAJOR}.0_${JAVA_MINOR} /opt/jdk && \
+  rm -rf /opt/jdk/man/* \
+         /opt/jdk/jre/bin/jjs \
+         /opt/jdk/jre/bin/keytool \
+         /opt/jdk/jre/bin/orbd \
+         /opt/jdk/jre/bin/pack200 \
+         /opt/jdk/jre/bin/policytool \
+         /opt/jdk/jre/bin/rmid \
+         /opt/jdk/jre/bin/rmiregistry \
+         /opt/jdk/jre/bin/servertool \
+         /opt/jdk/jre/bin/tnameserv \
+         /opt/jdk/jre/bin/unpack200 \
+         /opt/jdk/jre/lib/ext/nashorn.jar \
+         /opt/jdk/jre/lib/oblique-fonts
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/0c2ecdba/deploy/images/rabbitmq/Dockerfile
----------------------------------------------------------------------
diff --git a/deploy/images/rabbitmq/Dockerfile b/deploy/images/rabbitmq/Dockerfile
new file mode 100644
index 0000000..8dae7d4
--- /dev/null
+++ b/deploy/images/rabbitmq/Dockerfile
@@ -0,0 +1,3 @@
+FROM rabbitmq:3-management
+
+COPY rabbitmq.config /etc/rabbitmq/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0c2ecdba/deploy/images/rabbitmq/rabbitmq.config
----------------------------------------------------------------------
diff --git a/deploy/images/rabbitmq/rabbitmq.config b/deploy/images/rabbitmq/rabbitmq.config
new file mode 100644
index 0000000..a3be93c
--- /dev/null
+++ b/deploy/images/rabbitmq/rabbitmq.config
@@ -0,0 +1,5 @@
+[
+  {rabbit, [
+    {tcp_listeners, [{"127.0.0.1", 5672}]}
+  ]}
+].