#!/bin/bash
set -euo pipefail
# Get the directory containing this script
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
# Remove any stopped containers
docker rm $(docker ps --filter status=exited -q) || true
# Define a help function
show_help() {
echo "Usage: $(basename "$0") [-w WORKSPACE]"
echo ""
echo "Launch a swarm learning container"
echo ""
echo "Options:"
echo " -w WORKSPACE The name of the workspace directory to use (default: none)"
echo " -h Show this help message"
echo ""
exit 0
}
# Process command line options
while getopts ":w:h" opt; do
case ${opt} in
w ) workspace=${OPTARG} ;;
h ) show_help ;;
\? ) show_help ;;
: ) echo "Option -$OPTARG requires an argument." >&2; exit 1 ;;
esac
done
ip_addr=$(ip addr show tun0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/')
# Launch the swarm learning container with the specified options
"$script_dir"/../../swarm_learning_scripts/run-sl \
--name=sl1 \
--host-ip="$ip_addr" \
--sn-ip="$ip_addr"\
--sn-api-port=30304 \
--sl-fs-port=16000 \
--key=/opt/hpe/swarm-learning-hpe/cert/sl-TUD-key.pem \
--cert=/opt/hpe/swarm-learning-hpe/cert/sl-TUD-cert.pem \
--capath=/opt/hpe/swarm-learning-hpe/cert/ca/capath \
--ml-it \
--ml-image=user-env-marugoto-swop \
--ml-name=ml1 \
--ml-w=/tmp/test \
--ml-entrypoint=python3 \
--ml-cmd=model/main.py \
--ml-v=workspace/"$workspace"/model:/tmp/test/model \
--ml-e MODEL_DIR=model \
--ml-e MAX_EPOCHS=5 \
--ml-e MIN_PEERS=2 \
--ml-e https_proxy= \
--apls-ip="$ip_addr"
user-env-marugoto-swop is the docker image created when previously running swci tasks, error message for sl node:
b1e02b74e9a5
c024d14cc58e
f6b4be54f238198f8445ae3b82d8471ce9bb2028f5ad2c18ac01b6f43920ba3b
9b4cd1e1b9142dff749c7f44571f676194e9d2b92a5cc82135c816d069282944
Matplotlib created a temporary config/cache directory at /tmp/matplotlib-0il7218r because the default path (/.config/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.
/tmp/test/model/mil/helpers.py:56: FutureWarning: this interface is deprecated and will be removed in the future. For training from the command line, please use `marugoto.mil.train`.
warn(
Traceback (most recent call last):
File "/opt/conda/lib/python3.9/pathlib.py", line 1323, in mkdir
self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/platform/scratch/2023_03_02_123111_40-30-10-20_swarm_learning'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/conda/lib/python3.9/pathlib.py", line 1323, in mkdir
self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/platform/scratch'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/test/model/main.py", line 33, in <module>
train_categorical_model_(
File "/tmp/test/model/mil/helpers.py", line 63, in train_categorical_model_
output_path.mkdir(exist_ok=True, parents=True)
File "/opt/conda/lib/python3.9/pathlib.py", line 1327, in mkdir
self.parent.mkdir(parents=True, exist_ok=True)
File "/opt/conda/lib/python3.9/pathlib.py", line 1327, in mkdir
self.parent.mkdir(parents=True, exist_ok=True)
File "/opt/conda/lib/python3.9/pathlib.py", line 1323, in mkdir
self._accessor.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/platform'
SN node is up:
run sl node with script:
user-env-marugoto-swop is the docker image created when previously running swci tasks, error message for sl node: