2021-06-09 09:53:35 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2021-09-06 11:07:18 +02:00
|
|
|
if [ -d symfony ]; then
|
|
|
|
echo "Data already initialized!"
|
|
|
|
echo -n "Perform a fresh initialisation? Answer yes to proceed and no to exit. "
|
|
|
|
read -r answer
|
|
|
|
if [ "$answer" == "yes" ]; then
|
|
|
|
echo "Cleaning directories ..."
|
|
|
|
rm -rf symfony
|
|
|
|
sudo rm -rf job-archive
|
|
|
|
rm -rf influxdb/data/*
|
|
|
|
echo "done."
|
|
|
|
else
|
|
|
|
echo "Aborting ..."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-06-09 09:53:35 +02:00
|
|
|
mkdir symfony
|
2021-06-24 15:10:14 +02:00
|
|
|
wget https://hpc-mover.rrze.uni-erlangen.de/HPC-Data/0x7b58aefb/eig7ahyo6fo2bais0ephuf2aitohv1ai/job-archive.tar.xz
|
2021-06-25 08:50:20 +02:00
|
|
|
tar xJf job-archive.tar.xz
|
2021-06-24 15:10:14 +02:00
|
|
|
rm ./job-archive.tar.xz
|
2021-06-22 15:17:11 +02:00
|
|
|
|
2021-08-06 17:21:44 +02:00
|
|
|
# Default: Copy SQL source for demo use - Includes no INFLUX-Job Metadata
|
|
|
|
cp ./sql-source/ClusterCockpit-demo.sql ./sql-init/ClusterCockpit.sql
|
|
|
|
|
2021-06-22 15:17:11 +02:00
|
|
|
if [ $# -gt 0 ]; then
|
|
|
|
if [ $1 == "dev" ]; then
|
2021-07-16 09:01:46 +02:00
|
|
|
# 101 is the uid and gid of the user and group www in the cc-php container running php-fpm.
|
|
|
|
# For a demo with no new jobs it is enough to give www read permissions on that directory.
|
2021-08-17 18:26:53 +02:00
|
|
|
echo "This script needs to chown the job-archive directory so that the application can write to it:"
|
2021-07-16 09:01:46 +02:00
|
|
|
sudo chown -R 101:101 ./job-archive
|
|
|
|
|
2021-06-22 15:17:11 +02:00
|
|
|
mkdir -p influxdb/data
|
|
|
|
wget https://hpc-mover.rrze.uni-erlangen.de/HPC-Data/0x7b58aefb/eig7ahyo6fo2bais0ephuf2aitohv1ai/influxdbv2-data.tar.xz
|
|
|
|
cd influxdb/data
|
|
|
|
tar xJf ../../influxdbv2-data.tar.xz
|
|
|
|
rm ../../influxdbv2-data.tar.xz
|
2021-08-12 12:09:21 +02:00
|
|
|
cd ../..
|
2021-08-17 18:26:53 +02:00
|
|
|
|
2021-08-06 17:21:44 +02:00
|
|
|
# If development: Use SQL source including INFLUX-Job Metadata instead
|
|
|
|
cp ./sql-source/ClusterCockpit-dev.sql ./sql-init/ClusterCockpit.sql
|
2021-06-22 15:17:11 +02:00
|
|
|
fi
|
|
|
|
fi
|