├── .asf.yaml ├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE.txt ├── README.md ├── actionloop-starter-kit ├── .gitattributes ├── .gitignore ├── .scalafmt.conf ├── .travis.yml ├── README.md ├── build.gradle ├── example │ ├── Makefile │ ├── __main__.py │ └── hello.py ├── gradle │ ├── README.md │ ├── docker.gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── python3.7 │ ├── Dockerfile │ ├── Makefile │ ├── bin │ │ └── compile │ ├── build.gradle │ └── lib │ │ └── launcher.py ├── settings.gradle ├── tests │ ├── build.gradle │ └── src │ │ └── test │ │ └── scala │ │ └── runtime │ │ └── actionContainers │ │ ├── ActionLoopPythonBasicTests.scala │ │ └── SingleTest.scala └── tools │ ├── invoke.py │ └── travis │ ├── build.sh │ ├── publish.sh │ ├── setup.sh │ └── test.sh ├── docker-compose ├── .travis │ ├── build.sh │ └── setup.sh ├── Makefile ├── README.md ├── apigateway │ ├── env.conf │ │ ├── api-gateway-env-vars.server.conf │ │ ├── api-gateway-env.http.conf │ │ └── api-gateway-upstreams.http.conf │ ├── generated-conf.d │ │ └── whisk-docker-compose.conf │ └── rclone │ │ └── rclone.conf ├── docker-compose-lean.yml ├── docker-compose.packages.yml ├── docker-compose.yml └── docker-whisk-controller.env ├── java-action-archetype ├── .editorconfig ├── .gitignore ├── .travis │ ├── build.sh │ └── setup.sh ├── README.md ├── pom.xml └── src │ ├── main │ └── resources │ │ ├── META-INF │ │ └── maven │ │ │ └── archetype.xml │ │ └── archetype-resources │ │ ├── pom.xml │ │ └── src │ │ ├── main │ │ └── java │ │ │ └── FunctionApp.java │ │ └── test │ │ └── java │ │ └── FunctionAppTest.java │ └── test │ └── resources │ └── projects │ └── basic │ ├── archetype.properties │ └── goal.txt ├── java-local ├── .gitignore ├── README.md ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src │ ├── main │ └── java │ │ └── openwhisk │ │ └── java │ │ └── local │ │ ├── CLI.java │ │ ├── JarLoader.java │ │ ├── JavaCompilerLoader.java │ │ ├── Launcher.java │ │ └── MemoryFileManager.java │ └── test │ ├── java │ └── openwhisk │ │ └── java │ │ └── local │ │ └── test │ │ └── LauncherTest.java │ └── resources │ ├── aproject │ └── App.java │ └── serverlessJava.jar ├── knative-build ├── README.md ├── archive │ └── app-deployment-with-knative-0.2.2.md ├── docker-secret.yaml.tmpl ├── media │ ├── Knative Build for OpenWhisk Runtimes 2019-03-14.pdf │ ├── Knative Build for OpenWhisk Runtimes 2019-03-14.pptx │ └── demo-nodejs-helloworld.gif ├── runtimes │ ├── java │ │ ├── WhiskSim │ │ │ ├── .classpath │ │ │ ├── bin │ │ │ │ └── pom.xml │ │ │ ├── pom.xml │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── org │ │ │ │ │ └── apache │ │ │ │ │ └── openwhisk │ │ │ │ │ └── App.java │ │ │ └── test │ │ │ │ └── payload │ │ │ │ └── init-test-1.json │ │ ├── build.gradle │ │ ├── buildtemplate.yaml │ │ ├── core │ │ │ └── java8 │ │ │ │ ├── CHANGELOG.md │ │ │ │ ├── Dockerfile │ │ │ │ ├── build.gradle │ │ │ │ ├── delete-build-run.sh │ │ │ │ └── proxy │ │ │ │ ├── build.gradle │ │ │ │ ├── buildProfileClasses.sh │ │ │ │ ├── compileClassCache.sh │ │ │ │ ├── gradle │ │ │ │ └── wrapper │ │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ │ └── gradle-wrapper.properties │ │ │ │ ├── gradlew │ │ │ │ ├── gradlew.bat │ │ │ │ ├── profiles │ │ │ │ ├── base │ │ │ │ │ ├── libs │ │ │ │ │ │ └── gson-2.8.5.jar │ │ │ │ │ └── tests │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── build_all.sh │ │ │ │ │ │ ├── clean_all.sh │ │ │ │ │ │ ├── exec_tests.sh │ │ │ │ │ │ ├── helloworld │ │ │ │ │ │ ├── Hello.java │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── build-without-code.yaml.tmpl │ │ │ │ │ │ ├── build.yaml.tmpl │ │ │ │ │ │ ├── knative-data-init-run.json.tmpl │ │ │ │ │ │ ├── knative-data-init.json.tmpl │ │ │ │ │ │ ├── knative-data-run.json │ │ │ │ │ │ ├── openwhisk-data-init.json.tmpl │ │ │ │ │ │ ├── openwhisk-data-run.json │ │ │ │ │ │ ├── payload-knative-init-run.http.tmpl │ │ │ │ │ │ ├── payload-knative-init.http.tmpl │ │ │ │ │ │ ├── payload-knative-run.http │ │ │ │ │ │ ├── payload-openwhisk-init.http.tmpl │ │ │ │ │ │ ├── payload-openwhisk-run.http │ │ │ │ │ │ └── service.yaml.tmpl │ │ │ │ │ │ ├── helloworldwithparams │ │ │ │ │ │ ├── Hello.java │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── build-without-code.yaml.tmpl │ │ │ │ │ │ ├── build.yaml.tmpl │ │ │ │ │ │ ├── knative-data-init-run.json.tmpl │ │ │ │ │ │ ├── knative-data-init.json.tmpl │ │ │ │ │ │ ├── knative-data-run.json │ │ │ │ │ │ ├── openwhisk-data-init.json.tmpl │ │ │ │ │ │ ├── openwhisk-data-run.json │ │ │ │ │ │ ├── payload-knative-init-run.http.tmpl │ │ │ │ │ │ ├── payload-knative-init.http.tmpl │ │ │ │ │ │ ├── payload-knative-run.http │ │ │ │ │ │ ├── payload-openwhisk-init.http.tmpl │ │ │ │ │ │ ├── payload-openwhisk-run.http │ │ │ │ │ │ └── service.yaml.tmpl │ │ │ │ │ │ ├── helloworldwithparamsfromenv │ │ │ │ │ │ ├── Hello.java │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── build-without-code.yaml.tmpl │ │ │ │ │ │ ├── build.yaml.tmpl │ │ │ │ │ │ ├── knative-data-init-run.json.tmpl │ │ │ │ │ │ ├── knative-data-init.json.tmpl │ │ │ │ │ │ ├── knative-data-run.json │ │ │ │ │ │ ├── openwhisk-data-init.json.tmpl │ │ │ │ │ │ ├── openwhisk-data-run.json │ │ │ │ │ │ ├── payload-knative-init-run.http.tmpl │ │ │ │ │ │ ├── payload-knative-init.http.tmpl │ │ │ │ │ │ ├── payload-openwhisk-init.http.tmpl │ │ │ │ │ │ ├── payload-openwhisk-run.http │ │ │ │ │ │ └── service.yaml.tmpl │ │ │ │ │ │ └── update_payloads.sh │ │ │ │ └── spring │ │ │ │ │ └── profile.properties │ │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── openwhisk │ │ │ │ └── runtime │ │ │ │ └── java │ │ │ │ └── action │ │ │ │ ├── Debug.java │ │ │ │ ├── JarLoader.java │ │ │ │ ├── Proxy.java │ │ │ │ └── WhiskSecurityManager.java │ │ ├── gradle │ │ │ ├── README.md │ │ │ ├── docker.gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ └── settings.gradle │ └── javascript │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── app.js │ │ ├── buildtemplate.yaml │ │ ├── package.json │ │ ├── platform │ │ ├── knative.js │ │ ├── openwhisk.js │ │ └── platform.js │ │ ├── runner.js │ │ ├── src │ │ └── service.js │ │ ├── tests │ │ ├── README.md │ │ ├── error │ │ │ ├── payload-agnostic-bad-run-http-method-unsupported.http │ │ │ ├── payload-agnostic-bad-run-invalid-route.http │ │ │ ├── payload-kn-bad-http-body-data-missing.http │ │ │ ├── payload-kn-bad-http-body-empty.http │ │ │ ├── payload-kn-bad-init-code-empty.http │ │ │ ├── payload-kn-bad-init-json-payload-invalid.http │ │ │ ├── payload-kn-bad-initrun-activation-action-name-empy.http │ │ │ ├── payload-kn-bad-initrun-activation-action-name-missing.http │ │ │ ├── payload-ow-bad-init-code-empty.http │ │ │ └── payload-ow-bad-init-code-missing.http │ │ ├── helloworld │ │ │ ├── README.md │ │ │ ├── build-without-code.yaml.tmpl │ │ │ ├── build.yaml.tmpl │ │ │ ├── knative-data-init-run.json │ │ │ ├── knative-data-init.json │ │ │ ├── knative-data-run.json │ │ │ ├── openwhisk-data-init.json │ │ │ ├── openwhisk-data-run.json │ │ │ ├── payload-knative-init-run.http │ │ │ ├── payload-knative-init.http │ │ │ ├── payload-knative-run.http │ │ │ ├── payload-openwhisk-init.http │ │ │ ├── payload-openwhisk-run.http │ │ │ └── service.yaml.tmpl │ │ ├── helloworldwithparams │ │ │ ├── README.md │ │ │ ├── build-without-code.yaml.tmpl │ │ │ ├── build.yaml.tmpl │ │ │ ├── knative-data-init-run.json │ │ │ ├── knative-data-init.json │ │ │ ├── knative-data-run.json │ │ │ ├── openwhisk-data-init.json │ │ │ ├── openwhisk-data-run.json │ │ │ ├── payload-knative-init-run.http │ │ │ ├── payload-knative-init.http │ │ │ ├── payload-knative-run.http │ │ │ ├── payload-openwhisk-init.http │ │ │ ├── payload-openwhisk-run.http │ │ │ └── service.yaml.tmpl │ │ ├── helloworldwithparamsfromenv │ │ │ ├── README.md │ │ │ ├── build-without-code.yaml.tmpl │ │ │ ├── build.yaml.tmpl │ │ │ ├── knative-data-init-run.json │ │ │ ├── knative-data-init.json │ │ │ ├── knative-data-run.json │ │ │ ├── openwhisk-data-init.json │ │ │ ├── openwhisk-data-run.json │ │ │ ├── payload-knative-init-run.http │ │ │ ├── payload-openwhisk-init.http │ │ │ ├── payload-openwhisk-run.http │ │ │ └── service.yaml.tmpl │ │ ├── packageaction │ │ │ ├── build.yaml.tmpl │ │ │ ├── knative-data-init-run.json │ │ │ ├── knative-data-init.json │ │ │ ├── knative-data-run.json │ │ │ └── service.yaml.tmpl │ │ ├── webactionhelloworld │ │ │ ├── README.md │ │ │ ├── build.yaml.tmpl │ │ │ ├── data-init-run.json │ │ │ ├── data-init.json │ │ │ ├── data-run.json │ │ │ ├── payload-knative-init-run.http │ │ │ ├── payload-openwhisk-init.http │ │ │ ├── payload-openwhisk-run.http │ │ │ └── service.yaml.tmpl │ │ ├── webactionhttpredirect │ │ │ ├── data-init-run.json │ │ │ ├── payload-knative-init-run.http │ │ │ ├── payload-openwhisk-init.http │ │ │ └── payload-openwhisk-run.http │ │ ├── webactionjsonparams │ │ │ ├── data-init-run.json │ │ │ ├── payload-knative-init-run.http │ │ │ ├── payload-openwhisk-init.http │ │ │ └── payload-openwhisk-run.http │ │ ├── webactionoptions │ │ │ ├── data-init-run.json │ │ │ └── payload-knative-init-run.http │ │ ├── webactionpng │ │ │ ├── data-init-run.json │ │ │ ├── payload-knative-init-run.http │ │ │ ├── payload-openwhisk-init.http │ │ │ └── payload-openwhisk-run.http │ │ ├── webactionraw │ │ │ ├── README.md │ │ │ ├── build.yaml.tmpl │ │ │ ├── knative-data-init-run.json │ │ │ ├── knative-data-init.json │ │ │ ├── knative-data-run.json │ │ │ ├── openwhisk-data-init.json │ │ │ ├── openwhisk-data-run.json │ │ │ ├── payload-knative-init-run.http │ │ │ ├── payload-knative-init.http │ │ │ ├── payload-knative-run.http │ │ │ ├── payload-openwhisk-init.http │ │ │ ├── payload-openwhisk-run.http │ │ │ └── service.yaml.tmpl │ │ └── webactionsettingcookie │ │ │ ├── data-init-run.json │ │ │ ├── payload-knative-init-run.http │ │ │ ├── payload-openwhisk-init.http │ │ │ └── payload-openwhisk-run.http │ │ └── utils │ │ ├── cleanjs.sh │ │ ├── dbgstrip.sh │ │ └── debug.js └── service-account.yaml ├── maven-java ├── .editorconfig ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── README.md ├── dependency-reduced-pom.xml ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── apache │ └── openwhisk │ └── example │ └── maven │ └── App.java ├── node-local ├── README.md ├── runtest.sh └── test.js ├── terraform-wskdeploy-plugin ├── .gitignore ├── Makefile ├── README.md ├── main.go ├── main.tf ├── provider.go └── resource_server.go └── tools └── travis ├── scancode.sh └── setupscan.sh /.asf.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | github: 19 | description: "Development tools for building and deploying Apache OpenWhisk" 20 | homepage: https://openwhisk.apache.org/ 21 | labels: 22 | - apache 23 | - deployment 24 | - faas 25 | - functions 26 | - functions-as-a-service 27 | - openwhisk 28 | - serverless 29 | - serverless-functions 30 | - tooling 31 | protected_branches: 32 | master: 33 | required_status_checks: 34 | strict: false 35 | required_pull_request_reviews: 36 | required_approving_review_count: 1 37 | required_signatures: false 38 | enabled_merge_buttons: 39 | merge: false 40 | squash: true 41 | rebase: true 42 | features: 43 | issues: true 44 | 45 | notifications: 46 | commits: commits@openwhisk.apache.org 47 | issues_status: issues@openwhisk.apache.org 48 | issues_comment: issues@openwhisk.apache.org 49 | pullrequests_status: issues@openwhisk.apache.org 50 | pullrequests_comment: issues@openwhisk.apache.org 51 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # IDE 2 | .gradle 3 | .idea 4 | .project 5 | .pydevproject 6 | .settings 7 | .vscode 8 | *.iml 9 | *.code-workspace 10 | **/.sts4-cache 11 | 12 | # Go Binaries for programs and plugins 13 | *.exe 14 | *.exe~ 15 | *.dll 16 | *.so 17 | *.dylib 18 | 19 | # Test binary, built with `go test -c` 20 | *.test 21 | 22 | # Output of the go coverage tool, specifically when used with LiteIDE 23 | *.out 24 | 25 | # Kubernetes Secrets 26 | docker-secret.yaml 27 | 28 | # Kubernetes ServiceAccount (customized with username) 29 | build.yaml 30 | service.yaml 31 | 32 | # NodeJS 33 | node_modules/ 34 | package-lock.json 35 | 36 | # Java 37 | *.class 38 | *.base64 39 | out/ 40 | target/ 41 | 42 | # Swift 43 | Packages/ 44 | 45 | # OpenWhisk project-specific 46 | openwhisk-src 47 | .wskprops 48 | -------------------------------------------------------------------------------- /actionloop-starter-kit/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization. 2 | # Resources: 3 | # - https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html 4 | # - http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ 5 | # - https://help.github.com/articles/dealing-with-line-endings/ 6 | * text=auto 7 | 8 | *.go text eol=lf 9 | *.java text 10 | *.js text 11 | *.md text 12 | *.py text eol=lf 13 | *.scala text 14 | *.sh text eol=lf 15 | *.gradle text 16 | *.xml text 17 | *.bat text eol=crlf 18 | 19 | *.jar binary 20 | *.png binary 21 | 22 | # python files not having the .py extension 23 | tools/cli/wsk text eol=lf 24 | tools/cli/wskadmin text eol=lf 25 | 26 | # bash files not having the .sh extension 27 | tools/vagrant/simple/wsk text eol=lf 28 | gradlew text eol=lf 29 | core/javaAction/proxy/gradlew text eol=lf 30 | tools/vagrant/hello text eol=lf 31 | sdk/docker/client/action text eol=lf 32 | -------------------------------------------------------------------------------- /actionloop-starter-kit/.gitignore: -------------------------------------------------------------------------------- 1 | action/ 2 | results/ 3 | logs/ 4 | out/ 5 | build/ 6 | *.retry 7 | 8 | # Linux 9 | *~ 10 | 11 | # Mac 12 | .DS_Store 13 | 14 | # Gradle 15 | .gradle 16 | build/ 17 | !/tools/build/ 18 | 19 | # Python 20 | .ipynb_checkpoints/ 21 | *.pyc 22 | 23 | # NodeJS 24 | node_modules 25 | 26 | # Vagrant 27 | .vagrant* 28 | 29 | # IntelliJ 30 | .idea 31 | *.class 32 | *.iml 33 | out/ 34 | 35 | # .zip files must be explicited whitelisted 36 | *.zip 37 | -------------------------------------------------------------------------------- /actionloop-starter-kit/.scalafmt.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | style = intellij 19 | danglingParentheses = false 20 | maxColumn = 120 21 | docstrings = JavaDoc 22 | rewrite.rules = [SortImports] 23 | project.git = true 24 | -------------------------------------------------------------------------------- /actionloop-starter-kit/README.md: -------------------------------------------------------------------------------- 1 | 19 | # ActionLoop Starter Kit 20 | 21 | Use the content of this folder to build your own ActionLoop based runtime. 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /actionloop-starter-kit/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | buildscript { 19 | repositories { 20 | jcenter() 21 | } 22 | dependencies { 23 | classpath "cz.alenkacz:gradle-scalafmt:${gradle.scalafmt.version}" 24 | } 25 | } 26 | 27 | subprojects { 28 | apply plugin: 'scalafmt' 29 | scalafmt.configFilePath = gradle.scalafmt.config 30 | } 31 | 32 | -------------------------------------------------------------------------------- /actionloop-starter-kit/example/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | IMG=actionloop-demo-python-v3.7:latest 19 | ACT=hello-demo-python 20 | PREFIX=docker.io/openwhisk 21 | 22 | src.zip: main.rb hello.py 23 | zip src.zip __main__.py hello.py 24 | 25 | bin.zip: src.zip 26 | docker run -i $(IMG) -compile main bin.zip 27 | 28 | test-single: 29 | wsk action update $(ACT) hello.py --docker $(PREFIX)/$(IMG) --main hello 30 | wsk action invoke $(ACT) -r 31 | wsk action invoke $(ACT) -p name Mike -r 32 | 33 | test-src-zip: src.zip 34 | wsk action update $(ACT) $< --docker $(PREFIX)/$(IMG) 35 | wsk action invoke $(ACT) -r 36 | wsk action invoke $(ACT) -p name Mike -r 37 | 38 | test-bin-zip: bin.zip 39 | wsk action update $(ACT) $< --docker $(PREFIX)/$(IMG) 40 | wsk action invoke $(ACT) -r 41 | wsk action invoke $(ACT) -p name Mike -r 42 | 43 | .PHONE: test-single test-src-zip test-bin-zip 44 | 45 | -------------------------------------------------------------------------------- /actionloop-starter-kit/example/__main__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | import hello 19 | 20 | def main(args): 21 | return hello.hello(args) 22 | -------------------------------------------------------------------------------- /actionloop-starter-kit/example/hello.py: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | def hello(args): 19 | name = args["name"] if "name" in args else "world" 20 | print("name=%s" % name) 21 | return {"greeting": "Hello, %s" % name } 22 | 23 | -------------------------------------------------------------------------------- /actionloop-starter-kit/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwhisk-devtools/54734862af8e58276341963b8bc51123098453d1/actionloop-starter-kit/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /actionloop-starter-kit/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | distributionBase=GRADLE_USER_HOME 18 | distributionPath=wrapper/dists 19 | zipStoreBase=GRADLE_USER_HOME 20 | zipStorePath=wrapper/dists 21 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip 22 | -------------------------------------------------------------------------------- /actionloop-starter-kit/python3.7/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | FROM openwhisk/actionloop-v2:latest as builder 18 | FROM python:3.7-alpine 19 | RUN mkdir -p /proxy/bin /proxy/lib /proxy/action 20 | WORKDIR /proxy 21 | COPY --from=builder bin/proxy /bin/proxy 22 | ADD lib/launcher.py /proxy/lib/launcher.py 23 | ADD bin/compile /proxy/bin/compile 24 | ENV OW_COMPILER=/proxy/bin/compile 25 | ENTRYPOINT ["/bin/proxy"] -------------------------------------------------------------------------------- /actionloop-starter-kit/python3.7/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | IMG=actionloop-demo-python-v3.7:latest 19 | INVOKE=python ../tools/invoke.py 20 | PREFIX=docker.io/openwhisk 21 | 22 | build: 23 | docker build -t $(IMG) . 24 | 25 | push: build 26 | docker login 27 | docker tag $(IMG) $(PREFIX)/$(IMG) 28 | docker push $(PREFIX)/$(IMG) 29 | 30 | clean: 31 | docker rmi -f $(IMG) 32 | 33 | start: build 34 | docker run -p 8080:8080 -ti -v $(PWD):/proxy $(IMG) 35 | 36 | debug: build 37 | docker run -p 8080:8080 -ti --entrypoint=/bin/sh -v $(PWD):/proxy $(IMG) 38 | 39 | .PHONY: build push clean start debug 40 | 41 | ## You need to execute make start in another terminal 42 | test-single: 43 | $(INVOKE) init hello ../example/hello.py 44 | $(INVOKE) run '{}' 45 | $(INVOKE) run '{"name":"Mike"}' 46 | 47 | test-src-zip: 48 | $(MAKE) -C ../example src.zip 49 | $(INVOKE) init ../example/src.zip 50 | $(INVOKE) run '{}' 51 | $(INVOKE) run '{"name":"Mike"}' 52 | 53 | test-bin-zip: 54 | $(MAKE) -C ../example bin.zip 55 | $(INVOKE) init ../example/bin.zip 56 | $(INVOKE) run '{}' 57 | $(INVOKE) run '{"name":"Mike"}' 58 | -------------------------------------------------------------------------------- /actionloop-starter-kit/python3.7/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | ext.dockerImageName = 'actionloop-demo-python-v3.7' 19 | apply from: '../gradle/docker.gradle' 20 | -------------------------------------------------------------------------------- /actionloop-starter-kit/python3.7/lib/launcher.py: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | from __future__ import print_function 18 | from sys import stdin 19 | from sys import stdout 20 | from sys import stderr 21 | from os import fdopen 22 | import sys, os, json, traceback 23 | 24 | # now import the action as process input/output 25 | from main__ import main as main 26 | 27 | out = fdopen(3, "wb") 28 | while True: 29 | line = stdin.readline() 30 | if not line: break 31 | args = json.loads(line) 32 | payload = {} 33 | for key in args: 34 | if key == "value": 35 | payload = args["value"] 36 | else: 37 | os.environ["__OW_%s" % key.upper()]= args[key] 38 | res = {} 39 | try: 40 | res = main(payload) 41 | except Exception as ex: 42 | print(traceback.format_exc(), file=stderr) 43 | res = {"error": str(ex)} 44 | out.write(json.dumps(res, ensure_ascii=False).encode('utf-8')) 45 | out.write(b'\n') 46 | stdout.flush() 47 | stderr.flush() 48 | out.flush() 49 | -------------------------------------------------------------------------------- /actionloop-starter-kit/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | include 'tests' 19 | include 'python3.7' 20 | 21 | rootProject.name = 'runtime-actionlooop' 22 | 23 | gradle.ext.openwhisk = [ 24 | version: '1.0.0-SNAPSHOT' 25 | ] 26 | 27 | gradle.ext.scala = [ 28 | version: '2.11.8', 29 | compileFlags: ['-feature', '-unchecked', '-deprecation', '-Xfatal-warnings', '-Ywarn-unused-import'] 30 | ] 31 | 32 | gradle.ext.scalafmt = [ 33 | version: '1.5.0', 34 | config: new File(rootProject.projectDir, '.scalafmt.conf') 35 | ] 36 | 37 | -------------------------------------------------------------------------------- /actionloop-starter-kit/tests/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | apply plugin: 'scala' 19 | apply plugin: 'eclipse' 20 | compileTestScala.options.encoding = 'UTF-8' 21 | 22 | repositories { 23 | mavenCentral() 24 | mavenLocal() 25 | } 26 | 27 | tasks.withType(Test) { 28 | testLogging { 29 | events "passed", "skipped", "failed" 30 | showStandardStreams = true 31 | exceptionFormat = 'full' 32 | } 33 | outputs.upToDateWhen { false } // force tests to run every time 34 | } 35 | 36 | dependencies { 37 | compile "org.scala-lang:scala-library:${gradle.scala.version}" 38 | compile "org.apache.openwhisk:openwhisk-tests:${gradle.openwhisk.version}:tests" 39 | compile "org.apache.openwhisk:openwhisk-tests:${gradle.openwhisk.version}:test-sources" 40 | } 41 | 42 | tasks.withType(ScalaCompile) { 43 | scalaCompileOptions.additionalParameters = gradle.scala.compileFlags 44 | } 45 | -------------------------------------------------------------------------------- /actionloop-starter-kit/tools/travis/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | set -ex 20 | 21 | # Build script for Travis-CI. 22 | 23 | SCRIPTDIR=$(cd $(dirname "$0") && pwd) 24 | ROOTDIR="$SCRIPTDIR/../.." 25 | WHISKDIR="$ROOTDIR/../openwhisk" 26 | UTILDIR="$ROOTDIR/../openwhisk-utilities" 27 | 28 | export OPENWHISK_HOME=$WHISKDIR 29 | 30 | # run scancode using the ASF Release configuration 31 | cd $UTILDIR 32 | scancode/scanCode.py --config scancode/ASF-Release.cfg $ROOTDIR 33 | 34 | # Build OpenWhisk deps before we run tests 35 | cd $WHISKDIR 36 | TERM=dumb ./gradlew install 37 | # Mock file (works around bug upstream) 38 | echo "openwhisk.home=$WHISKDIR" > whisk.properties 39 | echo "vcap.services.file=" >> whisk.properties 40 | 41 | # Build runtime 42 | cd $ROOTDIR 43 | TERM=dumb ./gradlew distDocker 44 | -------------------------------------------------------------------------------- /actionloop-starter-kit/tools/travis/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | set -e 20 | 21 | # Build script for Travis-CI. 22 | 23 | SCRIPTDIR=$(cd $(dirname "$0") && pwd) 24 | ROOTDIR="$SCRIPTDIR/../.." 25 | HOMEDIR="$SCRIPTDIR/../../../" 26 | 27 | # clone OpenWhisk utilities repo. in order to run scanCode 28 | cd $HOMEDIR 29 | git clone https://github.com/apache/openwhisk-utilities.git 30 | 31 | # clone main openwhisk repo. for testing purposes 32 | git clone --depth=1 https://github.com/apache/openwhisk.git openwhisk 33 | cd openwhisk 34 | ./tools/travis/setup.sh 35 | -------------------------------------------------------------------------------- /actionloop-starter-kit/tools/travis/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | set -ex 20 | 21 | # Build script for Travis-CI. 22 | 23 | SCRIPTDIR=$(cd $(dirname "$0") && pwd) 24 | ROOTDIR="$SCRIPTDIR/../.." 25 | WHISKDIR="$ROOTDIR/../openwhisk" 26 | 27 | export OPENWHISK_HOME=$WHISKDIR 28 | cd ${ROOTDIR} 29 | TERM=dumb ./gradlew :tests:checkScalafmtAll 30 | TERM=dumb ./gradlew :tests:testPython3 31 | -------------------------------------------------------------------------------- /docker-compose/.travis/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | SCRIPTDIR=$(cd $(dirname "$0") && pwd) 20 | ROOTDIR="$SCRIPTDIR/../" 21 | 22 | cd $ROOTDIR 23 | PATH=$PATH:/usr/local/bin/ VERBOSE=true make quick-start stop 24 | -------------------------------------------------------------------------------- /docker-compose/.travis/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | set -x -e 20 | uname -sm 21 | 22 | DOCKER_COMPOSE="docker-compose" 23 | DOCKER_COMPOSE_TMP="$DOCKER_COMPOSE.bin" 24 | 25 | version_exists=`(docker-compose --version | grep ${DOCKER_COMPOSE_VERSION}) || echo "false"` 26 | 27 | # This script assumes Docker is already installed 28 | # Trusty for Travis SHOULD include latest docker compose (e.g., 1.13.0) 29 | if [ "${version_exists}" == "false" ] 30 | then 31 | echo "Installing Docker Compose ${DOCKER_COMPOSE_VERSION}" 32 | if [ -f /usr/local/bin/$DOCKER_COMPOSE ]; then 33 | sudo rm /usr/local/bin/$DOCKER_COMPOSE 34 | fi 35 | curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > $DOCKER_COMPOSE_TMP 36 | chmod +x $DOCKER_COMPOSE_TMP 37 | sudo mv $DOCKER_COMPOSE_TMP /usr/local/bin/$DOCKER_COMPOSE 38 | fi 39 | echo "Docker Compose Version:" `docker-compose --version` 40 | -------------------------------------------------------------------------------- /docker-compose/apigateway/env.conf/api-gateway-env-vars.server.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # TO BE INCLUDED FOR EACH VHOST 19 | # Use this file to overwrite any nginx variables based on the environment 20 | 21 | # set $my_var my_value; 22 | -------------------------------------------------------------------------------- /docker-compose/apigateway/env.conf/api-gateway-env.http.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # INCLUDED IN HTTP BLOCK 19 | more_set_headers 'Server: openwhisk/api-gateway-1.9.3.1'; 20 | -------------------------------------------------------------------------------- /docker-compose/apigateway/env.conf/api-gateway-upstreams.http.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | upstream api-gateway-redis { 18 | # redis.docker is defined by docker-compose 19 | server redis.docker:6379; 20 | } 21 | 22 | upstream api-gateway-redis-replica { 23 | # redis.docker is defined by docker-compose 24 | server redis.docker:6379; 25 | } 26 | -------------------------------------------------------------------------------- /docker-compose/apigateway/rclone/rclone.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | [minio] 19 | type = s3 20 | provider = Minio 21 | env_auth = false 22 | access_key_id = 5VCTEQOQ0GR0NV1T67GN 23 | secret_access_key = 8MBK5aJTR330V1sohz4n1i7W5Wv/jzahARNHUzi3 24 | region = us-east-1 25 | endpoint = http://minio.docker:9000 26 | location_constraint = 27 | server_side_encryption = 28 | acl = public-read 29 | -------------------------------------------------------------------------------- /java-action-archetype/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = false 10 | 11 | # Matches multiple files with brace expansion notation 12 | # Set default charset 13 | [*.{java}] 14 | charset = utf-8 15 | 16 | # 4 space indentation 17 | [*.java] 18 | indent_style = space 19 | indent_size = 2 20 | insert_final_newline = true 21 | 22 | # Indentation style for yaml, yml 23 | [*.{js,xml,html,json,yaml,yml}] 24 | indent_style = space 25 | indent_size = 2 -------------------------------------------------------------------------------- /java-action-archetype/.gitignore: -------------------------------------------------------------------------------- 1 | target -------------------------------------------------------------------------------- /java-action-archetype/.travis/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | SCRIPTDIR=$(cd $(dirname "$0") && pwd) 20 | TOOLDIR="$SCRIPTDIR/../" 21 | 22 | cd $TOOLDIR 23 | 24 | mvn -V test 25 | 26 | #TODO steps that can push this artifact to nexus 27 | -------------------------------------------------------------------------------- /java-action-archetype/.travis/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | set -x -e 20 | uname -sm 21 | 22 | SCRIPTDIR=$(cd $(dirname "$0") && pwd) 23 | TOOLDIR="$SCRIPTDIR/../" 24 | 25 | cd $TOOLDIR 26 | 27 | mvn -DskipTests=true -Dmaven.javadoc.skip=true -B -V clean install 28 | -------------------------------------------------------------------------------- /java-action-archetype/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | org.apache.openwhisk.java 6 | java-action-archetype 7 | 1.0-SNAPSHOT 8 | maven-archetype 9 | OpenWhisk:: Maven Archetype - Java Action 10 | http://openwhisk.apache.org 11 | 12 | 13 | 14 | org.apache.maven.archetype 15 | archetype-packaging 16 | 3.0.1 17 | 18 | 19 | 20 | 21 | 22 | maven-archetype-plugin 23 | 3.0.1 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /java-action-archetype/src/main/resources/META-INF/maven/archetype.xml: -------------------------------------------------------------------------------- 1 | 2 | java-action-archetype 3 | 4 | src/main/java/FunctionApp.java 5 | 6 | 7 | src/test/java/FunctionAppTest.java 8 | 9 | -------------------------------------------------------------------------------- /java-action-archetype/src/main/resources/archetype-resources/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | $groupId 6 | $artifactId 7 | $version 8 | https://openwhisk.apache.org/ 9 | 10 | UTF-8 11 | 1.8 12 | 1.8 13 | 2.8.2 14 | 15 | 16 | 17 | com.google.code.gson 18 | gson 19 | ${gson.version} 20 | 21 | 22 | junit 23 | junit 24 | 4.12 25 | test 26 | 27 | 28 | 29 | $artifactId 30 | 31 | 32 | 33 | org.apache.maven.plugins 34 | maven-shade-plugin 35 | 3.1.0 36 | 37 | 38 | package 39 | 40 | shade 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /java-action-archetype/src/main/resources/archetype-resources/src/main/java/FunctionApp.java: -------------------------------------------------------------------------------- 1 | package $groupId; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | import com.google.gson.JsonObject; 21 | 22 | /** 23 | * Hello FunctionApp 24 | */ 25 | public class FunctionApp { 26 | public static JsonObject main(JsonObject args) { 27 | JsonObject response = new JsonObject(); 28 | response.addProperty("greetings", "Hello! Welcome to OpenWhisk"); 29 | return response; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /java-action-archetype/src/main/resources/archetype-resources/src/test/java/FunctionAppTest.java: -------------------------------------------------------------------------------- 1 | package $groupId; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | import static org.junit.Assert.*; 21 | 22 | import com.google.gson.JsonObject; 23 | 24 | import org.junit.Test; 25 | 26 | /** 27 | * Unit test for simple function. 28 | */ 29 | public class FunctionAppTest { 30 | @Test 31 | public void testFunction() { 32 | JsonObject args = new JsonObject(); 33 | JsonObject response = FunctionApp.main(args); 34 | assertNotNull(response); 35 | String greetings = response.getAsJsonPrimitive("greetings").getAsString(); 36 | assertNotNull(greetings); 37 | assertEquals("Hello! Welcome to OpenWhisk", greetings); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /java-action-archetype/src/test/resources/projects/basic/archetype.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | groupId=com.example 18 | artifactId=java-demo-fn 19 | version=0.1-SNAPSHOT 20 | artifactId=basic 21 | -------------------------------------------------------------------------------- /java-action-archetype/src/test/resources/projects/basic/goal.txt: -------------------------------------------------------------------------------- 1 | clean test -------------------------------------------------------------------------------- /java-local/.gitignore: -------------------------------------------------------------------------------- 1 | .settings 2 | .project 3 | .classpath 4 | bin/ 5 | .gradle/ 6 | build/ 7 | -------------------------------------------------------------------------------- /java-local/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | apply plugin: 'java' 19 | 20 | repositories { 21 | mavenCentral() 22 | } 23 | 24 | dependencies { 25 | compile 'com.google.code.gson:gson:2.6.2' 26 | compile 'info.picocli:picocli:2.2.0' 27 | 28 | // Use JUnit test framework 29 | testImplementation 'junit:junit:4.12' 30 | } 31 | 32 | jar { 33 | manifest { 34 | attributes( 35 | 'Main-Class': 'openwhisk.java.local.CLI', 36 | ) 37 | } 38 | from { 39 | configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /java-local/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwhisk-devtools/54734862af8e58276341963b8bc51123098453d1/java-local/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /java-local/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | distributionBase=GRADLE_USER_HOME 18 | distributionPath=wrapper/dists 19 | zipStoreBase=GRADLE_USER_HOME 20 | zipStorePath=wrapper/dists 21 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip 22 | -------------------------------------------------------------------------------- /java-local/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /* 19 | // To declare projects as part of a multi-project build use the 'include' method 20 | include 'shared' 21 | include 'api' 22 | include 'services:webservice' 23 | */ 24 | 25 | rootProject.name = 'java-local' 26 | -------------------------------------------------------------------------------- /java-local/src/test/resources/aproject/App.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package aproject; 18 | 19 | import com.google.gson.JsonObject; 20 | 21 | /* 22 | * This Java source file was generated by the Gradle 'init' task. 23 | */ 24 | public class App { 25 | 26 | public static JsonObject main(JsonObject args) { 27 | String name = "stranger"; 28 | if (args.has("name")) 29 | name = args.getAsJsonPrimitive("name").getAsString(); 30 | JsonObject response = new JsonObject(); 31 | response.addProperty("greeting", "Hello " + name + "!"); 32 | return response; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /java-local/src/test/resources/serverlessJava.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwhisk-devtools/54734862af8e58276341963b8bc51123098453d1/java-local/src/test/resources/serverlessJava.jar -------------------------------------------------------------------------------- /knative-build/docker-secret.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: v1 19 | kind: Secret 20 | metadata: 21 | name: dockerhub-user-pass 22 | annotations: 23 | build.knative.dev/docker-0: https://index.docker.io/v1/ 24 | type: kubernetes.io/basic-auth 25 | data: 26 | # use `echo -n "username" | base64 -b 0` to generate this value 27 | username: ${DOCKERHUB_USERNAME_BASE64_ENCODED} 28 | # use `echo -n "password" | base64 -b 0` to generate this value 29 | password: ${DOCKERHUB_PASSWORD_BASE64_ENCODED} 30 | -------------------------------------------------------------------------------- /knative-build/media/Knative Build for OpenWhisk Runtimes 2019-03-14.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwhisk-devtools/54734862af8e58276341963b8bc51123098453d1/knative-build/media/Knative Build for OpenWhisk Runtimes 2019-03-14.pdf -------------------------------------------------------------------------------- /knative-build/media/Knative Build for OpenWhisk Runtimes 2019-03-14.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwhisk-devtools/54734862af8e58276341963b8bc51123098453d1/knative-build/media/Knative Build for OpenWhisk Runtimes 2019-03-14.pptx -------------------------------------------------------------------------------- /knative-build/media/demo-nodejs-helloworld.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwhisk-devtools/54734862af8e58276341963b8bc51123098453d1/knative-build/media/demo-nodejs-helloworld.gif -------------------------------------------------------------------------------- /knative-build/runtimes/java/WhiskSim/test/payload/init-test-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": { 3 | "name" : "java-helloworld", 4 | "main" : "Hello", 5 | "binary": true, 6 | "code" : "UEsDBBQACAgIABljwUoAAAAAAAAAAAAAAAAJAAQATUVUQS1JTkYv/soAAAMAUEsHCAAAAAACAAAAAAAAAFBLAwQUAAgICAAZY8FKAAAAAAAAAAAAAAAAFAAAAE1FVEEtSU5GL01BTklGRVNULk1G803My0xLLS7RDUstKs7Mz7NSMNQz4OVyLkpNLElN0XWqBAlY6BnEmxkoaPgXJSbnpCo45xcV5BcllgCVa/Jy8XIBAFBLBwhiwEEKQwAAAEQAAABQSwMEFAAICAgACmPBSgAAAAAAAAAAAAAAAAsAAABIZWxsby5jbGFzc31T227TQBA9k5tdx6HBtCkUUhpuTdK0Bkq5NFUlioQQSqFSUCV428Qr4+JL5DgVfAp/AS+pRCU+gG9CiFmLgFTSWvLM7J6Zc2Zn7R+/vn0H8ABtAxaqOpZ0XDegYVmZmoEbuKnhlloweFvDHQOGCleUr+toKN9U+KqGloY1QmHbC71kh5CtNw4IuWeRIwmzHS+Ur0ZBT8ZvRM/nnVwgvJCwVe/0o8B2o8j1pe0Oo9B+yeZ171D2k3bjPJBQ6iai/2FPDFJODesEoxuN4r587ikN44X0/Wj9UBwJE5cwR9CHSSxCV8bcQCgCacLGXRP3cF/DhsmT2CQsnq3JBG4sZeKFLmFB8do+09ndJOat3ZHnO4q6kOoum3iIRwSqmXiMTRNPsEXIpxih/K96wl0+TchDfC+GhPl65zTUbrwjWK5Mng5Ve/uxF3iJd8SH3piWPHWOf4t4lNVzEwjFVGrS1ly98b8In1sMBjJ0CGtTezhjXlyoJ9GEuigcZz+OBjJOPhFWphBNoT5ADRf5E1ZPBqTumu08r6rsiX2+eQz6ygGhwraQbmYwgwVc/pP6ETlk2e9YmU7Tyo6R+4xSGuTHKHROoL09hr7XsmZOYHBYtMwxSqv8WhfYjDE7Rrn1JeVVGousgpQzD5PjCv8mS9CxzapXGNFBP1HROI9wNa269htQSwcIevrqgf8BAACRAwAAUEsBAhQAFAAICAgAGWPBSgAAAAACAAAAAAAAAAkABAAAAAAAAAAAAAAAAAAAAE1FVEEtSU5GL/7KAABQSwECFAAUAAgICAAZY8FKYsBBCkMAAABEAAAAFAAAAAAAAAAAAAAAAAA9AAAATUVUQS1JTkYvTUFOSUZFU1QuTUZQSwECFAAUAAgICAAKY8FKevrqgf8BAACRAwAACwAAAAAAAAAAAAAAAADCAAAASGVsbG8uY2xhc3NQSwUGAAAAAAMAAwC2AAAA+gIAAAAA" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | buildscript { 19 | repositories { 20 | jcenter() 21 | } 22 | dependencies { 23 | classpath "cz.alenkacz:gradle-scalafmt:${gradle.scalafmt.version}" 24 | } 25 | } 26 | 27 | subprojects { 28 | apply plugin: 'scalafmt' 29 | scalafmt.configFilePath = gradle.scalafmt.config 30 | } 31 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # Java 8 OpenWhisk Runtime Container 21 | 22 | ## 1.1.3 23 | Changes: 24 | - Update jdk x86_64-ubuntu-jdk8u181-b13_openj9-0.9.0 and push latest hash [jdk8u181-b13_openj9-0.9.0](https://hub.docker.com/r/adoptopenjdk/openjdk8-openj9/tags/) [#77](https://github.com/apache/openwhisk-runtime-java/pull/77/files) 25 | 26 | ## 1.1.2 27 | Changes: 28 | - Update run handler to accept more environment variables [#67](https://github.com/apache/openwhisk-runtime-java/pull/67) 29 | 30 | ## 1.1.1 31 | Changes: 32 | - Adds log markers. 33 | - Improve error handling for improper initialization. 34 | 35 | ## 1.1.0 36 | Changes: 37 | - Replaced oracle [jdk8u131-b11](http://download.oracle.com/otn-pub/java/jdk/"${VERSION}"u"${UPDATE}"-b"${BUILD}"/d54c1d3a095b4ff2b6607d096fa80163/server-jre-"${VERSION}"u"${UPDATE}"-linux-x64.tar.gz) with OpenJDK [adoptopenjdk/openjdk8-openj9:jdk8u162-b12_openj9-0.8.0](https://hub.docker.com/r/adoptopenjdk/openjdk8-openj9) 38 | 39 | ## 1.0.1 40 | Changes: 41 | - Allow custom name for main Class 42 | 43 | ## 1.0.0 44 | Changes: 45 | - Initial release 46 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # Use AdoptOpenJDK's JDK8, OpenJ9 Critical Patch Update (CPU) release version 0.15.1 19 | FROM adoptopenjdk/openjdk8-openj9:x86_64-ubuntu-jdk8u222-b10_openj9-0.15.1 20 | 21 | RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update \ 22 | && apt-get install -y --no-install-recommends locales \ 23 | && rm -rf /var/lib/apt/lists/* \ 24 | && locale-gen en_US.UTF-8 25 | 26 | ENV LANG="en_US.UTF-8" \ 27 | LANGUAGE="en_US:en" \ 28 | LC_ALL="en_US.UTF-8" \ 29 | VERSION=8 \ 30 | UPDATE=222 \ 31 | BUILD=10 32 | 33 | ADD proxy /javaAction 34 | 35 | RUN cd /javaAction \ 36 | && rm -rf .classpath .gitignore .gradle .project .settings Dockerfile build \ 37 | && ./gradlew oneJar \ 38 | && rm -rf /javaAction/src \ 39 | && ./gradlew copyDependencies \ 40 | && ./compileClassCache.sh 41 | 42 | CMD ["java", "-Dfile.encoding=UTF-8", "-Xshareclasses:cacheDir=/javaSharedCache,readonly", "-Xquickstart", "-jar", "/javaAction/build/libs/javaAction-all.jar"] 43 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | ext.dockerImageName = 'java8action' 19 | apply from: '../../gradle/docker.gradle' 20 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/delete-build-run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | # Useful for local testing. 20 | # USE WITH CAUTION !! 21 | 22 | # Removes all previously built instances. 23 | docker rm $(docker ps -a -q) 24 | 25 | docker build -t javabox . 26 | 27 | echo "" 28 | echo " ---- RUNNING ---- " 29 | echo "" 30 | 31 | docker run -i -t -p 8080:8080 javabox 32 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/buildProfileClasses.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | set -x 19 | 20 | cd profiles/base/tests 21 | # Clean out previous build artifacts 22 | ./clean_all.sh 23 | 24 | # Create new build artifacts (e.g., JAR, ZIP, and their base64 encodings) 25 | ./build_all.sh 26 | 27 | # Update the HTTP (body) payloads for OW and Knative (with base64 encoded archives) 28 | ./update_payloads.sh 29 | 30 | # execute the functions that will cause the JVM cache to be populated for the profile 31 | # (e.g., invoke the /init and /run methods for each profile's "test" functions). 32 | ./exec_tests.sh 33 | 34 | cd ../../.. 35 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwhisk-devtools/54734862af8e58276341963b8bc51123098453d1/knative-build/runtimes/java/core/java8/proxy/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | distributionBase=GRADLE_USER_HOME 18 | distributionPath=wrapper/dists 19 | zipStoreBase=GRADLE_USER_HOME 20 | zipStorePath=wrapper/dists 21 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip 22 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/libs/gson-2.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwhisk-devtools/54734862af8e58276341963b8bc51123098453d1/knative-build/runtimes/java/core/java8/proxy/profiles/base/libs/gson-2.8.5.jar -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/README.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # OpenWhisk Runtimes for Knative 21 | 22 | [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0) 23 | 24 | This repository contains tests that comprise the sample Java functions that are used to prepare the Java runtime 25 | shared class cache. 26 | 27 | ## Test Manual build and execution 28 | 29 | ### Building 30 | 31 | TBD 32 | 33 | ### Executing 34 | 35 | #### OpenWhisk runtime build 36 | 37 | ``` 38 | curl -d "@openwhisk-data-init.json" -H "Content-Type: application/json" -X POST http://localhost:8080/init 39 | 40 | curl -d "@openwhisk-data-run.json" -H "Content-Type: application/json" -X POST http://localhost:8080/run 41 | ``` 42 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/build_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | set +x 19 | 20 | for f in *; do 21 | # if the file is a directory 22 | if [ -d ${f} ]; then 23 | echo "Compiling Test: ${f}" 24 | cd $f 25 | ls -al *.jar 26 | echo "Compiling Class..." 27 | javac -verbose -classpath ../../libs/gson-2.8.5.jar Hello.java 28 | echo "Creating JAR..." 29 | jar cvf hello.jar *.class 30 | echo "Base64 encoding JAR..." 31 | unameOut="$(uname -s)" 32 | case "${unameOut}" in 33 | Linux*) B64_WRAP="-w0";; 34 | Darwin*) B64_WRAP="";; 35 | esac 36 | #base64 -w0 hello.jar > hello.jar.base64 37 | base64 $B64_WRAP hello.jar > hello.jar.base64 38 | cd .. 39 | fi 40 | done 41 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/clean_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | set +x 19 | 20 | for f in *; do 21 | # if the file is a directory 22 | if [ -d ${f} ]; then 23 | echo "Cleaning up build artifacts for test: '${f}'" 24 | cd $f 25 | rm Hello.class 26 | rm hello.jar 27 | rm hello.jar.base64 28 | rm openwhisk-data-init.json 29 | rm knative-data-init.json 30 | rm knative-data-init-run.json 31 | rm payload-knative-init.http 32 | rm payload-knative-init-run.http 33 | rm payload-openwhisk-init.http 34 | cd .. 35 | fi 36 | done 37 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/exec_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | set +x 19 | 20 | for f in *; do 21 | # if the file is a directory 22 | if [ -d ${f} ]; then 23 | echo "Updating 'code' payload with base64 encoded archive data: ${f}" 24 | cd $f 25 | curl -d "@openwhisk-data-init.json" -H "Content-Type: application/json" -X POST http://localhost:8080/init 26 | curl -d "@openwhisk-data-run.json" -H "Content-Type: application/json" -X POST http://localhost:8080/run 27 | cd .. 28 | fi 29 | done 30 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworld/Hello.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import com.google.gson.JsonObject; 19 | public class Hello { 20 | public static JsonObject main(JsonObject args) { 21 | String name = "stranger"; 22 | if (args.has("name")) 23 | name = args.getAsJsonPrimitive("name").getAsString(); 24 | JsonObject response = new JsonObject(); 25 | response.addProperty("greeting", "Hello " + name + "!"); 26 | return response; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworld/build-without-code.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: build.knative.dev/v1alpha1 19 | kind: Build 20 | metadata: 21 | name: java-8-helloworld 22 | spec: 23 | serviceAccountName: openwhisk-runtime-builder 24 | source: 25 | git: 26 | url: "https://github.com/apache/openwhisk-devtools.git" 27 | revision: "master" 28 | template: 29 | name: openwhisk-java-runtime 30 | arguments: 31 | - name: TARGET_IMAGE_NAME 32 | value: "docker.io/${DOCKER_USERNAME}/java-8-helloworld" 33 | - name: DOCKERFILE 34 | value: "./knative-build/runtimes/java/core/java8/Dockerfile" 35 | - name: OW_RUNTIME_DEBUG 36 | value: "true" 37 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworld/knative-data-init-run.json.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | { 19 | "init": { 20 | "name": "java-helloworld", 21 | "main": "Hello", 22 | "binary": true, 23 | "code" : "BASE64_ENCODED_JAR" 24 | }, 25 | "activation": { 26 | "namespace": "default", 27 | "action_name": "java-helloworld", 28 | "api_host": "", 29 | "api_key": "", 30 | "activation_id": "", 31 | "deadline": "4102498800000" 32 | }, 33 | "value": { 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworld/knative-data-init.json.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | { 19 | "init": { 20 | "name": "java-helloworld", 21 | "main": "Hello", 22 | "binary": true, 23 | "code" : "BASE64_ENCODED_JAR" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworld/knative-data-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "activation": { 3 | "namespace": "default", 4 | "action_name": "java-helloworld", 5 | "api_host": "", 6 | "api_key": "", 7 | "activation_id": "", 8 | "deadline": "4102498800000" 9 | }, 10 | "value": { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworld/openwhisk-data-init.json.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | { 19 | "value": { 20 | "name" : "java-helloworld", 21 | "main" : "Hello", 22 | "binary": true, 23 | "code": "BASE64_ENCODED_JAR" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworld/openwhisk-data-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": { 3 | 4 | }, 5 | "namespace": "default", 6 | "action_name": "java-helloworld", 7 | "api_host": "", 8 | "api_key": "", 9 | "activation_id": "", 10 | "deadline": "4102498800000" 11 | } 12 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworld/payload-knative-init-run.http.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | POST http://localhost:8080/ HTTP/1.1 19 | content-type: application/json 20 | 21 | { 22 | "init": { 23 | "name": "java-helloworld", 24 | "main": "Hello", 25 | "binary": true, 26 | "code" : "BASE64_ENCODED_JAR" 27 | }, 28 | "activation": { 29 | "namespace": "default", 30 | "action_name": "java-helloworld", 31 | "api_host": "", 32 | "api_key": "", 33 | "activation_id": "", 34 | "deadline": "4102498800000" 35 | }, 36 | "value": { 37 | "name": "Joe", 38 | "place": "TX" 39 | } 40 | } 41 | 42 | ### 43 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworld/payload-knative-init.http.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | POST http://localhost:8080/ HTTP/1.1 19 | content-type: application/json 20 | 21 | { 22 | "init": { 23 | "name": "java-helloworld", 24 | "main": "Hello", 25 | "binary": true, 26 | "code" : "BASE64_ENCODED_JAR" 27 | } 28 | } 29 | 30 | ### 31 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworld/payload-knative-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "activation": { 6 | "namespace": "default", 7 | "action_name": "java-helloworld", 8 | "api_host": "", 9 | "api_key": "", 10 | "activation_id": "", 11 | "deadline": "4102498800000" 12 | }, 13 | "value": { 14 | } 15 | } 16 | 17 | ### 18 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworld/payload-openwhisk-init.http.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | POST http://localhost:8080/init HTTP/1.1 19 | content-type: application/json 20 | 21 | { 22 | "value": { 23 | "name" : "java-helloworld", 24 | "main" : "Hello", 25 | "binary": true, 26 | "code" : "BASE64_ENCODED_JAR" 27 | } 28 | } 29 | 30 | ### 31 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworld/payload-openwhisk-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/run HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | }, 7 | "namespace": "default", 8 | "action_name": "java-helloworld", 9 | "api_host": "", 10 | "api_key": "", 11 | "activation_id": "", 12 | "deadline": "4102498800000" 13 | } 14 | 15 | ### 16 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworld/service.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: serving.knative.dev/v1alpha1 19 | kind: Service 20 | metadata: 21 | name: java-helloworld 22 | namespace: default 23 | spec: 24 | runLatest: 25 | configuration: 26 | revisionTemplate: 27 | spec: 28 | container: 29 | image: docker.io/${DOCKER_USERNAME}/java-8-helloworld 30 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparams/Hello.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import com.google.gson.JsonObject; 19 | public class Hello { 20 | public static JsonObject main(JsonObject args) { 21 | String name = "stranger"; 22 | String place = "somewhere"; 23 | if (args.has("name")) 24 | name = args.getAsJsonPrimitive("name").getAsString(); 25 | if (args.has("place")) 26 | place = args.getAsJsonPrimitive("place").getAsString(); 27 | JsonObject response = new JsonObject(); 28 | response.addProperty("greeting", "Hello " + name + " from " + place + "!"); 29 | return response; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparams/build-without-code.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: build.knative.dev/v1alpha1 19 | kind: Build 20 | metadata: 21 | name: java-8-helloworld-with-params 22 | spec: 23 | serviceAccountName: openwhisk-runtime-builder 24 | source: 25 | git: 26 | url: "https://github.com/apache/openwhisk-devtools.git" 27 | revision: "master" 28 | template: 29 | name: openwhisk-java-runtime 30 | arguments: 31 | - name: TARGET_IMAGE_NAME 32 | value: "docker.io/${DOCKER_USERNAME}/java-8-helloworld-with-params" 33 | - name: DOCKERFILE 34 | value: "./knative-build/runtimes/java/core/java8/Dockerfile" 35 | - name: OW_RUNTIME_DEBUG 36 | value: "true" 37 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparams/build.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: build.knative.dev/v1alpha1 19 | kind: Build 20 | metadata: 21 | name: java-8-helloworld-with-params 22 | spec: 23 | serviceAccountName: openwhisk-runtime-builder 24 | source: 25 | git: 26 | url: "https://github.com/apache/openwhisk-devtools.git" 27 | revision: "master" 28 | template: 29 | name: openwhisk-java-runtime 30 | arguments: 31 | - name: TARGET_IMAGE_NAME 32 | value: "docker.io/${DOCKER_USERNAME}/java-8-helloworld-with-params" 33 | - name: DOCKERFILE 34 | value: "./knative-build/runtimes/java/core/java8/Dockerfile" 35 | - name: OW_RUNTIME_DEBUG 36 | value: "true" 37 | - name: OW_ACTION_NAME 38 | value: "java-helloworld-with-params" 39 | - name: OW_ACTION_MAIN 40 | value: "Hello" 41 | - name: OW_ACTION_BINARY 42 | value: "true" 43 | - name: OW_ACTION_CODE 44 | value: "" 45 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparams/knative-data-init-run.json.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | { 19 | "init": { 20 | "name" : "java-helloworld-with-params", 21 | "main" : "Hello", 22 | "binary": true, 23 | "code" : "BASE64_ENCODED_JAR" 24 | }, 25 | "activation": { 26 | "namespace": "default", 27 | "action_name": "java-helloworld-with-params", 28 | "api_host": "", 29 | "api_key": "", 30 | "activation_id": "", 31 | "deadline": "4102498800000" 32 | }, 33 | "value": { 34 | "name" : "Joe", 35 | "place" : "TX" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparams/knative-data-init.json.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | { 19 | "init": { 20 | "name" : "java-helloworld-with-params", 21 | "main" : "Hello", 22 | "binary": true, 23 | "code" : "BASE64_ENCODED_JAR" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparams/knative-data-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "activation": { 3 | "namespace": "default", 4 | "action_name": "java-helloworld-with-params", 5 | "api_host": "", 6 | "api_key": "", 7 | "activation_id": "", 8 | "deadline": "4102498800000" 9 | }, 10 | "value": { 11 | "name" : "Jill", 12 | "place" : "OK" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparams/openwhisk-data-init.json.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | { 19 | "value": { 20 | "name" : "java-helloworld-with-params", 21 | "main" : "Hello", 22 | "binary": true, 23 | "code" : "BASE64_ENCODED_JAR" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparams/openwhisk-data-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": { 3 | "name" : "Joe", 4 | "place" : "TX" 5 | }, 6 | "namespace": "default", 7 | "action_name": "java-helloworld-with-params", 8 | "api_host": "", 9 | "api_key": "", 10 | "activation_id": "", 11 | "deadline": "4102498800000" 12 | } 13 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparams/payload-knative-init-run.http.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | POST http://localhost:8080/ HTTP/1.1 19 | content-type: application/json 20 | 21 | { 22 | "init": { 23 | "name" : "java-helloworld-with-params", 24 | "main" : "Hello", 25 | "binary": true, 26 | "code" : "BASE64_ENCODED_JAR" 27 | }, 28 | "activation": { 29 | "namespace": "default", 30 | "action_name": "java-helloworld-with-params", 31 | "api_host": "", 32 | "api_key": "", 33 | "activation_id": "", 34 | "deadline": "4102498800000" 35 | }, 36 | "value": { 37 | "name" : "Joe", 38 | "place" : "TX" 39 | } 40 | } 41 | 42 | ### 43 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparams/payload-knative-init.http.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | POST http://localhost:8080/ HTTP/1.1 19 | content-type: application/json 20 | 21 | { 22 | "init": { 23 | "name" : "java-helloworld-with-params", 24 | "main" : "Hello", 25 | "binary": true, 26 | "code" : "BASE64_ENCODED_JAR" 27 | } 28 | } 29 | 30 | ### 31 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparams/payload-knative-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "activation": { 6 | "namespace": "default", 7 | "action_name": "java-helloworld-with-params", 8 | "api_host": "", 9 | "api_key": "", 10 | "activation_id": "", 11 | "deadline": "4102498800000" 12 | }, 13 | "value": { 14 | "name" : "Jill", 15 | "place" : "OK" 16 | } 17 | } 18 | 19 | ### 20 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparams/payload-openwhisk-init.http.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | POST http://localhost:8080/init HTTP/1.1 19 | content-type: application/json 20 | 21 | { 22 | "value": { 23 | "name" : "java-helloworld-with-params", 24 | "main" : "Hello", 25 | "binary": true, 26 | "code" : "BASE64_ENCODED_JAR" 27 | } 28 | } 29 | 30 | ### 31 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparams/payload-openwhisk-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/run HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "Joe", 7 | "place" : "TX" 8 | }, 9 | "namespace": "default", 10 | "action_name": "java-helloworld-with-params", 11 | "api_host": "", 12 | "api_key": "", 13 | "activation_id": "", 14 | "deadline": "4102498800000" 15 | } 16 | 17 | ### 18 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparams/service.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: serving.knative.dev/v1alpha1 19 | kind: Service 20 | metadata: 21 | name: java-helloworld-with-params 22 | namespace: default 23 | spec: 24 | runLatest: 25 | configuration: 26 | revisionTemplate: 27 | spec: 28 | container: 29 | image: docker.io/${DOCKER_USERNAME}/java-8-helloworld-with-params 30 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparamsfromenv/Hello.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import com.google.gson.JsonObject; 19 | public class Hello { 20 | public static JsonObject main(JsonObject args) { 21 | String name = System.getenv("name"); 22 | String place = System.getenv("place"); 23 | JsonObject response = new JsonObject(); 24 | response.addProperty("greeting", "Hello " + name + " from " + place + "!"); 25 | return response; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparamsfromenv/build-without-code.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: build.knative.dev/v1alpha1 19 | kind: Build 20 | metadata: 21 | name: java-8-helloworld-with-params-from-env 22 | spec: 23 | serviceAccountName: openwhisk-runtime-builder 24 | source: 25 | git: 26 | url: "https://github.com/apache/openwhisk-devtools.git" 27 | revision: "master" 28 | template: 29 | name: openwhisk-java-runtime 30 | arguments: 31 | - name: TARGET_IMAGE_NAME 32 | value: "docker.io/${DOCKER_USERNAME}/java-8-helloworld-with-params-from-env" 33 | - name: DOCKERFILE 34 | value: "./knative-build/runtimes/java/core/java8/Dockerfile" 35 | - name: OW_RUNTIME_DEBUG 36 | value: "true" 37 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparamsfromenv/build.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: build.knative.dev/v1alpha1 19 | kind: Build 20 | metadata: 21 | name: java-8-helloworld-with-params-from-env 22 | spec: 23 | serviceAccountName: openwhisk-runtime-builder 24 | source: 25 | git: 26 | url: "https://github.com/apache/openwhisk-devtools.git" 27 | revision: "master" 28 | template: 29 | name: openwhisk-java-runtime 30 | arguments: 31 | - name: TARGET_IMAGE_NAME 32 | value: "docker.io/${DOCKER_USERNAME}/java-8-helloworld-with-params-from-env" 33 | - name: DOCKERFILE 34 | value: "./knative-build/runtimes/java/core/java8/Dockerfile" 35 | - name: OW_RUNTIME_DEBUG 36 | value: "true" 37 | - name: OW_ACTION_NAME 38 | value: "java-helloworld-with-params-from-env" 39 | - name: OW_ACTION_CODE 40 | value: "" 41 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparamsfromenv/knative-data-init-run.json.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | { 19 | "init": { 20 | "name" : "java-helloworld-with-params-from-env", 21 | "main" : "Hello", 22 | "binary": true, 23 | "code" : "BASE64_ENCODED_JAR" 24 | }, 25 | "activation": { 26 | "namespace": "default", 27 | "action_name": "java-helloworld-with-params-from-env", 28 | "api_host": "", 29 | "api_key": "", 30 | "activation_id": "", 31 | "deadline": "4102498800000" 32 | }, 33 | "value": { 34 | "name" : "Jess", 35 | "place" : "OK" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparamsfromenv/knative-data-init.json.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | { 19 | "init": { 20 | "name" : "java-helloworld-with-params-from-env", 21 | "main" : "Hello", 22 | "binary": true, 23 | "code" : "BASE64_ENCODED_JAR" 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparamsfromenv/knative-data-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "activation": { 3 | "namespace": "default", 4 | "action_name": "java-helloworld-with-params-from-env", 5 | "api_host": "", 6 | "api_key": "", 7 | "activation_id": "", 8 | "deadline": "4102498800000" 9 | }, 10 | "value": { 11 | "name" : "Jess", 12 | "place" : "OK" 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparamsfromenv/openwhisk-data-init.json.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | { 19 | "value": { 20 | "name" : "java-helloworld-with-params-from-env", 21 | "main" : "Hello", 22 | "binary": true, 23 | "code" : "BASE64_ENCODED_JAR" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparamsfromenv/openwhisk-data-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": { 3 | "name" : "Jess", 4 | "place" : "OK" 5 | }, 6 | "namespace": "default", 7 | "action_name": "java-helloworld-with-params-from-env", 8 | "api_host": "", 9 | "api_key": "", 10 | "activation_id": "", 11 | "deadline": "4102498800000" 12 | } 13 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparamsfromenv/payload-knative-init-run.http.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | POST http://localhost:8080/ HTTP/1.1 19 | content-type: application/json 20 | 21 | { 22 | "init": { 23 | "name" : "java-helloworld-with-params-from-env", 24 | "main" : "Hello", 25 | "binary": true, 26 | "code" : "BASE64_ENCODED_JAR" 27 | }, 28 | "activation": { 29 | "namespace": "default", 30 | "action_name": "java-helloworld-with-params-from-env", 31 | "api_host": "", 32 | "api_key": "", 33 | "activation_id": "", 34 | "deadline": "4102498800000" 35 | }, 36 | "value": { 37 | "name" : "Jess", 38 | "place" : "OK" 39 | } 40 | } 41 | 42 | ### 43 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparamsfromenv/payload-knative-init.http.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | POST http://localhost:8080/ HTTP/1.1 19 | content-type: application/json 20 | 21 | { 22 | "init": { 23 | "name" : "java-helloworld-with-params-from-env", 24 | "main" : "Hello", 25 | "binary": true, 26 | "code" : "BASE64_ENCODED_JAR" 27 | } 28 | } 29 | 30 | ### 31 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparamsfromenv/payload-openwhisk-init.http.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | POST http://localhost:8080/init HTTP/1.1 19 | content-type: application/json 20 | 21 | { 22 | "value": { 23 | "name" : "java-helloworld-with-params-from-env", 24 | "main" : "Hello", 25 | "binary": true, 26 | "code" : "BASE64_ENCODED_JAR" 27 | } 28 | } 29 | 30 | ### 31 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparamsfromenv/payload-openwhisk-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/run HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "Jess", 7 | "place" : "OK" 8 | }, 9 | "namespace": "default", 10 | "action_name": "java-helloworld-with-params-from-env", 11 | "api_host": "", 12 | "api_key": "", 13 | "activation_id": "", 14 | "deadline": "4102498800000" 15 | } 16 | ### 17 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/helloworldwithparamsfromenv/service.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: serving.knative.dev/v1alpha1 19 | kind: Service 20 | metadata: 21 | name: java-helloworld-with-params-from-env 22 | namespace: default 23 | spec: 24 | runLatest: 25 | configuration: 26 | revisionTemplate: 27 | spec: 28 | container: 29 | image: docker.io/${DOCKER_USERNAME}/java-8-helloworld-with-params-from-env 30 | env: 31 | - name: NAME 32 | value: Bob 33 | - name: PLACE 34 | value: Italy 35 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/base/tests/update_payloads.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | set +x 19 | 20 | for f in *; do 21 | # if the file is a directory 22 | if [ -d ${f} ]; then 23 | echo "Updating 'code' payload with base64 encoded archive data: ${f}" 24 | cd $f 25 | sed "s#BASE64_ENCODED_JAR#$(cat hello.jar.base64)#" openwhisk-data-init.json.tmpl > openwhisk-data-init.json 26 | sed "s#BASE64_ENCODED_JAR#$(cat hello.jar.base64)#" knative-data-init.json.tmpl > knative-data-init.json 27 | sed "s#BASE64_ENCODED_JAR#$(cat hello.jar.base64)#" knative-data-init-run.json.tmpl > knative-data-init-run.json 28 | sed "s#BASE64_ENCODED_JAR#$(cat hello.jar.base64)#" payload-knative-init.http.tmpl > payload-knative-init.http 29 | sed "s#BASE64_ENCODED_JAR#$(cat hello.jar.base64)#" payload-knative-init-run.http.tmpl > payload-knative-init-run.http 30 | sed "s#BASE64_ENCODED_JAR#$(cat hello.jar.base64)#" payload-openwhisk-init.http.tmpl > payload-openwhisk-init.http 31 | cd .. 32 | fi 33 | done 34 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/profiles/spring/profile.properties: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | compile.gson=com.google.code.gson:gson:2.6.2 19 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/core/java8/proxy/src/main/java/org/apache/openwhisk/runtime/java/action/WhiskSecurityManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.openwhisk.runtime.java.action; 19 | 20 | import java.security.Permission; 21 | 22 | /** 23 | * A `SecurityManager` installed when executing action code. The purpose here 24 | * is not so much to prevent malicious behavior than it is to prevent users from 25 | * shooting themselves in the foot. In particular, anything that kills the JVM 26 | * will result in unhelpful action error messages. 27 | */ 28 | public class WhiskSecurityManager extends SecurityManager { 29 | @Override 30 | public void checkPermission(Permission p) { 31 | // Not throwing means accepting anything. 32 | } 33 | 34 | @Override 35 | public void checkPermission(Permission p, Object ctx) { 36 | // Not throwing means accepting anything. 37 | } 38 | 39 | @Override 40 | public void checkExit(int status) { 41 | super.checkExit(status); 42 | throw new SecurityException("System.exit(" + status + ") called from within an action."); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwhisk-devtools/54734862af8e58276341963b8bc51123098453d1/knative-build/runtimes/java/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /knative-build/runtimes/java/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | distributionBase=GRADLE_USER_HOME 18 | distributionPath=wrapper/dists 19 | zipStoreBase=GRADLE_USER_HOME 20 | zipStorePath=wrapper/dists 21 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip 22 | -------------------------------------------------------------------------------- /knative-build/runtimes/java/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | include 'tests' 19 | 20 | include 'core:java8' 21 | //include 'core:java8:proxy' 22 | 23 | rootProject.name = 'runtime-java' 24 | 25 | gradle.ext.openwhisk = [ 26 | version: '1.0.0-SNAPSHOT' 27 | ] 28 | 29 | gradle.ext.scala = [ 30 | version: '2.12.7', 31 | compileFlags: ['-feature', '-unchecked', '-deprecation', '-Xfatal-warnings', '-Ywarn-unused-import'] 32 | ] 33 | 34 | gradle.ext.scalafmt = [ 35 | version: '1.5.0', 36 | config: new File(rootProject.projectDir, '.scalafmt.conf') 37 | ] 38 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | FROM node:10.15.0-stretch 19 | RUN apt-get update && apt-get install -y \ 20 | imagemagick \ 21 | zip \ 22 | unzip \ 23 | && rm -rf /var/lib/apt/lists/* 24 | WORKDIR /nodejsAction 25 | COPY . . 26 | # COPY the package.json to root container, so we can install npm packages a level up from user's packages, so user's packages take precedence 27 | COPY ./knative-build/runtimes/javascript/package.json / 28 | RUN cd / && npm install --no-package-lock \ 29 | && npm cache clean --force 30 | EXPOSE 8080 31 | CMD node --expose-gc ./knative-build/runtimes/javascript/app.js 32 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "action-nodejs-v8", 3 | "version": "1.0.0", 4 | "description": "Apache OpenWhisk NodeJS Runtime", 5 | "repository": { 6 | "type": "git", 7 | "url": "git@github.com:apache/openwhisk-runtime-nodejs.git" 8 | }, 9 | "license": "Apache-2.0", 10 | "dependencies": { 11 | "body-parser": "^1.18.3", 12 | "express": "^4.16.4", 13 | "openwhisk": "3.18.0", 14 | "serialize-error": "^3.0.0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/platform/openwhisk.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | var dbg = require('../utils/debug'); 19 | var DEBUG = new dbg(); 20 | 21 | function PlatformOpenWhiskImpl(platformFactory) { 22 | DEBUG.functionStart(); 23 | DEBUG.dumpObject(platformFactory, 'platformFactory'); 24 | // Provide access to common runtime services 25 | var service = platformFactory.service; 26 | 27 | this.registerHandlers = function(app, platform) { 28 | app.post('/init', platformFactory.wrapEndpoint(service.initCode)); 29 | app.post('/run', platformFactory.wrapEndpoint(service.runCode)); 30 | }; 31 | DEBUG.functionEnd(); 32 | } 33 | 34 | module.exports = PlatformOpenWhiskImpl; 35 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/error/payload-agnostic-bad-run-http-method-unsupported.http: -------------------------------------------------------------------------------- 1 | GET http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "Bad", 7 | "place" : "POST" 8 | } 9 | } 10 | 11 | ### -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/error/payload-agnostic-bad-run-invalid-route.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/bad HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "Bad", 7 | "place" : "POST" 8 | } 9 | } 10 | 11 | ### -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/error/payload-kn-bad-http-body-data-missing.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/error/payload-kn-bad-http-body-empty.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | } 6 | 7 | ### 8 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/error/payload-kn-bad-init-code-empty.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "init": { 6 | "name" : "bad-init-code-empty", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "" 10 | } 11 | } 12 | 13 | ### 14 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/error/payload-kn-bad-init-json-payload-invalid.http: -------------------------------------------------------------------------------- 1 | GET http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "init": { 6 | "name" : "bad-init-json-payload-syntax-error", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "function main() {return {payload: 'Hello World!'};}", 10 | } 11 | } 12 | 13 | ### 14 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/error/payload-kn-bad-initrun-activation-action-name-empy.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "init": { 6 | "name": "nodejs-helloworld-from-init", 7 | "main": "main", 8 | "binary": false, 9 | "code": "function main() {return {payload: 'Hello World! (' + process.env[\"__OW_ACTION_NAME\"] + ')'};}" 10 | }, 11 | "activation": { 12 | "namespace": "default", 13 | "action_name": "", 14 | "api_host": "", 15 | "api_key": "", 16 | "activation_id": "", 17 | "deadline": "4102498800000" 18 | }, 19 | "value": { 20 | "name": "Joe", 21 | "place": "TX" 22 | } 23 | } 24 | 25 | ### 26 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/error/payload-kn-bad-initrun-activation-action-name-missing.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "init": { 6 | "name": "nodejs-helloworld-from-init", 7 | "main": "main", 8 | "binary": false, 9 | "code": "function main() {return {payload: 'Hello World! (' + process.env[\"__OW_ACTION_NAME\"] + ')'};}" 10 | }, 11 | "activation": { 12 | "namespace": "default", 13 | "api_host": "", 14 | "api_key": "", 15 | "activation_id": "", 16 | "deadline": "4102498800000" 17 | }, 18 | "value": { 19 | "name": "Joe", 20 | "place": "TX" 21 | } 22 | } 23 | 24 | ### 25 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/error/payload-ow-bad-init-code-empty.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/init HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "bad-init-code-empty", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "" 10 | } 11 | } 12 | 13 | ### 14 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/error/payload-ow-bad-init-code-missing.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/init HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "bad-init-no-code-key-missing", 7 | "main" : "main", 8 | "binary": false 9 | } 10 | } 11 | 12 | ### 13 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworld/build-without-code.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: build.knative.dev/v1alpha1 19 | kind: Build 20 | metadata: 21 | name: nodejs-10-helloworld 22 | spec: 23 | serviceAccountName: openwhisk-runtime-builder 24 | source: 25 | git: 26 | url: "https://github.com/apache/openwhisk-devtools.git" 27 | revision: "master" 28 | template: 29 | name: openwhisk-nodejs-runtime 30 | arguments: 31 | - name: TARGET_IMAGE_NAME 32 | value: "docker.io/${DOCKER_USERNAME}/nodejs-10-helloworld" 33 | - name: DOCKERFILE 34 | value: "./knative-build/runtimes/javascript/Dockerfile" 35 | - name: OW_RUNTIME_DEBUG 36 | value: "true" 37 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworld/build.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: build.knative.dev/v1alpha1 19 | kind: Build 20 | metadata: 21 | name: nodejs-10-helloworld 22 | spec: 23 | serviceAccountName: openwhisk-runtime-builder 24 | source: 25 | git: 26 | url: "https://github.com/apache/openwhisk-devtools.git" 27 | revision: "master" 28 | template: 29 | name: openwhisk-nodejs-runtime 30 | arguments: 31 | - name: TARGET_IMAGE_NAME 32 | value: "docker.io/${DOCKER_USERNAME}/nodejs-10-helloworld" 33 | - name: DOCKERFILE 34 | value: "./knative-build/runtimes/javascript/Dockerfile" 35 | - name: OW_RUNTIME_DEBUG 36 | value: "true" 37 | - name: OW_ACTION_NAME 38 | value: "nodejs-helloworld" 39 | - name: OW_ACTION_CODE 40 | value: "function main() {return {payload: 'Hello World!'};}" 41 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworld/knative-data-init-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "init": { 3 | "name": "nodejs-helloworld", 4 | "main": "main", 5 | "binary": false, 6 | "code": "function main() {return {payload: 'Hello World!'};}" 7 | }, 8 | "activation": { 9 | "namespace": "default", 10 | "action_name": "nodejs-helloworld", 11 | "api_host": "", 12 | "api_key": "", 13 | "activation_id": "", 14 | "deadline": "4102498800000" 15 | }, 16 | "value": { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworld/knative-data-init.json: -------------------------------------------------------------------------------- 1 | { 2 | "init": { 3 | "name": "nodejs-helloworld", 4 | "main": "main", 5 | "binary": false, 6 | "code": "function main() {return {payload: 'Hello World!'};}" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworld/knative-data-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "activation": { 3 | "namespace": "default", 4 | "action_name": "nodejs-helloworld", 5 | "api_host": "", 6 | "api_key": "", 7 | "activation_id": "", 8 | "deadline": "4102498800000" 9 | }, 10 | "value": { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworld/openwhisk-data-init.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": { 3 | "name" : "nodejs-helloworld", 4 | "main" : "main", 5 | "binary": false, 6 | "code" : "function main() {return {payload: 'Hello World!'};}" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworld/openwhisk-data-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": { 3 | 4 | }, 5 | "namespace": "default", 6 | "action_name": "nodejs-helloworld", 7 | "api_host": "", 8 | "api_key": "", 9 | "activation_id": "", 10 | "deadline": "4102498800000" 11 | } 12 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworld/payload-knative-init-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "init": { 6 | "name": "nodejs-helloworld", 7 | "main": "main", 8 | "binary": false, 9 | "code": "function main() {return {payload: 'Hello World!'};}" 10 | }, 11 | "activation": { 12 | "namespace": "default", 13 | "action_name": "nodejs-helloworld", 14 | "api_host": "", 15 | "api_key": "", 16 | "activation_id": "", 17 | "deadline": "4102498800000" 18 | }, 19 | "value": { 20 | "name": "Joe", 21 | "place": "TX" 22 | } 23 | } 24 | 25 | ### 26 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworld/payload-knative-init.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "init": { 6 | "name": "nodejs-helloworld", 7 | "main": "main", 8 | "binary": false, 9 | "code": "function main() {return {payload: 'Hello World!'};}" 10 | } 11 | } 12 | 13 | ### 14 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworld/payload-knative-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "activation": { 6 | "namespace": "default", 7 | "action_name": "nodejs-helloworld", 8 | "api_host": "", 9 | "api_key": "", 10 | "activation_id": "", 11 | "deadline": "4102498800000" 12 | }, 13 | "value": { 14 | } 15 | } 16 | 17 | ### 18 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworld/payload-openwhisk-init.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/init HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "nodejs-helloworld", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "function main() {return {payload: 'Hello World!'};}" 10 | } 11 | } 12 | 13 | ### 14 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworld/payload-openwhisk-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/run HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | }, 7 | "namespace": "default", 8 | "action_name": "nodejs-helloworld", 9 | "api_host": "", 10 | "api_key": "", 11 | "activation_id": "", 12 | "deadline": "4102498800000" 13 | } 14 | 15 | ### 16 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworld/service.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: serving.knative.dev/v1alpha1 19 | kind: Service 20 | metadata: 21 | name: nodejs-helloworld 22 | namespace: default 23 | spec: 24 | runLatest: 25 | configuration: 26 | revisionTemplate: 27 | spec: 28 | container: 29 | image: docker.io/${DOCKER_USERNAME}/nodejs-10-helloworld 30 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparams/build-without-code.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: build.knative.dev/v1alpha1 19 | kind: Build 20 | metadata: 21 | name: nodejs-10-helloworld-with-params 22 | spec: 23 | serviceAccountName: openwhisk-runtime-builder 24 | source: 25 | git: 26 | url: "https://github.com/apache/openwhisk-devtools.git" 27 | revision: "master" 28 | template: 29 | name: openwhisk-nodejs-runtime 30 | arguments: 31 | - name: TARGET_IMAGE_NAME 32 | value: "docker.io/${DOCKER_USERNAME}/nodejs-10-helloworld-with-params" 33 | - name: DOCKERFILE 34 | value: "./knative-build/runtimes/javascript/Dockerfile" 35 | - name: OW_RUNTIME_DEBUG 36 | value: "true" 37 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparams/build.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: build.knative.dev/v1alpha1 19 | kind: Build 20 | metadata: 21 | name: nodejs-10-helloworld-with-params 22 | spec: 23 | serviceAccountName: openwhisk-runtime-builder 24 | source: 25 | git: 26 | url: "https://github.com/apache/openwhisk-devtools.git" 27 | revision: "master" 28 | template: 29 | name: openwhisk-nodejs-runtime 30 | arguments: 31 | - name: TARGET_IMAGE_NAME 32 | value: "docker.io/${DOCKER_USERNAME}/nodejs-10-helloworld-with-params" 33 | - name: DOCKERFILE 34 | value: "./knative-build/runtimes/javascript/Dockerfile" 35 | - name: OW_RUNTIME_DEBUG 36 | value: "true" 37 | - name: OW_ACTION_NAME 38 | value: "nodejs-helloworld-with-params" 39 | - name: OW_ACTION_CODE 40 | value: "function main() {return {payload: 'Hello ' + params.name + ' from ' + params.place + '!'};}" 41 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparams/knative-data-init-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "init": { 3 | "name" : "nodejs-helloworld-with-params", 4 | "main" : "main", 5 | "binary": false, 6 | "code" : "function main(params) {return {payload: 'Hello ' + params.name + ' from ' + params.place + '!'};}" 7 | }, 8 | "activation": { 9 | "namespace": "default", 10 | "action_name": "nodejs-helloworld-with-params", 11 | "api_host": "", 12 | "api_key": "", 13 | "activation_id": "", 14 | "deadline": "4102498800000" 15 | }, 16 | "value": { 17 | "name" : "Joe", 18 | "place" : "TX" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparams/knative-data-init.json: -------------------------------------------------------------------------------- 1 | { 2 | "init": { 3 | "name" : "nodejs-helloworld-with-params", 4 | "main" : "main", 5 | "binary": false, 6 | "code" : "function main(params) {return {payload: 'Hello ' + params.name + ' from ' + params.place + '!'};}" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparams/knative-data-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "activation": { 3 | "namespace": "default", 4 | "action_name": "nodejs-helloworld-with-params", 5 | "api_host": "", 6 | "api_key": "", 7 | "activation_id": "", 8 | "deadline": "4102498800000" 9 | }, 10 | "value": { 11 | "name" : "Jill", 12 | "place" : "OK" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparams/openwhisk-data-init.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": { 3 | "name" : "nodejs-helloworld-with-params", 4 | "main" : "main", 5 | "binary": false, 6 | "code" : "function main(params) {return {payload: 'Hello ' + params.name + ' from ' + params.place + '!'};}" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparams/openwhisk-data-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": { 3 | "name" : "Joe", 4 | "place" : "TX" 5 | }, 6 | "namespace": "default", 7 | "action_name": "nodejs-helloworld-with-params", 8 | "api_host": "", 9 | "api_key": "", 10 | "activation_id": "", 11 | "deadline": "4102498800000" 12 | } 13 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparams/payload-knative-init-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "init": { 6 | "name" : "nodejs-helloworld-with-params", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "function main(params) {return {payload: 'Hello ' + params.name + ' from ' + params.place + '!'};}" 10 | }, 11 | "activation": { 12 | "namespace": "default", 13 | "action_name": "nodejs-helloworld-with-params", 14 | "api_host": "", 15 | "api_key": "", 16 | "activation_id": "", 17 | "deadline": "4102498800000" 18 | }, 19 | "value": { 20 | "name" : "Joe", 21 | "place" : "TX" 22 | } 23 | } 24 | 25 | ### 26 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparams/payload-knative-init.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "init": { 6 | "name" : "nodejs-helloworld-with-params", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "function main(params) {return {payload: 'Hello ' + params.name + ' from ' + params.place + '!'};}" 10 | } 11 | } 12 | 13 | ### 14 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparams/payload-knative-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "activation": { 6 | "namespace": "default", 7 | "action_name": "nodejs-helloworld-with-params", 8 | "api_host": "", 9 | "api_key": "", 10 | "activation_id": "", 11 | "deadline": "4102498800000" 12 | }, 13 | "value": { 14 | "name" : "Jill", 15 | "place" : "OK" 16 | } 17 | } 18 | 19 | ### 20 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparams/payload-openwhisk-init.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/init HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "nodejs-helloworld-with-params", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "function main(params) {return {payload: 'Hello ' + params.name + ' from ' + params.place + '!'};}" 10 | } 11 | } 12 | 13 | ### 14 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparams/payload-openwhisk-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/run HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "Joe", 7 | "place" : "TX" 8 | }, 9 | "namespace": "default", 10 | "action_name": "nodejs-helloworld-with-params", 11 | "api_host": "", 12 | "api_key": "", 13 | "activation_id": "", 14 | "deadline": "4102498800000" 15 | } 16 | 17 | ### 18 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparams/service.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: serving.knative.dev/v1alpha1 19 | kind: Service 20 | metadata: 21 | name: nodejs-helloworld-with-params 22 | namespace: default 23 | spec: 24 | runLatest: 25 | configuration: 26 | revisionTemplate: 27 | spec: 28 | container: 29 | image: docker.io/${DOCKER_USERNAME}/nodejs-10-helloworld-with-params 30 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/build-without-code.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: build.knative.dev/v1alpha1 19 | kind: Build 20 | metadata: 21 | name: nodejs-10-helloworld-with-params-from-env 22 | spec: 23 | serviceAccountName: openwhisk-runtime-builder 24 | source: 25 | git: 26 | url: "https://github.com/apache/openwhisk-devtools.git" 27 | revision: "master" 28 | template: 29 | name: openwhisk-nodejs-runtime 30 | arguments: 31 | - name: TARGET_IMAGE_NAME 32 | value: "docker.io/${DOCKER_USERNAME}/nodejs-10-helloworld-with-params-from-env" 33 | - name: DOCKERFILE 34 | value: "./knative-build/runtimes/javascript/Dockerfile" 35 | - name: OW_RUNTIME_DEBUG 36 | value: "true" 37 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/build.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: build.knative.dev/v1alpha1 19 | kind: Build 20 | metadata: 21 | name: nodejs-10-helloworld-with-params-from-env 22 | spec: 23 | serviceAccountName: openwhisk-runtime-builder 24 | source: 25 | git: 26 | url: "https://github.com/apache/openwhisk-devtools.git" 27 | revision: "master" 28 | template: 29 | name: openwhisk-nodejs-runtime 30 | arguments: 31 | - name: TARGET_IMAGE_NAME 32 | value: "docker.io/${DOCKER_USERNAME}/nodejs-10-helloworld-with-params-from-env" 33 | - name: DOCKERFILE 34 | value: "./knative-build/runtimes/javascript/Dockerfile" 35 | - name: OW_RUNTIME_DEBUG 36 | value: "true" 37 | - name: OW_ACTION_NAME 38 | value: "nodejs-helloworld-with-params-from-env" 39 | - name: OW_ACTION_CODE 40 | value: "function main() {return {payload: 'Hello ' + process.env.NAME + ' from ' + process.env.PLACE + '!'};}" 41 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/knative-data-init-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "init": { 3 | "name" : "nodejs-helloworld-with-params-from-env", 4 | "main" : "main", 5 | "binary": false, 6 | "code" : "function main() {return {payload: 'Hello ' + process.env.NAME + ' from ' + process.env.PLACE + '!'};}" 7 | }, 8 | "activation": { 9 | "namespace": "default", 10 | "action_name": "nodejs-helloworld-with-params-from-env", 11 | "api_host": "", 12 | "api_key": "", 13 | "activation_id": "", 14 | "deadline": "4102498800000" 15 | }, 16 | "value": { 17 | "name" : "Jess", 18 | "place" : "OK" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/knative-data-init.json: -------------------------------------------------------------------------------- 1 | { 2 | "init": { 3 | "name" : "nodejs-helloworld-with-params-from-env", 4 | "main" : "main", 5 | "binary": false, 6 | "code" : "function main() {return {payload: 'Hello ' + process.env.NAME + ' from ' + process.env.PLACE + '!'};}" 7 | } 8 | } 9 | 10 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/knative-data-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "activation": { 3 | "namespace": "default", 4 | "action_name": "nodejs-helloworld-with-params-from-env", 5 | "api_host": "", 6 | "api_key": "", 7 | "activation_id": "", 8 | "deadline": "4102498800000" 9 | }, 10 | "value": { 11 | "name" : "Jess", 12 | "place" : "OK" 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/openwhisk-data-init.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": { 3 | "name" : "nodejs-helloworld-with-params-from-env", 4 | "main" : "main", 5 | "binary": false, 6 | "code" : "function main() {return {payload: 'Hello ' + process.env.NAME + ' from ' + process.env.PLACE + '!'};}" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/openwhisk-data-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": { 3 | "name" : "Jess", 4 | "place" : "OK" 5 | }, 6 | "namespace": "default", 7 | "action_name": "nodejs-helloworld-with-params-from-env", 8 | "api_host": "", 9 | "api_key": "", 10 | "activation_id": "", 11 | "deadline": "4102498800000" 12 | } 13 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/payload-knative-init-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "init": { 6 | "name" : "nodejs-helloworld-with-params-from-env", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "function main() {return {payload: 'Hello ' + process.env.NAME + ' from ' + process.env.PLACE + '!'};}" 10 | }, 11 | "activation": { 12 | "namespace": "default", 13 | "action_name": "nodejs-helloworld-with-params-from-env", 14 | "api_host": "", 15 | "api_key": "", 16 | "activation_id": "", 17 | "deadline": "4102498800000" 18 | }, 19 | "value": { 20 | "name" : "Jess", 21 | "place" : "OK" 22 | } 23 | } 24 | 25 | ### 26 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/payload-openwhisk-init.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/init HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "nodejs-helloworld-with-params-from-env", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "function main() {return {payload: 'Hello ' + process.env.NAME + ' from ' + process.env.PLACE + '!'};}" 10 | } 11 | } 12 | 13 | ### 14 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/payload-openwhisk-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/run HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "Jess", 7 | "place" : "OK" 8 | }, 9 | "namespace": "default", 10 | "action_name": "nodejs-helloworld-with-params-from-env", 11 | "api_host": "", 12 | "api_key": "", 13 | "activation_id": "", 14 | "deadline": "4102498800000" 15 | } 16 | ### 17 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/service.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: serving.knative.dev/v1alpha1 19 | kind: Service 20 | metadata: 21 | name: nodejs-helloworld-with-params-from-env 22 | namespace: default 23 | spec: 24 | runLatest: 25 | configuration: 26 | revisionTemplate: 27 | spec: 28 | container: 29 | image: docker.io/${DOCKER_USERNAME}/nodejs-10-helloworld-with-params-from-env 30 | env: 31 | - name: NAME 32 | value: Bob 33 | - name: PLACE 34 | value: Italy 35 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/packageaction/build.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: build.knative.dev/v1alpha1 19 | kind: Build 20 | metadata: 21 | name: nodejs-10-package-npm 22 | spec: 23 | serviceAccountName: openwhisk-runtime-builder 24 | sources: 25 | - name: runtime 26 | git: 27 | url: "https://github.com/apache/openwhisk-devtools.git" 28 | revision: "master" 29 | - name: application 30 | targetPath: app 31 | git: 32 | url: "https://github.com/apache/openwhisk-test.git" 33 | revision: "master" 34 | template: 35 | name: openwhisk-nodejs-runtime 36 | arguments: 37 | - name: TARGET_IMAGE_NAME 38 | value: "docker.io/${DOCKER_USERNAME}/nodejs-10-package-npm" 39 | - name: DOCKERFILE 40 | value: "./knative-build/runtimes/javascript/Dockerfile" 41 | - name: OW_ACTION_BINARY 42 | value: "true" 43 | - name: OW_ACTION_NAME 44 | value: "nodejs-package-npm" 45 | - name: OW_PROJECT_URL 46 | value: "./app/packages/left-pad/" 47 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/packageaction/knative-data-init-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "init": { 3 | "name" : "nodejs-package-npm", 4 | "main" : "main", 5 | "binary": true, 6 | "url" : "app/packages/left-pad/" 7 | }, 8 | "activation": { 9 | "namespace": "default", 10 | "action_name": "nodejs-package-npm", 11 | "api_host": "", 12 | "api_key": "", 13 | "activation_id": "", 14 | "deadline": "4102498800000" 15 | }, 16 | "value": { 17 | "lines" : ["Hello","How are you?"] 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/packageaction/knative-data-init.json: -------------------------------------------------------------------------------- 1 | { 2 | "init": { 3 | "name" : "nodejs-package-npm", 4 | "main" : "main", 5 | "binary": true, 6 | "url" : "app/packages/left-pad/" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/packageaction/knative-data-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "activation": { 3 | "namespace": "default", 4 | "action_name": "nodejs-package-npm", 5 | "api_host": "", 6 | "api_key": "", 7 | "activation_id": "", 8 | "deadline": "4102498800000" 9 | }, 10 | "value": { 11 | "lines" : ["Hello","How are you?"] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/packageaction/service.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: serving.knative.dev/v1alpha1 19 | kind: Service 20 | metadata: 21 | name: nodejs-package-npm 22 | namespace: default 23 | spec: 24 | runLatest: 25 | configuration: 26 | revisionTemplate: 27 | spec: 28 | container: 29 | image: docker.io/${DOCKER_USERNAME}/nodejs-10-package-npm 30 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionhelloworld/build.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: build.knative.dev/v1alpha1 19 | kind: Build 20 | metadata: 21 | name: nodejs-10-web-action-helloworld 22 | spec: 23 | serviceAccountName: openwhisk-runtime-builder 24 | source: 25 | git: 26 | url: "https://github.com/apache/openwhisk-devtools.git" 27 | revision: "master" 28 | template: 29 | name: openwhisk-nodejs-runtime 30 | arguments: 31 | - name: TARGET_IMAGE_NAME 32 | value: "docker.io/${DOCKER_USERNAME}/nodejs-10-web-action-helloworld" 33 | - name: DOCKERFILE 34 | value: "./knative-build/runtimes/javascript/Dockerfile" 35 | - name: OW_RUNTIME_DEBUG 36 | value: "true" 37 | - name: OW_ACTION_NAME 38 | value: "nodejs-web-action-helloworld" 39 | - name: OW_ACTION_CODE 40 | "value" : "function main({name}) { var msg = 'you did not tell me who you are.'; if (name) { msg = `hello ${name}` } return {body: `

