Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

This section covers the details involved in getting, installing, and running ONOS. Both single- and multi-instance cases are described. 

...

We recommend the following for if a VM is used for running ONOS:

  • Ubuntu Server 14.04 LTS 64-bit
  • 2GB or more RAM 
  • 2 or more processors

In order to build and run ONOS the following are required:

  • Java 8 JDK (Oracle Java recommended; OpenJDK is not as thoroughly tested)
  • Apache Maven (3.*0 and later)
  • git
  • bash bash (for packaging & testing)
  • Apache Karaf (3.0.2 and later

Many of these have installers or packages, or, in the case of Karaf, simply be installed by extracting the tar archives to the desired install location.

Finally, to To take full advantage of the ONOS test suite and various developer conveniences, it is also recommended that developers have the following tools available on their machines:

  • IDE (IntelliJ, Eclipse, etc.)
  • VirtualBox (or other VM hosting software)

Getting ONOS

The ONOS source can be checked out using git:

Code Block
languagetext
$ git clone ssh://<user>@gerrit.onlab.us:29418/onos-next ~/onos

...

Java and Maven

The ONOS install process relies on the environment variable JAVA_HOME being properly set. In other words, both mvn --version and java -version should report the same Java version:

Tip

The best way to prevent this version mismatch is to install Maven before Java 8.

Upgrading to Java 8

For OS X, the latest Oracle Java 8 SDK can be downloaded from Oracle. 

For Ubuntu, the following steps will upgrade the installation to Java 8:

Code Block
languagetext
$ sudo add-apt-repository ppa:webupd8team/java -y
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer oracle-java8-set-default -y

You will have to accept the Oracle binary license terms  

Setting JAVA_HOME 

If not set automatically during the Java 8 installation process, The JAVA_HOME environment variable should be set to the JRE installation location for Java 8. The process for verifying/setting the proper version varies with platform.

  • On OS X: The current JAVA_HOME may be verified with:

    Code Block
    languagetext
    $ /usr/libexec/java_home
    /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home

    To set the version, either run or add the following to the shell profile:

    Code Block
    languagetext
    $ export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)


  • On Ubuntu: To verify the JAVA_HOME:

    Code Block
    languagetext
    $ env | grep JAVA_HOME
    JAVA_HOME=/usr/lib/jvm/java-8-oracle

    If JAVA_HOME is not set or incorrect, either run or add the following to the shell profile:

    Code Block
    languagetext
    $ export JAVA_HOME=/usr/lib/jvm/java-8-oracle


Getting ONOS

The ONOS source can be checked out using git:

Code Block
languagetext
$ git clone ssh://<user>@gerrit.onlab.us:29418/onos-next ~/onos

This clones the repository to your home directory, under a directory named 'onos'.

Tip

If the above generates the following error:

Code Block
languagetext
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

make sure that a public key has been uploaded to the ONOS Gerrit by following the steps in the dropdown below.

Expand
titleSSH key generation (click to expand)
  1. Generate a key. Keep the default file name and location. This will generate an id_rsa and id_rsa.pub file in ~/.ssh:

    Code Block
    languagetext
    $ ssh-keygen -t rsa
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/onosuser/.ssh/id_rsa): 
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    Your identification has been saved in /home/onosuser/.ssh/id_rsa.
    Your public key has been saved in /home/onosuser/.ssh/id_rsa.pub.
    
    ...
    $ ls ~/.ssh
    id_rsa  id_rsa.pub  known_hosts


  2. Upload the SSH public key. After logging into the Gerrit account, go to Settings > SSH Public Keys. Paste the contents of id_rsa.pub into the "Add SSH Public Key" box and hit Add:

    Image Added

Installing ONOS

Environment Setup

...