Skip to content
Snippets Groups Projects
Commit efe44d86 authored by Jupiter Hu's avatar Jupiter Hu
Browse files

fixed templates

parent 5fed48d3
No related branches found
No related tags found
No related merge requests found
- name: clean up system installation
shell: rpm -e munge-libs slurm-munge munge slurm-plugins munge-devel slurm slurm-slurmdbd slurm-perlapi slurm-devel slurm-pam_slurm slurm-sjstat slurm-perlapi slurm-pam_slurm slurm-slurmdb-direct slurm-torque slurm-sjobexit
ignore_errors: true
sudo: true
when: ansible_distribution == "RedHat"
- name: get munge - name: get munge
shell: wget https://munge.googlecode.com/files/munge-{{ munge_version }}.tar.bz2 shell: wget https://munge.googlecode.com/files/munge-{{ munge_version }}.tar.bz2
args: args:
......
...@@ -98,6 +98,11 @@ SlurmSchedLogFile={{ slurmschedlog.log }} ...@@ -98,6 +98,11 @@ SlurmSchedLogFile={{ slurmschedlog.log }}
JobCompType=jobcomp/none JobCompType=jobcomp/none
#JobCompLoc= #JobCompLoc=
# #
{% if slurmjob %}
Prolog={{ slurmjob.prolog }}
Epilog={{ slurmjob.epilog }}
{% endif %}
#
# ACCOUNTING # ACCOUNTING
#JobAcctGatherType=jobacct_gather/linux #JobAcctGatherType=jobacct_gather/linux
#JobAcctGatherFrequency=30 #JobAcctGatherFrequency=30
...@@ -110,7 +115,7 @@ AccountingStorageHost={{ slurmctrl }} ...@@ -110,7 +115,7 @@ AccountingStorageHost={{ slurmctrl }}
#AccountingStorageUser= #AccountingStorageUser=
# #
#GRES #GRES
GresTypes=gpu #GresTypes=gpu
# Fair share # Fair share
{% if slurmfairshare.def %} {% if slurmfairshare.def %}
...@@ -128,7 +133,7 @@ MpiParams=ports=12000-12999 ...@@ -128,7 +133,7 @@ MpiParams=ports=12000-12999
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
{% for node in nodelist|unique %} {% for node in nodelist|unique %}
NodeName={{ node }} Procs={{ hostvars[node]['ansible_processor_vcpus'] }} State=UNKNOWN NodeName={{ node }} Procs={{ hostvars[node]['ansible_processor_vcpus'] }}
{% endfor %} {% endfor %}
{% for queue in slurmqueues %} {% for queue in slurmqueues %}
......
#!/bin/sh #!/bin/sh
CVL_HOME="/cvl/home" HOME_DIR="/cvl/home"
user_list=($(getent passwd | cut -d ":" -f1)) user_list=($(getent passwd | cut -d ":" -f1))
log_file="/root/slurm.log" log_file="/root/slurm.log"
for user in ${user_list[*]}; do for user in ${user_list[*]}; do
uid=$(id -u ${user}) {% if project_check is defined %}
gid=$(id -g ${user}) run=$(id ${user} | grep {{ project_check }})
user_home=${CVL_HOME}/${user} {% else %}
if [[ ! -d ${user_home} && ${uid} -gt 1000 ]]; then run="1"
mkdir -p ${user_home} {% endif %}
cp -r /etc/skel/* ${user_home} if [ ! -z "${run}" ]; then
chown -R ${uid}:${gid} ${user_home} uid=$(id -u ${user})
chmod 700 ${user_home} gid=$(id -g ${user})
user_home=${HOME_DIR}/${user}
if [[ ! -d ${user_home} && ${uid} -gt 1000 ]]; then
cp -r /etc/skel ${user_home}
chown -R ${uid}:${gid} ${user_home}
chmod 700 ${user_home}
account={{ projectname }} account={{ projectname }}
cluster={{ clustername }} cluster={{ clustername }}
find=$(sacctmgr list cluster ${cluster} | grep ${cluster}) find=$(sacctmgr list cluster ${cluster} | grep ${cluster})
if [ -z "${find}" ]; then if [ -z "${find}" ]; then
su slurm -c "sacctmgr -i add cluster ${cluster}" || { echo "error to create cluster ${cluster}" >> ${log_file} && exit 1; } su slurm -c "sacctmgr -i add cluster ${cluster}" || { echo "error to create cluster ${cluster}" >> ${log_file} && exit 1; }
fi fi
find=$(sacctmgr list account ${account} | grep ${account}) find=$(sacctmgr list account ${account} | grep ${account})
if [ -z "${find}" ]; then if [ -z "${find}" ]; then
su slurm -c "sacctmgr -i add account ${account} Description=CVL Organization=monash cluster=${cluster}" || { echo "error to create account ${account}" >> ${log_file} && exit 1; } su slurm -c "sacctmgr -i add account ${account} Description=CVL Organization=monash cluster=${cluster}" || { echo "error to create account ${account}" >> ${log_file} && exit 1; }
fi fi
find=$(sacctmgr list user ${username} | grep ${username}) find=$(sacctmgr list user ${user} | grep ${user})
if [ -z "${find}" ]; then if [ -z "${find}" ]; then
su slurm -c "sacctmgr -i add user ${username} account=${account} cluster=${cluster}" || { echo "error to create user ${username}" >> ${log_file} && exit 1; } su slurm -c "sacctmgr -i add user ${user} account=${account} cluster=${cluster}" || { echo "error to create user ${user}" >> ${log_file} && exit 1; }
fi
fi fi
fi fi
done done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment