This is an automated email from the ASF dual-hosted git repository.
csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git
The following commit(s) were added to refs/heads/master by this push:
new 570c044 Consolidate to a single tools/ow-utils docker image (#4158)
570c044 is described below
commit 570c044592010cddf2d6e40b9b49aa66fd91523a
Author: David Grove <[email protected]>
AuthorDate: Thu Dec 6 10:07:36 2018 -0500
Consolidate to a single tools/ow-utils docker image (#4158)
Rather than defining separate images for running shell scripts,
running ansible playbooks, running gradle tasks, etc. switch
to an uber utility image that will include wsk, wsk-deploy,
and all the software packages to execute our various scripting
languages.
---
settings.gradle | 3 +-
tools/ansibleRunner/Dockerfile | 28 ------------------
tools/ansibleRunner/build.gradle | 19 -------------
tools/jenkins/apache/dockerhub.groovy | 2 +-
tools/ow-utils/Dockerfile | 41 +++++++++++++++++++++++++++
tools/{ansibleRunner => ow-utils}/README.md | 11 +++----
tools/{scriptRunner => ow-utils}/build.gradle | 2 +-
tools/scriptRunner/Dockerfile | 26 -----------------
tools/scriptRunner/README.md | 28 ------------------
tools/scriptRunner/init.sh | 13 ---------
10 files changed, 50 insertions(+), 123 deletions(-)
diff --git a/settings.gradle b/settings.gradle
index ca9b7c0..39ab270 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -24,8 +24,7 @@ include 'tests'
include 'tests:performance:gatling_tests'
include 'tools:actionProxy'
-include 'tools:ansibleRunner'
-include 'tools:scriptRunner'
+include 'tools:ow-utils'
include 'tools:dev'
include 'tools:admin'
diff --git a/tools/ansibleRunner/Dockerfile b/tools/ansibleRunner/Dockerfile
deleted file mode 100644
index 6731f24..0000000
--- a/tools/ansibleRunner/Dockerfile
+++ /dev/null
@@ -1,28 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
contributor
-# license agreements; and to You under the Apache License, Version 2.0.
-
-from debian:jessie-slim
-
-ENV DOCKER_VERSION 1.12.0
-
-RUN apt-get update && apt-get install -y \
- curl \
- git \
- libffi-dev \
- python \
- python-pip \
- wget \
- zip
-
-# Install docker client
-RUN wget --no-verbose
https://get.docker.com/builds/Linux/x86_64/docker-${DOCKER_VERSION}.tgz && \
-tar --strip-components 1 -xvzf docker-${DOCKER_VERSION}.tgz -C /usr/bin
docker/docker && \
-rm -f docker-${DOCKER_VERSION}.tgz && \
-chmod +x /usr/bin/docker
-
-RUN pip install --upgrade pip
-RUN pip install --upgrade setuptools
-RUN pip install ansible==2.5.2
-RUN pip install jinja2==2.9.6
-
-CMD ["/usr/local/bin/ansible-playbook", "/task/playbook.yml"]
diff --git a/tools/ansibleRunner/build.gradle b/tools/ansibleRunner/build.gradle
deleted file mode 100644
index d6c32a2..0000000
--- a/tools/ansibleRunner/build.gradle
+++ /dev/null
@@ -1,19 +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.
- */
-
-ext.dockerImageName = 'ansible-runner'
-apply from: '../../gradle/docker.gradle'
diff --git a/tools/jenkins/apache/dockerhub.groovy
b/tools/jenkins/apache/dockerhub.groovy
index d2f73b4..3032fb6 100644
--- a/tools/jenkins/apache/dockerhub.groovy
+++ b/tools/jenkins/apache/dockerhub.groovy
@@ -29,7 +29,7 @@ node('xenial&&!H21&&!H22&&!H11&&!ubuntu-eu3') {
withCredentials([usernamePassword(credentialsId: 'openwhisk_dockerhub',
passwordVariable: 'DOCKER_PASSWORD', usernameVariable: 'DOCKER_USER')]) {
sh 'docker login -u ${DOCKER_USER} -p ${DOCKER_PASSWORD}'
}
- def PUSH_CMD = "./gradlew :core:controller:distDocker
:core:invoker:distDocker :tools:scriptRunner:distDocker
:tools:ansibleRunner:distDocker -PdockerRegistry=docker.io
-PdockerImagePrefix=openwhisk"
+ def PUSH_CMD = "./gradlew :core:controller:distDocker
:core:invoker:distDocker :tools:ow-utils:distDocker -PdockerRegistry=docker.io
-PdockerImagePrefix=openwhisk"
def gitCommit = sh(returnStdout: true, script: 'git rev-parse
HEAD').trim()
def shortCommit = gitCommit.take(7)
sh "${PUSH_CMD} -PdockerImageTag=latest"
diff --git a/tools/ow-utils/Dockerfile b/tools/ow-utils/Dockerfile
new file mode 100644
index 0000000..5953d86
--- /dev/null
+++ b/tools/ow-utils/Dockerfile
@@ -0,0 +1,41 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
contributor
+# license agreements; and to You under the Apache License, Version 2.0.
+
+FROM adoptopenjdk/openjdk8:jdk8u191-b12
+
+ENV DOCKER_VERSION 1.12.0
+ENV WHISK_CLI_VERSION latest
+ENV WHISKDEPLOY_CLI_VERSION latest
+
+RUN apt-get update && apt-get install -y \
+ git \
+ libffi-dev \
+ nodejs \
+ npm \
+ python \
+ python-pip \
+ wget \
+ zip \
+&& rm -rf /var/lib/apt/lists/*
+
+# Python packages
+RUN pip install --upgrade pip
+RUN pip install --upgrade setuptools
+RUN pip install ansible==2.5.2
+RUN pip install jinja2==2.9.6
+
+# Install docker client
+RUN wget --no-verbose
https://get.docker.com/builds/Linux/x86_64/docker-${DOCKER_VERSION}.tgz && \
+ tar --strip-components 1 -xvzf docker-${DOCKER_VERSION}.tgz -C /usr/bin
docker/docker && \
+ rm -f docker-${DOCKER_VERSION}.tgz && \
+ chmod +x /usr/bin/docker
+
+# # Install `wsk` cli in /usr/local/bin
+RUN wget -q
https://github.com/apache/incubator-openwhisk-cli/releases/download/$WHISK_CLI_VERSION/OpenWhisk_CLI-$WHISK_CLI_VERSION-linux-amd64.tgz
&& \
+ tar xzf OpenWhisk_CLI-$WHISK_CLI_VERSION-linux-amd64.tgz -C /usr/local/bin
wsk && \
+ rm OpenWhisk_CLI-$WHISK_CLI_VERSION-linux-amd64.tgz
+
+# # Install `wskdeploy` cli in /usr/local/bin
+RUN wget -q
https://github.com/apache/incubator-openwhisk-wskdeploy/releases/download/$WHISKDEPLOY_CLI_VERSION/openwhisk_wskdeploy-$WHISKDEPLOY_CLI_VERSION-linux-amd64.tgz
&& \
+ tar xzf openwhisk_wskdeploy-$WHISK_CLI_VERSION-linux-amd64.tgz -C
/usr/local/bin wskdeploy && \
+ rm openwhisk_wskdeploy-$WHISK_CLI_VERSION-linux-amd64.tgz
diff --git a/tools/ansibleRunner/README.md b/tools/ow-utils/README.md
similarity index 71%
rename from tools/ansibleRunner/README.md
rename to tools/ow-utils/README.md
index 13afef9..0a06963 100644
--- a/tools/ansibleRunner/README.md
+++ b/tools/ow-utils/README.md
@@ -17,11 +17,12 @@
#
-->
-Utility image for executing ansible playbooks
+Utility image for executing tasks
================
-The `ansible-runner` base image is intended to be used to execute
-utility tasks defined as ansible playbooks. The playbook to be
-executed should be mounted in the container as /task/playbook.yml by
-Kubernetes/Docker/Mesos.
+This `ow-utils` image can be used to execute various utility tasks
+for OpenWhisk using most of the tools that are used in the project.
+It includes a JDK8, python/ansible, nodejs, and standard packages
+such as bash, git, wget, curl, and docker.
+It also includes the `wsk` and `wskdeploy` CLIs.
diff --git a/tools/scriptRunner/build.gradle b/tools/ow-utils/build.gradle
similarity index 95%
rename from tools/scriptRunner/build.gradle
rename to tools/ow-utils/build.gradle
index fe536e8..c4e7932 100644
--- a/tools/scriptRunner/build.gradle
+++ b/tools/ow-utils/build.gradle
@@ -15,5 +15,5 @@
* limitations under the License.
*/
-ext.dockerImageName = 'script-runner'
+ext.dockerImageName = 'ow-utils'
apply from: '../../gradle/docker.gradle'
diff --git a/tools/scriptRunner/Dockerfile b/tools/scriptRunner/Dockerfile
deleted file mode 100644
index 868a4d5..0000000
--- a/tools/scriptRunner/Dockerfile
+++ /dev/null
@@ -1,26 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
contributor
-# license agreements; and to You under the Apache License, Version 2.0.
-
-FROM node:slim
-
-RUN apt-get update && apt-get install -y \
- git \
- wget \
- zip
-
-# Install `wsk` cli in /usr/local/bin
-ENV WHISK_CLI_VERSION latest
-RUN wget -q
https://github.com/apache/incubator-openwhisk-cli/releases/download/$WHISK_CLI_VERSION/OpenWhisk_CLI-$WHISK_CLI_VERSION-linux-amd64.tgz
&& \
- tar xzf OpenWhisk_CLI-$WHISK_CLI_VERSION-linux-amd64.tgz -C /usr/local/bin
wsk && \
- rm OpenWhisk_CLI-$WHISK_CLI_VERSION-linux-amd64.tgz
-
-# Install `wskdeploy` cli in /usr/local/bin
-ENV WHISKDEPLOY_CLI_VERSION latest
-RUN wget -q
https://github.com/apache/incubator-openwhisk-wskdeploy/releases/download/$WHISKDEPLOY_CLI_VERSION/openwhisk_wskdeploy-$WHISKDEPLOY_CLI_VERSION-linux-amd64.tgz
&& \
- tar xzf openwhisk_wskdeploy-$WHISK_CLI_VERSION-linux-amd64.tgz -C
/usr/local/bin wskdeploy && \
- rm openwhisk_wskdeploy-$WHISK_CLI_VERSION-linux-amd64.tgz
-
-COPY init.sh /init.sh
-RUN chmod +x /init.sh
-
-CMD ["/init.sh"]
diff --git a/tools/scriptRunner/README.md b/tools/scriptRunner/README.md
deleted file mode 100644
index 06b9d19..0000000
--- a/tools/scriptRunner/README.md
+++ /dev/null
@@ -1,28 +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.
-#
--->
-
-Utility image for executing bash scripts
-================
-
-The `script-runner` base image is intended to be used to execute
-utility tasks defined as bash scripts. The script to be executed
-should be mounted in the container as /task/myTask.sh by
-Kubernetes/Docker/Mesos. The `wsk` cli is installed in /usr/local/bin
-to make it easily available to the scripts.
-
diff --git a/tools/scriptRunner/init.sh b/tools/scriptRunner/init.sh
deleted file mode 100755
index e76c2ca..0000000
--- a/tools/scriptRunner/init.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one or more
contributor
-# license agreements; and to You under the Apache License, Version 2.0.
-
-set -ex
-
-# Run the custom task mounted into /task by kube/docker
-if [ -f /task/myTask.sh ]; then
- . /task/myTask.sh
-else
- echo "I was not given a task to execute. Exiting with error"
- exit 1
-fi