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
|
|
|
|
|
|
|
|
|
2022-06-23 18:05:08 +02:00
|
|
|
# Download unedited job-archive to ./data/job-archive-source
|
|
|
|
if [ ! -d data/job-archive-source ]; then
|
2022-06-20 18:53:44 +02:00
|
|
|
cd data
|
|
|
|
wget https://hpc-mover.rrze.uni-erlangen.de/HPC-Data/0x7b58aefb/eig7ahyo6fo2bais0ephuf2aitohv1ai/job-archive.tar.xz
|
|
|
|
tar xJf job-archive.tar.xz
|
2022-06-23 18:05:08 +02:00
|
|
|
mv ./job-archive ./job-archive-source
|
2022-06-20 18:53:44 +02:00
|
|
|
rm ./job-archive.tar.xz
|
|
|
|
cd ..
|
2022-06-09 11:38:26 +02:00
|
|
|
else
|
2022-06-23 18:05:08 +02:00
|
|
|
echo "'data/job-archive-source' already exists!"
|
2022-06-01 11:27:50 +02:00
|
|
|
fi
|
|
|
|
|
2022-06-23 18:05:08 +02:00
|
|
|
# Download unedited checkpoint files to ./data/cc-metric-store-source/checkpoints
|
|
|
|
if [ ! -d data/cc-metric-store-source ]; then
|
|
|
|
mkdir -p data/cc-metric-store-source/checkpoints
|
|
|
|
cd data/cc-metric-store-source/checkpoints
|
2022-06-09 11:38:26 +02:00
|
|
|
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-23 18:05:08 +02:00
|
|
|
echo "'data/cc-metric-store-source' already exists!"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Update timestamps
|
|
|
|
perl ./migrateTimestamps.pl
|
|
|
|
|
|
|
|
# Create archive folder for rewrtitten ccms checkpoints
|
|
|
|
if [ ! -d data/cc-metric-store/archive ]; then
|
|
|
|
mkdir -p data/cc-metric-store/archive
|
|
|
|
fi
|
|
|
|
|
|
|
|
# cleanup sources
|
|
|
|
# rm -r ./data/job-archive-source
|
|
|
|
# rm -r ./data/cc-metric-store-source
|
|
|
|
|
|
|
|
# prepare folders for influxdb2
|
|
|
|
if [ ! -d data/influxdb ]; then
|
|
|
|
mkdir -p data/influxdb/data
|
|
|
|
mkdir -p data/influxdb/config/influx-configs
|
|
|
|
else
|
|
|
|
echo "'data/influxdb' already exists!"
|
2022-06-01 11:27:50 +02:00
|
|
|
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
|
2022-06-23 18:05:08 +02:00
|
|
|
./cc-backend/cc-backend --init-db --add-user demo:admin:AdminDev --no-server
|
|
|
|
docker-compose up -d
|
2022-06-01 11:27:50 +02:00
|
|
|
|
|
|
|
echo ""
|
2022-06-23 18:05:08 +02:00
|
|
|
echo "Setup complete, containers are up by default: Shut down with 'docker-compose down'."
|
|
|
|
echo "Use './cc-backend/cc-backend' to start cc-backend."
|
|
|
|
echo "Use scripts in /scripts to load data into influx or mariadb."
|
|
|
|
# ./cc-backend/cc-backend
|