feat(automation/deployment): Added script to autodeploy and setup wedge and nodes

Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
Tuan-Dat Tran
2024-12-31 15:17:29 +01:00
parent f3e97a4619
commit 5857beeaf6
16 changed files with 104 additions and 148 deletions

7
scripts/01-wedge_compile_code.sh Normal file → Executable file
View File

@@ -1,5 +1,7 @@
#!/bin/bash
SDE_INSTALL=/home/user/bf-sde-9.7.0/install
# For this code we'll need to do the following steps
# 1. `cd` into the directory where the P4 code is
# 2. Copy this script into the same directory
@@ -7,9 +9,10 @@
# Define the name of the P4 main program as an argument to this script, like this:
# $ ./00-wedge_compile_code.sh l1switch.p4
PROGRAM=$1
PROGRAM=l1switch.p4
COMPILED=${PROGRAM%.p4}.tofino
bf-p4c "$PROGRAM"
cd /tmp/l1switch || exit
/home/user/bf-sde-9.7.0/install/bin/bf-p4c "$PROGRAM" 1>/dev/null
cp -r "$COMPILED/" "$SDE_INSTALL"
cp -r "$COMPILED"/*.conf "$SDE_INSTALL"/share/p4/targets/tofino/