Date: Fri, 29 Mar 2024 07:05:42 +0000 (UTC) Message-ID: <1533018314.1017.1711695942135@ip-10-30-146-46.us-west-2.compute.internal> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_1016_671756439.1711695942131" ------=_Part_1016_671756439.1711695942131 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
This Quick Start describes a simple "local" workflow where you b= uild and run ONOS on a single development machine.
First of all, you should install Baze= lisk (a wrapper for Bazel), both open-source build tools developed by Googl= e. We will use Bazel to build and run ONOS. We suggest downloading and= installing Bazelisk using the instructions at Installing required tools.
Some other dependencies are required as well. Use your package manager o= f choice to install these:
git zip curl unzip python # 2.7 required by some development scripts python3 # Required by Bazel bzip2 # Needed by legacy GUI build
Java Development Kit (JDK)
Do I need to install a JDK? The short answer is NO :smile:
Starting with ONOS 2.2, we no longer require to install a JDK in your sy= stem to build and run ONOS when using Bazel, as we use a version of OpenJDK= 11 that is shipped with Bazel.
However, you might still need to install a Java Runtime Environment (JRE= ) or JDK if you want to run some of the development tools (e.g. onos-lib-ge= n, etc.) or if you want to run ONOS without using Bazel. In this case, we s= uggest installing Amazon Corretto, a free, easy-to-install, production-grad= e OpenJDK build from Amazon:
https://aws.amazon.com/corretto/
If you plan to build and run a version of ONOS prior to 2.2, you should = install JDK 8, otherwise, feel free to install the more recent JDK 11.
To get the source code and build ONOS= , run the following commands from a Unix-like terminal (e.g. Linux, MacOS):=
git clo= ne https://gerrit.onosproject.org/onos cd onos bazel build onos
This will compile and assemble the installable onos.tar.=
gz
, which is located in the bazel-bin
directory. <=
/p>
To run ONOS locally on the development machine, simply run the following= command:
bazel r= un onos-local -- clean debug # 'clean' to delete all previous running status # 'debug' to enable remote debugging
The above command will create a local installation from the o=
nos.tar.gz
file (re-building it if necessary) and will start th=
e ONOS server in the background. In the foreground, it will display a conti=
nuous view of the ONOS (Apache Karaf) log file. Options following the doubl=
e-dash (=E2=80=93) are passed through to the ONOS Apache Karaf and can=
be omitted. Here, the clean
option forces a clean i=
nstallation of ONOS and the debug
option means that =
the default debug port 5005 will be available for attaching a remote Java d=
ebugger.
To attach to the ONOS CLI console, run:
tools/t= est/bin/onos localhost
Once connected, you can run various ONOS CLI and Apache Karaf commands. For example, to start up OpenFlo= w and ReactiveForwarding app, you could do the following:
onos>= ; app activate org.onosproject.openflow onos> app activate org.onosproject.fwd
To open your default browser on the <= a href=3D"/display/ONOS/The+ONOS+Web+GUI">ONOS GUI page, simply type:= span>
tools/t= est/bin/onos-gui localhost
or alternatively, visit <= a class=3D"external-link" href=3D"http://localhost:8181/onos/ui" rel=3D"nof= ollow">http://localhost:8181/onos/ui=
To start up a Mininet network control= led by an ONOS instance that is already running on your development machine= , you can use a command like:
sudo mn= --controller remote,ip=3D<ONOS IP address> --topo torus,3,3
Note that you should replace &l=
t;ONOS IP address>
with the IP address of your development machin=
e where ONOS is running.
To execute ONOS unit tests, including= code Checkstyle validation, run the following command:
bazel q= uery 'tests(//...)' | xargs bazel test=09=09# or use 'ot' alias
To get access to a number of aliases (such as those mentioned above) and i=
n 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
.
export = ONOS_ROOT=3D~/onos source $ONOS_ROOT/tools/dev/bash_profile
Congratulations! The above should be enough to get you started. If you l= ike more detailed instructions for importing the ONOS project into an IDE o= r contributing your changes back to the ONOS project, please consult the Development Environment Setup section.=
Bazel supports building behind a web proxy. Here are the steps to build = with a proxy:
export = HTTPS_PROXY=3Dhttps://<proxy address>:<proxy port> export HTTP_PROXY=3Dhttp://<proxy address>:<proxy port> bazel build onos --action_env=3DHTTP_PROXY=3D$HTTP_PROXY