Skip to content

Commit

Permalink
Update the document regarding Open JDK and Oracle JDK (#3720)
Browse files Browse the repository at this point in the history
Our documents need to be changed to point according to the usage of
Open JDK or Oracle JDK. This PR adds the instructions to install
either of them as the Java environment of OpenWhisk.

Partially-closes: apache/openwhisk-release#169
  • Loading branch information
Vincent authored Jun 5, 2018
1 parent 4ec2806 commit 5aa8fc7
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ wsk action invoke /whisk.system/utils/echo -p message hello --result
These steps were tested on Mac OS X El Capitan, Ubuntu 14.04.3 LTS and Windows using Vagrant.
For more information about using OpenWhisk on Vagrant see the [tools/vagrant/README.md](tools/vagrant/README.md)

During the Vagrant setup, Open JDK 8 is used as the default Java environment. If you would like to use Oracle JDK 8, please change the line "su vagrant -c 'source all.sh'" into "su vagrant -c 'source all.sh oracle'" in tools/vagrant/Vagrantfile.

### Native development

Docker must be natively installed in order to build and deploy OpenWhisk.
Expand Down
20 changes: 19 additions & 1 deletion tools/macos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ If you prefer to use Docker-machine, you can follow instructions in [docker-mach
The following are required to build and deploy OpenWhisk from a Mac host:

- [Docker 1.12.0](https://docs.docker.com/docker-for-mac/)
- [Java 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
- [Java 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html) or [Open JDK 8](https://adoptopenjdk.net/releases.html#x64_mac)
- [Scala 2.11](http://scala-lang.org/download/)
- [Ansible 2.5.2](http://docs.ansible.com/ansible/intro_installation.html)

Expand All @@ -54,6 +54,24 @@ sudo easy_install pip
sudo -H pip install docker==2.2.1 ansible==2.5.2 jinja2==2.9.6 couchdb==1.1 httplib2==0.9.2 requests==2.10.0' | bash
```

The above section of command installs Oracle JDK 8 as the default Java environment. If you would like to install Open JDK 8 instead of Oracle JDK 8, please run the following section.

```
echo '
# install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install for finding alternative versions (Open JDK 8)
brew tap AdoptOpenJDK/openjdk
# install Open JDK 8
brew install adoptopenjdk-openjdk8
# install scala
brew install scala
# install pip
sudo easy_install pip
# install script prerequisites
sudo -H pip install docker==2.2.1 ansible==2.5.2 jinja2==2.9.6 couchdb==1.1 httplib2==0.9.2 requests==2.10.0' | bash
```

# Build
```
cd /your/path/to/openwhisk
Expand Down
11 changes: 11 additions & 0 deletions tools/ubuntu-setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,22 @@ The commands below should be executed on the host machine for single VM/server d
# Change current directory to openwhisk
cd openwhisk
```

Open JDK 8 is installed by running the following script as the default Java environment.

```
# Install all required software
(cd tools/ubuntu-setup && ./all.sh)
```

If you choose to install Oracle JDK 8 instead of Open JDK 8, please run the following script.

```
# Install all required software
(cd tools/ubuntu-setup && ./all.sh oracle)
```

If you are deploying OpenWhisk in a distributed environment across multiple VMs, then follow the instructions in [ansible/README_DISTRIBUTED.md](../../ansible/README_DISTRIBUTED.md) to complete the deployment. Otherwise, continue with the instructions below.

### Select a data store
Expand Down
5 changes: 4 additions & 1 deletion tools/ubuntu-setup/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

set -e
set -x

JAVA_SOURCE=${1:-"open"}

SOURCE="${BASH_SOURCE[0]}"
SCRIPTDIR="$( dirname "$SOURCE" )"

Expand All @@ -35,7 +38,7 @@ echo "*** installing python dependences"
/bin/bash "$SCRIPTDIR/pip.sh"

echo "*** installing java"
/bin/bash "$SCRIPTDIR/java8.sh"
/bin/bash "$SCRIPTDIR/java8.sh" $JAVA_SOURCE

echo "*** installing ansible"
/bin/bash "$SCRIPTDIR/ansible.sh"
Expand Down
18 changes: 14 additions & 4 deletions tools/ubuntu-setup/java8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,20 @@
set -e
set -x

if [ "$(lsb_release -cs)" == "trusty" ]; then
JAVA_SOURCE=${1:-"open"}

if [ "$JAVA_SOURCE" != "oracle" ] ; then
if [ "$(lsb_release -cs)" == "trusty" ]; then
sudo apt-get install -y software-properties-common python-software-properties
sudo add-apt-repository ppa:jonathonf/openjdk -y
sudo apt-get update
fi

sudo apt-get install openjdk-8-jdk -y
else
sudo apt-get install -y software-properties-common python-software-properties
sudo add-apt-repository ppa:jonathonf/openjdk -y
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
fi

sudo apt-get install openjdk-8-jdk -y
sudo apt-get install oracle-java8-installer -y
fi
2 changes: 1 addition & 1 deletion tools/vagrant/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Vagrant.configure('2') do |config|
echo PATH=${PATH}:${HOME}/bin:${OPENWHISK_HOME}/tools/build >> /etc/environment
cd ${OPENWHISK_HOME}
cd tools/ubuntu-setup
su vagrant -c 'source all.sh'
su vagrant -c 'source all.sh oracle'
echo "`date`: ubuntu-setup-end" >> /tmp/vagrant-times.txt
SCRIPT

Expand Down

0 comments on commit 5aa8fc7

Please sign in to comment.