Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
// "forwardPorts": [],
"forwardPorts": [
8000
]
],

// Uncomment the next line if you want start specific services in your Docker Compose config.
// "runServices": [],
Expand All @@ -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": {},
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Initial creation 11/04/2023 - G
Basic files added.
Basic files added.
# Fix 11/04/2023 - G
Grammar in readme
24 changes: 16 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -23,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
Expand Down Expand Up @@ -92,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"]
CMD ["/bin/zsh"]
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
- developing new container prototypes
- debugging container builds and deployments
- educational intents for container development/examples (i.e. workflows and devcontainers)

Expand Down Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions ansible/inventory.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
myhosts:
hosts:
localhost:
ansible_host: localhost
server1:
ansible_host: server1
server2:
ansible_host: server2
server3:
ansible_host: nexus
14 changes: 7 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"]
Expand Down
13 changes: 9 additions & 4 deletions src/broker_preflight.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,22 @@ 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: $@"
}
function _done_msg () {
echo "DONE: $@"
}



#######################################
Expand Down Expand Up @@ -232,6 +236,7 @@ function do_arguments() {
usage
_failure_msg "Error: Unknown Command: ${args}"
fi
_done_msg "All checks completed"
exit 0
}
#######################################
Expand Down
1 change: 1 addition & 0 deletions src/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ portscan==1.1
pyfiglet==1.0.2
speedtest-cli==2.1.3
urllib3==2.1.0
ansible==9.2.0
14 changes: 9 additions & 5 deletions src/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down