apache / openwhisk

Apache OpenWhisk is an open source serverless cloud platform
https://openwhisk.apache.org/
Apache License 2.0
6.5k stars 1.16k forks source link

mac instructions omit ansible installation #757

Closed rabbah closed 8 years ago

rabbah commented 8 years ago

While helping @weijinxu setup a mac with docker-machine installation, we ran into a host of problems captured below.

Environment details:

cd openwhisk
./gradlew distDocker --parallel -PdockerHost=192.168.99.100:4243
cd ansible
ansible-playbook -i environments/mac setup.yml
ansible-playbook -i environments/mac prereq.yml
ansible-playbook -i environments/mac couchdb.yml -e mode=clean
ansible-playbook -i environments/mac couchdb.yml
ansible-playbook -i environments/mac initdb.yml
ansible-playbook -i environments/mac openwhisk.yml -e mode=clean
ansible-playbook -i environments/mac openwhisk.yml
wsk action invoke /whisk.system/samples/greeting --blocking $(cat files/auth.guest)

Provide the expected results and outputs:

successful activation response

Provide the actual results and outputs:

  1. ant clean build deploy instructions don't work - because they require ansible (setup, prereq at least)
  2. our mac instructions omit installation of ansible, resulting in -bash: ansible-playbook: command not found
  3. installing ansible via brew install ansible will result in version 2.1.0.0 (is 2.0.2.0 a hard requirement?)
  4. the need to create a link to /usr/local/bin/python on the mac should be required or checked for explicitly otherwise playbooks don't work.
TASK [prepare db_local.ini] ****************************************************
Thursday 23 June 2016  21:42:07 -0700 (0:00:00.526)       0:00:02.606 ********* 
fatal: [localhost -> localhost]: FAILED! => {"changed": false, "failed": true, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'db'"}

Also, redo fails with the following cryptic error if ansible is not installed

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
   raise child_exception
OSError: [Errno 2] No such file or directory

and after installing ansible produced this error

 tools/build/redo couchdb
Traceback (most recent call last):
 File "tools/build/redo", line 31, in <module>
   import wskprop
 File "/Users/guest/openwhisk/tools/cli/wskprop.py", line 24, in <module>
   import pkg_resources
ImportError: No module named pkg_resources
sjfink commented 8 years ago

Proposal: nuke support for ant entirely -- document the gradle/ansible path as "THE" one and only solution.

Rationale: we don't want to maintain 2 ways of doing things. Unless we test both one will always rot.

sjfink commented 8 years ago

I'm running locally with ansible 2.1.0.0 and have encountered no problems.

tuler commented 8 years ago

As a constructive criticism, build and deploy is very confusing. Ant, gradle, ansible, some python scripts, a lot of environment variable and properties. Getting rid of ant is definetely positive.

And it's hard to know which variables are "build" time variables or "deployment" time variables. I believe (from experience) most are deployment variables, but I don't know for sure if any of them are baked into the resulting docker images.

After a battle I managed to build and deploy locally on my mac, using docker for mac beta, only for the sake of understanding the whole build and deploy process.

rabbah commented 8 years ago

Thanks for the feedback @tuler. We're in a transition state and removing ant throughout.

gradle for building. ansible for deploying.

There are a few more scripts related to deployment that haven't made it into playbooks. We are working on updated documentation as well.

All of the parameters are intended for deployment parameters (i.e.,whisk.properties) or used for tests. @markusthoemmes confirm?

markusthoemmes commented 8 years ago

Correct, there shouldn't really be any build-time variables. gradle can be told to use a specific registry or dockertag and thelike, nothing which should mangle with our really be "baked into" our images.

ansible is solely used to take the images generated by gradle and deploy them using a certain configuration. Tests are a bit mangled in currently, as in they rely on whisk.properties being written for them to run, so they only work in a combination of ansible (writing the property file) and gradle (running the tests)

rabbah commented 8 years ago

ant artifacts have been removed (including documentation references). other artifacts that are now deadcode are part of #871.

csantanapr commented 8 years ago

Closing with #980