From 535db41c8edd86bb09249b2117cc0adafe2833d5 Mon Sep 17 00:00:00 2001 From: bmsmcgee <98934884+bmsmcgee@users.noreply.github.com> Date: Tue, 13 Feb 2024 11:47:40 -0700 Subject: [PATCH 1/7] Group 12 added cat command after container is created --- .devcontainer/devcontainer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 02eedd2..8e1e2cd 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -41,7 +41,7 @@ // "forwardPorts": [], "forwardPorts": [ 8000 - ] + ], // Uncomment the next line if you want start specific services in your Docker Compose config. // "runServices": [], @@ -50,7 +50,7 @@ // "shutdownAction": "none", // Uncomment the next line to run commands after the container is created. - // "postCreateCommand": "cat /etc/os-release", + "postCreateCommand": "cat /etc/os-release" // Configure tool-specific properties. // "customizations": {}, From fca09465ac05bdc207378b353387a8076d6b9a48 Mon Sep 17 00:00:00 2001 From: Alessandro Baldassarre <113554225+aleabalda@users.noreply.github.com> Date: Sun, 25 Feb 2024 12:29:22 -0700 Subject: [PATCH 2/7] added timestamps group 26 (#143) --- src/broker_preflight.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/broker_preflight.sh b/src/broker_preflight.sh index dcc6d4c..f380c13 100755 --- a/src/broker_preflight.sh +++ b/src/broker_preflight.sh @@ -31,18 +31,20 @@ OFFLINE=${OFFLINE:=false} # Output CMDs ####################################### function _banner_msg () { - echo -e "\n$@" + echo -e "\n$(date "+%Y-%m-%d %H:%M:%S") - $@" } function _success_msg () { - echo -e "$@" + echo -e "$(date "+%Y-%m-%d %H:%M:%S") - $@" } function _failure_msg () { - echo -e "FAILURE: $@" + echo -e "$(date "+%Y-%m-%d %H:%M:%S") - FAILURE: $@" exit 1 } function _warning_msg () { - echo "WARNING: $@" + echo "$(date "+%Y-%m-%d %H:%M:%S") - WARNING: $@" } +# Group 26 added timestamps to the messages above to allow for +# better debugging and better logging. ####################################### From e58f4fdc0e5949ae71922e64cbc37958c3680d64 Mon Sep 17 00:00:00 2001 From: Isaac Hus <102320893+1saacH@users.noreply.github.com> Date: Sun, 25 Feb 2024 12:39:05 -0700 Subject: [PATCH 3/7] group 2 changes (#139) Co-authored-by: Garth Johnson --- src/broker_preflight.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/broker_preflight.sh b/src/broker_preflight.sh index f380c13..5862e49 100755 --- a/src/broker_preflight.sh +++ b/src/broker_preflight.sh @@ -43,8 +43,10 @@ function _failure_msg () { function _warning_msg () { echo "$(date "+%Y-%m-%d %H:%M:%S") - WARNING: $@" } -# Group 26 added timestamps to the messages above to allow for -# better debugging and better logging. +function _done_msg () { + echo "DONE: $@" +} + ####################################### @@ -234,6 +236,7 @@ function do_arguments() { usage _failure_msg "Error: Unknown Command: ${args}" fi + _done_msg "All checks completed" exit 0 } ####################################### From a0771cfb85b8e684c916193a1adfc1441819bacc Mon Sep 17 00:00:00 2001 From: Javy-He <92188742+Javy-He@users.noreply.github.com> Date: Sun, 25 Feb 2024 12:50:31 -0700 Subject: [PATCH 4/7] Added comment to Dockerfile (#135) --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 509f1f2..072f7de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM python:3.12-slim-bullseye +FROM python:3.12-slim-bullseye +# 3.12 is the latest version of Python as of 2021-10-20 # Passed from Github Actions ARG GIT_VERSION_TAG=unspecified From 1b55e6bc4c1564addf11047556007fddb8fb2a3b Mon Sep 17 00:00:00 2001 From: HarrisHasnain <113812133+HarrisHasnain@users.noreply.github.com> Date: Sun, 25 Feb 2024 13:09:34 -0700 Subject: [PATCH 5/7] fixed readme (#124) * Adding ansible (#15) * rm duplicates added rsync * added bzip, pw10 theme ownership, and consistant ADD over COPY * adding ownership and history plugin as well as rc files * codespace font setting * Coder (#6) * moar promptiness * more compatible with lesser fonting * add user to docker group * corrected docker lib reference * added dockerinfo to tasks * better separation of build env * Testing with badges and adding notes * Testing with badges and adding notes * changed workflow names * changed from app to dev container name * fixed indent filure * indenting * versioning test * removed bad version test * added Docker test tasks * added docker test tasks * added example bash script to basic-test network * Added test_net and docs * added ansible tool * new tools added in dockerfile2 * fixed readme * yuh * frfr --------- Co-authored-by: Garth Johnson Co-authored-by: E J --- CHANGELOG | 4 +++- Dockerfile | 21 ++++++++++++++------- README.md | 6 +++++- ansible/inventory.yml | 10 ++++++++++ docker-compose.yml | 14 +++++++------- src/requirements.txt | 1 + 6 files changed, 40 insertions(+), 16 deletions(-) create mode 100644 ansible/inventory.yml diff --git a/CHANGELOG b/CHANGELOG index 2b8aada..2c6161f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,2 +1,4 @@ # Initial creation 11/04/2023 - G -Basic files added. \ No newline at end of file +Basic files added. +# Fix 11/04/2023 - G +Grammar in readme \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 072f7de..f382a99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,21 +24,28 @@ RUN apt-get -yq install --no-install-recommends \ tcpdump traceroute iproute2 dnsutils whois mtr iftop iputils-ping wget nmap netcat-traditional \ procps \ htop \ - # Clean up - && apt-get autoremove -y \ - && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* + screen tmux \ + unzip zip \ + jq \ + build-essential \ + software-properties-common \ + tree \ + lsof \ + fish \ + && sh -c "curl -fsSL https://starship.rs/install.sh | bash -s -- --yes" \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* # ensure that there is a place to mount the host files RUN mkdir /host -# Set tthe working directory for installations and login +# Set the working directory for installations and login WORKDIR /app # Copy in any/all additional files from our project ADD src/requirements.txt . -# Istall Python basic libraries +# Install Python basic libraries RUN python3 -m pip install --no-cache-dir -r requirements.txt # Setup a user to match the host and reduce the frustration/confusion of file ownership @@ -93,4 +100,4 @@ ADD --chown=1000:1000 --chmod=+x src/test_net.sh . ADD --chown=1000:1000 src/nodes.list . # Set default command -CMD ["/bin/zsh"] \ No newline at end of file +CMD ["/bin/zsh"] diff --git a/README.md b/README.md index 6a9ac2b..e939787 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The purpose of this container image is to provide tools that can help diagnose i Additionally, this container image can easily used for: -- devlopment new container prototypes +- developed new container prototypes - debugging container builds and deployments - educational intents for container development/examples (i.e. workflows and devcontainers) @@ -77,6 +77,10 @@ Some possible tasks to add-to/replace the default options: Use the `portainer-compose.yml` file and modify to your hearts content. +## Fixed grammer + +Fixed grammar + ## Notes - https://ohmyz.sh/#install diff --git a/ansible/inventory.yml b/ansible/inventory.yml new file mode 100644 index 0000000..d0efe4b --- /dev/null +++ b/ansible/inventory.yml @@ -0,0 +1,10 @@ +myhosts: + hosts: + localhost: + ansible_host: localhost + server1: + ansible_host: server1 + server2: + ansible_host: server2 + server3: + ansible_host: nexus diff --git a/docker-compose.yml b/docker-compose.yml index 306c73e..dfed9d8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,22 +8,22 @@ services: dockerfile: Dockerfile image: ghcr.io/growlf/toolbox:latest environment: - - TESTVAR=${TESTVAR:-app} + - TESTVAR=${TESTVAR:/src} stdin_open: true tty: true command: ["/bin/zsh"] volumes: - - ${HOME}/.gitconfig:/home/ubuntu/.gitconfig - - ${HOME}/.ssh:/home/ubuntu/.ssh - - ${PWD}:/app - - /var/run/docker.sock:/var/run/docker.sock + - ${HOME}/.gitconfig:/home/ubuntu/.gitconfig + - ${HOME}/.ssh:/home/ubuntu/.ssh + - .:/src + - /var/run/docker.sock:/var/run/docker.sock network_mode: "host" # Example container with DooD and host file/net access app1: image: ghcr.io/growlf/toolbox:latest environment: - - TESTVAR=${TESTVAR:-app2} + - TESTVAR=${TESTVAR:/src} stdin_open: true tty: true command: ["/bin/zsh"] @@ -37,7 +37,7 @@ services: app2: image: ghcr.io/growlf/toolbox:latest environment: - - TESTVAR=${TESTVAR:-app2} + - TESTVAR=${TESTVAR:/src} stdin_open: true tty: true command: ["/bin/bash"] diff --git a/src/requirements.txt b/src/requirements.txt index 462dfd6..4f3b0df 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -6,3 +6,4 @@ portscan==1.1 pyfiglet==1.0.2 speedtest-cli==2.1.3 urllib3==2.1.0 +ansible==9.2.0 From 5065c6a43c70349b9b4623f836428bff3202f506 Mon Sep 17 00:00:00 2001 From: gillhabs <113945147+gillhabs@users.noreply.github.com> Date: Sun, 25 Feb 2024 13:26:50 -0700 Subject: [PATCH 6/7] Change README (#113) Co-authored-by: Garth Johnson --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e939787..c395b2e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The purpose of this container image is to provide tools that can help diagnose i Additionally, this container image can easily used for: -- developed new container prototypes +- developing new container prototypes - debugging container builds and deployments - educational intents for container development/examples (i.e. workflows and devcontainers) From edb122edae293fd666ca66ff786954442ce24287 Mon Sep 17 00:00:00 2001 From: NickSavino Date: Mon, 24 Feb 2025 13:37:10 -0700 Subject: [PATCH 7/7] added error failsafe to netspeed command --- src/tasks.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/tasks.py b/src/tasks.py index b993590..88a6fea 100644 --- a/src/tasks.py +++ b/src/tasks.py @@ -89,11 +89,15 @@ def netspeed(c, verbose=0): # If you want to use a single threaded test # threads = 1 - s = speedtest.Speedtest() - s.get_servers(servers) - s.get_best_server() - s.download(threads=threads) - s.upload(threads=threads) + try: + s = speedtest.Speedtest() + s.get_servers(servers) + s.get_best_server() + s.download(threads=threads) + s.upload(threads=threads) + except Exception as e: + raise invoke.Exit("ERROR: Speedtest failed.", e) + results_dict = s.results.dict()