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
|
2023-06-23 06:37:41 +02:00
|
|
|
wget https://hpc-mover.rrze.uni-erlangen.de/HPC-Data/0x7b58aefb/eig7ahyo6fo2bais0ephuf2aitohv1ai/job-archive-demo.tar
|
|
|
|
tar xf job-archive-demo.tar
|
2022-06-23 18:05:08 +02:00
|
|
|
mv ./job-archive ./job-archive-source
|
2023-06-23 06:37:41 +02:00
|
|
|
rm ./job-archive-demo.tar
|
2022-06-20 18:53:44 +02:00
|
|
|
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
|
|
|
|
|
2023-06-23 06:37:41 +02:00
|
|
|
# Create archive folder for rewritten ccms checkpoints
|
2022-06-23 18:05:08 +02:00
|
|
|
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
|
|
|
|
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-09-20 13:14:21 +02:00
|
|
|
./cc-backend/cc-backend --init-db --add-user demo:admin:AdminDev
|
2022-06-23 18:05:08 +02:00
|
|
|
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
|