diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index 68ba88ac..94679101 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -21,3 +21,4 @@ jobs: # demote var-naming[no-role-prefix] to warnings, as we only have a single role, # and prefixing all variables in that role with the role name is really ugly args: "--warn-list var-naming[no-role-prefix]" + requirements_file: "ansible/galaxy-requirements.yml" diff --git a/ansible/galaxy-requirements.yml b/ansible/galaxy-requirements.yml new file mode 100644 index 00000000..06b90316 --- /dev/null +++ b/ansible/galaxy-requirements.yml @@ -0,0 +1,8 @@ +# +# Install roles and collections from the default Ansible Galaxy server. +# +--- +collections: + - name: community.general + version: '>=10.7.3' +... diff --git a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml index 9c7aab84..ddd867db 100644 --- a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml +++ b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml @@ -20,9 +20,9 @@ gentoo_git_repo: https://github.com/gentoo/gentoo.git gentoo_git_commit: 083e38cef302128d595e9f9cfd029ad8f67ec2b7 prefix_required_space: 15 GB prefix_user_defined_trusted_dirs: - - "/cvmfs/{{ cvmfs_repository }}/host_injections/{{ eessi_version }}/compat/{{ eessi_host_os }}/{{ eessi_host_arch }}/lib/override" - - "/cvmfs/{{ cvmfs_repository }}/host_injections/{{ eessi_version }}/compat/{{ eessi_host_os }}/{{ eessi_host_arch }}/lib/nvidia" - - "/cvmfs/{{ cvmfs_repository }}/host_injections/{{ eessi_version }}/compat/{{ eessi_host_os }}/{{ eessi_host_arch }}/lib/amd" + - "/cvmfs/{{ cvmfs_repository }}/versions/{{ eessi_version }}/compat/{{ eessi_host_os }}/{{ eessi_host_arch }}/lib/override" + - "/cvmfs/{{ cvmfs_repository }}/versions/{{ eessi_version }}/compat/{{ eessi_host_os }}/{{ eessi_host_arch }}/lib/nvidia" + - "/cvmfs/{{ cvmfs_repository }}/versions/{{ eessi_version }}/compat/{{ eessi_host_os }}/{{ eessi_host_arch }}/lib/amd" prefix_mask_packages: | # stick to GCC 13.x; using a too recent compiler in the compat layer may complicate stuff in the software layer, # see for example https://github.com/EESSI/software-layer/issues/151 diff --git a/ansible/playbooks/roles/compatibility_layer/handlers/main.yml b/ansible/playbooks/roles/compatibility_layer/handlers/main.yml index 15f88ef7..078eb915 100644 --- a/ansible/playbooks/roles/compatibility_layer/handlers/main.yml +++ b/ansible/playbooks/roles/compatibility_layer/handlers/main.yml @@ -4,3 +4,8 @@ - name: Generate locales ansible.builtin.command: locale-gen changed_when: true + +- name: Sync overlays + community.general.portage: + sync: 'yes' + verbose: true diff --git a/ansible/playbooks/roles/compatibility_layer/tasks/add_overlay.yml b/ansible/playbooks/roles/compatibility_layer/tasks/add_overlay.yml index f728896b..47a8c4d4 100644 --- a/ansible/playbooks/roles/compatibility_layer/tasks/add_overlay.yml +++ b/ansible/playbooks/roles/compatibility_layer/tasks/add_overlay.yml @@ -17,6 +17,7 @@ dest: "{{ gentoo_prefix_path }}/etc/portage/repos.conf/{{ item.name }}.conf" mode: "0644" loop: "{{ custom_overlays }}" + notify: Sync overlays - name: Make configuration file with overlays that can override eclasses ansible.builtin.copy: @@ -29,10 +30,8 @@ selectattr('eclass-overrides', 'equalto', True) | map(attribute='name') | join(' ') }} -- name: Sync the repositories - community.general.portage: - sync: 'yes' - verbose: true +- name: Flush handlers to make sure that overlays are synced + ansible.builtin.meta: flush_handlers - name: Find all files and directories in the etc/portage directory of the overlay ansible.builtin.find: diff --git a/test/compat_layer.py b/test/compat_layer.py index fb494fc3..746a5f1d 100644 --- a/test/compat_layer.py +++ b/test/compat_layer.py @@ -219,15 +219,20 @@ def __init__(self): self.descr = 'Verify that the env file for sys-libs/glibc was created and is picked up by emerge.' self.command = 'equery has --package glibc EXTRA_EMAKE' - trusted_dir = os.path.join( - self.eessi_repo_dir, - 'host_injections', - self.eessi_version, - 'compat', - self.eessi_os, - self.eessi_arch, - 'lib' - ) + # in 2023.06 we had a single trusted directory in host_injections, + # in 2025.06 we introduced three subdirectories (override, nvidia, amd) in the lib dir of the compat layer itself. + if self.eessi_version == '2023.06': + trusted_dirs = os.path.join( + self.eessi_repo_dir, + 'host_injections', + self.eessi_version, + 'compat', + self.eessi_os, + self.eessi_arch, + 'lib' + ) + else: + trusted_dirs = [os.path.join(self.compat_dir, 'lib', subdir) for subdir in ['override', 'nvidia', 'amd']] self.sanity_patterns = sn.assert_found( f'user-defined-trusted-dirs={trusted_dir}', @@ -242,26 +247,20 @@ def __init__(self): self.descr = 'Verify that glibc was compiled with the custom user-defined trusted dirs.' self.command = 'ld.so --help' - libdir = os.path.join( - self.eessi_repo_dir, - 'host_injections', - self.eessi_version, - 'compat', - self.eessi_os, - self.eessi_arch, - 'lib' - ) - - # in 2023.06 we had a single trusted directory, - # in 2025.06 we introduced three subdirectories (override, nvidia, amd). + # in 2023.06 we had a single trusted directory in host_injections, + # in 2025.06 we introduced three subdirectories (override, nvidia, amd) in the lib dir of the compat layer itself. if self.eessi_version == '2023.06': - trusted_dirs = [libdir] + trusted_dirs = os.path.join( + self.eessi_repo_dir, + 'host_injections', + self.eessi_version, + 'compat', + self.eessi_os, + self.eessi_arch, + 'lib' + ) else: - trusted_dirs = [ - os.path.join(libdir, 'override'), - os.path.join(libdir, 'nvidia'), - os.path.join(libdir, 'amd'), - ] + trusted_dirs = [os.path.join(self.compat_dir, 'lib', subdir) for subdir in ['override', 'nvidia', 'amd']] # ld.so --help prints the trusted directories as: # /path/to/dir (system search path)