onos2.0 compilation and installation

Keywords: sudo npm Oracle git

onos compilation and installation

1 pre download and installation

1.1 front package installation

sudo apt-get install git
sudo apt-get install python

#Oracle JDK8
sudo apt-get install software-properties-common -y && \
  sudo add-apt-repository ppa:webupd8team/java -y && \
  sudo apt-get update && \
  echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections && \
  sudo apt-get install oracle-java8-installer oracle-java8-set-default -y

1.2 download and install bazel

(1) download on the official website bazel-0.19.2-installer-linux-86_64.sh And drag it into the virtual desktop

(2) installation

#Prefix packet
sudo apt-get install pkg-config zip g++ zlib1g-dev unzip python

#Run install
chmod +x bazel-0.19.2-installer-linux-x86_64.sh
./bazel-0.19.2-installer-linux-x86_64.sh --user

#Modify ~ /. bashrc
sudo gedit ~/.bashrc
#Add to
export PATH="$PATH:$HOME/bin"

. ~/.bashrc

1.3 source download and environment settings

(1) source download and branch switching

sudo git clone https://gerrit.onosproject.org/onos

#Switch branches to onos-2.0
cd onos
sudo git checkout onos-2.0
sudo git branch

(2) environment configuration

cd onos
cat << EOF >> ~/.bash_profile
export ONOS_ROOT="`pwd`"
source $ONOS_ROOT/tools/dev/bash_profile
EOF

#The above execution may not be correct. Modify the source
sudo gedit ~/.bash_profile
source $ONOS_ROOT/tools/dev/bash_profile

. ~/.bash_profile


#It's better to match it to / etc/profile
export ONOS_ROOT="/opt/onos"
source $ONOS_ROOT/tools/dev/bash_profile


#restart
reboot

1.4 download and install idea and bazel plug-in

(1) download and install (Baidu)
(2) plug in installation

Open idea and select the issued furniture
 Select Settings
 Search plugins
 Search bazel plug-in in the store, install

2 modify Build and compile installation

2.1 modify the build file (if there is an npm installation error, do not modify it if there is no such error during the build)

(1) modify onos/web/gui/BUILD

#Modify 1 ﹣ onos GUI NPM install
#Add after $$NPM $$NPM? Args install of cmd
--registry=https://registry.npm.taobao.org

#Modify 2 ﹣ onos GUI NPM build
#Add after "Chmod a + X. / node [modules / gulp / bin / gulp. JS & &" +

" export HTTPS_PROXY=http://ip:port &&" +
" export HTTP_PROXY=http://ip:port &&" +

(2) modify onos / Web / gui2 FW lib / build

#Add after NPM $$NPM ﹐ args install of cmd of onos-gui2-fw-npm-install

--registry=https://registry.npm.taobao.org

2.2 build

cd onos
bazel build onos

#If you fail, try more and succeed

2.3 boot

bazel run onos-local [-- [clean] [debug]]

#Enter cli
onos localhost

#Installation characteristics
feature:install onos-providers-openflow-app 
feature:install onos-apps-fwd 


#Activation characteristics
app activate org.onosproject.openflow  
app activate org.onosproject.fwd 

export ONOS_APPS="drivers,openflow,proxyarp,lldpprovider,fwd"

2.4 UI

http://localhost:8181/onos/ui/index.html
onos/rocks

#The host is not displayed by default, and it will be displayed after pressing H

2.5 debugging

Command line
bazel run onos-local -- debug

#idea
Run
    Edit Configurations
            +(select Remote)
                Click OK

Posted by myitanalyst on Sat, 30 Nov 2019 10:42:34 -0800