This is an automated email from the ASF dual-hosted git repository. pdesai pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-devtools.git
The following commit(s) were added to refs/heads/master by this push: new 79b8230 Fix Travis build for new Knative contrib. (#206) 79b8230 is described below commit 79b823086b9e28e1519657fee543572efc0bc385 Author: Matt Rutkowski <mrutk...@us.ibm.com> AuthorDate: Thu Mar 14 15:48:18 2019 -0500 Fix Travis build for new Knative contrib. (#206) --- knative-build/README.md | 20 +- .../archive/app-deployment-with-knative-0.2.2.md | 32 +- knative-build/runtimes/javascript/README.md | 20 +- .../runtimes/javascript/buildtemplate.yaml | 2 + knative-build/runtimes/javascript/src/service.js | 2 +- knative-build/runtimes/javascript/tests/README.md | 58 ++-- knative-build/samples/helloworld-nodejs/Readme.md | 25 +- knative-build/samples/helloworld-nodejs/app.js | 14 - .../samples/helloworld-nodejs/package-lock.json | 358 --------------------- .../samples/helloworld-nodejs/package.json | 14 - .../samples/helloworld-nodejs/service.yaml | 3 + knative-build/samples/nodejs-runtime/Readme.md | 21 +- knative-build/samples/nodejs-runtime/service.yaml | 3 + knative-build/service-account.yaml | 3 + 14 files changed, 126 insertions(+), 449 deletions(-) diff --git a/knative-build/README.md b/knative-build/README.md index f8bc82e..69c6289 100644 --- a/knative-build/README.md +++ b/knative-build/README.md @@ -30,7 +30,7 @@ The general pre-requisites are as follows: - [x] kubectl - [x] Knative v0.3.0 -Specifically, for developement and testing on Mac OS, the following components and versions were used: +Specifically, for development and testing on Mac OS, the following components and versions were used: - [x] [Docker Desktop for Mac Docker Community Edition 2.0.1.0 2019-01-11](https://docs.docker.com/docker-for-mac/edge-release-notes/) which includes: - Docker 18.09.1 @@ -75,8 +75,8 @@ $ kubectl get pods --namespace kube-system ``` <details> <summary>Sample output</summary> - -``` + +``` NAME READY STATUS RESTARTS AGE coredns-86c58d9df4-ms8qs 1/1 Running 0 4d22h coredns-86c58d9df4-x29vt 1/1 Running 0 4d22h @@ -105,8 +105,8 @@ $ kubectl get pods --namespace istio-system ``` <details> <summary>Sample output</summary> - -``` + +``` NAME READY STATUS RESTARTS AGE cluster-local-gateway-547467ccf6-p8n72 1/1 Running 1 4d21h istio-citadel-7d64db8bcf-m7gsj 1/1 Running 0 4d21h @@ -125,16 +125,16 @@ knative-ingressgateway-75644679c7-c2kxj 1/1 Running 1 4d21 ``` </details> -#### Verify your default namespace uses Istio for all services +#### Verify your default namespace uses Istio for all services Check the `default` namespace has the label **istio-injection** and it is set to **enabled**: ```bash $ kubectl get namespace default -o yaml ``` - + Example output: -``` +``` apiVersion: v1 kind: Namespace metadata: @@ -157,7 +157,7 @@ status: # Building and Serving OpenWhisk Runtime Build Templates -All OpenWhisk Runtime Build Templates require a valid Kubernetes **Service Account** with access to a Kubernetes **Secret** that containst base64 encoded versions of your Docker Hub username and password. This credential will be used as part of the Knative Build process to "push" your Knative application image containing your OpenWhisk Action to Docker Hub. +All OpenWhisk Runtime Build Templates require a valid Kubernetes **Service Account** with access to a Kubernetes **Secret** that containst base64 encoded versions of your Docker Hub username and password. This credential will be used as part of the Knative Build process to "push" your Knative application image containing your OpenWhisk Action to Docker Hub. ## Clone this repository @@ -239,7 +239,7 @@ namespace "default" labeled <p> <details> - <summary>Sample output: Successful Knative resources creation</summary> + <summary>Sample output: Successful Knative resources creation</summary> ``` clusterrole "knative-build-admin" created diff --git a/knative-build/archive/app-deployment-with-knative-0.2.2.md b/knative-build/archive/app-deployment-with-knative-0.2.2.md index 0a12655..70e19ab 100644 --- a/knative-build/archive/app-deployment-with-knative-0.2.2.md +++ b/knative-build/archive/app-deployment-with-knative-0.2.2.md @@ -1,3 +1,22 @@ +<!-- +# +# 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. +# +--> + # App Deployment with Knative 0.2.2 on Docker for Desktop This guide walks us over the set of instructions we followed to get sample applications deployed on Knative. @@ -230,7 +249,7 @@ Hello Go Sample v1! Yay! We have `helloworld-go` application deployed and reachable. -Now, lets try and deploy one more application. +Now, lets try and deploy one more application. ## Source Code in a Git Repository to a Running Application @@ -249,9 +268,9 @@ Use the following commands to generate base64 encoded values of Docker Hub usern $ echo -n "your username" | base64 -b 0 eW91ciB1c2VybmFtZQ== -$ echo -n "your password" | base64 -b +$ echo -n "your password" | base64 -b 0eW91ciBwYXNzd29yZA== -``` +``` Create a new `secret` manifest named `docker-secret.yaml`: @@ -297,7 +316,7 @@ metadata: name: build-bot secrets: - name: basic-user-pass -``` +``` Apply `service account` manifest: @@ -384,8 +403,3 @@ $ curl -H "Host: app-from-source.default.example.com" http://localhost:32380 ``` Hurray! We could deploy applications on Knative and interact with them. Watch this space for more experiments with Knative. - - - - - diff --git a/knative-build/runtimes/javascript/README.md b/knative-build/runtimes/javascript/README.md index 6c07128..972ebc5 100644 --- a/knative-build/runtimes/javascript/README.md +++ b/knative-build/runtimes/javascript/README.md @@ -31,13 +31,13 @@ Complete the pre-requisites and Knative installation and configuration instructi Verify **kube-system**, **istio-system**, and **knative-xxx** pods are all **Running** ``` -$ kubectl get pods --all-namespaces +$ kubectl get pods --all-namespaces ``` <details> <summary>Sample output</summary> - + ``` -$ kubectl get pods --all-namespaces +$ kubectl get pods --all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE istio-system cluster-local-gateway-547467ccf6-p8n72 1/1 Running 1 8d istio-system istio-citadel-7d64db8bcf-m7gsj 1/1 Running 0 8d @@ -77,7 +77,7 @@ kube-system kube-scheduler-docker-desktop 1/1 Runni ## Intall the BuildTemplate for the NodeJS runtime ``` -$ kubectl apply --filename buildtemplate.yaml +$ kubectl apply --filename buildtemplate.yaml buildtemplate.build.knative.dev/openwhisk-nodejs-runtime created ``` @@ -96,7 +96,7 @@ $ kubectl get buildtemplate -o yaml <details> <summary>Sample output</summary> - + ``` apiVersion: v1 items: @@ -163,7 +163,7 @@ metadata: selfLink: "" ``` </details> - + ## Building a Knative service using the NodeJS BuildTemplate We will use the simple "helloworld" test case to demonstrate how to use Knative to Build your function into container image and then deploy it as a Service. @@ -173,13 +173,13 @@ The testcase resides within this repo. at: For a complete listing of testcases, please view the [README](tests/README.md) in the tests subdirectory. -### Build HelloWorld +### Build HelloWorld #### Configure build.yaml You will need to configure the build template to point to the Docker Hub repo. you wish the image to be "pushed" to once built. -To do this, +To do this, - Copy [build.yaml.tmpl](tests/helloworld/build.yaml.tmpl) to `build.yaml`. - Replace ```${DOCKER_USERNAME}``` with your own Docker username in `build.yaml`. @@ -269,11 +269,11 @@ kubectl exec <build-pod-name> -- env #### Configure service.yaml -Now that you have built the OpenWhisk NodeJS runtime image with the `helloworld` function "baked" into it, you can can deploy the image as a Knative Service. +Now that you have built the OpenWhisk NodeJS runtime image with the `helloworld` function "baked" into it, you can can deploy the image as a Knative Service. You will need to configure the Service template to point to the Docker Hub repo. where your Knative OpenWhisk runtime (with the Hello World function) will be "pulled" from. -To do this, +To do this, - Copy [service.yaml.tmpl](tests/helloworld/service.yaml.tmpl) to `service.yaml`. - Replace ```${DOCKER_USERNAME}``` with your own Docker username in `service.yaml`. diff --git a/knative-build/runtimes/javascript/buildtemplate.yaml b/knative-build/runtimes/javascript/buildtemplate.yaml index dd7c4ac..e63e36f 100644 --- a/knative-build/runtimes/javascript/buildtemplate.yaml +++ b/knative-build/runtimes/javascript/buildtemplate.yaml @@ -1,3 +1,5 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements; and to You under the Apache License, Version 2.0. apiVersion: build.knative.dev/v1alpha1 kind: BuildTemplate metadata: diff --git a/knative-build/runtimes/javascript/src/service.js b/knative-build/runtimes/javascript/src/service.js index 75bf55a..ab947e2 100644 --- a/knative-build/runtimes/javascript/src/service.js +++ b/knative-build/runtimes/javascript/src/service.js @@ -90,7 +90,7 @@ function NodeActionService(cfg) { DEBUG.functionStart("status=" + status); if (status === Status.ready && userCodeRunner === undefined) { - + setStatus(Status.starting); var body = req.body || {}; diff --git a/knative-build/runtimes/javascript/tests/README.md b/knative-build/runtimes/javascript/tests/README.md index 35333dc..1a36863 100644 --- a/knative-build/runtimes/javascript/tests/README.md +++ b/knative-build/runtimes/javascript/tests/README.md @@ -70,7 +70,7 @@ <li><sub>OpenWhisk /run data: <a href="helloworldwithparams/data-run.json">data-run.json</a></sub></li> <li><sub>Knative Payload: <a href="helloworldwithparams/payload-knative-init-run.http">payload-knative-init-run.http</a></sub></li> <li><sub>OpenWhisk /init Payload: <a href="helloworldwithparams/payload-openwhisk-init.http">payload-openwhisk-init.http</a></sub></li> - <li><sub>OpenWhisk /run Payload: <a href="helloworldwithparams/payload-openwhisk-run.http">payload-openwhisk-run.http</a></sub></li> + <li><sub>OpenWhisk /run Payload: <a href="helloworldwithparams/payload-openwhisk-run.http">payload-openwhisk-run.http</a></sub></li> </ul> </td> </tr> @@ -95,14 +95,14 @@ <li><sub>OpenWhisk /init Payload: <a href="helloworldwithparamsfromenv/payload-openwhisk-init.http">payload-openwhisk-init.http</a></sub></li> <li><sub>OpenWhisk /run Payload: <a href="helloworldwithparamsfromenv/payload-openwhisk-run.http">payload-openwhisk-run.http</a></sub></li> </ul> - </td> + </td> </tr> <!-- webactionhelloworld --> <tr align="left" valign="top"> <td> <a href="webactionhelloworld">webactionhelloworld</a> - <p><sub>A Web Action that takes the HTTP request's query parameters and makes them available as arguments to - the <em>main</em> function. In this case, the value for the <em>name</em> query parameter is used in a + <p><sub>A Web Action that takes the HTTP request's query parameters and makes them available as arguments to + the <em>main</em> function. In this case, the value for the <em>name</em> query parameter is used in a Hello World function.</sub></p> </td> <td> @@ -113,12 +113,12 @@ </td> <td> <ul> - <li><sub>Knative data: <a href="webactionhelloworld/data-init.json">data-init-run.json</a></sub></li> + <li><sub>Knative data: <a href="webactionhelloworld/data-init.json">data-init-run.json</a></sub></li> <li><sub>Knative Payload: <a href="webactionhelloworld/payload-knative-init-run.http">payload-knative-init-run.http</a></sub></li> <li><sub>OpenWhisk /init Payload: <a href="webactionhelloworld/payload-openwhisk-init.http">payload-openwhisk-init.http</a></sub></li> <li><sub>OpenWhisk /run Payload: <a href="webactionhelloworld/payload-openwhisk-run.http">payload-openwhisk-run.http</a></sub></li> </ul> - </td> + </td> </tr> <!-- webactionhttpredirect --> <tr align="left" valign="top"> @@ -134,12 +134,12 @@ </td> <td> <ul> - <li><sub>Knative data: <a href="webactionhttpredirect/data-init.json">data-init-run.json</a></sub></li> + <li><sub>Knative data: <a href="webactionhttpredirect/data-init.json">data-init-run.json</a></sub></li> <li><sub>Knative Payload: <a href="webactionhttpredirect/payload-knative-init-run.http">payload-knative-init-run.http</a></sub></li> <li><sub>OpenWhisk /init Payload: <a href="webactionhttpredirect/payload-openwhisk-init.http">payload-openwhisk-init.http</a></sub></li> <li><sub>OpenWhisk /run Payload: <a href="webactionhttpredirect/payload-openwhisk-run.http">payload-openwhisk-run.http</a></sub></li> </ul> - </td> + </td> </tr> <!-- webactionjsonparams --> <tr align="left" valign="top"> @@ -155,12 +155,12 @@ </td> <td> <ul> - <li><sub>Knative data: <a href="webactionjsonparams/data-init.json">data-init-run.json</a></sub></li> + <li><sub>Knative data: <a href="webactionjsonparams/data-init.json">data-init-run.json</a></sub></li> <li><sub>Knative Payload: <a href="webactionjsonparams/payload-knative-init-run.http">payload-knative-init-run.http</a></sub></li> <li><sub>OpenWhisk /init Payload: <a href="webactionjsonparams/payload-openwhisk-init.http">payload-openwhisk-init.http</a></sub></li> <li><sub>OpenWhisk /run Payload: <a href="webactionjsonparams/payload-openwhisk-run.http">payload-openwhisk-run.http</a></sub></li> </ul> - </td> + </td> </tr> <!-- webactionsettingcookie --> <tr align="left" valign="top"> @@ -176,12 +176,12 @@ </td> <td> <ul> - <li><sub>Knative data: <a href="webactionsettingcookie/data-init.json">data-init-run.json</a></sub></li> + <li><sub>Knative data: <a href="webactionsettingcookie/data-init.json">data-init-run.json</a></sub></li> <li><sub>Knative Payload: <a href="webactionsettingcookie/payload-knative-init-run.http">payload-knative-init-run.http</a></sub></li> <li><sub>OpenWhisk /init Payload: <a href="webactionsettingcookie/payload-openwhisk-init.http">payload-openwhisk-init.http</a></sub></li> <li><sub>OpenWhisk /run Payload: <a href="webactionsettingcookie/payload-openwhisk-run.http">payload-openwhisk-run.http</a></sub></li> </ul> - </td> + </td> </tr> <!-- webactionpng --> <tr align="left" valign="top"> @@ -197,15 +197,15 @@ </td> <td> <ul> - <li><sub>Knative data: <a href="webactionpng/data-init.json">data-init-run.json</a></sub></li> + <li><sub>Knative data: <a href="webactionpng/data-init.json">data-init-run.json</a></sub></li> <li><sub>Knative Payload: <a href="webactionpng/payload-knative-init-run.http">payload-knative-init-run.http</a></sub></li> <li><sub>OpenWhisk /init Payload: <a href="webactionpng/payload-openwhisk-init.http">payload-openwhisk-init.http</a></sub></li> <li><sub>OpenWhisk /run Payload: <a href="webactionpng/payload-openwhisk-run.http">payload-openwhisk-run.http</a></sub></li> </ul> - </td> + </td> </tr> </tbody> -</table> +</table> # Running the Tests @@ -219,7 +219,7 @@ NAME CREATED AT openwhisk-nodejs-runtime 10m ``` -### Configure and Deploy Build YAML +### Configure and Deploy Build YAML ``` export DOCKER_USERNAME="myusername" @@ -248,18 +248,18 @@ Currently, the following platform (values) are supported: ## Running with OW_RUNTIME_PLATFORM set to "knative" Under the Knative platform, the developer has 2 choices: -1. Use the Knative "build" step to "bake the function" into the runtime resulting in a dedicated runtime +1. Use the Knative "build" step to "bake the function" into the runtime resulting in a dedicated runtime (service) container for your running a specific function. -2. Use Knative build to create a "stem cell" runtime that allows some control plane to inject the function +2. Use Knative build to create a "stem cell" runtime that allows some control plane to inject the function dynamically. -The test case cases under this directory presume option 2 ("stem cells") where both the both runtime -initialization, as well as function execution (Activation) happen sequentially. +The test case cases under this directory presume option 2 ("stem cells") where both the both runtime +initialization, as well as function execution (Activation) happen sequentially. -However, as OW runtimes do not allow "re-initialization" at this time, once you send the "init data" once to the runtime you +However, as OW runtimes do not allow "re-initialization" at this time, once you send the "init data" once to the runtime you cannot send it again or it will result in an error. -Below are some options for invoking the endpoint (route) manually using common developer tooling +Below are some options for invoking the endpoint (route) manually using common developer tooling in conjunction with prepared data: #### Using the 'curl' command @@ -280,8 +280,8 @@ curl -H "Host: <hostname>" -d "@data-init-run.json" -H "Content-Type: applicatio #### Using Http Clients -If using an IDE such as VSCode or IntelliJ you can simply "run" the HTTP payload files named -*'payload-knative-init-run.http'* which both initializes the runtime with the function and +If using an IDE such as VSCode or IntelliJ you can simply "run" the HTTP payload files named +*'payload-knative-init-run.http'* which both initializes the runtime with the function and configuration and executes the function with the provided *"values"* data. For example, the HelloWorld with parameters payload looks like this: @@ -313,22 +313,22 @@ content-type: application/json ``` please note that the *"activation"* data is also provided, but defaulted in most cases as these would -be provided by a control-plane which would manage pools of the runtimes and track Activations. +be provided by a control-plane which would manage pools of the runtimes and track Activations. --- ## Running with OW_RUNTIME_PLATFORM set to "openwhisk" -The standard OW methods used to run functions is done through calls to 2 separte endpoints. +The standard OW methods used to run functions is done through calls to 2 separte endpoints. In short, The control plane would: 1. first, invoke the */init* route with strictly the OW "init. data" (JSON format) including the funtional code itself. -2. then, invoke */run* route which executes the function (i.e., Activates the function) with caller-provided -parameters via OW "value data" (JSON format) along with per-activation information which would normally be +2. then, invoke */run* route which executes the function (i.e., Activates the function) with caller-provided +parameters via OW "value data" (JSON format) along with per-activation information which would normally be provided and tracked by the control plane (default/dummy key-values provided for tests). -Below are some options for invoking these routes manually using common developer tooling +Below are some options for invoking these routes manually using common developer tooling in conjunction with prepared data: ### Using the 'curl' command diff --git a/knative-build/samples/helloworld-nodejs/Readme.md b/knative-build/samples/helloworld-nodejs/Readme.md index ee2bafe..95bb376 100644 --- a/knative-build/samples/helloworld-nodejs/Readme.md +++ b/knative-build/samples/helloworld-nodejs/Readme.md @@ -1,8 +1,27 @@ +<!-- +# +# 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. +# +--> + ## Step 1: Install npm package `express` ```bash $ npm install express --save -``` +``` ## Build Docker Image @@ -35,7 +54,7 @@ Hello Node.js Sample v1! ```bash $ kubectl get pods helloworld-nodejs-00001-deployment-69f788f64b-gtvrc -o yaml -``` +``` ```bash $ kubectl logs helloworld-nodejs-00001-deployment-69f788f64b-gtvrc --all-containers=true @@ -56,6 +75,6 @@ $ kubectl logs helloworld-nodejs-00001-deployment-69f788f64b-gtvrc -c istio-init ``` ```bash -kubectl exec nodejs-10-action-00003-deployment-65cd48975b-kbkwj -c istio-proxy -- ls -l +kubectl exec nodejs-10-action-00003-deployment-65cd48975b-kbkwj -c istio-proxy -- ls -l kubectl exec nodejs-10-action-00003-deployment-65cd48975b-kbkwj -c istio-proxy -- curl localhost:8080 ``` diff --git a/knative-build/samples/helloworld-nodejs/app.js b/knative-build/samples/helloworld-nodejs/app.js deleted file mode 100644 index c63c272..0000000 --- a/knative-build/samples/helloworld-nodejs/app.js +++ /dev/null @@ -1,14 +0,0 @@ -const express = require("express"); -const app = express(); - -app.get("/", (req, res) => { - console.log("Hello world received a request."); - - const target = process.env.TARGET || "World"; - res.send(`Hello ${target}!`); -}); - -const port = process.env.PORT || 8080; -app.listen(port, () => { - console.log("Hello world listening on port", port); -}); diff --git a/knative-build/samples/helloworld-nodejs/package-lock.json b/knative-build/samples/helloworld-nodejs/package-lock.json deleted file mode 100644 index 06f681a..0000000 --- a/knative-build/samples/helloworld-nodejs/package-lock.json +++ /dev/null @@ -1,358 +0,0 @@ -{ - "name": "helloworld-nodejs", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "accepts": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", - "requires": { - "mime-types": "2.1.21", - "negotiator": "0.6.1" - } - }, - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" - }, - "body-parser": { - "version": "1.18.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", - "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", - "requires": { - "bytes": "3.0.0", - "content-type": "1.0.4", - "debug": "2.6.9", - "depd": "1.1.2", - "http-errors": "1.6.3", - "iconv-lite": "0.4.23", - "on-finished": "2.3.0", - "qs": "6.5.2", - "raw-body": "2.3.3", - "type-is": "1.6.16" - } - }, - "bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" - }, - "content-disposition": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" - }, - "content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" - }, - "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" - }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" - }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" - }, - "express": { - "version": "4.16.4", - "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", - "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", - "requires": { - "accepts": "1.3.5", - "array-flatten": "1.1.1", - "body-parser": "1.18.3", - "content-disposition": "0.5.2", - "content-type": "1.0.4", - "cookie": "0.3.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "1.1.2", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "etag": "1.8.1", - "finalhandler": "1.1.1", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "1.1.2", - "on-finished": "2.3.0", - "parseurl": "1.3.2", - "path-to-regexp": "0.1.7", - "proxy-addr": "2.0.4", - "qs": "6.5.2", - "range-parser": "1.2.0", - "safe-buffer": "5.1.2", - "send": "0.16.2", - "serve-static": "1.13.2", - "setprototypeof": "1.1.0", - "statuses": "1.4.0", - "type-is": "1.6.16", - "utils-merge": "1.0.1", - "vary": "1.1.2" - } - }, - "finalhandler": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", - "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", - "requires": { - "debug": "2.6.9", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "on-finished": "2.3.0", - "parseurl": "1.3.2", - "statuses": "1.4.0", - "unpipe": "1.0.0" - } - }, - "forwarded": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" - }, - "http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", - "requires": { - "depd": "1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": "1.4.0" - } - }, - "iconv-lite": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", - "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", - "requires": { - "safer-buffer": "2.1.2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "ipaddr.js": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", - "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=" - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" - }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" - }, - "mime": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" - }, - "mime-db": { - "version": "1.37.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" - }, - "mime-types": { - "version": "2.1.21", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", - "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", - "requires": { - "mime-db": "1.37.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "negotiator": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { - "ee-first": "1.1.1" - } - }, - "parseurl": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", - "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" - }, - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" - }, - "proxy-addr": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", - "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", - "requires": { - "forwarded": "0.1.2", - "ipaddr.js": "1.8.0" - } - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - }, - "range-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" - }, - "raw-body": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", - "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", - "requires": { - "bytes": "3.0.0", - "http-errors": "1.6.3", - "iconv-lite": "0.4.23", - "unpipe": "1.0.0" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "send": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", - "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", - "requires": { - "debug": "2.6.9", - "depd": "1.1.2", - "destroy": "1.0.4", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "etag": "1.8.1", - "fresh": "0.5.2", - "http-errors": "1.6.3", - "mime": "1.4.1", - "ms": "2.0.0", - "on-finished": "2.3.0", - "range-parser": "1.2.0", - "statuses": "1.4.0" - } - }, - "serve-static": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", - "requires": { - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "parseurl": "1.3.2", - "send": "0.16.2" - } - }, - "setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" - }, - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" - }, - "type-is": { - "version": "1.6.16", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", - "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", - "requires": { - "media-typer": "0.3.0", - "mime-types": "2.1.21" - } - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" - }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" - } - } -} diff --git a/knative-build/samples/helloworld-nodejs/package.json b/knative-build/samples/helloworld-nodejs/package.json deleted file mode 100644 index 5c96c24..0000000 --- a/knative-build/samples/helloworld-nodejs/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "knative-serving-helloworld-nodejs", - "version": "1.0.0", - "description": "", - "main": "app.js", - "scripts": { - "start": "node app.js" - }, - "author": "", - "license": "Apache-2.0", - "dependencies": { - "express": "^4.16.4" - } -} diff --git a/knative-build/samples/helloworld-nodejs/service.yaml b/knative-build/samples/helloworld-nodejs/service.yaml index 804647d..e7530b9 100644 --- a/knative-build/samples/helloworld-nodejs/service.yaml +++ b/knative-build/samples/helloworld-nodejs/service.yaml @@ -1,3 +1,6 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements; and to You under the Apache License, Version 2.0. + apiVersion: serving.knative.dev/v1alpha1 kind: Service metadata: diff --git a/knative-build/samples/nodejs-runtime/Readme.md b/knative-build/samples/nodejs-runtime/Readme.md index 3088dc3..7ce18e7 100644 --- a/knative-build/samples/nodejs-runtime/Readme.md +++ b/knative-build/samples/nodejs-runtime/Readme.md @@ -1,3 +1,22 @@ +<!-- +# +# 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. +# +--> + ```bash kubectl apply -f service.yaml service.serving.knative.dev/nodejs-10-runtime created @@ -382,7 +401,7 @@ status: qosClass: Burstable startTime: "2019-01-28T19:29:00Z" ``` - + ```bash curl -H "Host: nodejs-10-runtime.default.example.com" http://localhost curl: (52) Empty reply from server diff --git a/knative-build/samples/nodejs-runtime/service.yaml b/knative-build/samples/nodejs-runtime/service.yaml index 4bdae23..f751c60 100644 --- a/knative-build/samples/nodejs-runtime/service.yaml +++ b/knative-build/samples/nodejs-runtime/service.yaml @@ -1,3 +1,6 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements; and to You under the Apache License, Version 2.0. + apiVersion: serving.knative.dev/v1alpha1 kind: Service metadata: diff --git a/knative-build/service-account.yaml b/knative-build/service-account.yaml index 1f30981..bbe72c3 100644 --- a/knative-build/service-account.yaml +++ b/knative-build/service-account.yaml @@ -1,3 +1,6 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements; and to You under the Apache License, Version 2.0. + apiVersion: v1 kind: ServiceAccount metadata: