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 |
| 20 | |
| 21 | # build stratum |
Carmelo Cascone | 1537e8e | 2019-06-28 14:30:05 -0700 | [diff] [blame^] | 22 | bazel build //stratum/hal/bin/bmv2:stratum_bmv2 |
Ray Milkey | 9713d15 | 2019-03-27 15:47:58 -0700 | [diff] [blame] | 23 | |
| 24 | # deploy stratum binaries to where mininet will look for them |
| 25 | mkdir -p /home/sdn/stratum/bazel-bin/stratum/hal/bin/bmv2 |
| 26 | cp bazel-bin/stratum/hal/bin/bmv2/stratum_bmv2 /home/sdn/stratum/bazel-bin/stratum/hal/bin/bmv2/stratum_bmv2 |
| 27 | |
| 28 | mkdir -p /home/sdn/stratum/stratum/hal/bin/bmv2 |
| 29 | 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 |
| 30 | |