openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From houshen...@apache.org
Subject [incubator-openwhisk] branch master updated: Add the private docker registry for three VMs under Apache (#4356)
Date Tue, 19 Mar 2019 22:20:14 GMT
This is an automated email from the ASF dual-hosted git repository.

houshengbo 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 b3d1e70  Add the private docker registry for three VMs under Apache (#4356)
b3d1e70 is described below

commit b3d1e7092c482b6b1eccf1953c0b977870fde208
Author: Vincent <shou@us.ibm.com>
AuthorDate: Tue Mar 19 18:20:08 2019 -0400

    Add the private docker registry for three VMs under Apache (#4356)
    
    A private docker registry has been set up for the VMs dedicated to
    OpenWhisk deployment. This PR adds the feature to  push the controller
    and invoker images into this private registry, so that they can be
    accessed by all the VMs.
---
 ansible/environments/jenkins/group_vars/all |  2 +-
 tools/jenkins/Jenkinsfile                   | 43 +++++++++++++++--------------
 2 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/ansible/environments/jenkins/group_vars/all b/ansible/environments/jenkins/group_vars/all
index 9377a7d..659fdc2 100755
--- a/ansible/environments/jenkins/group_vars/all
+++ b/ansible/environments/jenkins/group_vars/all
@@ -6,7 +6,7 @@ config_root_dir: "{{ openwhisk_tmp_dir }}/wskconf"
 whisk_logs_dir: "{{ openwhisk_tmp_dir }}/wsklogs"
 coverage_enabled: "{{ lookup('env', 'GRADLE_COVERAGE') | default('false', true) | bool}}"
 coverage_logs_dir: "{{ openwhisk_tmp_dir }}/wskcov"
-docker_registry: ""
+docker_registry: "openwhisk-vm1-he-de.apache.org:444/"
 docker_dns: ""
 runtimes_bypass_pull_for_local_images: true
 invoker_use_runc: "{{ ansible_distribution != 'MacOSX' }}"
diff --git a/tools/jenkins/Jenkinsfile b/tools/jenkins/Jenkinsfile
index 6565d8d..db3aac7 100644
--- a/tools/jenkins/Jenkinsfile
+++ b/tools/jenkins/Jenkinsfile
@@ -18,37 +18,40 @@
 
 timeout(time: 4, unit: 'HOURS') {
 
-    node("openwhisk2") {
+    def domainName = "openwhisk-vm1-he-de.apache.org"
+    def port = "444"
+    def tag = "latest"
+    def prefix = "whisk"
+    def cert = "domain.crt"
+    def key = "domain.key"
+
+    node("openwhisk1") {
         deleteDir()
-        stage ('Checkout and build on OpenWhisk2') {
+        stage ('Checkout') {
             checkout([$class: 'GitSCM', branches: [[name: '${Branch}']], doGenerateSubmoduleConfigurations:
false,
                       extensions: [], submoduleCfg: [],
                       userRemoteConfigs: [[credentialsId: '', url: 'https://github.com/${Fork}/${RepoName}']]])
-            sh './gradlew :core:invoker:distDocker'
         }
-    }
 
-    node("openwhisk3") {
-        deleteDir()
-        stage ('Checkout and build on OpenWhisk3') {
-            checkout([$class: 'GitSCM', branches: [[name: '${Branch}']], doGenerateSubmoduleConfigurations:
false,
-                     extensions: [], submoduleCfg: [],
-                     userRemoteConfigs: [[credentialsId: '', url: 'https://github.com/${Fork}/${RepoName}']]])
-            sh './gradlew :core:invoker:distDocker'
-       }
-    }
+        stage ('Build') {
+            // Set up a private docker registry service, accessed by all the OpenWhisk VMs.
+            try {
+                sh "docker container stop registry && docker container rm -v registry"
+            } catch (exp) {
+                println("Unable to stop and remove the container registry.")
+            }
 
-    node("openwhisk1") {
-        deleteDir()
-        stage ('Checkout and build on OpenWhisk1') {
-            checkout([$class: 'GitSCM', branches: [[name: '${Branch}']], doGenerateSubmoduleConfigurations:
false,
-                      extensions: [], submoduleCfg: [],
-                      userRemoteConfigs: [[credentialsId: '', url: 'https://github.com/${Fork}/${RepoName}']]])
-            sh './gradlew distDocker'
+            sh "docker run -d --restart=always --name registry -v \"$HOME\"/certs:/certs
\
+                -e REGISTRY_HTTP_ADDR=0.0.0.0:${port} -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/${cert}
\
+                -e REGISTRY_HTTP_TLS_KEY=/certs/${key} -p ${port}:${port} registry:2"
+            // Build the controller and invoker images.
+            sh "./gradlew distDocker -PdockerRegistry=${domainName}:${port}"
         }
 
         stage('Deploy') {
             dir("ansible") {
+                // Copy the jenkins ansible configuration under the directory ansible. This
can make sure the SSH is used to
+                // access the VMs of invokers by the VM of the controller.
                 sh '[ -f "environments/jenkins/ansible_jenkins.cfg" ] && cp environments/jenkins/ansible_jenkins.cfg
ansible.cfg'
                 sh 'ansible-playbook -i environments/jenkins setup.yml'
                 sh 'ansible-playbook -i environments/jenkins openwhisk.yml -e mode=clean'


Mime
View raw message