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.
## Delete old version of Go if already installed
```bash
sudo rm -rf /usr/local/go
```
## Download Go
### Check for latest system updates using the commands below
```bash
sudo apt update
sudo apt upgrade
```
### Download Go using wget
The latest version can be found [here](https://go.dev/dl/). Please adjust the command below accordingly.
```bash
wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz
```
### 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.
```bash
sudo tar -C /usr/local/ -xzf go1.22.0.linux-amd64.tar.gz
```
### Check if path for Go is already set
```bash
echo $PATH
```
### Set path for Go if not set
```bash
cd /usr/local/
sudo nano $HOME/.profile
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
source $HOME/.profile
cat $HOME/.profile
```
### Optional: Set Go path to use with sudo
```bash
sudo visudo
```
And add by secure_path at the end:
```bash
:/usr/local/go/bin
```
### Check Go version
```bash
go version
```
Use
```bash
source ~/.profile
```
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.
## Install Docker
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
```bash
sudo docker login registry.code.fbi.h-da.de
```
## Install Containerlab
```bash
bash -c "$(curl -sL https://get.containerlab.dev)"
```
## Install Make
```bash
sudo apt install make
```
## Download the repositories
### Get the goSDN repository from the Gitlab site
Go into the directory where you want to have this repository.
Get it with SSH:
```bash
git clone git@code.fbi.h-da.de:danet/gosdn.git
```
or with HTTPS:
```bash
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):
```bash
https://code.fbi.h-da.de/danet/gosdn
```
#### Run command init the submodules in the repository gosdn
```bash
cd gosdn
git submodule update --init --recursive
```
### Get the gNMI target repository from the Gitlab site
Get it with SSH:
```bash
cd ..
git clone git@code.fbi.h-da.de:danet/gnmi-target.git
```
or with HTTPS:
```bash
cd ..
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):
```bash
https://code.fbi.h-da.de/danet/gnmi-target
```
#### Run command to build the docker image for the gNMI target
Firstly, go to your local gnmi-target repository
```bash
cd gnmi-target
```
Next, build the image:
```bash
make container
```
On this page, you will learn how to install all necessary software to run the labs.
## Delete old version of Go if already installed
```bash
sudo rm -rf /usr/local/go
```
## Download Go
### Check for latest system updates using the commands below
```bash
sudo apt update
sudo apt upgrade
```
### Download Go using wget
The latest version can be found [here](https://go.dev/dl/). Please adjust the command below accordingly.
```bash
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
Make sure to adjust the version in this command to fit the one downloaded in the previous step.
```bash
sudo tar -C /usr/local/ -xzf go1.23.2.linux-amd64.tar.gz
```
### Check if path for Go is already set
```bash
echo $PATH
```
### Set path for Go if not set
```bash
cd /usr/local/
sudo nano $HOME/.profile
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
source $HOME/.profile
cat $HOME/.profile
```
### Optional: Set Go path to use with sudo
```bash
sudo visudo
```
And add by secure_path at the end:
```bash
:/usr/local/go/bin
```
### Check Go version
```bash
go version
```
Use
```bash
source ~/.profile
```
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.
## Install Docker
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
```bash
sudo docker login registry.code.fbi.h-da.de
```
## Install Containerlab
```bash
bash -c "$(curl -sL https://get.containerlab.dev)"
```
## Install Make
```bash
sudo apt install make
```
## Download the repositories
### Get the goSDN repository from the Gitlab site
Go into the directory where you want to have this repository.
Get it with SSH:
```bash
git clone git@code.fbi.h-da.de:danet/gosdn.git
```
or with HTTPS:
```bash
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):
```bash
https://code.fbi.h-da.de/danet/gosdn
```
#### Run command init the submodules in the repository gosdn
```bash
cd gosdn
git submodule update --init --recursive
```
### Get the gNMI target repository from the Gitlab site
Get it with SSH:
```bash
cd ..
git clone git@code.fbi.h-da.de:danet/gnmi-target.git
```
or with HTTPS:
```bash
cd ..
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):
```bash
https://code.fbi.h-da.de/danet/gnmi-target
```
#### Run command to build the docker image for the gNMI target
Firstly, go to your local gnmi-target repository
```bash
cd gnmi-target
```
Next, build the image:
```bash
make container
```