singularity for cobald

This commit is contained in:
2021-06-30 16:31:06 +02:00
parent 3be5025442
commit d88761ca7d
6 changed files with 21 additions and 3 deletions

View File

@@ -109,6 +109,13 @@
include_tasks: facts.yml
when: cobald_container_hostname is not defined
- name: build singularity container
include_tasks:
file: singularity.yml
apply:
tags: singularity
tags: singularity
- name: run cobald container
docker_container:
name: "{{ container_name | default('cobald') }}"

View File

@@ -0,0 +1,8 @@
- name: "setup singularity"
import_role: name="singularity"
tags: singularity
#- name: copy slurm def file
# - name: export docker image
#- name: build container

View File

@@ -0,0 +1,18 @@
- yum:
name: singularity
state: present
- name: "enable user namespaces for singularity fakeroot function"
sysctl:
name: user.max_user_namespaces
value: "15000"
sysctl_file: /etc/sysctl.d/90-max_net_namespaces.conf
- name: "enable user {{unpriv_user}} for fakeroot access"
lineinfile:
line: "{{unpriv_user}}:4294836224:65536"
dest: "{{item}}"
with_items: ["/etc/subuid", "/etc/subgid"]
# the task above idempotentially does the same as:
#- shell:
# command: singularity config fakeroot --add thoto

View File

@@ -9,3 +9,6 @@ RUN chmod 755 /etc/docker-init.d/30-slurmd
ENV SLURMCTLD_LOG_PATH="/var/log/slurm/slurmctld.log"
ENV SLURMD_LOG_PATH="/var/log/slurm/slurmd.log"
ENV SLURM_SCHED_LOG_PATH="/var/log/slurm/slurmsched.log"
RUN yum install -y singularity && \
yum clean all && rm -rf /var/cache/yum