Git Product home page Git Product logo

apache / openwhisk Goto Github PK

View Code? Open in Web Editor NEW
6.4K 231.0 1.2K 67.98 MB

Apache OpenWhisk is an open source serverless cloud platform

Home Page: https://openwhisk.apache.org/

License: Apache License 2.0

JavaScript 4.36% Shell 1.95% Swift 0.21% Scala 89.31% Python 2.16% Java 0.66% Groovy 0.40% Lua 0.01% Dockerfile 0.27% C# 0.02% HTML 0.11% CSS 0.08% Jinja 0.41% Mustache 0.05%
openwhisk apache serverless cloud faas functions-as-a-service serverless-architectures serverless-functions docker kubernetes

openwhisk's Introduction

OpenWhisk

License Join Slack Twitter

Unit Tests System Tests MultiRuntime Tests Standalone Tests Scheduler Tests Performance Tests codecov

OpenWhisk is a serverless functions platform for building cloud applications. OpenWhisk offers a rich programming model for creating serverless APIs from functions, composing functions into serverless workflows, and connecting events to functions using rules and triggers. Learn more at http://openwhisk.apache.org.

Quick Start

The easiest way to start using OpenWhisk is to install the "Standalone" OpenWhisk stack. This is a full-featured OpenWhisk stack running as a Java process for convenience. Serverless functions run within Docker containers. You will need Docker, Java and Node.js available on your machine.

To get started:

git clone https://github.com/apache/openwhisk.git
cd openwhisk
./gradlew core:standalone:bootRun
  • When the OpenWhisk stack is up, it will open your browser to a functions Playground, typically served from http://localhost:3232. The Playground allows you create and run functions directly from your browser.

  • To make use of all OpenWhisk features, you will need the OpenWhisk command line tool called wsk which you can download from https://s.apache.org/openwhisk-cli-download. Please refer to the CLI configuration for additional details. Typically you configure the CLI for Standalone OpenWhisk as follows:

wsk property set \
  --apihost 'http://localhost:3233' \
  --auth '23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP'
  • Standalone OpenWhisk can be configured to deploy additional capabilities when that is desirable. Additional resources are available here.

Deploy to Kubernetes

OpenWhisk can also be installed on a Kubernetes cluster. You can use a managed Kubernetes cluster provisioned from a public cloud provider (e.g., AKS, EKS, IKS, GKE), or a cluster you manage yourself. Additionally for local development, OpenWhisk is compatible with Minikube, and Kubernetes for Mac using the support built into Docker 18.06 (or higher).

To get started:

git clone https://github.com/apache/openwhisk-deploy-kube.git

Then follow the instructions in the OpenWhisk on Kubernetes README.md.

Learn Concepts and Commands

Browse the documentation to learn more. Here are some topics you may be interested in:

OpenWhisk Community and Support

Report bugs, ask questions and request features here on GitHub.

You can also join the OpenWhisk Team on Slack https://openwhisk-team.slack.com and chat with developers. To get access to our public Slack team, request an invite https://openwhisk.apache.org/slack.html.

Project Repository Structure

The OpenWhisk system is built from a number of components. The picture below groups the components by their GitHub repos. Please open issues for a component against the appropriate repo (if in doubt just open against the main openwhisk repo).

component/repo mapping

What happens on an invocation?

This diagram depicts the steps which take place within Openwhisk when an action is invoked by the user:

component/repo mapping

openwhisk's People

Contributors

akrabat avatar bdoyle0182 avatar cbickel avatar chetanmeh avatar csantanapr avatar dgrove-oss avatar dubee avatar ioana-blue avatar jasonpet avatar jeremiaswerner avatar jiangpengcheng avatar jonpspri avatar markusthoemmes avatar mcdan avatar mdeuser avatar mhenke1 avatar mrutkows avatar ningyougang avatar paulcastro avatar perryibm avatar psuter avatar rabbah avatar sjfink avatar starpit avatar style95 avatar sven-lange-last avatar tysonnorris avatar tz70s avatar upgle avatar vvraskin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openwhisk's Issues

