Update Prerequisites authored by Martin Stiemerling's avatar Martin Stiemerling
On this page, you will learn how to install all necessary software to run the labs. On this page, you will learn how to install all necessary software to run the labs.
## Delete old version of Go if already installed ## Delete old version of Go if already installed
```bash ```bash
sudo rm -rf /usr/local/go sudo rm -rf /usr/local/go
``` ```
## Download Go ## Download Go
### Check for latest system updates using the commands below ### Check for latest system updates using the commands below
```bash ```bash
sudo apt update sudo apt update
sudo apt upgrade sudo apt upgrade
``` ```
### Download Go using wget ### Download Go using wget
The latest version can be found [here](https://go.dev/dl/). Please adjust the command below accordingly. The latest version can be found [here](https://go.dev/dl/). Please adjust the command below accordingly.
```bash ```bash
wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz wget https://go.dev/dl/go1.23.2.linux-amd64.tar.gz
``` ```
### Extract the libraries using the tar command and placing it in the correct location ### Extract the libraries using the tar command and placing it in the correct location
Make sure to adjust the version in this command to fit the one downloaded in the previous step. Make sure to adjust the version in this command to fit the one downloaded in the previous step.
```bash ```bash
sudo tar -C /usr/local/ -xzf go1.22.0.linux-amd64.tar.gz sudo tar -C /usr/local/ -xzf go1.23.2.linux-amd64.tar.gz
``` ```
### Check if path for Go is already set ### Check if path for Go is already set
```bash ```bash
echo $PATH echo $PATH
``` ```
### Set path for Go if not set ### Set path for Go if not set
```bash ```bash
cd /usr/local/ cd /usr/local/
sudo nano $HOME/.profile sudo nano $HOME/.profile
export PATH=$PATH:/usr/local/go/bin export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go export GOPATH=$HOME/go
source $HOME/.profile source $HOME/.profile
cat $HOME/.profile cat $HOME/.profile
``` ```
### Optional: Set Go path to use with sudo ### Optional: Set Go path to use with sudo
```bash ```bash
sudo visudo sudo visudo
``` ```
And add by secure_path at the end: And add by secure_path at the end:
```bash ```bash
:/usr/local/go/bin :/usr/local/go/bin
``` ```
### Check Go version ### Check Go version
```bash ```bash
go version go version
``` ```
Use Use
```bash ```bash
source ~/.profile source ~/.profile
``` ```
to reload your profile in the current shell. to reload your profile in the current shell.
If an error occurs it is recommended to log in again, so the .profile can be applied correctly. If an error occurs it is recommended to log in again, so the .profile can be applied correctly.
## Install Docker ## Install Docker
Use the [**Installation Guide**](https://docs.docker.com/engine/install/) for Windows, MacOS and Linux to install Docker on your machine. Use the [**Installation Guide**](https://docs.docker.com/engine/install/) for Windows, MacOS and Linux to install Docker on your machine.
## Login to the code.fbi.h-da.de repository ## Login to the code.fbi.h-da.de repository
```bash ```bash
sudo docker login registry.code.fbi.h-da.de sudo docker login registry.code.fbi.h-da.de
``` ```
## Install Containerlab ## Install Containerlab
```bash ```bash
bash -c "$(curl -sL https://get.containerlab.dev)" bash -c "$(curl -sL https://get.containerlab.dev)"
``` ```
## Install Make ## Install Make
```bash ```bash
sudo apt install make sudo apt install make
``` ```
## Download the repositories ## Download the repositories
### Get the goSDN repository from the Gitlab site ### Get the goSDN repository from the Gitlab site
Go into the directory where you want to have this repository. Go into the directory where you want to have this repository.
Get it with SSH: Get it with SSH:
```bash ```bash
git clone git@code.fbi.h-da.de:danet/gosdn.git git clone git@code.fbi.h-da.de:danet/gosdn.git
``` ```
or with HTTPS: or with HTTPS:
```bash ```bash
git clone https://code.fbi.h-da.de/danet/gosdn.git git clone https://code.fbi.h-da.de/danet/gosdn.git
``` ```
You can find the repository with this [link](https://code.fbi.h-da.de/danet/gosdn): You can find the repository with this [link](https://code.fbi.h-da.de/danet/gosdn):
```bash ```bash
https://code.fbi.h-da.de/danet/gosdn https://code.fbi.h-da.de/danet/gosdn
``` ```
#### Run command init the submodules in the repository gosdn #### Run command init the submodules in the repository gosdn
```bash ```bash
cd gosdn cd gosdn
git submodule update --init --recursive git submodule update --init --recursive
``` ```
### Get the gNMI target repository from the Gitlab site ### Get the gNMI target repository from the Gitlab site
Get it with SSH: Get it with SSH:
```bash ```bash
cd .. cd ..
git clone git@code.fbi.h-da.de:danet/gnmi-target.git git clone git@code.fbi.h-da.de:danet/gnmi-target.git
``` ```
or with HTTPS: or with HTTPS:
```bash ```bash
cd .. cd ..
git clone https://code.fbi.h-da.de/danet/gnmi-target.git git clone https://code.fbi.h-da.de/danet/gnmi-target.git
``` ```
You can find the repository with this [link](https://code.fbi.h-da.de/danet/gnmi-target): You can find the repository with this [link](https://code.fbi.h-da.de/danet/gnmi-target):
```bash ```bash
https://code.fbi.h-da.de/danet/gnmi-target https://code.fbi.h-da.de/danet/gnmi-target
``` ```
#### Run command to build the docker image for the gNMI target #### Run command to build the docker image for the gNMI target
Firstly, go to your local gnmi-target repository Firstly, go to your local gnmi-target repository
```bash ```bash
cd gnmi-target cd gnmi-target
``` ```
Next, build the image: Next, build the image:
```bash ```bash
make container make container
``` ```