Honeycomb/VPPJAPI workflow

From fd.io
< Honeycomb
Revision as of 14:58, 24 May 2016 by Alagalah (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

WORK IN PROGRESS

alagalah - I'm currently doing some VPP / Honeycomb V3PO integration work so found something I had messed up and thanks to Maros for unmessing me, wanted to share it.

Background

  • you've made an API change in VPP that has means a new JVPP JAR has been produced.
  • you want to see this in Honeycomb V3PO but Honeycomb uses VPP artifacts from nexus... oh the humanity.

Where I develop I run these scripts:

On my HOST where source is developed and debugged:

 #!/usr/bin/env bash
 
 FDIO="/home/alagalah/git/work/fdio" # Replace with yours
 
 # VPP:
 
 cd $FDIO/vpp
 make build # | build-vat | pkg-deb | wipe wipe-release | rebuild ... whatever works for your usecase
 
 # Honeycomb: 
 mkdir -p ~/.m2/repository/io/fd/vpp/jvpp/16.09-SNAPSHOT
 mvn install:install-file -Dfile=$FDIO/vpp/build-root/build-vpp-native/vpp-api/java/jvpp-16.09.jar -DgroupId=io.fd.vpp -DartifactId=jvpp -Dversion=16.09-SNAPSHOT -Dpackaging=jar
 
 
 cd $FDIO/honeycomb/v3po
 mvn clean install -nsu -DskipTests # -nsu is the main thing here, it will pull artifacts from the M2 repository locally first


In my VMs (also Ubuntu 14.04 as luck would have it so I can copy things) where I am testing VPP+HC instances:

 #!/usr/bin/env bash
 
 echo
 echo
 echo "Stopping VPP - assuming you are running debug image too, and checks for prod image"
 sudo stop vpp
 sudo killall ./install-vpp_debug-native/vpp/bin/vpp
 
 echo
 echo "Installing honeycomb/v3po karaf into ./v3po-karaf-1.0.0-SNAPSHOT/bin"
 sudo rm -rf /home/vagrant/v3po-karaf-1.0.0-SNAPSHOT
 sudo cp -a /fdio/honeycomb/v3po/karaf/target/v3po-karaf-1.0.0-SNAPSHOT.tar.gz /home/vagrant/
 tar -xf v3po-karaf-1.0.0-SNAPSHOT.tar.gz
 
 echo
 echo "Copying VPP debug image dir: install-vpp_debug_native into ~"
 cp -a /fdio/vpp/build-root/install-vpp_debug-native/ /home/vagrant/
  
 echo "Running ...."
 cd
 echo "... starting VPP debug image"; echo
 sudo ./install-vpp_debug-native/vpp/bin/vpp unix { cli-listen 127.0.0.1:5002}
 echo "... starting honeycomb/v3po"; echo
 sudo ./v3po-karaf-1.0.0-SNAPSHOT/bin/karaf clean


I will post my Vagrantfile setup for doing all this that uses an env.sh file to set up where repos are etc as well as expose gdb-server, HC REST and Karaf debug ports per VM (uses "base" + VM#) ie:

  1. General idea is to "source ./env.sh" so Vagrantfile env vars are set.
 export FDS_ENV_SET=1  # Vagrant up fails if this env var is not set ... this forces folks to check this carefully then source ./env.sh
 export FDS_NUM_NODES=2
 export FDS_ODL_SUBNET="192.168.70."
 export FDS_FDIO_REPO=/home/alagalah/git/work/fdio # should have vpp and honeycomb clonded to here
 export FDS_VAGRANT_NICS=2

Vagrantfile snippet that borks if env.sh hasn't been sourced:

 # Check to make sure you have done "source ./env.sh"
 envcheck = ENV['FDS_ENV_SET']
 
 if envcheck != '1'
   abort("Please edit env.sh for your environment and use \"source ./env.sh\"")
 end