wsk activation poll backoff

currently wsk activation poll polls every 2 seconds, indefinitely.

instead, it should backoff exponentially -- for example, after each 100 seconds, double the poll period.

Provide ansible playbook for consul deployment

Provide an ansible playbook that deploys consul.

Purpose of this playbook is to replace the ant targets

startConsulServer
startConsulClient
startRegistrators

in services/consul/build.xml

Depending on how ansible is going to change the overall deployment, we might also include the importWhiskProperties task in the playbook.

Set your OpenWhisk Namespace and Authorization Key

I had ever connected via CLI successfully. After I build my local OpenWhisk development environment, the CLI does not work.

I input the same command "wsk property set --auth " in my terminal, it returns

error: The supplied authentication is invalid (code 599)

stop printing credentials in build/deploy logs

Several of the build/deploy scripts will echo logging information to console that may contain sensitive information. Remove all of these log messages so that it is easier to post issues and share logs without having to sanitize the logs.

Setup guide for mac-only using docker machine

As a second way of setting up a dev machine there is the option to use docker machine
instead of vagrant.

The advantage is greatly improved performance on a mac.
Also it eliminates problems with shared folders and symlinks.
The result is a mac that builds OpenWhisk locally and deploys it into a very small VM that is managed by docker machine.

These steps should later be turned into a setupguide.md under docs.

"wsk activation poll" should put a timestamp on "Activation: action (id)" statement

The "Activation:..." lines should have a timestamp like the others. Make it easier when debugging a log file to have everything formatted the same.

2016-02-23T15:28:02.015099357Z stdout: [ 3666c679c084045f3ce8fd5366ee5a0d ] Processing image.jpg from document
2016-02-23T15:28:13.826113391Z stdout: [ 3666c679c084045f3ce8fd5366ee5a0d ] OK
Activation: vision-analysis (48581ba45fac4119a5970250e3f0b0d7)
2016-02-23T15:28:14.837651635Z stdout: [ 3666c679c084045f3ce8fd5366ee5a0d ] Processing image.jpg from document
2016-02-23T15:28:18.889271119Z stdout: [ 3666c679c084045f3ce8fd5366ee5a0d ] OK
Activation: vision-analysis (e2e22077ad3945b48b612436fe0bb334)
2016-02-23T15:28:28.280158105Z stdout: [ 3666c679c084045f3ce8fd5366ee5a0d ] Processing image.jpg from document
2016-02-23T15:28:31.245863607Z stdout: [ 3666c679c084045f3ce8fd5366ee5a0d ] OK
Activation: vision-analysis (3b33904f79f448beb0c913856363a088)
2016-02-23T15:28:34.482853574Z stdout: [ 3666c679c084045f3ce8fd5366ee5a0d ] Processing image.jpg from document
2016-02-23T15:28:38.577133336Z stdout: [ 3666c679c084045f3ce8fd5366ee5a0d ] OK
Activation: vision-analysis (0fa2dd0bb55f4df3ba68a571da1a6d34)
2016-02-23T15:51:12.976504553Z stdout: [ cd79105c27b8a96a34c9487de5ae3674 ] Processing image.jpg from document
2016-02-23T15:51:17.293723081Z stdout: [ cd79105c27b8a96a34c9487de5ae3674 ] OK
Activation: vision-analysis (21526c4dd7564090a9095941fa1d546b)
2016-02-23T15:51:29.006188995Z stdout: [ 3dfe009246a5be3eed46b476f527f22f ] Processing image.jpg from document
2016-02-23T15:51:32.361084759Z stdout: [ 3dfe009246a5be3eed46b476f527f22f ] OK
Activation: vision-analysis (123fb4243552491b94b6fcf6a94be745)
2016-02-23T16:17:53.955350233Z stdout: [ 446a5e1a48171008b3faa34b3bd33d00 ] Processing image.jpg from document
2016-02-23T16:17:59.847872226Z stdout: [ 446a5e1a48171008b3faa34b3bd33d00 ] OK

