Skip to content

Commit

Permalink
add container_runtime from modak
Browse files Browse the repository at this point in the history
  • Loading branch information
kmlTE committed Aug 31, 2020
1 parent a8854c6 commit c32615a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 25 deletions.
49 changes: 25 additions & 24 deletions use-cases/clinical-uc/egi-hlrs-modak/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,6 @@ topology_template:
properties:
endpoint: { get_input: modak-endpoint }

### image pulling
mpi-test-image-hlrs:
type: sodalite.image_puller.singularity
properties:
image: "ethcscs/mpich:ub1804_cuda101_mpi314_gnugprof"
registry: "docker"
images_location: /mnt/nfs/home/kamil/singularity_images
requirements:
- host: hlrs-torque

mpi-test-image-egi:
type: sodalite.image_puller.singularity
properties:
image: "pottava/openmpi:1.10"
registry: "docker"
images_location: /home/kamil/singularity_images
requirements:
- host: egi-torque


### modak job parameters for hlrs
mpi-test-modak-job-hlrs:
type: sodalite.nodes.modak.job
Expand Down Expand Up @@ -121,7 +101,7 @@ topology_template:

requirements:
- modak_endpoint: modak-instance
- dependency: mpi-test-image-hlrs


### modak job parameters for egi
mpi-test-modak-job-egi:
Expand Down Expand Up @@ -174,7 +154,28 @@ topology_template:

requirements:
- modak_endpoint: modak-instance
- dependency: mpi-test-image-egi


### image pulling
mpi-test-image-hlrs:
type: sodalite.image_puller.singularity
properties:
image: { get_attribute: [SELF, dependency, container_runtime] }
registry: "docker"
images_location: /mnt/nfs/home/kamil/singularity_images
requirements:
- host: hlrs-torque
- dependency: mpi-test-modak-job-hlrs

mpi-test-image-egi:
type: sodalite.image_puller.singularity
properties:
image: { get_attribute: [SELF, dependency, container_runtime] }
registry: "docker"
images_location: /home/kamil/singularity_images
requirements:
- host: egi-torque
- dependency: mpi-test-modak-job-egi

### job configs
mpi-test-job-config-hlrs:
Expand All @@ -188,7 +189,7 @@ topology_template:
SINGULARITY_DIR: /mnt/nfs/home/kamil/singularity_images
requirements:
- host: hlrs-torque
- dependency: mpi-test-modak-job-hlrs
- dependency: mpi-test-image-hlrs

mpi-test-job-config-egi:
type: sodalite.nodes.hpc.job.torque.preconfigured
Expand All @@ -201,7 +202,7 @@ topology_template:
SINGULARITY_DIR: /home/kamil/singularity_images
requirements:
- host: egi-torque
- dependency: mpi-test-modak-job-egi
- dependency: mpi-test-image-egi

### job workflow
mpi-test-job-hlrs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@
singularity pull \
--dir {{ images_location }} \
{{ output }} \
{{ registry }}://{{ image }}
{{ image_path }}
register: pull_status
ignore_errors: yes
vars:
image_path: "{{ image if image is search('(docker|library|shub)://') else registry + '://' + image }}"

# ignoring only "Image file already exists" error
- fail:
Expand Down
2 changes: 2 additions & 0 deletions use-cases/modules/hpc/modak/job/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ node_types:
attributes:
artifact_url:
type: string
container_runtime:
type: string
requirements:
- modak_endpoint:
node: sodalite.nodes.modak
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@
- set_fact:
artifact_url: "{{ response.json.job.job_script }}"

- set_fact:
container_runtime: "{{ response.json.job.application.container_runtime if response.json.job.application.container_runtime is defined else '' }}"

- name: Set artifact url
set_stats:
data:
artifact_url: "{{ artifact_url }}"
container_runtime: "{{ container_runtime }}"

- name: Save job
get_url:
Expand Down

0 comments on commit c32615a

Please sign in to comment.