|
49 | 49 | mpi_containers: "{{ (mpi_containers | default([]) + [dict({'os': item.1.os, 'mpi': item.1.mpi})]) | unique }}"
|
50 | 50 | loop: "{{ containers.basic.items() }}"
|
51 | 51 | - name: Try to get MPI containers from registry
|
52 |
| - vars: |
53 |
| - distro: "{{ item.os.distro | regex_replace('_', '/') }}" |
54 | 52 | shell: |
|
55 |
| - if [ ! -f {{ original_dir }}/containers/basic/{{ distro }}-{{ item.os.version }}-{{ item.mpi.implementation }}-{{ item.mpi.version }}.sif ]; then |
| 53 | + if [ ! -f {{ original_dir }}/containers/basic/{{ item.os.distro }}-{{ item.os.version }}-{{ item.mpi.implementation }}-{{ item.mpi.version }}.sif ]; then |
56 | 54 | apptainer pull \
|
57 |
| - {{ original_dir }}/containers/basic/{{ distro }}-{{ item.os.version }}-{{ item.mpi.implementation }}-{{ item.mpi.version }}.sif \ |
58 |
| - {{ pull.protocol }}://{{ pull.scope }}/{{ distro }}-{{ item.os.version }}-{{ item.mpi.implementation }}-{{ item.mpi.version }} |
| 55 | + {{ original_dir }}/containers/basic/{{ item.os.distro }}-{{ item.os.version }}-{{ item.mpi.implementation }}-{{ item.mpi.version }}.sif \ |
| 56 | + {{ pull.protocol }}://{{ pull.scope }}/{{ item.os.distro }}-{{ item.os.version }}-{{ item.mpi.implementation }}-{{ item.mpi.version }} |
59 | 57 | fi
|
60 | 58 | loop: "{{ mpi_containers }}"
|
61 | 59 | ignore_errors: yes
|
|
64 | 62 | vars:
|
65 | 63 | distro: "{{ item.os.distro | regex_replace('_', '/') }}"
|
66 | 64 | shell: |
|
67 |
| - if [ ! -f {{ original_dir }}/containers/basic/{{ distro }}-{{ item.os.version }}-{{ item.mpi.implementation }}-{{ item.mpi.version }}.sif ]; then |
| 65 | + if [ ! -f {{ original_dir }}/containers/basic/{{ item.os.distro }}-{{ item.os.version }}-{{ item.mpi.implementation }}-{{ item.mpi.version }}.sif ]; then |
68 | 66 | apptainer build \
|
69 | 67 | --warn-unused-build-args \
|
70 |
| - --build-arg OS_DISTRO={{ item.os.distro }} \ |
| 68 | + --build-arg OS_DISTRO={{ distro }} \ |
71 | 69 | --build-arg OS_VERSION={{ item.os.version }} \
|
72 | 70 | --build-arg MPI_IMPLEMENTATION={{ item.mpi.implementation }} \
|
73 | 71 | --build-arg MPI_VERSION={{ item.mpi.version }} \
|
74 |
| - {{ original_dir }}/containers/basic/{{ distro }}-{{ item.os.version }}-{{ item.mpi.implementation }}-{{ item.mpi.version }}.sif \ |
| 72 | + {{ original_dir }}/containers/basic/{{ item.os.distro }}-{{ item.os.version }}-{{ item.mpi.implementation }}-{{ item.mpi.version }}.sif \ |
75 | 73 | {{ playbook_dir }}/basic/{{ item.mpi.implementation }}.def
|
76 | 74 | else
|
77 |
| - echo "Container {{ original_dir }}/containers/basic/{{ distro }}-{{ item.os.version }}-{{ item.mpi.implementation }}-{{ item.mpi.version }}.sif already exists. Skipping build." |
| 75 | + echo "Container {{ original_dir }}/containers/basic/{{ item.os.distro }}-{{ item.os.version }}-{{ item.mpi.implementation }}-{{ item.mpi.version }}.sif already exists. Skipping build." |
78 | 76 | fi
|
79 | 77 | loop: "{{ mpi_containers }}"
|
80 | 78 | - name: Try to get base containers from registry
|
|
0 commit comments