Commits (6)
......@@ -45,10 +45,9 @@ RUN apt-get update \
&& pip install pandas
# manuel: configure git to ignore certificates (SUUUPER SHADY)
# install the simulator tools
# install the simulator tools under /opt
RUN git config --global http.sslverify false \
&& mkdir -p /home/slurm/ \
&& cd /home/slurm/ \
&& cd /opt \
&& git clone https://earth.bsc.es/gitlab/mgimenez/ces_slurm_simulator_tools
# Set Vim and Git defaults
......@@ -74,19 +73,14 @@ ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
# manuel: configure slurm user that will be in charge of the simulation
RUN set -x \
&& groupadd -r slurm \
&& useradd -r -g slurm slurm
# manuel: install the simulator
RUN set -x \
&& cd /home/slurm/ces_slurm_simulator_tools \
&& cd /opt/ces_slurm_simulator_tools/ \
&& ./install_slurm_sim.sh
# manuel: compile the algorithm that translates SWF to binary datac
RUN set -x \
&& cd /home/slurm/ces_slurm_simulator_tools/ces_slurm_simulator/contribs/simulator \
&& cd /opt/ces_slurm_simulator_tools/ces_slurm_simulator/contribs/simulator \
&& gcc -c swf2trace.c \
&& gcc -o swf2trace swf2trace.o -lm
......@@ -97,14 +91,7 @@ RUN mkdir -p /etc/sysconfig/slurm \
/var/log/slurm \
/var/run/slurmd \
/var/run/slurm \
/var/run/supervisor \
&& chown -R slurm:slurm /var/spool/slurmd \
/var/spool/slurmctld \
/var/log/slurm \
/var/run/slurmd \
/var/run/slurm
# RUN export USERNAME=root
/var/run/supervisor
# manuel: file that controls launching deamons
COPY files/supervisord.conf /etc/
......
......@@ -42,6 +42,11 @@ function start_service {
check_running_status $1
}
function stop_service {
echo "- Stopping $1"
/usr/bin/supervisorctl stop $1
}
if [ ! -d "/var/lib/mysql/slurm_acct_db" ]; then
/usr/bin/mysqld_safe --datadir='/var/lib/mysql' &
......@@ -60,12 +65,12 @@ if [ ! -d "/var/lib/mysql/slurm_acct_db" ]; then
echo "- Creating Slurm acct database"
mysql -NBe "CREATE DATABASE slurm_acct_db"
mysql -NBe "CREATE USER 'slurm'@'localhost'"
mysql -NBe "SET PASSWORD for 'slurm'@'localhost' = password('slurm')"
mysql -NBe "GRANT USAGE ON *.* to 'slurm'@'localhost'"
mysql -NBe "GRANT ALL PRIVILEGES on slurm_acct_db.* to 'slurm'@'localhost'"
mysql -NBe "CREATE USER 'root'@'localhost'"
mysql -NBe "GRANT USAGE ON *.* to 'root'@'localhost'"
mysql -NBe "GRANT ALL PRIVILEGES on slurm_acct_db.* to 'root'@'localhost'"
mysql -NBe "FLUSH PRIVILEGES"
echo "- Slurm acct database created. Stopping MariaDB"
killall mysqld
for count in {30..0}; do
if echo "SELECT 1" | mysql &> /dev/null; then
......@@ -83,13 +88,17 @@ fi
echo "- Starting supervisord process manager"
/usr/bin/supervisord --configuration /etc/supervisord.conf
for service in mysqld
do
start_service $service
done
start_service mysqld
chown slurm:slurm /var/spool/slurmd /var/run/slurmd /var/lib/slurmd /var/log/slurm
# configure database
pushd /opt/ces_slurm_simulator_tools/install/slurm_programs/bin
start_service slurmdbd
./sacctmgr -i modify QOS set normal priority=0
./sacctmgr -i add cluster name=slurm_sim fairshare=1 qos=normal
stop_service slurmdbd
popd
# finally set environmental flag to use the
export USERNAME=root
exec "$@"
......
......@@ -32,3 +32,16 @@ autostart=false
autorestart=false
priority=2
[program:slurmdbd]
command=/opt/ces_slurm_simulator_tools/install/slurm_programs/sbin/slurmdbd -Dvv
stdout_logfile=/var/log/supervisor/slurmdbd.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=5
stderr_logfile=/var/log/supervisor/slurmdbd.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=5
exitcodes=0,1,2
autostart=false
autorestart=false
priority=2