Skip to content
Snippets Groups Projects
Commit ca0a98b3 authored by Stefano Alberto Russo's avatar Stefano Alberto Russo
Browse files

First codebase push. Edited README accordingly.

parent 8ff7a024
No related branches found
No related tags found
No related merge requests found
FROM rosetta/slurmbase
MAINTAINER Stefano Alberto Russo <stefano.russo@gmail.com>
# Add Slurm supervisord conf
COPY supervisord_slurm* /etc/supervisor/conf.d/
[program:slurmd]
; Process definition
process_name = slurmd
command = /usr/sbin/slurmd -D -f /etc/slurm-llnl/slurm.conf
autostart = true
autorestart = true
startsecs = 5
stopwaitsecs = 10
priority = 200
; Log files
stdout_logfile = /var/log/supervisor/%(program_name)s_out.log
stdout_logfile_maxbytes = 100MB
stdout_logfile_backups = 5
stderr_logfile = /var/log/supervisor/%(program_name)s_err.log
stderr_logfile_maxbytes = 100MB
stderr_logfile_backups = 5
FROM rosetta/slurmcluster
MAINTAINER Stefano Alberto Russo <stefano.russo@gmail.com>
# Configure supervisord to run SLURM
COPY supervisord_slurm* /etc/supervisor/conf.d/
# Add sample job script
COPY test.sh /rosetta
# Add prestartup
COPY prestartup_slurmclustermaster.sh /prestartup/
#!/bin/bash
set -e
mkdir -p /shared/rosetta && chown rosetta:rosetta /shared/rosetta
[program:slurmctld]
; Process definition
process_name = slurmctld
command = /usr/sbin/slurmctld -D -f /etc/slurm-llnl/slurm.conf
autostart = true
autorestart = true
startsecs = 5
stopwaitsecs = 10
priority = 300
; Log files
stdout_logfile = /var/log/supervisor/%(program_name)s_out.log
stdout_logfile_maxbytes = 100MB
stdout_logfile_backups = 5
stderr_logfile = /var/log/supervisor/%(program_name)s_err.log
stderr_logfile_maxbytes = 100MB
stderr_logfile_backups = 5
#!/bin/bash
#SBATCH --job-name=test
#SBATCH --output=res.txt
#SBATCH --ntasks=1
srun hostname
srun sleep 60
\ No newline at end of file
FROM rosetta/slurmcluster
MAINTAINER Stefano Alberto Russo <stefano.russo@gmail.com>
#!/bin/bash
set -e
# Check if we are in the right place
if [ ! -d ./images ]; then
echo "You must run this command from the project's root folder."
exit 1
fi
# Set service and cacheing
if [[ "x$1" == "xnocache" ]] ; then
NOCACHE=True
SERVICE=""
elif [[ "x$2" == "xnocache" ]] ; then
NOCACHE=True
SERVICE=$1
else
NOCACHE=False
SERVICE=$1
fi
if [[ "x$NOCACHE" == "xTrue" ]] ; then
BUILD_COMMAND="docker build --no-cache"
else
BUILD_COMMAND="docker build"
fi
if [[ "x$SERVICE" == "x" ]] ; then
# Build all images
$BUILD_COMMAND images/base -t rosetta/base
$BUILD_COMMAND images/slurmbase -t rosetta/slurmbase
$BUILD_COMMAND images/slurmcluster -t rosetta/slurmcluster
$BUILD_COMMAND images/slurmclustermaster -t rosetta/slurmclustermaster
$BUILD_COMMAND images/slurmclusterworker -t rosetta/slurmclusterworker
$BUILD_COMMAND images/dregistry -t rosetta/dregistry
else
# Build a specific image
$BUILD_COMMAND images/$SERVICE -t rosetta/$SERVICE
fi
#!/bin/bash
# Check if we are in the right place
if [ ! -d ./images ]; then
echo "You must run this command from the project's root folder."
exit 1
fi
if [[ $# -eq 0 ]] ; then
docker-compose down
else
docker-compose down $@
fi
#!/bin/bash
# Check if we are in the right place
if [ ! -d ./images ]; then
echo "You must run this command from the project's root folder."
exit 1
fi
if [[ $# -eq 0 ]] ; then
docker-compose ps
else
echo "This command does not support any argument."
exit 1
fi
#!/bin/bash
# Check if we are in the right place
if [ ! -d ./images ]; then
echo "You must run this command from the project's root folder."
exit 1
fi
if [[ $# -eq 0 ]] ; then
docker-compose down
docker-compose up -d
else
docker-compose up -d --no-deps $@
fi
#!/bin/bash
# Check if we are in the right place
if [ ! -d ./images ]; then
echo "You must run this command from the project's root folder."
exit 1
fi
if [[ $# -eq 0 ]] ; then
docker-compose up -d
else
docker-compose up $@ -d
fi
#!/bin/bash
# Check if we are in the right place
if [ ! -d ./images ]; then
echo "You must run this command from the project's root folder."
exit 1
fi
if [[ $# -eq 0 ]] ; then
echo "Please tell me on which service to open the shell in."
exit 1
elif [[ $# -gt 2 ]] ; then
echo "Use double quotes to wrap commands with spaces"
exit 1
else
COMMAND=$2
if [[ "x$COMMAND" == "x" ]] ; then
echo ""
echo "Executing: /bin/bash"
echo ""
docker-compose exec $1 sudo -i -u rosetta /bin/bash
else
echo ""
echo "Executing: \"$COMMAND\""
echo ""
docker-compose exec $1 sudo -i -u rosetta /bin/bash -c "$COMMAND"
fi
fi
#!/bin/bash
# Check if we are in the right place
if [ ! -d ./images ]; then
echo "You must run this command from the project's root folder."
exit 1
fi
if [[ $# -eq 0 ]] ; then
declare -a container_names
OUT=$(rosetta/ps)
while read -r line; do
if [[ $line == *"Up"* ]]; then
container_name=$(echo $line | cut -d ' ' -f1)
container_names+=($container_name);
fi
done <<< "$OUT"
for container_name in ${container_names[@]}
do
echo ""
echo "$container_name"
docker-compose exec $container_name /bin/bash -c "supervisorctl status"
done
echo ""
else
docker-compose exec $@ /bin/bash -c "supervisorctl status"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment