redhat-developer-demos / faas-tutorial

Java FaaS demos with OpenWhisk and OpenShift
Apache License 2.0
43 stars 29 forks source link

Missing wskadmin tool configuration docs #16

Open ricardozanini opened 6 years ago

ricardozanini commented 6 years ago

Hi! I was trying to create a custom namespace to configure the packages and to expose my web actions through the API Gateway. The API Gateway seems to work only with custom namespaces. My bet is that the whisk.admin namespace isn't supposed to be accessed externally. What I'm missing in this tutorial is how to set up the wskadmin tool.

Running the wskadmin tool, it claims that some env variables are missing:

property "DB_WHISK_AUTHS" not found in environment or property file
property "WHISK_LOGS_DIR" not found in environment or property file
property "DB_PASSWORD" not found in environment or property file
property "DB_PORT" not found in environment or property file
property "DB_PROTOCOL" not found in environment or property file
property "DB_WHISK_ACTIONS" not found in environment or property file
property "DB_HOST" not found in environment or property file
property "DB_WHISK_ACTIVATIONS" not found in environment or property file
property "DB_USERNAME" not found in environment or property file

I think it needs to connect directly to the CouchDB. That put, we should expose the routes on OpenShift directly? Could someone give some advice of how to make this work? I could write a chapter here helping others how to properly configure it. :)

Many thanks!

id-graziano commented 6 years ago

@ricardozanini I just went through these troubles, there is definitely some documentation missing.

Add the file whisk.properties to your $OPENWHISK_PROJECT_DIR, the location that you have this repo cloned https://github.com/apache/incubator-openwhisk.

For example on my system it is located at /Users/nickgraziano/incubator-openwhisk/whisk.properties

Add this to it:

WHISK_LOGS_DIR=/Users/nickgraziano/incubator-openwhisk/logs
DB_PROTOCOL=http
DB_PORT=5984
DB_HOST=127.0.0.1
DB_USERNAME=whisk_admin
DB_PASSWORD=some_passw0rd
DB_WHISK_AUTHS=local_subjects
DB_WHISK_ACTIONS=local_whisks
DB_WHISK_ACTIVATIONS=local_activations

You will need to modify it according to your system, but you get the idea. The DB_* properties are all concerning your CouchDB setup. On my system, I am running all the containers via docker as outlined in https://github.com/apache/incubator-openwhisk-devtools/tree/master/docker-compose. The DB_WHISK_* properties are the CouchDB databases that interact with Open Whisk.

A lot of this is going to be system specific, but hopefully I helped you out at least a little, good luck!

ricardozanini commented 6 years ago

Many thanks @id-graziano! I'll give it a try and report back.