You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2017/12/18 15:42:51 UTC

[GitHub] rabbah closed pull request #126: define Job to install openwhisk-catalog

rabbah closed pull request #126: define Job to install openwhisk-catalog
URL: https://github.com/apache/incubator-openwhisk-deploy-kube/pull/126
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/.travis.yml b/.travis.yml
index 62d05e4..7d63add 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,7 +18,7 @@ script:
   - ./tools/travis/scancode.sh
   - ./tools/travis/build.sh
   - ./tools/travis/collect-logs.sh
-  - ./tools/travis/box-upload.py "$TRAVIS_BUILD_DIR/logs" "deploy-kube-$TRAVIS_BUILD_ID-$TRAVIS_BRANCH.tar.gz"
+  - ./tools/travis/box-upload.py "logs" "deploy-kube-$TRAVIS_BUILD_ID-$TRAVIS_BRANCH.tar.gz"
 
 deploy:
 - provider: script
diff --git a/docker/README.md b/docker/README.md
index e0c204c..ebcab79 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -10,6 +10,9 @@ The built images are:
     production usage.
   * routemgmt - installs OpenWhisk's route management package
     in the system namespace of the OpenWhisk deployment.
+  * openwhisk-catalog - installs the catalog from the project
+    incubator-openwhisk-calalog to the system namespace of the
+    OpenWhisk deployment.
 
 The nginx and kafka images are not officially built and published
 because they are considered to be temporary.  We are working on
diff --git a/docker/openwhisk-catalog/Dockerfile b/docker/openwhisk-catalog/Dockerfile
new file mode 100644
index 0000000..984e2d0
--- /dev/null
+++ b/docker/openwhisk-catalog/Dockerfile
@@ -0,0 +1,10 @@
+from ubuntu:latest
+
+RUN apt-get -y update && apt-get -y install \
+  git \
+  wget
+
+COPY init.sh /init.sh
+RUN chmod +X /init.sh
+
+CMD ["/init.sh"]
diff --git a/docker/openwhisk-catalog/init.sh b/docker/openwhisk-catalog/init.sh
new file mode 100755
index 0000000..28f8690
--- /dev/null
+++ b/docker/openwhisk-catalog/init.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+set -x
+
+# Clone openwhisk-catalog
+# TODO: when openwhisk-catalog has releases, download release instead!
+git clone https://github.com/apache/incubator-openwhisk-catalog openwhisk-catalog
+
+# TODO: installCatalog.sh wants OPENWHISK_HOME set, but doesn't actually need
+# it for anything.  Fix upstream and then remove this.
+export OPENWHISK_HOME=/openwhisk
+mkdir -p $OPENWHISK_HOME/bin
+
+# Download and install openwhisk cli
+pushd $OPENWHISK_HOME/bin
+  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
+popd
+
+# Run installCatalog.sh
+pushd openwhisk-catalog/packages
+  ./installCatalog.sh $WHISK_AUTH $WHISK_API_HOST_NAME $OPENWHISK_HOME/bin/wsk
+popd
+
diff --git a/kubernetes/openwhisk-catalog/README.md b/kubernetes/openwhisk-catalog/README.md
new file mode 100644
index 0000000..a951cf2
--- /dev/null
+++ b/kubernetes/openwhisk-catalog/README.md
@@ -0,0 +1,14 @@
+OpenWhisk Catalog
+-----
+
+Once the system is deployed, we need to run a Job to install all the
+standard package catalog from incubator-openwhisk-catalog into the
+/whisk.system namespace.
+
+# Deploying
+
+To run the Job, you just need to run:
+
+```
+kubectl apply -f install-catalog.yml
+```
diff --git a/kubernetes/openwhisk-catalog/install-catalog.yml b/kubernetes/openwhisk-catalog/install-catalog.yml
new file mode 100644
index 0000000..49e7530
--- /dev/null
+++ b/kubernetes/openwhisk-catalog/install-catalog.yml
@@ -0,0 +1,27 @@
+apiVersion: batch/v1
+kind: Job
+metadata:
+  name: install-catalog
+spec:
+  activeDeadlineSeconds: 600
+  template:
+    metadata:
+      name: install-catalog
+    spec:
+      containers:
+      - name: catalog
+        image: openwhisk/kube-openwhisk-catalog
+        env:
+          - name: "WHISK_CLI_VERSION"
+            value: "latest"
+          - name: "WHISK_AUTH"
+            valueFrom:
+              secretKeyRef:
+                name: auth.whisk.system
+                key: auth.whisk.system
+          - name: "WHISK_API_HOST_NAME"
+            valueFrom:
+              configMapKeyRef:
+                name: whisk
+                key: whisk_api_host_name
+      restartPolicy: Never
diff --git a/tools/travis/deploy.sh b/tools/travis/deploy.sh
index 8d27014..3a10cd7 100755
--- a/tools/travis/deploy.sh
+++ b/tools/travis/deploy.sh
@@ -12,3 +12,6 @@ echo "Publishing kube-couchdb image"
 
 echo "Publishing kube-routemgmt image"
 ./tools/travis/publish.sh openwhisk kube-routemgmt latest docker/routemgmt
+
+echo "Publishing kube-openwhisk-catalog image"
+./tools/travis/publish.sh openwhisk kube-openwhisk-catalog latest docker/openwhisk-catalog


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services