From ce975ea572826df5fb971c473c4d978777395711 Mon Sep 17 00:00:00 2001 From: jillesca Date: Tue, 5 Sep 2023 16:58:37 +0100 Subject: [PATCH] Updating dependencies to fix dependabot issues. Instructions updated as well --- README.md | 11 +++++++++++ build_run_cml.sh | 6 +++--- build_run_grafana.sh | 4 ++-- build_run_influxdb.sh | 4 ++-- build_run_telegraf.sh | 4 ++-- cml/dockerfile | 29 ++++++++++++----------------- cml/requirements.txt | 26 ++++++++------------------ 7 files changed, 40 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index b1534c6..87510cf 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ Either manually stop and wipe the existing lab and then import the [cml topology Or run the cml container. _If first time, it will take around 5min to be ready. Manual option could be faster._ +> The cml container assumes the default lab is called '_Multi Platform Network_' in cml. If this is not the case, update the [build_run_cml.sh script with the corresponding name](build_run_cml.sh#24) + ```bash chmod +x build_run_cml.sh bash build_run_cml.sh @@ -149,6 +151,15 @@ Then you need to tell telegraf, which configuration file it should use under [ne Rebuild the container using `bash build_run_telegraf.sh` +## Tear down the lab + +Remove any containers from your laptop with the commands below + +```bash +docker rm -f cml telegraf influxdb grafana +docker volume rm influxdb +``` + ## .env.local file The [.env.local file](.env.local) is used to define all variables used by the containers. diff --git a/build_run_cml.sh b/build_run_cml.sh index 8014b7f..813306f 100755 --- a/build_run_cml.sh +++ b/build_run_cml.sh @@ -28,7 +28,7 @@ docker exec -it cml ansible-playbook cisco.cml.build -e startup='host' -e wait=' -echo "\n################################" +echo "################################" echo "To access the container use:" -echo "docker exec -it cml /bin/sh" -echo "################################\n" \ No newline at end of file +echo "docker exec -it cml /bin/bash" +echo "################################" \ No newline at end of file diff --git a/build_run_grafana.sh b/build_run_grafana.sh index ab68b34..cdc4a62 100755 --- a/build_run_grafana.sh +++ b/build_run_grafana.sh @@ -13,7 +13,7 @@ docker build --file grafana/dockerfile \ docker run -itd -p 3000:3000 --name grafana --add-host host.docker.internal:host-gateway grafana:$GRAFANA_TAG -echo "\n################################" +echo "################################" echo "To access the container use:" echo "docker exec -it grafana bash" -echo "################################\n" \ No newline at end of file +echo "################################" \ No newline at end of file diff --git a/build_run_influxdb.sh b/build_run_influxdb.sh index 8a1f0da..9323870 100755 --- a/build_run_influxdb.sh +++ b/build_run_influxdb.sh @@ -18,7 +18,7 @@ docker build \ docker run -itd -p 8086:8086 --volume influxdb:/var/lib/influxdb2 --name influxdb --add-host host.docker.internal:host-gateway influxdb:$INFLUXDB_TAG -echo "\n################################" +echo "################################" echo "To access the container use:" echo "docker exec -it influxdb bash" -echo "################################\n" \ No newline at end of file +echo "################################" \ No newline at end of file diff --git a/build_run_telegraf.sh b/build_run_telegraf.sh index 86451f7..b485a54 100755 --- a/build_run_telegraf.sh +++ b/build_run_telegraf.sh @@ -18,7 +18,7 @@ docker run -itd -p 57500:57500 --name telegraf \ --add-host host.docker.internal:host-gateway telegraf:$TELEGRAF_TAG # -v ${PWD}/netconf_client:/opt/netconf_client/ \ -echo "\n################################" +echo "################################" echo "To access the container use:" echo "docker exec -it telegraf bash" -echo "################################\n" \ No newline at end of file +echo "################################" \ No newline at end of file diff --git a/cml/dockerfile b/cml/dockerfile index 0152218..7709abf 100644 --- a/cml/dockerfile +++ b/cml/dockerfile @@ -1,22 +1,17 @@ # syntax=docker/dockerfile:1 -# FROM python:alpine3.16 AS base -# COPY ./cml/requirements.txt . -# RUN apk add \ -# gcc \ -# musl-dev \ -# linux-headers \ -# libssh-dev \ -# openssh-client \ -# && pip install --upgrade pip \ -# && pip3 install -r requirements.txt \ -# && pip install virl2-client==2.5.0 \ -# && ansible-galaxy collection install cisco.cml -# WORKDIR /home - -FROM jillesca/ansible:cml1.1 as base - -RUN pip install virl2-client==2.5.0 \ +FROM python:alpine3.16 AS base +COPY ./cml/requirements.txt . +RUN apk add \ + gcc \ + bash \ + musl-dev \ + libssh-dev \ + linux-headers \ + openssh-client \ + && pip install --upgrade pip \ + && pip install -r requirements.txt \ && ansible-galaxy collection install cisco.cml +WORKDIR /home FROM base as cml diff --git a/cml/requirements.txt b/cml/requirements.txt index 57d389e..666ddb8 100644 --- a/cml/requirements.txt +++ b/cml/requirements.txt @@ -1,18 +1,8 @@ -ansible==6.5.0 -ansible-core==2.13.5 -ansible-pylibssh==1.0.0 -certifi==2022.9.24 -cffi==1.15.1 -charset-normalizer==2.1.1 -cryptography==38.0.1 -idna==3.4 -Jinja2==3.1.2 -MarkupSafe==2.1.1 -packaging==21.3 -pycparser==2.21 -pyparsing==3.0.9 -PyYAML -requests==2.28.1 -resolvelib==0.8.1 -urllib3==1.26.12 -paramiko==2.11.0 \ No newline at end of file +ansible>=8.3.0 +ansible-core>=2.15.3 +Jinja2>=3.1.2 +PyYAML>=6.0.1 +requests>=2.31.0 +urllib3>=2.0.4 +paramiko>=3.3.1 +virl2-client==2.5.0 \ No newline at end of file