nginx deployment fails if mount source is wiped

Observed this failure a few times and here's how to reproduce it.

sudo rm -rf /tmp/nginx
ant clean build deploy
ant teardown
sudo rm -rf /tmp/nginx # note that if vm reboots or on a vagrant reload, this directory is gone
ant deploy # would normally work without a rebuild modulo the nginx config

Now /tmp/nginx is owned by root instead of the user (e.g., vagrant); nginx deployment appears to work and the failure is detected much later because the API host will not respond. The nginx container during deployment comes up and responds to heartbeat before it detects a bad configuration (and dies).

The nginx deployment needs to assert the configuration directory exists and fail if it does not. This will prevent mounting a non-existent directory and making it root-owned. Should also consider using an alternate directory instead of /tmp.

Lastly, the nginx build needs to fail if it cannot copy the nginx conf to the target directory (which will now happen since that directory is owned by root and the user has to write permission).

wsk activation poll doesn't show anything after a trigger was created

The documentation https://new-console.ng.bluemix.net/docs/openwhisk/openwhisk_catalog.html#openwhisk_catalog_cloudant states in section "Listening for changes to a Cloudant database" that wsk activation poll should show when the trigger is executed.

But this only works after a rule has been created that includes that same trigger and an action.

Could the documentation be updated? Or even better log something when the trigger is executed.

"wsk activation poll" should prefix log statements with activation ID

Having the activation ID in all log statements will make it easier when debugging an execution as one could sort the rows to group them by activation ID.

Currently everything is mixed up:

Activation: vision-analysis (48581ba45fac4119a5970250e3f0b0d7)
Activation: vision-analysis (e2e22077ad3945b48b612436fe0bb334)
Activation: vision-analysis (3b33904f79f448beb0c913856363a088)
2016-02-23T15:28:02.015099357Z stdout: [ 3666c679c084045f3ce8fd5366ee5a0d ] Processing image.jpg from document
2016-02-23T15:28:13.826113391Z stdout: [ 3666c679c084045f3ce8fd5366ee5a0d ] OK
2016-02-23T15:28:14.837651635Z stdout: [ 3666c679c084045f3ce8fd5366ee5a0d ] Processing image.jpg from document
2016-02-23T15:28:18.889271119Z stdout: [ 3666c679c084045f3ce8fd5366ee5a0d ] OK
2016-02-23T15:28:28.280158105Z stdout: [ 3666c679c084045f3ce8fd5366ee5a0d ] Processing image.jpg from document
2016-02-23T15:28:31.245863607Z stdout: [ 3666c679c084045f3ce8fd5366ee5a0d ] OK
2016-02-23T15:28:34.482853574Z stdout: [ 3666c679c084045f3ce8fd5366ee5a0d ] Processing image.jpg from document
2016-02-23T15:28:38.577133336Z stdout: [ 3666c679c084045f3ce8fd5366ee5a0d ] OK
Activation: vision-analysis (0fa2dd0bb55f4df3ba68a571da1a6d34)
2016-02-23T15:51:12.976504553Z stdout: [ cd79105c27b8a96a34c9487de5ae3674 ] Processing image.jpg from document
2016-02-23T15:51:17.293723081Z stdout: [ cd79105c27b8a96a34c9487de5ae3674 ] OK
Activation: vision-analysis (21526c4dd7564090a9095941fa1d546b)
2016-02-23T15:51:29.006188995Z stdout: [ 3dfe009246a5be3eed46b476f527f22f ] Processing image.jpg from document
2016-02-23T15:51:32.361084759Z stdout: [ 3dfe009246a5be3eed46b476f527f22f ] OK
Activation: vision-analysis (123fb4243552491b94b6fcf6a94be745)
2016-02-23T16:17:53.955350233Z stdout: [ 446a5e1a48171008b3faa34b3bd33d00 ] Processing image.jpg from document
2016-02-23T16:17:59.847872226Z stdout: [ 446a5e1a48171008b3faa34b3bd33d00 ] OK

