OpenWhisk can run on a Mac host with Docker for Mac. If you prefer to use Docker-machine, you can follow instructions in docker-machine/README.md
The following are required to build and deploy OpenWhisk from a Mac host:
Tips:
- Versions of Docker and Ansible are lower than the latest released versions, the versions used in OpenWhisk are pinned to have stability during continuous integration and deployment.
- It is required to install Docker >= 18.06.2 because of this CVE
Homebrew is an easy way to install all of these and prepare your Mac to build and deploy OpenWhisk. The following shell command is provided for your convenience to install brew
with Cask and bootstraps these to complete the setup. Copy the entire section below and paste it into your terminal to run it.
echo '
# install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install cask
brew tap homebrew/cask
# install for AdoptOpenJDK (java11)
brew tap AdoptOpenJDK/openjdk
# install java 11
brew install --cask adoptopenjdk11
# install scala
brew install scala
# install gnu tar
brew install gnu-tar
# install pip
sudo easy_install pip
# install script prerequisites
pip install docker==5.0.0 ansible==4.1.0 jinja2==3.0.1 couchdb==1.2 httplib2==0.19.1 requests==2.25.1 six==1.16.0
Make sure you correctly configure the environment variable $JAVA_HOME.
cd /your/path/to/openwhisk
./gradlew distDocker
Tip Using gradlew
handles the installation of the correct version of Gradle to use.
Follow instructions in ansible/README.md
brew install wsk
wsk property set --apihost https://localhost
wsk property set --auth `cat ansible/files/auth.guest`
For more instructions see Configure CLI doc.
wsk action invoke /whisk.system/utils/echo -p message hello --result
{
"message": "hello"
}
Unit tests require Ansible setup at the moment.
Bellow are the ansible commands required to prepare your machine:
cd ./ansible
ansible-playbook setup.yml -e mode=HA
ansible-playbook couchdb.yml
ansible-playbook initdb.yml
ansible-playbook wipe.yml
ansible-playbook properties.yml
To run the unit tests execute the command bellow from the project's root folder:
# go back to project's root folder
cd ../
./gradlew -PtestSetName="REQUIRE_ONLY_DB" :tests:testCoverageLean