Commit 5b66f209 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Tutorial cleanup

parent 7d3e613d
Loading
Loading
Loading
Loading
+39 −0
Original line number Diff line number Diff line
#!/bin/bash
# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

COMPONENT_NAME=$1
PROJECTDIR=`pwd`

mkdir -p ${PROJECTDIR}/src/${COMPONENT_NAME}
mkdir -p ${PROJECTDIR}/src/${COMPONENT_NAME}/client
mkdir -p ${PROJECTDIR}/src/${COMPONENT_NAME}/service
mkdir -p ${PROJECTDIR}/src/${COMPONENT_NAME}/tests

touch ${PROJECTDIR}/src/${COMPONENT_NAME}/client/__init__.py
touch ${PROJECTDIR}/src/${COMPONENT_NAME}/service/__init__.py
touch ${PROJECTDIR}/src/${COMPONENT_NAME}/tests/__init__.py
touch ${PROJECTDIR}/src/${COMPONENT_NAME}/.gitlab-ci.yml
touch ${PROJECTDIR}/src/${COMPONENT_NAME}/__init__.py
touch ${PROJECTDIR}/src/${COMPONENT_NAME}/Config.py
touch ${PROJECTDIR}/src/${COMPONENT_NAME}/Dockerfile
touch ${PROJECTDIR}/src/${COMPONENT_NAME}/requirements.in

cd ${PROJECTDIR}/src
python gitlab-ci.yml_generator.py -t latest forecaster

cd ${PROJECTDIR}/src/${COMPONENT_NAME}
mv .gitlab-ci.yml gitlab-ci.yaml
${PROJECTDIR}/scripts/add_license_header_to_files.sh
mv gitlab-ci.yaml .gitlab-ci.yml
+20 −6
Original line number Diff line number Diff line
@@ -83,17 +83,27 @@ microk8s config > $HOME/.kube/config
sudo reboot
```

## 1.2.6. Check status of Kubernetes
## 1.2.6. Check status of Kubernetes and addons
To retrieve the status of Kubernetes __once__, run the following command:
```bash
microk8s.status --wait-ready
```

To retrieve the status of Kubernetes __periodically__ (e.g., every 1 second), run the following command:
```bash
watch -n 1 microk8s.status --wait-ready
```

## 1.2.7. Check all resources in Kubernetes
To retrieve the status of the Kubernetes resources __once__, run the following command:
```bash
microk8s.kubectl get all --all-namespaces
kubectl get all --all-namespaces
```

To retrieve the status of the Kubernetes resources __periodically__ (e.g., every 1 second), run the following command:
```bash
watch -n 1 kubectl get all --all-namespaces
```

## 1.2.8. Enable addons
The Addons enabled are:
@@ -106,10 +116,14 @@ The Addons enabled are:
microk8s.enable dns hostpath-storage ingress registry
```

__Note__: enabling some of the addons might take few minutes.
          [Check status](./1-2-install-microk8s.md#124-check-status-of-kubernetes) periodically until all addons are
          shown as enabled. Then [Check resources](./1-2-install-microk8s.md#125-check-all-resources-in-kubernetes)
          periodically until all pods are Ready and Running.
__Important__: Enabling some of the addons might take few minutes. Do not proceed with next steps until the addons are
               ready. Otherwise, the deployment might fail. To confirm everything is up and running:
1. Periodically
   [Check the status of Kubernetes](./1-2-install-microk8s.md#126-check-status-of-kubernetes)
   until you see the addons [dns, ha-cluster, hostpath-storage, ingress, registry, storage] in the enabled block.
2. Periodically
   [Check Kubernetes resources](./1-2-install-microk8s.md#127-check-all-resources-in-kubernetes)
   until all pods are __Ready__ and __Running__.


## 1.2.9. Stop, Restart, and Redeploy
+6 −3
Original line number Diff line number Diff line
@@ -2,7 +2,9 @@

This functional test reproduces the live demonstration "Demonstration of Zero-touch Device and L3-VPN Service Management
Using the TeraFlow Cloud-native SDN Controller" carried out at
[OFC'22](https://www.ofcconference.org/en-us/home/program-speakers/demo/).
[OFC'22](https://ieeexplore.ieee.org/document/9748575).




## 2.2.1. Functional test folder
@@ -33,8 +35,9 @@ To run this functional test, it is assumed you have deployed a MicroK8s-based Ku
controller instance as described in the [Tutorial: Deployment Guide](./1-0-deployment.md), and you configured the Python
environment as described in
[Tutorial: Run Experiments Guide > 2.1. Configure Python Environment](./2-1-python-environment.md).
Remember to source the scenario settings appropriately, e.g., `cd ~/tfs-ctrl && source my_deploy.sh` in each terminal
you open.
Remember to source the scenario settings, e.g., `cd ~/tfs-ctrl && source ofc22/deploy_specs.sh` in each terminal you open.
Then, re-build the protocol buffers code from the proto files:
`./proto/generate_code_python.sh`


## 2.2.4. Access to the WebUI and Dashboard
+2 −5
Original line number Diff line number Diff line
# 2.4. ECOC'22 Demo - Disjoint DC-2-DC L3VPN Service (WORK IN PROGRESS)

This functional test reproduces the experimental assessment of "Experimental Demonstration of Transport Network Slicing
with SLA Using the TeraFlowSDN Controller" presented at [ECOC'22](https://www.ecoc2022.org/).
with SLA Using the TeraFlowSDN Controller" presented at [ECOC'22](https://www.optica.org/en-us/events/topical_meetings/ecoc/schedule/?day=Tuesday#Tuesday).

## 2.4.1. Functional test folder

@@ -27,10 +27,7 @@ To run this functional test, it is assumed you have deployed a MicroK8s-based Ku
controller instance as described in the [Tutorial: Deployment Guide](./1-0-deployment.md), and you configured the Python
environment as described in
[Tutorial: Run Experiments Guide > 2.1. Configure Python Environment](./2-1-python-environment.md).
Remember to source the scenario settings appropriately, e.g., `cd ~/tfs-ctrl && source my_deploy.sh` in each terminal
you open.
Next, remember to source the environment variables created by the deployment, e.g.,
`cd ~/tfs-ctrl && source tfs_runtime_env_vars.sh`.
Remember to source the scenario settings, e.g., `cd ~/tfs-ctrl && source ecoc22/deploy_specs.sh` in each terminal you open.
Then, re-build the protocol buffers code from the proto files:
`./proto/generate_code_python.sh`

+3 −1
Original line number Diff line number Diff line
@@ -7,4 +7,6 @@ this guide assumes you are using the Oracle VirtualBox-based VM running MicroK8s
## Table of Content:
- [3.1. Configure VSCode and Connect to the VM](./3-1-configure-vscode.md)
- [3.2. Development Commands, Tricks, and Hints (WORK IN PROGRESS)](./3-2-develop-cth.md)
- [3.3. Debugging individual components in VSCode](./3.3-debug-comp.md)
- [3.3. Debugging individual components in VSCode](./3-3-debug-comp.md)

- [3.X. Developing a new component: Forecaster (WORK IN PROGRESS)](./3-X-develop-new-component.md)
Loading