Ray Milkey | 9713d15 | 2019-03-27 15:47:58 -0700 | [diff] [blame] | 1 | set -eu -o pipefail |
| 2 | |
| 3 | # install prerequisites for stratum/bmv2 build |
| 4 | USE_STRATUM=true DEBUG_FLAGS=false FAST_BUILD=true CLEAN_UP=true bash /tmp/install-p4-tools.sh |
| 5 | |
| 6 | # install bazel |
Carmelo Cascone | 1537e8e | 2019-06-28 14:30:05 -0700 | [diff] [blame] | 7 | BAZEL_VERSION="0.23.2" |
Ray Milkey | 9713d15 | 2019-03-27 15:47:58 -0700 | [diff] [blame] | 8 | curl -L -o bazel.sh -s https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh |
| 9 | chmod +x bazel.sh |
| 10 | ./bazel.sh --user |
| 11 | export PATH=/home/sdn/bin:$PATH |
| 12 | bazel version |
| 13 | |
| 14 | # unroll the stratum tar ball from the build machine |
| 15 | cd ~/stratum |
| 16 | rm -rf * |
| 17 | tar xf /tmp/stratum-sources.tar |
| 18 | cd stratum |
| 19 | export BMV2_INSTALL=/usr/local |
Carmelo Cascone | fb99267 | 2019-07-09 10:26:01 -0700 | [diff] [blame] | 20 | export PI_INSTALL=/usr/local |
Ray Milkey | 9713d15 | 2019-03-27 15:47:58 -0700 | [diff] [blame] | 21 | |
| 22 | # build stratum |
Carmelo Cascone | fb99267 | 2019-07-09 10:26:01 -0700 | [diff] [blame] | 23 | bazel build --curses=no --color=no //stratum/hal/bin/bmv2:stratum_bmv2 |
Ray Milkey | 9713d15 | 2019-03-27 15:47:58 -0700 | [diff] [blame] | 24 | |
| 25 | # deploy stratum binaries to where mininet will look for them |
| 26 | mkdir -p /home/sdn/stratum/bazel-bin/stratum/hal/bin/bmv2 |
| 27 | cp bazel-bin/stratum/hal/bin/bmv2/stratum_bmv2 /home/sdn/stratum/bazel-bin/stratum/hal/bin/bmv2/stratum_bmv2 |
| 28 | |
| 29 | mkdir -p /home/sdn/stratum/stratum/hal/bin/bmv2 |
| 30 | cp bazel-bin/stratum/hal/bin/bmv2/stratum_bmv2.runfiles/com_github_stratum_stratum/stratum/hal/bin/bmv2/dummy.json /home/sdn/stratum/stratum/hal/bin/bmv2 |
| 31 | |