Note that in this output, I have prefixed all my log statements with the id of the cloudant document I process - it helps.

Update iOS starter app to use Podfile

Including the SDK binary framework in the starter apps is fragile. We should remove the embedded binary of the iOS SDK and change over to a CocoaPods and Carthage style of install.

ant deploy target fails due to container name conflicts

After a successful build in a Vagrant box on a Mac, deploy target fails like this:

# ant deploy
Buildfile: /root/openwhisk/build.xml

setDeployTarget:
     [echo] deploy target: local

writePropertyFile:
     [exec] 
     [exec] 
     [exec] 

deploy:

deployDatabase:
     [echo] wiping databases with prefix ..._
     [exec]   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Currentroot_ansiblewsk_whisks
     [exec]                                  Dload  Upload   Total   Spent    Left  Speed
     [exec] 
     [exec] 
     [exec] {"ok":true}
     [exec]   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  0    12    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0100    12  100    12    0     0     11      0  0:00:01  0:00:01 --:--:--    11  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
     [exec]                                  Dload  Upload   Total   Spent    Left  Speed
     [exec] 
     [exec] {"ok":true}
     [exec] loading views
     [exec]   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0100    12  100    12    0     0     21      0 --:--:-- --:--:-- --:--:--    21  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
     [exec]                                  Dload  Upload   Total   Spent    Left  Speed
     [exec] 
     [exec]   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0100    41  100    41    0     0    110      0 --:--:-- --:--:-- --:--:--   110  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
     [exec]                                  Dload  Upload   Total   Spent    Left  Speed
     [exec] 
     [exec] {"ok":true,"id":"_design/whisks","rev":"1-ab1e5bc5a04ec5b56953042e3c0781a1"}
     [exec] 
     [exec]   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0100  7823  100    77  100  7746    124  12521 --:--:-- --:--:-- --:--:-- 12533

startProxy:
     [exec] d53e740d6ac45269713b1adf54e772017713b3c71d7f69274e455f08cc14476a

setDeployTarget:

writePropertyFile:

deploy:

setDeployTarget:

writePropertyFile:

deployKafka:

startZookeeper:

pullImageFromRegistry:
     [exec] Error response from daemon: Conflict. The name "zookeeper" is already in use by container 31e2b619694a. You have to remove (or rename) that container to be able to reuse that name.

BUILD FAILED
/root/openwhisk/build.xml:56: The following error occurred while executing this line:
/root/openwhisk/services/build.xml:23: The following error occurred while executing this line:
/root/openwhisk/services/build.xml:36: The following error occurred while executing this line:
/root/openwhisk/services/zookeeper/build.xml:46: exec returned: 1

Total time: 4 seconds

Conflicting names vary, from nginx to zookeeper to kafka (with deploy bailing out at appropriate stages)

discussion: relax convention on main() entrypoint in javascript

One user has suggested that forcing the action method to be main() is too constraining and we should allow the user to specify the main method.

Originally we did this via module.exports. As we move to support more languages, it may be better to define a language-neutral attribute on actions.

Alternatively, we could decide not to support this.

Getting Exception: 'NoneType' object has no attribute '__getitem__' on wks and wskadmin commands

On my Macbook, I followed the instructions for 'Vagrant cheat sheet (for Mac and Windows)' and 'Ubuntu cheat sheet'

My vagrant up --provider=virtualbox command completed successfully and I can vagrant ssh into the box.

