IGNITE-8526 Created web-agent docker image for k8s deployment. - Fixes #4038.
Signed-off-by: Andrey Novikov <anovi...@gridgain.com> Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fc737b76 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fc737b76 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fc737b76 Branch: refs/heads/ignite-8446 Commit: fc737b768f731b9b090cfa710bd6a01c5dc967e7 Parents: c956346 Author: Ivanov Petr <piva...@gridgain.com> Authored: Wed Jul 11 17:06:55 2018 +0700 Committer: Andrey Novikov <anovi...@gridgain.com> Committed: Wed Jul 11 17:09:21 2018 +0700 ---------------------------------------------------------------------- docker/apache-ignite/.dockerignore | 1 + docker/apache-ignite/Dockerfile | 39 +++++++++++++++++ docker/apache-ignite/README.txt | 26 +++++++++++ docker/apache-ignite/run.sh | 46 ++++++++++++++++++++ docker/web-agent/Dockerfile | 45 +++++++++++++++++++ docker/web-agent/README.txt | 36 +++++++++++++++ modules/docker/.dockerignore | 1 - modules/docker/Dockerfile | 38 ---------------- modules/docker/README.txt | 26 ----------- modules/docker/run.sh | 46 -------------------- .../web-agent/bin/ignite-web-agent.sh | 0 11 files changed, 193 insertions(+), 111 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/fc737b76/docker/apache-ignite/.dockerignore ---------------------------------------------------------------------- diff --git a/docker/apache-ignite/.dockerignore b/docker/apache-ignite/.dockerignore new file mode 100644 index 0000000..c4c4ffc --- /dev/null +++ b/docker/apache-ignite/.dockerignore @@ -0,0 +1 @@ +*.zip http://git-wip-us.apache.org/repos/asf/ignite/blob/fc737b76/docker/apache-ignite/Dockerfile ---------------------------------------------------------------------- diff --git a/docker/apache-ignite/Dockerfile b/docker/apache-ignite/Dockerfile new file mode 100644 index 0000000..fec672e --- /dev/null +++ b/docker/apache-ignite/Dockerfile @@ -0,0 +1,39 @@ +# +# 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. +# + +# Start from Java 8 based on Alpine Linux image (~5Mb) +FROM openjdk:8-jre-alpine + +# Settings +ENV IGNITE_HOME /opt/ignite/apache-ignite-fabric +WORKDIR /opt/ignite + +# Add missing software +RUN apk --no-cache \ + add bash + +# Copy main binary archive +COPY apache-ignite-fabric* apache-ignite-fabric + +# Copy sh files and set permission +COPY run.sh $IGNITE_HOME/ + +# Entry point +CMD $IGNITE_HOME/run.sh + +# Container port exposure +EXPOSE 11211 47100 47500 49112 http://git-wip-us.apache.org/repos/asf/ignite/blob/fc737b76/docker/apache-ignite/README.txt ---------------------------------------------------------------------- diff --git a/docker/apache-ignite/README.txt b/docker/apache-ignite/README.txt new file mode 100644 index 0000000..6912bc4 --- /dev/null +++ b/docker/apache-ignite/README.txt @@ -0,0 +1,26 @@ +Apache Ignite Docker module +=========================== +Apache Ignite Docker module provides Dockerfile and accompanying files for building docker image. + + +Build image +=========== +1) Build Apache Ignite binary archive as described in DEVNOTES.txt. + +2) Goto Apache Ignite's Docker module directory + + cd modules/docker + +3) Copy Apache Ignite's binary archive to Docker module directory + + cp -rfv ../../target/bin/apache-ignite-fabric-*.zip + +4) Unpack Apache Ignite's binary archive + + unzip apache-ignite-fabric-*.zip + +5) Build docker image + + docker build . -t apacheignite/ignite[:<version>] + + Prepared image will be available issuing `docker images` command http://git-wip-us.apache.org/repos/asf/ignite/blob/fc737b76/docker/apache-ignite/run.sh ---------------------------------------------------------------------- diff --git a/docker/apache-ignite/run.sh b/docker/apache-ignite/run.sh new file mode 100755 index 0000000..72cfdd8 --- /dev/null +++ b/docker/apache-ignite/run.sh @@ -0,0 +1,46 @@ +#!/bin/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. +# + +if [ ! -z "$OPTION_LIBS" ]; then + IFS=, LIBS_LIST=("$OPTION_LIBS") + + for lib in ${LIBS_LIST[@]}; do + cp -r $IGNITE_HOME/libs/optional/"$lib"/* \ + $IGNITE_HOME/libs/ + done +fi + +if [ ! -z "$EXTERNAL_LIBS" ]; then + IFS=, LIBS_LIST=("$EXTERNAL_LIBS") + + for lib in ${LIBS_LIST[@]}; do + wget $lib -P $IGNITE_HOME/libs + done +fi + +QUIET="" + +if [ "$IGNITE_QUIET" = "false" ]; then + QUIET="-v" +fi + +if [ -z $CONFIG_URI ]; then + $IGNITE_HOME/bin/ignite.sh $QUIET +else + $IGNITE_HOME/bin/ignite.sh $QUIET $CONFIG_URI +fi http://git-wip-us.apache.org/repos/asf/ignite/blob/fc737b76/docker/web-agent/Dockerfile ---------------------------------------------------------------------- diff --git a/docker/web-agent/Dockerfile b/docker/web-agent/Dockerfile new file mode 100644 index 0000000..cdf7e4d --- /dev/null +++ b/docker/web-agent/Dockerfile @@ -0,0 +1,45 @@ +# +# 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. +# + +# Start from Java 8 based on Alpine Linux image (~5Mb) +FROM openjdk:8-jre-alpine + +# Provide default arguments +ARG DEFAULT_DRIVER_FOLDER="/opt/ignite/drivers" +ARG DEFAULT_NODE_URI="http://localhost:8080" +ARG DEFAULT_SERVER_URI="http://localhost" +ARG DEFAULT_TOKENS="NO_TOKENS" + +ENV DRIVER_FOLDER=$DEFAULT_DRIVER_FOLDER +ENV NODE_URI=$DEFAULT_NODE_URI +ENV SERVER_URI=$DEFAULT_SERVER_URI +ENV TOKENS=$DEFAULT_TOKENS + +# Settings +USER root +ENV AGENT_HOME /opt/ignite/ignite-web-agent +WORKDIR ${AGENT_HOME} + +# Add missing software +RUN apk --no-cache \ + add bash + +# Copy main binary archive +COPY ignite-web-agent*/* ./ + +# Entrypoint +CMD ignite-web-agent.sh -d ${DRIVER_FOLDER} -n ${NODE_URI} -s ${SERVER_URI} -t ${TOKENS} http://git-wip-us.apache.org/repos/asf/ignite/blob/fc737b76/docker/web-agent/README.txt ---------------------------------------------------------------------- diff --git a/docker/web-agent/README.txt b/docker/web-agent/README.txt new file mode 100644 index 0000000..376e333 --- /dev/null +++ b/docker/web-agent/README.txt @@ -0,0 +1,36 @@ +Apache Ignite Web Agent Docker module +===================================== +Apache Ignite Web Agent Docker module provides Dockerfile and accompanying files +for building docker image of Web Agent. + + +Build image +=========== +1) Build Apache Ignite Web Console module + + mvn clean install -T 2C \ + -Pall-java,all-scala,licenses,web-console \ + -pl :ignite-web-console -am \ + -DskipTests + +2) Go to Apache Ignite Web Console Docker module directory and copy Apache + Ignite Web Agent's binary archive + + cd docker/web-agent + cp -rfv ../../modules/web-console/web-agent/target/ignite-web-agent-*.zip ./ + +3) Unpack and remove Apache Ignite Web Agent's binary archive + + unzip ignite-web-agent-*.zip + rm -rf ignite-web-agent-*.zip + +4) Build docker image + + docker build . -t apacheignite/web-agent[:<version>] + + Prepared image will be available in local docker registry (can be seen + issuing `docker images` command) + +5) Clean up + + rm -rf ignite-web-agent* http://git-wip-us.apache.org/repos/asf/ignite/blob/fc737b76/modules/docker/.dockerignore ---------------------------------------------------------------------- diff --git a/modules/docker/.dockerignore b/modules/docker/.dockerignore deleted file mode 100644 index c4c4ffc..0000000 --- a/modules/docker/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -*.zip http://git-wip-us.apache.org/repos/asf/ignite/blob/fc737b76/modules/docker/Dockerfile ---------------------------------------------------------------------- diff --git a/modules/docker/Dockerfile b/modules/docker/Dockerfile deleted file mode 100644 index 2cfa85f..0000000 --- a/modules/docker/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -# -# 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. -# - -# Start from Java 8 based on Alpine Linux image (~5Mb) -FROM openjdk:8-jre-alpine - -# Settings -ENV IGNITE_HOME /opt/ignite/apache-ignite-fabric -WORKDIR /opt/ignite - -# Add missing software -RUN apk --update --no-cache add bash - -# Copy main binary archive -COPY apache-ignite-fabric* apache-ignite-fabric - -# Copy sh files and set permission -COPY run.sh $IGNITE_HOME/ - -# Entry point -CMD $IGNITE_HOME/run.sh - -# Container port exposure -EXPOSE 11211 47100 47500 49112 http://git-wip-us.apache.org/repos/asf/ignite/blob/fc737b76/modules/docker/README.txt ---------------------------------------------------------------------- diff --git a/modules/docker/README.txt b/modules/docker/README.txt deleted file mode 100644 index 6912bc4..0000000 --- a/modules/docker/README.txt +++ /dev/null @@ -1,26 +0,0 @@ -Apache Ignite Docker module -=========================== -Apache Ignite Docker module provides Dockerfile and accompanying files for building docker image. - - -Build image -=========== -1) Build Apache Ignite binary archive as described in DEVNOTES.txt. - -2) Goto Apache Ignite's Docker module directory - - cd modules/docker - -3) Copy Apache Ignite's binary archive to Docker module directory - - cp -rfv ../../target/bin/apache-ignite-fabric-*.zip - -4) Unpack Apache Ignite's binary archive - - unzip apache-ignite-fabric-*.zip - -5) Build docker image - - docker build . -t apacheignite/ignite[:<version>] - - Prepared image will be available issuing `docker images` command http://git-wip-us.apache.org/repos/asf/ignite/blob/fc737b76/modules/docker/run.sh ---------------------------------------------------------------------- diff --git a/modules/docker/run.sh b/modules/docker/run.sh deleted file mode 100755 index 72cfdd8..0000000 --- a/modules/docker/run.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/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. -# - -if [ ! -z "$OPTION_LIBS" ]; then - IFS=, LIBS_LIST=("$OPTION_LIBS") - - for lib in ${LIBS_LIST[@]}; do - cp -r $IGNITE_HOME/libs/optional/"$lib"/* \ - $IGNITE_HOME/libs/ - done -fi - -if [ ! -z "$EXTERNAL_LIBS" ]; then - IFS=, LIBS_LIST=("$EXTERNAL_LIBS") - - for lib in ${LIBS_LIST[@]}; do - wget $lib -P $IGNITE_HOME/libs - done -fi - -QUIET="" - -if [ "$IGNITE_QUIET" = "false" ]; then - QUIET="-v" -fi - -if [ -z $CONFIG_URI ]; then - $IGNITE_HOME/bin/ignite.sh $QUIET -else - $IGNITE_HOME/bin/ignite.sh $QUIET $CONFIG_URI -fi http://git-wip-us.apache.org/repos/asf/ignite/blob/fc737b76/modules/web-console/web-agent/bin/ignite-web-agent.sh ---------------------------------------------------------------------- diff --git a/modules/web-console/web-agent/bin/ignite-web-agent.sh b/modules/web-console/web-agent/bin/ignite-web-agent.sh old mode 100644 new mode 100755