Commit a884b356 authored by Rita Sousa's avatar Rita Sousa
Browse files

Updated README and deleted unused file

parent 32585938
NUVLA_ENDPOINT=https://nuvla.io
NUVLA_API_KEY=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
NUVLA_API_SECRET=XXXXXX.XXXXXX.XXXXXX.XXXXXX.XXXXXX
NUVLA_API_COOKIES=/demo/<name-of-cookies-file>
......@@ -17,51 +17,50 @@ git submodule update --remote --recursive
# Structure
- The **app** folder contains a demo for the NFR Tool time and energy
- The **app** folder contains the NFR Tool time and energy
- The **dataclay** folder should correspond to the GitLab repo https://gitlab.bsc.es/elastic-h2020/elastic-sa/nfr-tool/dataclay
# SETUP
There are two options:
## 1. In the device/machine
To use this demo, a connection to dataClay is mandatory. Before establishing this connection, run the **setupForDataclay.sh** script to configure some necessary settings.
You can check usage by executing:
```
./setupForDataclay.sh -h
```
In this demo, **Global Resource Manager (GRM)** (https://gitlab.bsc.es/elastic-h2020/elastic-sa/nfr-tool/grm-global_resource_manager) must be running to create a fake ElasticSystem. Then, to have several fake Workers (Docker containers) available, you should run:
For a full functional demo, **Global Resource Manager (GRM)** (https://gitlab.bsc.es/elastic-h2020/elastic-sa/nfr-tool/grm-global_resource_manager) must be running to create a fake ElasticSystem. To have several fake Workers (Docker containers) available with real workload, you should run:
```
docker pull rita09sousa/fake_docker_workers:2.0
docker image tag rita09sousa/fake_docker_workers:2.0 fake_docker_workers
```
OR
```
cd app/fakeWorkers/
docker build -t fake_docker_workers .
```
Then, start some fake Workers with constant resource usage:
docker build -t rita09sousa/fake_docker_workers:2.0 .
```
docker run -d --rm -it -e FAKE_WORKER=<NUM_FAKEWORKER> --name fakeworker<NUM_FAKEWORKER> fake_docker_workers
```
where <NUM_FAKEWORKER> must be a number between 1 and 6.
After creating the desired fake Workers (attention to not overload the system), execute in nfrtool-time-and-energy/app directory
```
cd ..
./getWorkersPid.sh
```
to update some files with the necessary configurations to create the fake Workers.
**NOTE:** This demo uses NuvlaBox telemetry. This video https://bit.ly/3pyekR4 shows how to install the NuvlaBox on some Node (Edge device) and this https://bit.ly/3cyJRPd shows how to use the NuvlaBox's Data Gateway, which provides the telemetry/resources metrics.
However, you only need to install NuvlaBox. Watch the first video or follow the steps below:
Additionally, this demo uses NuvlaBox telemetry. This video https://bit.ly/3pyekR4 shows how to install the NuvlaBox on some Node (Edge device) and this https://bit.ly/3cyJRPd shows how to use the NuvlaBox's Data Gateway, which provides the telemetry/resources metrics.
However, you only need to install NuvlaBox. Watch the first video OR follow the steps below:
1. Log in to Nuvla.
2. In the left bar, select **Nuvlabox**, and then **+ Add**.
3. Fill in the name and description, and under INSTALLATION METHOD, choose Compose file bundle.
3. Fill in the name (put the user of the machine preferably) and description, and under INSTALLATION METHOD, choose Compose file bundle.
4. Click **create** and then follow the steps presented under Quick Installation.
And since this demo uses the Nuvla API, you need to obtain your credentials and and put them in the .env file.
To create an API key (credentials):
1. Go to https://nuvla.io/ui/api/credential
2. Click **Search...**
3. Click **+ Add**
4. On the Menu drop-down (Drop-down list), select **generate-api-key**
5. Click **create** and save the resource-id and secret-key (look for a notification at the top righ corner)
In .env.example, replace "XXX ..." with your credentials generated, and rename the file by removing ".example".
NOTE: API key is the id after credential/
This was the pre-setup. Now, there are two options. You can deploy:
## 1. In the device/machine
To use this demo, a connection to dataClay is mandatory. Before establishing this connection, run the **setupForDataclay.sh** script to configure some necessary settings.
You can check usage by executing:
```
./setupForDataclay.sh -h
```
Go to nfrtool-time-and-energy/ directory.
### 1.1 Start dataClay
Start the dataClay, destroying any dataClay instance that could be active.
```
......@@ -79,10 +78,10 @@ docker-compose -f backend-dataclay.yml up --build
**NOTE:** In release 2.5, dcinitializer should only start when all dataClay nodes are up! You can use development versions to add nodes "on demand".
### 1.2 Start NFR Tool
Then start the Global Resource Manager (from the respective respositories), **wait for the dcinitializer to finish**, and start the NFR Tools on the different Nodes, executing:
Then ensure that Global Resource Manager is running (from the respective respositories), **wait for the dcinitializer to finish**, and start the NFR Tools on the different Nodes, executing:
```
docker-compose down -v
docker-compose up --build
```
......@@ -135,7 +134,7 @@ Environment variables | Value
# Demo behavior
The NFR Tool will search for a fake Elastic System with an alias equals to "system".
Then, it pulls data from Nuvla telemetry and Docker API, evaluates the resources' consumption and when necessary publishes NFRViolations in the "violations" queue name (topic) to GRM's evaluation.
Then, it pulls data from Nuvla telemetry and Docker API, evaluates the resources' consumption and when necessary publishes NFRViolations to GRM's evaluation.
# Acknowledgements
......
#!/bin/sh
set -e
DELIMITER=" "
LIST_PIDS=""
LIST_IPS=""
for container_id in $(docker ps -q -f name=fakeworker)
do
NEW_PID=$(docker inspect -f '{{ .State.Pid }}' $container_id)
if [ -z "$NEW_PID" ]
then
continue
fi
LIST_PIDS=$LIST_PIDS$NEW_PID$DELIMITER
NEW_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $container_id)
if [ -z "$NEW_IP" ]
then
LIST_IPS=$LIST_IPS"null"$DELIMITER
fi
LIST_IPS=$LIST_IPS$NEW_IP$DELIMITER
done
echo $LIST_PIDS > pidsToMonitor.txt
echo $LIST_IPS > ipsToMonitor.txt
......@@ -28,7 +28,7 @@ services:
- NUVLA_DG_HOSTNAME=tcp://data-gateway
- NUVLA_DG_TOPIC=nuvlabox-status
- NUVLA_DG_HEARTBEAT=10
- NUVLA_ENDPOINT=${NUVLA_ENDPOINT}
- NUVLA_ENDPOINT=https://nuvla.io
- NUVLA_API_KEY=${NUVLA_API_KEY}
- NUVLA_API_SECRET=${NUVLA_API_SECRET}
- NUVLA_API_COOKIES=${NUVLA_API_COOKIES}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment