You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/02/23 03:07:06 UTC
[GitHub] csantanapr opened a new issue #3329: local mode for openwhisk ansible
csantanapr opened a new issue #3329: local mode for openwhisk ansible
URL: https://github.com/apache/incubator-openwhisk/issues/3329
I had some problems today when deploying with default settings as ansible playbook edge.yml tries to download the CLI, I get some github/s3 network errors.
I try to use local mode
ansibile-playbook -e environment/local edge.yml -e cli_installation_mode=local
This doesn't work for multiple reasons
1. The directory where to pick up the CLI
https://github.com/apache/incubator-openwhisk/blob/master/ansible/group_vars/all#L4
```
openwhisk_cli_home: "{{ lookup('env', 'OPENWHISK_CLI') | default(openwhisk_home, true) }}"
...
openwhisk_cli:
installation_mode: "{{ cli_installation_mode | default('remote') }}"
local:
location: "{{ openwhisk_cli_home }}/bin"
remote:
name: OpenWhisk_CLI
dest_name: OpenWhisk_CLI
location: "https://github.com/apache/incubator-openwhisk-cli/releases/download/{{ openwhisk_cli_tag }}"
```
Using `openwhisk_home` or `OPENWHISK_CLI` pointing to the root of incubator-openwhisk-cli
Now with the recent change in CLI build to use gradle the CLI is not built in `/bin`
is built in `incubator-openwhisk-cli/build/`
2. The directory structure is not the expected one by the ansible script
https://github.com/apache/incubator-openwhisk/blob/master/ansible/roles/cli/tasks/copy_local_openwhisk_cli.yml
or
https://github.com/apache/incubator-openwhisk/blob/master/ansible/roles/cli/tasks/deploy.yml
IMHO the fix should be:
1. The ansible needs to be adjusted to what the incubator-openwhisk-cli produces
```
~/dev/whisk/git/apache/incubator-openwhisk-cli (master)
? $ ls build
content.json darwin-amd64 linux-amd64 linux-arm64 linux-s390x windows-amd64
darwin-386 linux-386 linux-arm linux-ppc64le windows-386 wsk
~/dev/whisk/git/apache/incubator-openwhisk-cli (master)
? $ ls release/
OpenWhisk_CLI-latest-all.tgz OpenWhisk_CLI-latest-linux-arm64.tgz OpenWhisk_CLI-latest-mac-amd64.zip
OpenWhisk_CLI-latest-linux-386.tgz OpenWhisk_CLI-latest-linux-ppc64le.tgz OpenWhisk_CLI-latest-windows-386.zip
OpenWhisk_CLI-latest-linux-amd64.tgz OpenWhisk_CLI-latest-linux-s390x.tgz OpenWhisk_CLI-latest-windows-amd64.zip
OpenWhisk_CLI-latest-linux-arm.tgz OpenWhisk_CLI-latest-mac-386.zip
```
2. The incubator-openwhisk-cli Travis build should not use remote mode and it should use local mode
https://github.com/apache/incubator-openwhisk-cli/blob/master/tools/travis/test_openwhisk.sh#L71
It sets the `openwhisk_cli_home`
```
$ANSIBLE_CMD openwhisk.yml -e openwhisk_cli_home=$TRAVIS_BUILD_DIR
```
But it still is remote mode.
It should be
```
$ANSIBLE_CMD openwhisk.yml -e cli_installation_mode=locale -e openwhisk_cli_home=$TRAVIS_BUILD_DIR
```
And then it cheats to copy the wsk to make the test happy this should be remove
```
# Copy the binary generated into the OPENWHISK_HOME/bin, so that the test cases will run based on it.
mkdir -p $OPENWHISK_HOME/bin
cp -f $TRAVIS_BUILD_DIR/build/wsk $OPENWHISK_HOME/bin
```
This should be remove as the ansible tasks for CLI should copy the `wsk` to `$OPENWHISK_HOME/bin/wsk`
cc @dubeejw @jonpspri
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services