${msg}

`} }" 41 | 42 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionhelloworld/data-init-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "init": { 3 | "name" : "nodejs-web-action-helloworld", 4 | "main" : "main", 5 | "binary": false, 6 | "code" : "function main({name}) { var msg = 'you did not tell me who you are.'; if (name) { msg = `hello ${name}` } return {body: `

${msg}

`} }" 7 | }, 8 | "activation": { 9 | "namespace": "default", 10 | "action_name": "nodejs-web-action-helloworld", 11 | "api_host": "", 12 | "api_key": "", 13 | "activation_id": "", 14 | "deadline": "4102498800000" 15 | }, 16 | "value": { 17 | "name": "Joe" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionhelloworld/data-init.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": { 3 | "name" : "nodejs-web-action-helloworld", 4 | "main" : "main", 5 | "binary": false, 6 | "code" : "function main({name}) { var msg = 'you did not tell me who you are.'; if (name) { msg = `hello ${name}` } return {body: `

${msg}

`} }" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionhelloworld/data-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": { 3 | "name": "Joe" 4 | }, 5 | "namespace": "default", 6 | "action_name": "nodejs-web-action-helloworld", 7 | "api_host": "", 8 | "api_key": "", 9 | "activation_id": "", 10 | "deadline": "4102498800000" 11 | } 12 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionhelloworld/payload-knative-init-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "init": { 6 | "name" : "nodejs-web-action-helloworld", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "function main({name}) { var msg = 'you did not tell me who you are.'; if (name) { msg = `hello ${name}` } return {body: `

