2022-06-01 11:27:50 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-06-20 18:53:44 +02:00
|
|
|
# Check cc-backend, touch job.db if exists
|
|
|
|
if [ ! -d cc-backend ]; then
|
|
|
|
echo "'cc-backend' not yet prepared! Please clone cc-backend repository before starting this script."
|
|
|
|
echo -n "Stopped."
|
|
|
|
exit
|
|
|
|
else
|
|
|
|
cd cc-backend
|
|
|
|
if [ ! -d var ]; then
|
|
|
|
mkdir var
|
|
|
|
touch var/job.db
|
|
|
|
else
|
|
|
|
echo "'cc-backend/var' exists. Cautiously exiting."
|
|
|
|
echo -n "Stopped."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Download unedited job-archibe to /data
|
|
|
|
if [ ! -d data/job-archive ]; then
|
|
|
|
cd data
|
|
|
|
wget https://hpc-mover.rrze.uni-erlangen.de/HPC-Data/0x7b58aefb/eig7ahyo6fo2bais0ephuf2aitohv1ai/job-archive.tar.xz
|
|
|
|
tar xJf job-archive.tar.xz
|
|
|
|
rm ./job-archive.tar.xz
|
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-01 11:27:50 +02:00
|
|
|
# Download data for influxdb2
|
2022-06-09 11:38:26 +02:00
|
|
|
if [ ! -d data/influxdb ]; then
|
|
|
|
mkdir -p data/influxdb/data
|
|
|
|
cd data/influxdb/data
|
|
|
|
wget https://hpc-mover.rrze.uni-erlangen.de/HPC-Data/0x7b58aefb/eig7ahyo6fo2bais0ephuf2aitohv1ai/influxdbv2-data.tar.xz
|
|
|
|
tar xJf influxdbv2-data.tar.xz
|
|
|
|
rm influxdbv2-data.tar.xz
|
|
|
|
cd ../../../
|
|
|
|
else
|
|
|
|
echo "'data/influxdb' already exists!"
|
|
|
|
echo -n "Remove existing folder and redownload? [yes to redownload / no to continue] "
|
|
|
|
read -r answer
|
|
|
|
if [ "$answer" == "yes" ]; then
|
|
|
|
echo "Removing 'data/influxdb' ..."
|
|
|
|
rm -rf data/influxdb
|
|
|
|
echo "Reinstall 'data/influxdb'..."
|
2022-06-01 11:27:50 +02:00
|
|
|
mkdir -p data/influxdb/data
|
|
|
|
cd data/influxdb/data
|
|
|
|
wget https://hpc-mover.rrze.uni-erlangen.de/HPC-Data/0x7b58aefb/eig7ahyo6fo2bais0ephuf2aitohv1ai/influxdbv2-data.tar.xz
|
|
|
|
tar xJf influxdbv2-data.tar.xz
|
|
|
|
rm influxdbv2-data.tar.xz
|
|
|
|
cd ../../../
|
2022-06-09 11:38:26 +02:00
|
|
|
echo "done."
|
2022-06-01 11:27:50 +02:00
|
|
|
else
|
2022-06-09 11:38:26 +02:00
|
|
|
echo "'data/influxdb' unchanged."
|
2022-06-01 11:27:50 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Download checkpoint files for cc-metric-store
|
2022-06-09 11:38:26 +02:00
|
|
|
if [ ! -d data/cc-metric-store ]; then
|
|
|
|
mkdir -p data/cc-metric-store/checkpoints
|
|
|
|
mkdir -p data/cc-metric-store/archive
|
|
|
|
cd data/cc-metric-store/checkpoints
|
|
|
|
wget https://hpc-mover.rrze.uni-erlangen.de/HPC-Data/0x7b58aefb/eig7ahyo6fo2bais0ephuf2aitohv1ai/cc-metric-store-checkpoints.tar.xz
|
|
|
|
tar xf cc-metric-store-checkpoints.tar.xz
|
|
|
|
rm cc-metric-store-checkpoints.tar.xz
|
|
|
|
cd ../../../
|
2022-06-01 11:27:50 +02:00
|
|
|
else
|
2022-06-09 11:38:26 +02:00
|
|
|
echo "'data/cc-metric-store' already exists!"
|
|
|
|
echo -n "Remove existing folder and redownload? [yes to redownload / no to continue] "
|
2022-06-01 11:27:50 +02:00
|
|
|
read -r answer
|
|
|
|
if [ "$answer" == "yes" ]; then
|
2022-06-09 11:38:26 +02:00
|
|
|
echo "Removing 'data/cc-metric-store' ..."
|
|
|
|
rm -rf data/cc-metric-store
|
|
|
|
echo "Reinstall 'data/cc-metric-store'..."
|
|
|
|
mkdir -p data/cc-metric-store/checkpoints
|
|
|
|
mkdir -p data/cc-metric-store/archive
|
|
|
|
cd data/cc-metric-store/checkpoints
|
|
|
|
wget https://hpc-mover.rrze.uni-erlangen.de/HPC-Data/0x7b58aefb/eig7ahyo6fo2bais0ephuf2aitohv1ai/cc-metric-store-checkpoints.tar.xz
|
|
|
|
tar xf cc-metric-store-checkpoints.tar.xz
|
|
|
|
rm cc-metric-store-checkpoints.tar.xz
|
|
|
|
cd ../../../
|
|
|
|
echo "done."
|
2022-06-01 11:27:50 +02:00
|
|
|
else
|
2022-06-09 11:38:26 +02:00
|
|
|
echo "'data/cc-metric-store' unchanged."
|
2022-06-01 11:27:50 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Check dotenv-file and docker-compose-yml, copy accordingly if not present and build docker services
|
|
|
|
# !! By default, this decides which metric database is used based on the selected argument !!
|
|
|
|
if [ ! -d .env ]; then
|
2022-06-09 11:38:26 +02:00
|
|
|
cp templates/env.default ./.env
|
2022-06-01 11:27:50 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d docker-compose.yml ]; then
|
2022-06-09 11:38:26 +02:00
|
|
|
cp templates/docker-compose.yml.default ./docker-compose.yml
|
2022-06-01 11:27:50 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
docker-compose build
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Setup complete. Use 'startDev.sh' to boot containers and start cc-backend."
|