Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add another method to run ONOS more stably. Add some detailed instructions for importing ONOS into IDEA.

...

Code Block
languagebash
titleRun ONOS
bazel run onos-local -- clean debug  # or use 'ok' alias
# 'clean' to delete all previous running status
# 'debug' to enable remote debugging


# --- The second method, only run ONOS in the background: ---
1. tar -zxvf $ONOS_ROOT/bazel-bin/onos.tar.gz (re-building ONOS if necessary) # e.g. unzip to /tmp
2. cd /tmp/onos-<your version>/apache-karaf-3.0.8/bin # e.g. onos-1.15.0-SNAPSHOT
3. ./start clean debug    # Start ONOS. 'clean' & 'debug' are optional parameters
4. ./client               # You can login ONOS CLI at any time. In CLI, type 'logout' to leave, and 'shutdown' to stop ONOS.
5. ./stop                 # Stop ONOS.

The above command will create a local installation from the onos.tar.gz file (re-building it if necessary) and will start the ONOS server 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.

...

Code Block
languagebash
titleExecute ONOS unit tests
bazel query '\''tests(//...)'\'' | xargs bazel test		# or use 'ot' ali

...

Code Block
languagebash
titleImport ONOS into Intellij IDEA
1. File → Setting → Plugin, install the Bazel plugin
2. restart Intellij IDEA
3. File → Import Bazel Project...
4. choose $ONOS_ROOT for Workspace
5. choose "Generate from BUILD file", and $ONOS_ROOT/BUILD
6. check and click Finish


To get access to a number of aliases (such as those mentioned above) and in general to make your development environment setup more conveniently for ONOS development, please put the following two lines in your ~/.bash_profile or ~/.bash_aliases

...