${msg}

`} }" 10 | }, 11 | "activation": { 12 | "namespace": "default", 13 | "action_name": "nodejs-web-action-helloworld", 14 | "api_host": "", 15 | "api_key": "", 16 | "activation_id": "", 17 | "deadline": "4102498800000" 18 | }, 19 | "value": { 20 | "name": "Joe" 21 | } 22 | } 23 | 24 | ### 25 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionhelloworld/payload-openwhisk-init.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/init HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "nodejs-web-action-helloworld", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "function main({name}) { var msg = 'you did not tell me who you are.'; if (name) { msg = `hello ${name}` } return {body: `

${msg}

`} }" 10 | } 11 | } 12 | 13 | ### 14 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionhelloworld/payload-openwhisk-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/run HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "Joe" 7 | }, 8 | "namespace": "default", 9 | "action_name": "nodejs-web-action-helloworld", 10 | "api_host": "", 11 | "api_key": "", 12 | "activation_id": "", 13 | "deadline": "4102498800000" 14 | } 15 | 16 | ### 17 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionhelloworld/service.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: serving.knative.dev/v1alpha1 19 | kind: Service 20 | metadata: 21 | name: nodejs-web-action-helloworld 22 | namespace: default 23 | spec: 24 | runLatest: 25 | configuration: 26 | revisionTemplate: 27 | spec: 28 | container: 29 | image: docker.io/${DOCKER_USERNAME}/nodejs-10-web-action-helloworld 30 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionhttpredirect/data-init-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "init": { 3 | "name" : "nodejs-web-action-to-redirect", 4 | "main" : "main", 5 | "binary": false, 6 | "code" : "function main() { return { headers: { location: 'http://openwhisk.org' }, statusCode: 302 }}" 7 | }, 8 | "activation": { 9 | "namespace": "default", 10 | "action_name": "nodejs-web-action-to-redirect", 11 | "api_host": "", 12 | "api_key": "", 13 | "activation_id": "", 14 | "deadline": "4102498800000" 15 | }, 16 | "value": { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionhttpredirect/payload-knative-init-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "init": { 6 | "name" : "nodejs-web-action-to-redirect", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "function main() { return { headers: { location: 'http://openwhisk.org' }, statusCode: 302 }}" 10 | }, 11 | "activation": { 12 | "namespace": "default", 13 | "action_name": "nodejs-web-action-to-redirect", 14 | "api_host": "", 15 | "api_key": "", 16 | "activation_id": "", 17 | "deadline": "4102498800000" 18 | }, 19 | "value": { 20 | } 21 | } 22 | 23 | ### 24 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionhttpredirect/payload-openwhisk-init.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/init HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "nodejs-web-action-to-redirect", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "function main() { return { headers: { location: 'http://openwhisk.org' }, statusCode: 302 }}" 10 | } 11 | } 12 | 13 | ### 14 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionhttpredirect/payload-openwhisk-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/run HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | }, 7 | "namespace": "default", 8 | "action_name": "nodejs-web-action-to-redirect", 9 | "api_host": "", 10 | "api_key": "", 11 | "activation_id": "", 12 | "deadline": "4102498800000" 13 | } 14 | 15 | ### 16 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionjsonparams/data-init-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "init": { 3 | "name" : "nodejs-web-action-json-params", 4 | "main" : "main", 5 | "binary": false, 6 | "code": "function main(params) { return { statusCode: 200, headers: { 'Content-Type': 'application/json' }, body: params }};" 7 | }, 8 | "activation": { 9 | "namespace": "default", 10 | "action_name": "nodejs-web-action-json-params", 11 | "api_host": "", 12 | "api_key": "", 13 | "activation_id": "", 14 | "deadline": "4102498800000" 15 | }, 16 | "value": { 17 | "name": "Joe" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionjsonparams/payload-knative-init-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "init": { 6 | "name" : "nodejs-web-action-json-params", 7 | "main" : "main", 8 | "binary": false, 9 | "code": "function main(params) { return { statusCode: 200, headers: { 'Content-Type': 'application/json' }, body: params }};" 10 | }, 11 | "activation": { 12 | "namespace": "default", 13 | "action_name": "nodejs-web-action-json-params", 14 | "api_host": "", 15 | "api_key": "", 16 | "activation_id": "", 17 | "deadline": "4102498800000" 18 | }, 19 | "value": { 20 | "name": "Joe" 21 | } 22 | } 23 | 24 | ### 25 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionjsonparams/payload-openwhisk-init.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/init HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "nodejs-web-action-json-params", 7 | "main" : "main", 8 | "binary": false, 9 | "code": "function main(params) { return { statusCode: 200, headers: { 'Content-Type': 'application/json' }, body: params }};", 10 | } 11 | } 12 | 13 | ### 14 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionjsonparams/payload-openwhisk-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/run HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "Joe" 7 | }, 8 | "namespace": "default", 9 | "action_name": "nodejs-web-action-json-params", 10 | "api_host": "", 11 | "api_key": "", 12 | "activation_id": "", 13 | "deadline": "4102498800000" 14 | } 15 | 16 | ### 17 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionoptions/data-init-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "init": { 3 | "name" : "nodejs-web-action-options", 4 | "main" : "main", 5 | "binary": false, 6 | "code" : "function main(params) { if (params.__ow_method == 'OPTIONS') { return { headers: { 'Access-Control-Allow-Methods': 'OPTIONS, GET', 'Access-Control-Allow-Origin': 'example.com' }, statusCode: 200 }}}" 7 | }, 8 | "activation": { 9 | "namespace": "default", 10 | "action_name": "nodejs-web-action-options", 11 | "api_host": "", 12 | "api_key": "", 13 | "activation_id": "", 14 | "deadline": "4102498800000" 15 | }, 16 | "value": { 17 | "name": "Joe" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionoptions/payload-knative-init-run.http: -------------------------------------------------------------------------------- 1 | OPTIONS http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "init": { 6 | "name" : "nodejs-web-action-options", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "function main(params) { if (params.__ow_method == 'OPTIONS') { return { headers: { 'Access-Control-Allow-Methods': 'OPTIONS, GET', 'Access-Control-Allow-Origin': 'example.com' }, statusCode: 200 }}}" 10 | }, 11 | "activation": { 12 | "namespace": "default", 13 | "action_name": "nodejs-web-action-options", 14 | "api_host": "", 15 | "api_key": "", 16 | "activation_id": "", 17 | "deadline": "4102498800000" 18 | }, 19 | "value": { 20 | "name": "Joe" 21 | } 22 | } 23 | 24 | ### 25 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionpng/data-init-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "init": { 3 | "name" : "nodejs-web-action-png", 4 | "main" : "main", 5 | "binary": false, 6 | "code": "function main() {let png = 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAGCAYAAAD68A/GAAAA/klEQVQYGWNgAAEHBxaG//+ZQMyyn581Pfas+cRQnf1LfFLjf+62smUgcUbt0FA2Zh7drf/ffMy9vLn3RurrW9e5hCU11i2azfD4zu1/DHz8TAy/foUxsXBrFzHzC7r8+M9S1vn1qxQT07dDjL9fdemrqKxlYGT6z8AIMo6hgeUfA0PUvy9fGFh5GWK3z7vNxSWt++jX99+8SoyiGQwsW38w8PJEM7x5v5SJ8f+/xv8MDAzffv9hevfkWjiXBGMpMx+j2awovjcMjFztDO8+7GF49LkbZDCDeXLTWnZO7qDfn1/+5jbw/8pjYWS4wZLztXnuEuYTk2M+MzIw/AcA36VewaD6fzsAAAAASUVORK5CYII='; return { headers: { 'Content-Type': 'image/png' }, statusCode: 200, body: png };}" 7 | }, 8 | "activation": { 9 | "namespace": "default", 10 | "action_name": "nodejs-web-action-png", 11 | "api_host": "", 12 | "api_key": "", 13 | "activation_id": "", 14 | "deadline": "4102498800000" 15 | }, 16 | "value": { 17 | "name": "Joe" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionpng/payload-knative-init-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "init": { 6 | "name" : "nodejs-web-action-png", 7 | "main" : "main", 8 | "binary": false, 9 | "code": "function main() {let png = 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAGCAYAAAD68A/GAAAA/klEQVQYGWNgAAEHBxaG//+ZQMyyn581Pfas+cRQnf1LfFLjf+62smUgcUbt0FA2Zh7drf/ffMy9vLn3RurrW9e5hCU11i2azfD4zu1/DHz8TAy/foUxsXBrFzHzC7r8+M9S1vn1qxQT07dDjL9fdemrqKxlYGT6z8AIMo6hgeUfA0PUvy9fGFh5GWK3z7vNxSWt++jX99+8SoyiGQwsW38w8PJEM7x5v5SJ8f+/xv8MDAzffv9hevfkWjiXBGMpMx+j2awovjcMjFztDO8+7GF49LkbZDCDeXLTWnZO7qDfn1/+5jbw/8pjYWS4wZLztXnuEuYTk2M+MzIw/AcA36VewaD6fzsAAAAASUVORK5CYII='; return { headers: { 'Content-Type': 'image/png' }, statusCode: 200, body: png };}" 10 | }, 11 | "activation": { 12 | "namespace": "default", 13 | "action_name": "nodejs-web-action-png", 14 | "api_host": "", 15 | "api_key": "", 16 | "activation_id": "", 17 | "deadline": "4102498800000" 18 | }, 19 | "value": { 20 | "name": "Joe" 21 | } 22 | } 23 | 24 | ### 25 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionpng/payload-openwhisk-init.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/init HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "nodejs-web-action-png", 7 | "main" : "main", 8 | "binary": false, 9 | "code": "function main() {let png = 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAGCAYAAAD68A/GAAAA/klEQVQYGWNgAAEHBxaG//+ZQMyyn581Pfas+cRQnf1LfFLjf+62smUgcUbt0FA2Zh7drf/ffMy9vLn3RurrW9e5hCU11i2azfD4zu1/DHz8TAy/foUxsXBrFzHzC7r8+M9S1vn1qxQT07dDjL9fdemrqKxlYGT6z8AIMo6hgeUfA0PUvy9fGFh5GWK3z7vNxSWt++jX99+8SoyiGQwsW38w8PJEM7x5v5SJ8f+/xv8MDAzffv9hevfkWjiXBGMpMx+j2awovjcMjFztDO8+7GF49LkbZDCDeXLTWnZO7qDfn1/+5jbw/8pjYWS4wZLztXnuEuYTk2M+MzIw/AcA36VewaD6fzsAAAAASUVORK5CYII='; return { headers: { 'Content-Type': 'image/png' }, statusCode: 200, body: png };}" 10 | } 11 | } 12 | 13 | ### 14 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionpng/payload-openwhisk-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/run HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "Joe" 7 | }, 8 | "namespace": "default", 9 | "action_name": "nodejs-web-action-png", 10 | "api_host": "", 11 | "api_key": "", 12 | "activation_id": "", 13 | "deadline": "4102498800000" 14 | } 15 | 16 | ### 17 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionraw/build.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: build.knative.dev/v1alpha1 19 | kind: Build 20 | metadata: 21 | name: nodejs-10-web-action-raw 22 | spec: 23 | serviceAccountName: openwhisk-runtime-builder 24 | source: 25 | git: 26 | url: "https://github.com/apache/openwhisk-devtools.git" 27 | revision: "master" 28 | template: 29 | name: openwhisk-nodejs-runtime 30 | arguments: 31 | - name: TARGET_IMAGE_NAME 32 | value: "docker.io/${DOCKER_USERNAME}/nodejs-10-web-action-raw" 33 | - name: DOCKERFILE 34 | value: "./knative-build/runtimes/javascript/Dockerfile" 35 | - name: OW_RUNTIME_DEBUG 36 | value: "true" 37 | - name: OW_ACTION_NAME 38 | value: "nodejs-web-action-raw" 39 | - name: OW_ACTION_CODE 40 | value : "function main(params) { return { response: params }; }" 41 | - name: OW_ACTION_RAW 42 | value: "true" 43 | 44 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionraw/knative-data-init-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "init": { 3 | "name" : "nodejs-web-action-raw", 4 | "main" : "main", 5 | "binary": false, 6 | "code" : "function main(params) { return { response: params }; }", 7 | "raw": true 8 | }, 9 | "activation": { 10 | "namespace": "default", 11 | "action_name": "nodejs-web-action-raw", 12 | "api_host": "", 13 | "api_key": "", 14 | "activation_id": "", 15 | "deadline": "4102498800000" 16 | }, 17 | "value": { 18 | "name": "Joe" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionraw/knative-data-init.json: -------------------------------------------------------------------------------- 1 | { 2 | "init": { 3 | "name" : "nodejs-web-action-raw", 4 | "main" : "main", 5 | "binary": false, 6 | "code" : "function main(params) { return { response: params }; }", 7 | "raw": true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionraw/knative-data-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "activation": { 3 | "namespace": "default", 4 | "action_name": "nodejs-web-action-raw", 5 | "api_host": "", 6 | "api_key": "", 7 | "activation_id": "", 8 | "deadline": "4102498800000" 9 | }, 10 | "value": { 11 | "name": "Joe" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionraw/openwhisk-data-init.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": { 3 | "name" : "nodejs-web-action-raw", 4 | "main" : "main", 5 | "binary": false, 6 | "code" : "function main(params) { return { response: params }; }" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionraw/openwhisk-data-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": { 3 | "name": "Joe" 4 | }, 5 | "namespace": "default", 6 | "action_name": "nodejs-web-action-raw", 7 | "api_host": "", 8 | "api_key": "", 9 | "activation_id": "", 10 | "deadline": "4102498800000" 11 | } 12 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionraw/payload-knative-init-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "init": { 6 | "name" : "nodejs-web-action-raw", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "function main(params) { return { response: params }; }", 10 | "raw": true 11 | }, 12 | "activation": { 13 | "namespace": "default", 14 | "action_name": "nodejs-web-action-raw", 15 | "api_host": "", 16 | "api_key": "", 17 | "activation_id": "", 18 | "deadline": "4102498800000" 19 | }, 20 | "value": { 21 | "name": "Joe" 22 | } 23 | } 24 | 25 | ### 26 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionraw/payload-knative-init.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "init": { 6 | "name" : "nodejs-web-action-raw", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "function main(params) { return { response: params }; }", 10 | "raw": true 11 | } 12 | } 13 | 14 | ### 15 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionraw/payload-knative-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "activation": { 6 | "namespace": "default", 7 | "action_name": "nodejs-web-action-raw", 8 | "api_host": "", 9 | "api_key": "", 10 | "activation_id": "", 11 | "deadline": "4102498800000" 12 | }, 13 | "value": { 14 | "name": "Joe" 15 | } 16 | } 17 | 18 | ### 19 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionraw/payload-openwhisk-init.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/init HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "nodejs-web-action-raw", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "function main(params) { return { response: params }; }" 10 | } 11 | } 12 | 13 | ### 14 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionraw/payload-openwhisk-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/run HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "name" : "Joe" 7 | }, 8 | "namespace": "default", 9 | "action_name": "nodejs-web-action-raw", 10 | "api_host": "", 11 | "api_key": "", 12 | "activation_id": "", 13 | "deadline": "4102498800000" 14 | } 15 | 16 | ### 17 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionraw/service.yaml.tmpl: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: serving.knative.dev/v1alpha1 19 | kind: Service 20 | metadata: 21 | name: nodejs-web-action-raw 22 | namespace: default 23 | spec: 24 | runLatest: 25 | configuration: 26 | revisionTemplate: 27 | spec: 28 | container: 29 | image: docker.io/${DOCKER_USERNAME}/nodejs-10-web-action-raw 30 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionsettingcookie/data-init-run.json: -------------------------------------------------------------------------------- 1 | { 2 | "init": { 3 | "name" : "nodejs-web-action-set-a-cookie", 4 | "main" : "main", 5 | "binary": false, 6 | "code" : "function main() { return { headers: { 'Set-Cookie': 'UserID=Jane; Max-Age=3600; Version=', 'Content-Type': 'text/html'}, statusCode: 200, body: '

hello

' }}" 7 | }, 8 | "activation": { 9 | "namespace": "default", 10 | "action_name": "nodejs-web-action-set-a-cookie", 11 | "api_host": "", 12 | "api_key": "", 13 | "activation_id": "", 14 | "deadline": "4102498800000" 15 | }, 16 | "value": { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionsettingcookie/payload-knative-init-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/ HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "init": { 6 | "name" : "nodejs-web-action-set-a-cookie", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "function main() { return { headers: { 'Set-Cookie': 'UserID=Jane; Max-Age=3600; Version=', 'Content-Type': 'text/html'}, statusCode: 200, body: '

hello

' }}" 10 | }, 11 | "activation": { 12 | "namespace": "default", 13 | "action_name": "nodejs-web-action-set-a-cookie", 14 | "api_host": "", 15 | "api_key": "", 16 | "activation_id": "", 17 | "deadline": "4102498800000" 18 | }, 19 | "value": { 20 | } 21 | } 22 | 23 | ### 24 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionsettingcookie/payload-openwhisk-init.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/init HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | "__ow_action_name" : "nodejs-web-action-set-a-cookie", 7 | "main" : "main", 8 | "binary": false, 9 | "code" : "function main() { return { headers: { 'Set-Cookie': 'UserID=Jane; Max-Age=3600; Version=', 'Content-Type': 'text/html'}, statusCode: 200, body: '

hello

' }}" 10 | } 11 | } 12 | 13 | ### 14 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/tests/webactionsettingcookie/payload-openwhisk-run.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/run HTTP/1.1 2 | content-type: application/json 3 | 4 | { 5 | "value": { 6 | }, 7 | "namespace": "default", 8 | "action_name": "nodejs-web-action-set-a-cookie", 9 | "api_host": "", 10 | "api_key": "", 11 | "activation_id": "", 12 | "deadline": "4102498800000" 13 | } 14 | 15 | ### 16 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/utils/cleanjs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | USAGE="cleanjs.sh " 19 | 20 | if [ $1 ] 21 | then 22 | : # $1 was given 23 | SOURCE=$1 24 | 25 | echo "SOURCE=[$SOURCE]" 26 | TARGET=$SOURCE"/.cleanjs" 27 | echo "TARGET=[$TARGET]" 28 | 29 | # create target directory 30 | mkdir -p $TARGET 31 | 32 | # copy all javascript files while preserving the original path 33 | find $SOURCE -name "*.js" | cpio -p -dumv $TARGET/ 34 | 35 | # remove the package itself 36 | find $TARGET -type f -exec sed -i '' -e '\|utils/debug|d' '{}' \; 37 | 38 | # remove all lines that dereference the package (i.e., named DEBUG by convention) 39 | find $TARGET -type f -exec sed -i '' -e '/DEBUG/d' '{}' \; 40 | 41 | else 42 | echo $USAGE 43 | exit 1 44 | fi 45 | -------------------------------------------------------------------------------- /knative-build/runtimes/javascript/utils/dbgstrip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | USAGE="dbgstrip " 19 | 20 | if [ $1 ] 21 | then 22 | : # $1 was given 23 | SOURCE=$1 24 | 25 | if [ $2 ] 26 | then 27 | : 28 | TARGET=$2 29 | else 30 | echo $USAGE 31 | exit 2 32 | fi 33 | 34 | echo "SOURCE=[$SOURCE]" 35 | echo "TARGET=[$TARGET]" 36 | 37 | # FIRST: remove the package itself THEN: remove all lines that 38 | # dereference the package (i.e., named DEBUG by convention) 39 | sed '\|utils/debug|d' $SOURCE | sed '/DEBUG/d' > $TARGET 40 | 41 | else 42 | echo $USAGE 43 | exit 1 44 | fi 45 | -------------------------------------------------------------------------------- /knative-build/service-account.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: v1 19 | kind: ServiceAccount 20 | metadata: 21 | name: openwhisk-runtime-builder 22 | secrets: 23 | - name: dockerhub-user-pass 24 | -------------------------------------------------------------------------------- /maven-java/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = false 10 | 11 | # Matches multiple files with brace expansion notation 12 | # Set default charset 13 | [*.{js,py,java}] 14 | charset = utf-8 15 | 16 | # 4 space indentation 17 | [*.java] 18 | indent_style = space 19 | indent_size = 2 20 | insert_final_newline = true 21 | 22 | # Indentation style for yaml, yml 23 | [*.{js,xml,html,json,yaml,yml}] 24 | indent_style = space 25 | indent_size = 2 -------------------------------------------------------------------------------- /maven-java/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | *.iml 3 | *.idea 4 | .vscode 5 | .project 6 | **/.settings 7 | .classpath -------------------------------------------------------------------------------- /maven-java/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwhisk-devtools/54734862af8e58276341963b8bc51123098453d1/maven-java/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /maven-java/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.2/apache-maven-3.5.2-bin.zip 19 | -------------------------------------------------------------------------------- /maven-java/README.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # Maven Example 21 | 22 | 23 | This example shows how to deploy a Java Action which has external dependency. This 24 | example uses Maven as the dependency manager. 25 | 26 | ## Build 27 | 28 | ``` 29 | ./mvnw clean install 30 | ``` 31 | 32 | ## Deploying the application to OpenWhisk 33 | 34 | ``` 35 | wsk -i action create md5hasher target/maven-java.jar --main org.apache.openwhisk.example.maven.App 36 | ``` 37 | 38 | ## Invoking Action 39 | 40 | ``` 41 | wsk -i action invoke md5hasher --result -p text openwhisk 42 | ``` 43 | 44 | Invoking the above action will return an JSON output which will have original plain text and MD5 hash of the same. 45 | 46 | #### Output of above action: 47 | 48 | ``` 49 | { 50 | "md5": "803cd3a8fe96ceab1dc654dc6e41be5c", 51 | "text": "openwhisk" 52 | } 53 | ``` 54 | -------------------------------------------------------------------------------- /maven-java/dependency-reduced-pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | openwhisk.example.maven 5 | maven-java 6 | OpenWhisk::Examples::Maven with External Deps 7 | 1.0-SNAPSHOT 8 | https://openwhisk.apache.org/ 9 | 10 | maven-java 11 | 12 | 13 | maven-shade-plugin 14 | 3.1.0 15 | 16 | 17 | package 18 | 19 | shade 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 1.8 28 | UTF-8 29 | 1.8 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /maven-java/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | openwhisk.example.maven 6 | maven-java 7 | 1.0-SNAPSHOT 8 | jar 9 | OpenWhisk::Examples::Maven with External Deps 10 | https://openwhisk.apache.org/ 11 | 12 | UTF-8 13 | 1.8 14 | 1.8 15 | 16 | 17 | 18 | com.google.code.gson 19 | gson 20 | 2.8.2 21 | 22 | 23 | com.google.guava 24 | guava 25 | 24.0-jre 26 | 27 | 28 | 29 | maven-java 30 | 31 | 32 | org.apache.maven.plugins 33 | maven-shade-plugin 34 | 3.1.0 35 | 36 | 37 | package 38 | 39 | shade 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /maven-java/src/main/java/org/apache/openwhisk/example/maven/App.java: -------------------------------------------------------------------------------- 1 | package org.apache.openwhisk.example.maven; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | import java.nio.charset.Charset; 20 | 21 | import com.google.common.hash.Hasher; 22 | import com.google.common.hash.Hashing; 23 | import com.google.gson.JsonObject; 24 | 25 | public class App { 26 | public static JsonObject main(JsonObject args) { 27 | JsonObject response = new JsonObject(); 28 | if (args.has("text")) { 29 | String text = args.getAsJsonPrimitive("text").getAsString(); 30 | try { 31 | Hasher hasher = Hashing.md5().newHasher(); 32 | hasher.putString(text.toString(), Charset.forName("UTF-8")); 33 | response.addProperty("text", text); 34 | response.addProperty("md5", hasher.hash().toString()); 35 | } catch (Exception e) { 36 | response.addProperty("Error", e.getMessage()); 37 | } 38 | } 39 | return response; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /terraform-wskdeploy-plugin/.gitignore: -------------------------------------------------------------------------------- 1 | local.env 2 | *.log 3 | /.c9 4 | /snippets 5 | backup.sh 6 | actions/mhpost/node_modules 7 | actions/mhpost/mhpost.zip 8 | VCAP_SERVICES.json 9 | .idea 10 | -------------------------------------------------------------------------------- /terraform-wskdeploy-plugin/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | SOURCEDIR=. 19 | 20 | SOURCES := $(shell find $(SOURCEDIR) -name '*.go') 21 | BINARY=terraform-provider-example 22 | 23 | VERSION=1.0.0 24 | 25 | BUILD=`git rev-parse HEAD` 26 | 27 | # Build the project 28 | build:deps 29 | go build ${LDFLAGS} -o ${BINARY} 30 | 31 | deps: 32 | @echo "Installing dependencies" 33 | go get -d -t ./... 34 | 35 | LDFLAGS=-ldflags "-X main.Version=`date -u '+%Y-%m-%dT%H:%M:%S'` -X main.Build=`git rev-parse HEAD` " 36 | 37 | 38 | -------------------------------------------------------------------------------- /terraform-wskdeploy-plugin/main.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package main 19 | 20 | import ( 21 | "github.com/hashicorp/terraform/plugin" 22 | "github.com/hashicorp/terraform/terraform" 23 | ) 24 | 25 | func main() { 26 | plugin.Serve(&plugin.ServeOpts{ 27 | ProviderFunc: func() terraform.ResourceProvider { 28 | return Provider() 29 | }, 30 | }) 31 | } 32 | -------------------------------------------------------------------------------- /terraform-wskdeploy-plugin/main.tf: -------------------------------------------------------------------------------- 1 | resource "example_server" "my-server" { 2 | address = "1.2.3.4" 3 | wskdeploy_yaml = "/Users/$USER/$GOPATH/src/github.com/apache/openwhisk-wskdeploy/tests/src/integration/triggerrule/manifest.yml" 4 | } 5 | -------------------------------------------------------------------------------- /terraform-wskdeploy-plugin/provider.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package main 19 | 20 | import "github.com/hashicorp/terraform/helper/schema" 21 | 22 | func Provider() *schema.Provider { 23 | return &schema.Provider{ 24 | ResourcesMap: map[string]*schema.Resource{ 25 | "example_server": resourceServer(), 26 | }, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tools/travis/scancode.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | set -e 19 | 20 | # Build script for Travis-CI. 21 | SCRIPTDIR=$(cd $(dirname "$0") && pwd) 22 | ROOTDIR="$SCRIPTDIR/../.." 23 | UTIL_DIR="$ROOTDIR/../openwhisk-utilities" 24 | 25 | # run scancode 26 | cd $UTIL_DIR 27 | scancode/scanCode.py $ROOTDIR 28 | -------------------------------------------------------------------------------- /tools/travis/setupscan.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | SCRIPTDIR=$(cd $(dirname "$0") && pwd) 19 | HOMEDIR="$SCRIPTDIR/../../../" 20 | 21 | # clone OpenWhisk utilities repo. in order to run scanCode.py 22 | cd $HOMEDIR 23 | git clone https://github.com/apache/openwhisk-utilities.git 24 | --------------------------------------------------------------------------------