When I attempt to execute the wskadmin command to create a new subject, I am getting an error of `

Exception:  'NoneType' object has no attribute '__getitem__'

I get the same error when I install the command line tools on my Mac and attempt to run a wks command such as:

wsk property set --apihost 192.168.33.13 --auth $(cat config/keys/auth.guest)
Exception:  'NoneType' object has no attribute '__getitem__'   

Any pointers?

--Mark

Transient failures for `ConsulKVTests` in CI builds

The test fails occasionally, mostly on Travis CI runs (e.g. this one). The most obvious symptom being:

Test whisk.consul.ConsulKVTests FAILED

The issue is likely to be that timeouts are too short for the performance the machines provide. Alternatively, the test should retry a few times before giving up.

Not receiving Cloudant change feed information when using the Cloudant dashboard

Using the documentation in the README, I have tried to create a trigger associated to the change feed for a Cloudant service and looking at the wsk activation poll.

The change feed does not seems to be active when using the Cloudant dashboard, when I:

  1. Create a database (corresponding to the name of the trigger parameter dbname.)
  2. Creating a document.
  3. Deleting a document.
  4. Changing or cloning a document.

Note that I have successfully received change feed information when (from the terminal)

  1. Invoke read and write actions for the same Cloudant service (ask action invoke ...).

Is this intentional (by design)?

Unable to call action from JavaScript

I've been trying to invoke a whisk action from my JavaScript running on Bluemix similar to what is documented here:

https://github.com/openwhisk/openwhisk/blob/master/docs/reference.md#additional-sdk-methods

However, I haven't been able to get this to work. I did see there are some samples that show how to do this for instance:

https://github.com/openwhisk/openwhisk/blob/88cb9961d5d3553026a94113908a3867a6d76170/catalog/samples/wcbin.js
https://github.com/openwhisk/openwhisk/blob/88cb9961d5d3553026a94113908a3867a6d76170/catalog/samples/countdown.js

However, even if I just copy and paste these samples I get this error coming back in my next callback:

error: The requested resource does not exist. activation: undefined"

Does anyone have any thoughts as to why this is? I also noticed that on Bluemix if I run:

wsk action list /whisk.system/samples

That it doesn't list either of these samples in the list so I wondered if that was because this functionality isn't supported yet or is known to fail?

Thanks for your help!

Allow actions to return JS Promise directly

With Promises now part of the JS standard library (ES6 onwards+), it would be nice to replace the return value for async actions from the whisk function calls to a native Promise. See the example below.
This would have many benefits for the user including allow them to directly return responses from many third-party modules that return Promises without having to add unnecessary boilerplate to handle the response and then return.

function main() {
   setTimeout(function() {
       return whisk.done({done: true});
   }, 20000);
   return whisk.async();
}

to....

function main() {
   return new Promise(function (resolve, reject) {
       setTimeout(function() {
           resolve({done: true});
       }, 20000);
   })
}

Install prereqs for ansible migration

Ansible needs to be installed on dev env:

  • local (ubuntu-setup. all.sh)

Ansible prereqs are:

sudo easy_install pip
sudo pip install paramiko PyYAML Jinja2 httplib2 six

Ansible can then be installed via

git clone git://github.com/ansible/ansible.git --recursive
cd ansible
source ./hacking/env-setup

Alternatively, we can get pinned versions via apt:

sudo apt-get install software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible=<version>

loadbalancer dockerfile should contain CMD with start script

controller and loadbalancer are currently started in different ways:

controller dockerfile contains CMD controller/bin/controller that allows us to simply do

docker run -d ... whisk/controller

in loadbalancer we have no CMD directive which is inconsistent.
here we have to do

docker run -d ... whisk/loadbalancer loadbalancer/bin/loadbalancer

We should aim to be consistent on our docker image semantics.

Will attach PR to fix this.

OPTIONS verb not implemented by OpenWhisk REST API to invoke actions

Hi,

I've been working on a OpenWhisk action that I want to call directly from the web browser. But I got an issue using jQuery.ajax. JQuery is sending a preflight OPTIONS method to check for cross-domain requests. As OpenWhisk does not emit proper CORS headers today, the AJAX call failed.

Could OpenWhisk REST API implement OPTIONS and send the right CORS headers?

KafkaTests depends on KafkaConnectorTests

Commit ef0c026

ignores KafkaTests for now.

We found out that the test works if KafkaConnectorTests run first. It fails if not, so I assume a connection between the two.

Related to gradle work in #6 which changed order of test execution and revealed this dep.

wsk commands return "[Errno 111] Connection refused"

After a successful build in a Vagrant container, I am getting

wsk --verbose list
{'apihost': '172.17.0.1:443', 'namespace': '_', 'clibuild': '2016-02-28T08:53:30-05:00', 'apiversion': 'v1'}
========
REQUEST:
GET https://172.17.0.1:443/api/v1/namespaces/_
Headers sent:
{}
error: [Errno 111] Connection refused

The box has the following interfaces configured:

ifconfig | grep 'inet addr'
      inet addr:172.17.0.1  Bcast:0.0.0.0  Mask:255.255.0.0
      inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
      inet addr:192.168.33.13  Bcast:192.168.33.255  Mask:255.255.255.0
      inet addr:127.0.0.1  Mask:255.0.0.0

The same error is returned when directing wsk commands to the 192.168.33.13 address from outside the VM.

whisk.properties.txt

The sanitized whisk.properties file is attached.

Any pointers?

wsk package refresh doesn't work

I tried to follow the instructions https://new-console.ng.bluemix.net/docs/openwhisk/openwhisk_catalog.html#openwhisk_catalog_cloudant to use Cloudant. However wsk package refresh doesn't work. As a workaround I followed the steps in "Setting up a Cloudant database outside Bluemix".

Niklass-MBP:whisk nheidloff$ wsk property set --namespace [email protected]_dev
ok: namespace set to [email protected]_dev
Niklass-MBP:whisk nheidloff$ wsk package refresh
error: Malformed request, did you specify a bluemix namespace?
error: Malformed request, did you specify a bluemix namespace?
Niklass-MBP:whisk nheidloff$

"wsk activation list" should show more information about activations

If I'm looking at a recent activation to debug it and I don't know its ID, it would be useful to have its start/end time, its status (success, running, failed).

Currently other than confirming there are activations, it is not very useful:

$ wsk activation list
activations
123fb4243552491b94b6fcf6a94be745             vision-analysis                         
21526c4dd7564090a9095941fa1d546b             vision-analysis                         
0fa2dd0bb55f4df3ba68a571da1a6d34             vision-analysis                         
3b33904f79f448beb0c913856363a088             vision-analysis                         
e2e22077ad3945b48b612436fe0bb334             vision-analysis                         
48581ba45fac4119a5970250e3f0b0d7             vision-analysis                         
dec75b9e241942e6a9ddd0fc9b8dd68b             vision-analysis                         
3a0e3cbf45734ce1b13220414d6c10af             vision-analysis

Error invoking wsk actions. "The supplied authentication is not authorized to access this resource"

I can successfully run wsk list but am getting an "authentication not authorized" error when invoking the sample action.

 wsk list
 entities in namespace: default
 packages
 actions
 triggers
 rules

Results of wsk action:

 wsk -v action invoke /whisk.system/samples/echo -p message hello --blocking --result
 {'apihost': '192.168.33.13:443', 'namespace': '_', 'clibuild': '2016-02-28T20:51:47-05:00', 'apiversion': 'v1'}
 ========
 REQUEST:
 POST https://192.168.33.13:443/api/v1/namespaces/whisk.system/actions/samples/echo?blocking=true
 Headers sent:
 {
 "Authorization": "Basic Nzg5YzQ2YjEtNzFmNi00ZWQ1LThjNTQtODE2YWE0ZjhjNTAyOmFiY3pPM3haQ0xyTU42djJCS0sxZFhZRnBYbFBrY2NPRnFtMTJDZEFzTWdSVTRWck5aOWx5R1ZDR3VNREdJd1A=",
 "Content-Type": "application/json"
 }
 Body sent:
 {"message": "hello"}
 --------
 RESPONSE:
 Got response with code 403
 Body received:
 {
 "error": "The supplied authentication is not authorized to access this resource",
 "code": 40
 }
 ========
 error: The supplied authentication is not authorized to access this resource (code 40)

I used wsk property set --auth $(cat config/keys/<<keyname>> to test the auth.guest and auth.whisk.system creds. Also tested a subject that I created with wskadmin.

discussion: parameters in action sequence

Right now our programming model says that in an action sequence A -> B, only the output of A is passed to B, as in Unix pipes.

An alternative would be that all parameters passed to A are also passed to B, along with the output of A, merged via overwriting.

Options include:

  • keep things the way there are
  • change things to alternative B
  • support either/or via a flag.

Input welcome.

Provide ansible playbook for invoker deployment

Provide an ansible playbook that deploys invokers.

Should be able to deploy, scale up and scale down invokers.

Purpose of this playbook is to replace the ant target

deploySlaves

in core/build.xml

-Probably also handle userland network creation and ipTables rules here.

Enable Travis CI integration

@sjfink Can we enable Travis CI integration with this repo? Among other things, this will annotate pull requests with the build status of the corresponding commits.

confusing error message for wsk action update

Attempting to update an action sequence that doesn't exist results in a confusing error message:

wsk: error: unrecognized arguments:

We need a better error message like "Error: cannot update sequence A which does not exist".

Alternatively, we could change the semantics of 'update' to mean 'createOrUpdate'

MacBook-Pro-3:~ sjfink$ wsk list
entities in namespace: [email protected]_dev
packages
/[email protected]_dev/Bluemix_Cloudant NoSQL DB-sm_Credentials-1 private binding
actions
/[email protected]_dev/Hello World                                private 
/[email protected]_dev/My Action                                  private 
triggers
rules
MacBook-Pro-3:~ sjfink$ wsk action update A --sequence 'Hello World','Hello World'
usage: wsk [-h] [-v] [--apihost hostname] [--apiversion version]

           {action,activation,namespace,package,rule,trigger,sdk,property,list}
           ...
wsk: error: unrecognized arguments: Hello World,Hello World
MacBook-Pro-3:~ sjfink$ wsk action create A --sequence 'Hello World','Hello World'
ok: created action A

wskadmin create user testuser returns "Database does not exist error:

I have successfully created a Cloudant db and can interact with it from cURL and form Chrome using jsonview.

When I attempt to create a new subject using wskadmin I get a "Database does not exist error"

wskadmin -v user create testuser1
using CLOUDANT_PASSWORD = xxxxxxxx
using CLOUDANT_USERNAME = yyyyyyyy
using CLOUDANT_WHISK_AUTHS = <<auth.guest content>>

========
REQUEST:
POST http://xxxxxxxx.cloudant.com/23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP
Headers sent:
{
    "Authorization": "Basic xxxxxxxxMhQ2xvdWRhbnQ=",
    "Content-Type": "application/json"
}
Body sent:
{"_id": "testuser1", "uuid": "0d9292a2-2b1e-4e6c-84c9-c95dc2d23581", "key": "g6u7ryrkEVqWEE3nfFRosAXdLKZMX42D66f5fcEKCAuKq25RxNz1JhYyC1H7oO4X", "subject": "testuser1"}
--------
RESPONSE:
Got response with code 404
Body received:
{"error":"not_found","reason":"Database does not exist."}

========
Failed to create subject ({"error":"not_found","reason":"Database does not exist."})

Thanks!

stop mounting filesystem from vagrant host

Right now the instructions say to git clone on the host, then map the filesystem into the virtual machine.

This is problematic on Windows where the host filesystem permissions are inconsistent with Linux/Mac.

Instead: change the directions to simply wget our Vagrantfile (or just download it if wget not available), and then do the git clone directly to the filesystem inside the Ubuntu VM.

support choice of node.js runtime for an action

Right now javascript actions run with node 0.12.9.

We need to support newer versions of node.js.

As upgrading base software will be an ongoing issue, we should design a solution to allow users to choose either "latest" or a backlevel configuration for an action.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.