Skip to content
Snippets Groups Projects
Commit 497a9775 authored by Carlos Santana's avatar Carlos Santana
Browse files

configure as stand-alone repo

parent 504877fc
No related branches found
No related tags found
No related merge requests found
Showing
with 369 additions and 82 deletions
sudo: required
group: deprecated-2017Q3
language: scala
scala:
- 2.11.8
services:
- docker
before_install:
- "./tools/travis/setup.sh"
install: true
script:
- "./tools/travis/build.sh && ./tools/travis/deploy.sh && ./tools/travis/test.sh"
deploy:
- provider: script
script: "./tools/travis/publish.sh csantanapr ${TRAVIS_TAG%@*} ${TRAVIS_TAG##*@}"
on:
tags: true
all_branches: true
env:
global:
- secure: ekeKM0bPtGx051FdMOUmqK8yDGQGlyGkJeMU+PAzwWf2XBGzl3SQijOse6uRpyMT/ik3V4rO3CsW+Bdlsu50ylF8nKGVtTpuISTetUCtDHg6m8Fwro//JeXHi3ufJaHtNNos5m8ZmX8rkGZLLSsIwrNQzYHHfiqDhdAL642snLfk3qddjjRBdYD7jGQBr6EwVu5sEORmDJf63I4wwW8fI7olBtIa4W1xW/2dZGoxNU984ypOzG0yoerxgxsuD1ZchS9R93NEG8kcQLpmzqYMFN9XguqXWdp4f8ImbSIGQ0ANDtHIGs+7ZX56fuDA0VsDwK9OCIfG1ZrsO94/fdb/sbSKKuYc0u4l5SVx+n6gdttikGJT6IMM2kRQ5eT/SbJiZshyLkB117IVq3JHTIS3alDSIchFP589sVxfAVzZJ89p5cq7g2JU+weObgxd6Tp/rkEjF5Obo2/5iFf+J5Lf56Ei83SnmYeu7maAzIv+fLzTONymWpCwOtQcif4LeiMNTUdgYtHRBKRCFaMEuOaGi20YuIyoy+OULM/KUFDHwIJROkNFZ+SQ19Jx0qQOIY85E8+D4JBLcXp8VZVGMY+ZnoE76ih/WZZ8wl3zwq0+l53sYhOWUfo5fFSxqg5Ac6gG9OTeO4PmmV/m7ZKdFWFbGbB4qhBq+4swsVpOR+cMuUQ=
- secure: dMiAsOrklxVR/tkyM11pibEpqdz1qEjziDU1slIYCG4PFRmX9DC9s+fe5gnOCLhyXmt0khz+MG5Pg9bjOma06XbaUAxPvQ+pAf1/OO/e96VLLEo7Bz4jY8qJlvQTfDbAJFlmXOThNu81uNWAvccb+7+Bf/26UOH5vmAvpdIGTsudU1kmC4C+WYRNjtY0us1OPP6jabKZ7jCnQ8m5rAaUPAwuyiwKPEM+Uk0Yo0SvyiMyxihJIJnPi3kT7D0wqQdq9l9WGWSJRCnu6sRpc/VFDRfIcAnxVrg/AuGRxXedO8QdJvJTugxmIxbwB3bYGHZBfHIQkiQfo+7urWXpApNr5ytUjMm0u6ktb53zjhGm2T16Ow04DByT8FWyMnak+ekyV2v7E037Gdq28SgclbZTTJYMtix0rylt/d70upsDbiOKulxWhhIIv1+qZa9kaclW/FXe+0VziSSspJv6ZzXe1DBEpi/W3dm6/GUzbm41h/5agnvCspJ7itsksaXOwCDB3jSCMcqpW9JiLjDyVklycF9QsGUPOa9hOA3eTve2Y3G3ToPFG7tCZYj/SbN6Cm6jpuFcczjT/Lps8XNg0jDcpfZJYP+vWiPa/4vJdo/NAvOdr+VesxAC/2BIGu4OSBi/ayXeEDa8QEen7BCmfYWAtkTsKhO6JNx81e1KekT802o=
# Apache OpenWhisk runtimes for swift
[![Build Status](https://travis-ci.org/apache/incubator-openwhisk-runtime-python.svg?branch=master)](https://travis-ci.org/apache/incubator-openwhisk-runtime-python)
### Give it a try today
To use as a docker action using python 3
```
wsk action update myAction myAction.py --docker openwhisk/python3action:1.0.0
```
Replace `python3ction` with `python2acton` to use python 2.
### To use on deployment that contains the rutime as a kind
To use as a kind action using python 3
```
wsk action update myAction myAction.swift --kind python:3
```
Replace `python:3` with `python:2` to use python 2.
### Local development
```
./gradlew core:pythonAction:distDocker
```
This will produce the image `whisk/python3action`
Build and Push image
```
docker login
./gradlew core:pythonAction:distDocker -PdockerImagePrefix=$prefix-user -PdockerRegistry=docker.io
```
Replace `core:pythonAction` with `core:python2Action` to build python 2 instead.
Deploy OpenWhisk using ansible environment that contains the kind `python:3` and `python:2`
Assuming you have OpenWhisk already deploy localy and `OPENWHISK_HOME` pointing to root directory of OpenWhisk core repository.
Set `ROOTDIR` to the root directory of this repository.
Redeploy OpenWhisk
```
cd $OPENWHISK_HOME/ansible
ANSIBLE_CMD="ansible-playbook -i ${ROOTDIR}/ansible/environments/local"
$ANSIBLE_CMD setup.yml
$ANSIBLE_CMD couchdb.yml
$ANSIBLE_CMD initdb.yml
$ANSIBLE_CMD wipe.yml
$ANSIBLE_CMD openwhisk.yml
```
Or you can use `wskdev` and create a soft link to the target ansible environment, for example:
```
ln -s ${ROOTDIR}/ansible/environments/local ${OPENWHISK_HOME}/ansible/environments/local-python
wskdev fresh -t local-python
```
To use as docker action push to your own dockerhub account
```
docker tag whisk/python3action $user_prefix/python
docker push $user_prefix/python3action
```
Then create the action using your the image from dockerhub
```
wsk action update myAction myAction.py --docker $user_prefix/python3action
```
The `$user_prefix` is usually your dockerhub user id.
Replace `python3action` with `python2action` to use python 2
# License
[Apache 2.0](LICENSE.txt)
whisk_version_name: local
config_root_dir: /tmp
whisk_logs_dir: /tmp/wsklogs
docker_registry: ""
docker_dns: ""
db_prefix: whisk_local_
# Auto lookup to find the db credentials
db_provider: "{{ lookup('ini', 'db_provider section=db_creds file={{ playbook_dir }}/db_local.ini') }}"
db_username: "{{ lookup('ini', 'db_username section=db_creds file={{ playbook_dir }}/db_local.ini') }}"
db_password: "{{ lookup('ini', 'db_password section=db_creds file={{ playbook_dir }}/db_local.ini') }}"
db_protocol: "{{ lookup('ini', 'db_protocol section=db_creds file={{ playbook_dir }}/db_local.ini') }}"
db_host: "{{ lookup('ini', 'db_host section=db_creds file={{ playbook_dir }}/db_local.ini') }}"
db_port: "{{ lookup('ini', 'db_port section=db_creds file={{ playbook_dir }}/db_local.ini') }}"
# API GW connection configuration
apigw_auth_user: ""
apigw_auth_pwd: ""
apigw_host_v2: "http://{{ groups['apigateway']|first }}:{{apigateway.port.api}}/v2"
controller_arguments: '-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=1098'
invoker_arguments: "{{ controller_arguments }}"
invoker_allow_multiple_instances: true
runtimes_manifest:
defaultImagePrefix: "openwhisk"
defaultImageTag: "latest"
runtimes:
nodejs:
- kind: "nodejs:6"
default: true
image:
name: "nodejs6action"
deprecated: false
python:
- kind: "python"
image:
name: "python2action"
deprecated: false
- kind: "python:2"
default: true
image:
name: "python2action"
deprecated: false
- kind: "python:3"
image:
name: "python3action"
deprecated: false
blackboxes:
- name: "dockerskeleton"
; the first parameter in a host is the inventory_hostname
; used for local actions only
ansible ansible_connection=local
[edge]
172.17.0.1 ansible_host=172.17.0.1 ansible_connection=local
[controllers]
controller0 ansible_host=172.17.0.1 ansible_connection=local
[kafka]
172.17.0.1 ansible_host=172.17.0.1 ansible_connection=local
[invokers]
invoker0 ansible_host=172.17.0.1 ansible_connection=local
; db group is only used if db_provider is CouchDB
[db]
172.17.0.1 ansible_host=172.17.0.1 ansible_connection=local
[redis]
172.17.0.1 ansible_host=172.17.0.1 ansible_connection=local
[apigateway]
172.17.0.1 ansible_host=172.17.0.1 ansible_connection=local
# Python 2 OpenWhisk Runtime Container
## 1.0.0
Change: Initial release
Python version = 2.7.12
- asn1crypto (0.22.0)
- attrs (17.2.0)
- beautifulsoup4 (4.5.1)
- cffi (1.10.0)
- click (6.7)
- cryptography (2.0.3)
- cssselect (1.0.1)
- enum34 (1.1.6)
- Flask (0.11.1)
- gevent (1.1.2)
- greenlet (0.4.12)
- httplib2 (0.9.2)
- idna (2.6)
- ipaddress (1.0.18)
- itsdangerous (0.24)
- Jinja2 (2.9.6)
- kafka-python (1.3.1)
- lxml (3.6.4)
- MarkupSafe (1.0)
- parsel (1.2.0)
- pip (9.0.1)
- pyasn1 (0.3.3)
- pyasn1-modules (0.1.1)
- pycparser (2.18)
- PyDispatcher (2.0.5)
- pyOpenSSL (17.2.0)
- python-dateutil (2.5.3)
- queuelib (1.4.2)
- requests (2.11.1)
- Scrapy (1.1.2)
- service-identity (17.0.0)
- setuptools (36.4.0)
- simplejson (3.8.2)
- six (1.10.0)
- Twisted (16.4.0)
- virtualenv (15.1.0)
- w3lib (1.18.0)
- Werkzeug (0.12.2)
- wheel (0.29.0)
- zope.interface (4.4.2)
File moved
...@@ -4,7 +4,6 @@ distDocker.dependsOn 'copyFiles' ...@@ -4,7 +4,6 @@ distDocker.dependsOn 'copyFiles'
distDocker.finalizedBy 'rmFiles' distDocker.finalizedBy 'rmFiles'
def runners = files( def runners = files(
new File(project(':core:actionProxy').projectDir, 'actionproxy.py'),
new File(project(':core:pythonAction').projectDir, 'pythonrunner.py') new File(project(':core:pythonAction').projectDir, 'pythonrunner.py')
) )
......
File moved
# Python 3 OpenWhisk Runtime Container
## 1.0.0
Change: Initial release
Python version = 3.6.1
- asn1crypto (0.23.0)
- attrs (17.2.0)
- Automat (0.6.0)
- beautifulsoup4 (4.5.3)
- cffi (1.11.1)
- click (6.7)
- constantly (15.1.0)
- cryptography (2.0.3)
- cssselect (1.0.1)
- Flask (0.12)
- gevent (1.2.1)
- greenlet (0.4.12)
- httplib2 (0.10.3)
- idna (2.6)
- incremental (17.5.0)
- itsdangerous (0.24)
- Jinja2 (2.9.6)
- kafka-python (1.3.4)
- lxml (3.7.3)
- MarkupSafe (1.0)
- parsel (1.2.0)
- pip (9.0.1)
- pyasn1 (0.3.7)
- pyasn1-modules (0.1.4)
- pycparser (2.18)
- PyDispatcher (2.0.5)
- pyOpenSSL (17.3.0)
- python-dateutil (2.6.0)
- queuelib (1.4.2)
- requests (2.13.0)
- Scrapy (1.3.3)
- service-identity (17.0.0)
- setuptools (36.5.0)
- simplejson (3.10.0)
- six (1.11.0)
- Twisted (17.1.0)
- virtualenv (15.1.0)
- w3lib (1.18.0)
- Werkzeug (0.12.2)
- wheel (0.29.0)
- zope.interface (4.4.3)
# Dockerfile for python actions, overrides and extends ActionRunner from actionProxy # Dockerfile for python actions, overrides and extends ActionRunner from actionProxy
FROM dockerskeleton FROM openwhisk/dockerskeleton:1.0.0
RUN apk add --no-cache \ RUN apk add --no-cache \
bzip2-dev \ bzip2-dev \
......
ext.dockerImageName = 'python3action' ext.dockerImageName = 'python3action'
apply from: '../../gradle/docker.gradle' apply from: '../../gradle/docker.gradle'
distDocker.dependsOn ':core:actionProxy:distDocker'
include 'common:scala' def owPath = System.getenv("OPENWHISK_HOME") ?: '../open'
def owDirectory = new File(owPath)
include 'core:controller' include 'common:scala'; project(':common:scala').projectDir = new File(owDirectory, 'common/scala')
include 'core:invoker' include 'core:controller'; project(':core:controller').projectDir = new File(owDirectory, 'core/controller')
include 'core:nodejsActionBase' include 'core:invoker'; project(':core:invoker').projectDir = new File(owDirectory, 'core/invoker')
include 'core:nodejs6Action' include 'whisktests'; project(':whisktests').projectDir = new File(owDirectory, 'tests')
include 'core:actionProxy'
include 'core:pythonAction'
include 'core:python2Action'
include 'core:swift3Action'
include 'core:swift3.1.1Action'
include 'core:javaAction'
include 'core:php7.1Action'
include 'tools:cli'
include 'sdk:docker'
include 'tests' include 'tests'
include 'tests:dat:blackbox:badaction'
include 'tests:dat:blackbox:badproxy'
rootProject.name = 'openwhisk' include 'core:pythonAction'
include 'core:python2Action'
rootProject.name = 'runtime-python'
gradle.ext.scala = [ gradle.ext.scala = [
version: '2.11.8', version: '2.11.8',
......
...@@ -2,13 +2,13 @@ apply plugin: 'scala' ...@@ -2,13 +2,13 @@ apply plugin: 'scala'
apply plugin: 'eclipse' apply plugin: 'eclipse'
compileTestScala.options.encoding = 'UTF-8' compileTestScala.options.encoding = 'UTF-8'
evaluationDependsOn(':whisktests')
repositories { repositories {
mavenCentral() mavenCentral()
} }
tasks.withType(Test) { tasks.withType(Test) {
systemProperties(System.getProperties())
testLogging { testLogging {
events "passed", "skipped", "failed" events "passed", "skipped", "failed"
showStandardStreams = true showStandardStreams = true
...@@ -17,63 +17,12 @@ tasks.withType(Test) { ...@@ -17,63 +17,12 @@ tasks.withType(Test) {
outputs.upToDateWhen { false } // force tests to run every time outputs.upToDateWhen { false } // force tests to run every time
} }
task testLean(type: Test) {
exclude '**/*Swift*'
exclude '**/*Python*'
exclude '**/*Java*'
exclude '**/*ThrottleTests*'
exclude '**/MaxActionDurationTests*'
exclude '**/*ApiGwTests*'
}
// Add all images needed for local testing here
test.dependsOn([
':core:nodejs6Action:distDocker',
':core:actionProxy:distDocker',
':core:pythonAction:distDocker',
':core:python2Action:distDocker',
':core:javaAction:distDocker',
':core:swift3Action:distDocker',
':core:swift3.1.1Action:distDocker',
':sdk:docker:distDocker',
':tests:dat:blackbox:badaction:distDocker',
':tests:dat:blackbox:badproxy:distDocker'
])
dependencies { dependencies {
compile "org.scala-lang:scala-library:${gradle.scala.version}" compile "org.scala-lang:scala-library:${gradle.scala.version}"
compile 'org.apache.commons:commons-lang3:3.3.2' compile project(':whisktests')
compile 'org.apache.httpcomponents:httpclient:4.5.2:tests' compile project(':whisktests').sourceSets.test.output
compile 'org.apache.httpcomponents:httpmime:4.3.6'
compile 'junit:junit:4.11'
compile 'com.jayway.restassured:rest-assured:2.6.0'
compile 'org.scalatest:scalatest_2.11:3.0.1'
compile 'com.typesafe.akka:akka-testkit_2.11:2.5.4'
compile 'com.google.code.gson:gson:2.3.1'
compile 'org.scalamock:scalamock-scalatest-support_2.11:3.4.2'
compile 'com.typesafe.akka:akka-testkit_2.11:2.4.16'
compile 'com.typesafe.akka:akka-http-testkit_2.11:10.0.10'
compile 'com.github.java-json-tools:json-schema-validator:2.2.8';
compile project(':common:scala')
compile project(':core:controller')
compile project(':core:invoker')
} }
tasks.withType(ScalaCompile) { tasks.withType(ScalaCompile) {
scalaCompileOptions.additionalParameters = gradle.scala.compileFlags scalaCompileOptions.additionalParameters = gradle.scala.compileFlags
} }
def keystorePath = new File(sourceSets.test.scala.outputDir, 'keystore')
task deleteKeystore(type: Delete) {
delete keystorePath
}
task createKeystore(dependsOn: deleteKeystore) {
doLast {
Properties props = new Properties()
props.load(new FileInputStream(file('../whisk.properties')))
def cmd = ['keytool', '-import', '-alias', 'Whisk', '-noprompt', '-trustcacerts', '-file', file(props['whisk.ssl.cert']), '-keystore', keystorePath, '-storepass', 'openwhisk']
cmd.execute().waitForProcessOutput(System.out, System.err)
}
}
compileTestScala.finalizedBy createKeystore
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package actionContainers package runtime.actionContainers
import java.io.ByteArrayOutputStream import java.io.ByteArrayOutputStream
import java.io.File import java.io.File
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package actionContainers package runtime.actionContainers
import java.io.File import java.io.File
import java.util.Base64 import java.util.Base64
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package actionContainers package runtime.actionContainers
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner import org.scalatest.junit.JUnitRunner
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package actionContainers package runtime.actionContainers
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner import org.scalatest.junit.JUnitRunner
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package actionContainers package runtime.actionContainers
import java.net.URI import java.net.URI
import java.net.URLClassLoader import java.net.URLClassLoader
......
#!/bin/bash
set -ex
# Build script for Travis-CI.
SCRIPTDIR=$(cd $(dirname "$0") && pwd)
ROOTDIR="$SCRIPTDIR/../.."
WHISKDIR="$ROOTDIR/../openwhisk"
export OPENWHISK_HOME=$WHISKDIR
IMAGE_PREFIX="testing"
# Build runtime
cd $ROOTDIR
TERM=dumb ./gradlew \
:core:python2Action:distDocker :core:pythonAction:distDocker \
-PdockerImagePrefix=${IMAGE_PREFIX}
# Build OpenWhisk
cd $WHISKDIR
#pull down images
docker pull openwhisk/controller
docker tag openwhisk/controller ${IMAGE_PREFIX}/controller
docker pull openwhisk/invoker
docker tag openwhisk/invoker ${IMAGE_PREFIX}/invoker
docker pull openwhisk/nodejs6action
docker tag openwhisk/nodejs6action ${IMAGE_PREFIX}/nodejs6action
#Build CLI
TERM=dumb ./gradlew \
:tools:cli:distDocker \
-PdockerImagePrefix=${IMAGE_PREFIX}
#!/bin/bash
set -ex
# Build script for Travis-CI.
SCRIPTDIR=$(cd $(dirname "$0") && pwd)
ROOTDIR="$SCRIPTDIR/../.."
WHISKDIR="$ROOTDIR/../openwhisk"
export OPENWHISK_HOME=$WHISKDIR
IMAGE_PREFIX="testing"
# Deploy OpenWhisk
cd $WHISKDIR/ansible
ANSIBLE_CMD="ansible-playbook -i ${ROOTDIR}/ansible/environments/local -e docker_image_prefix=${IMAGE_PREFIX}"
$ANSIBLE_CMD setup.yml
$ANSIBLE_CMD prereq.yml
$ANSIBLE_CMD couchdb.yml
$ANSIBLE_CMD initdb.yml
$ANSIBLE_CMD wipe.yml
$ANSIBLE_CMD openwhisk.yml
docker images
docker ps
cat $WHISKDIR/whisk.properties
curl -s -k https://172.17.0.1 | jq .
curl -s -k https://172.17.0.1/api/v1 | jq .
#Deployment
WHISK_APIHOST="172.17.0.1"
WHISK_AUTH=`cat ${WHISKDIR}/ansible/files/auth.guest`
WHISK_CLI="${WHISKDIR}/bin/wsk -i"
${WHISK_CLI} property set --apihost ${WHISK_APIHOST} --auth ${WHISK_AUTH}
${WHISK_CLI} property get
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment