Have questions? Stuck? Please check our FAQ for some common questions and answers.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 38 Next »

Welcome to the ONOS Developer's Guide! Here you will find information useful for developing on ONOS, contributing to ONOS itself, and the tools and procedures involved in the ONOS development process. This guide also describes how to contribute to the ONOS Guides; to do so, please refer to Contributing to ONOS Documentation.

ONOS is built with Buck, an open-source build tool created by Facebook and inspired by Google. It is also in use by number of well-known projects, including all Facebook’s mobile apps, Gerrit, etc. By relying on explicit dependencies between targets and SHA hashes of files (rather than on timestamps), BUCK avoids unnecessary work by recognizing whether or not a target artifact requires a rebuild. This also helps to increase reproducibility of builds.

ONOS currently uses a modified version of Buck, which has been packaged with ONOS. Please use this version until our changes have been upstreamed and released as part of an official Buck release.

To get the source code and build ONOS, all you need to do it run the following commands from Unix-like terminal (e.g. Linux, MacOS):

git clone https://gerrit.onosproject.org/onos
cd onos
tools/build/onos-buck build onos --show-output

This will compile all source code assemble the installable onos.tar.gz, which is located in the buck-out directory. Note the --show-output option, which can be omitted, will display the path to this file.

To run ONOS locally on the development machine, simply run the following command:

tools/build/onos-buck run onos -- clean debug

The above command will create local installation from the onos.tar.gz file and will start it in the background. In the foreground, it will display a continuous view of the ONOS (Apache Karaf) log file. Options following the double-dash (–) are passed through to the ONOS Apache Karaf and can be omitted. Here, the clean option forces a clean installation of ONOS and the debug option means that the default debug port 5005 will be available for attaching a remote debugger.

To attach to the ONOS CLI console, run:

tools/test/bin/onos localhost

Once connected, you can run various ONOS CLI and Apache Karaf commands.

To open your default browser on the ONOS GUI page, simply type:

tools/test/bin/onos-gui localhost

or alternatively visit http://localhost:8181/onos/ui 

To execute ONOS unit tests, including code Checkstyle validation, run the following command:

tools/build/onos-buck test

Guides

 While the above should be enough to get you started. If you like instructions like importing the ONOS project into an IDE and contributing your changes back to the ONOS project, please see the resources below.

  • No labels