singularity for cobald
This commit is contained in:
@@ -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') }}"
|
||||
|
8
roles/cobald/tasks/singularity.yml
Normal file
8
roles/cobald/tasks/singularity.yml
Normal 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
|
||||
|
18
roles/singularity/tasks/main.yml
Normal file
18
roles/singularity/tasks/main.yml
Normal 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
|
@@ -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
|
||||
|
Reference in New Issue
Block a user