Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump version to 2021.12, use new snapshot and new bootstrap script + mask glibc >= 2.34 #126

Merged
merged 27 commits into from
Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d769f1a
merge latest upstream changes
bedroge Nov 18, 2021
8a28d39
add execute permissions
bedroge Nov 18, 2021
885c3f5
bump version to 2021.12
bedroge Nov 18, 2021
ece2021
use newer snapshot
bedroge Nov 18, 2021
abfbaa9
remove the -a from emerge system
bedroge Nov 19, 2021
c769782
add task step for copying custom bootstrap script
bedroge Nov 20, 2021
b1a449e
add options for using a custom bootstrap script
bedroge Nov 20, 2021
67df4be
update README
bedroge Nov 20, 2021
f1026d6
remove debug step
bedroge Nov 20, 2021
24641e1
remove unnecessary variable
bedroge Nov 20, 2021
821c24b
remove unnecessary variable
bedroge Nov 20, 2021
7a6186c
Merge branch 'main' into 2021.12
boegel Nov 20, 2021
16511c0
add note about which bootstrap script can/will be used by the playbook
bedroge Nov 20, 2021
9a3dc56
Merge branch '2021.12' of github.com:bedroge/compatibility-layer into…
bedroge Nov 20, 2021
1ee7f64
update portage snapshot to 20211120 to pick up fix for sys-libs/libca…
boegel Nov 21, 2021
7c87d65
disable 'stable mode' in Gentoo Prefix bootstrap script, since it's o…
boegel Nov 21, 2021
8b2c3e7
Merge pull request #1 from boegel/2021.12
bedroge Nov 22, 2021
b94e493
use equery to find out if user_defined_trusted_dirs was used
bedroge Nov 23, 2021
88fa917
Merge branch 'glibc_user_dirs_improvements' into 2021.12
bedroge Nov 23, 2021
46ee4c9
Add steps for creating a package.mask right before the bootstrap, cha…
bedroge Nov 25, 2021
2cbd615
Add variable for setting a package.mask for the bootstrap
bedroge Nov 25, 2021
42caa87
remove tab on empty line
bedroge Nov 25, 2021
e7597d4
add prefix_mask_packages to README
bedroge Nov 25, 2021
a38c421
also add dev-libs/libgcrypt to package.mask to work around compilatio…
boegel Nov 25, 2021
b8f7baa
Merge pull request #2 from boegel/2021.12
bedroge Nov 25, 2021
20206a5
only mask specific versions of glibc and libgcrypt
bedroge Nov 25, 2021
fbe11ee
mask glibc >= 2.34
bedroge Nov 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ansible/playbooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ Before running the playbook, make sure the following settings are correct, and o
| prefix_required_space | Minimal amount of disk space that is required for the Gentoo Prefix bootstrap |
| prefix_snapshot_url | Directory (served over http(s)) containing snapshot files |
| prefix_snapshot_version | Date (`YYYYMMDD`) of the Portage snapshot file for the Prefix installation |
| prefix_python_targets | String consisting of [Gentoo Python targets](https://wiki.gentoo.org/wiki/Project:Python/PYTHON_TARGETS) Python targets used for the Prefix installation |
| prefix_user_defined_trusted_dirs | List of paths to the user defined trusted dirs for glibc |
| prefix_mask_packages | Contents of a [package.mask file](https://wiki.gentoo.org/wiki//etc/portage/package.mask) that should be used during the bootstrap |
| prefix_use_builtin_bootstrap | Use the container's built-in bootstrap script? |
| prefix_custom_bootstrap_script | Dictionary with the `local` source and `remote` destination of the bootstrap script |
| prefix_singularity_command | Singularity command for launching the container with the bootstrap script |
| prefix_source | Singularity container path used for the Prefix installtion |
| prefix_source_options | Arguments to be passed to the Prefix bootstrap script |
Expand Down Expand Up @@ -75,3 +77,7 @@ ip-or-hostname-of-your-stratum0 eessi_host_arch=x86_64 eessi_host_os=linux

The `eessi_host_arch` corresponds to the architecture of the machine that executes the playbook and for which this compatibility layer has to be built, e.g. `x86_64`, `aarch64`, or `ppc64le`.
Similarly, `eessi_host_os` should refer to the operating system of the machine, and should be set to either `linux` or `macos`.

Note that, by default, the bootstrap script from the root directory of this git repository will be used, unless you set `prefix_use_builtin_bootstrap` to `yes`
(in which case the bootstrap script included in the Prefix build container will be used).
A different bootstrap script can be used by changing `prefix_custom_bootstrap_script.local` to a local path.
21 changes: 17 additions & 4 deletions ansible/playbooks/roles/compatibility_layer/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Defaults file for the compatibility layer role.
---
eessi_version: "2021.06"
eessi_version: "2021.12"

custom_overlays:
- name: eessi
Expand All @@ -18,17 +18,30 @@ gentoo_prefix_path: /cvmfs/{{ cvmfs_repository }}/{{ eessi_version }}/compat/{{
# How to build the prefix
prefix_required_space: 15 GB
prefix_snapshot_url: https://eessi-gentoo-snapshot.s3-eu-west-1.amazonaws.com
prefix_snapshot_version: 20210607
prefix_snapshot_version: 20211120
prefix_user_defined_trusted_dirs:
- "/cvmfs/{{ cvmfs_repository }}/host_injections/{{ eessi_version }}/compat/{{ eessi_host_os }}/{{ eessi_host_arch }}/lib"
prefix_singularity_command: "singularity run -B {{ gentoo_prefix_path }}:{{ gentoo_prefix_path }}"
prefix_mask_packages: |
# avoid glibc 2.34, as it's causing issues with the bootstrap, and it's not compatible with CUDA 11.
# see https://github.com/EESSI/compatibility-layer/issues/137 + https://bugs.gentoo.org/824482
>=sys-libs/glibc-2.34
bedroge marked this conversation as resolved.
Show resolved Hide resolved
# avoid libgcrypt 1.9.4 due to compiler errros on ppc64le,
# see https://github.com/EESSI/compatibility-layer/issues/134 + https://bugs.gentoo.org/825722
=dev-libs/libgcrypt-1.9.4
prefix_use_builtin_bootstrap: no
prefix_custom_bootstrap_script:
local: "{{ playbook_dir }}/../../bootstrap-prefix.sh"
remote: /tmp/bootstrap-prefix.sh
prefix_singularity_command: "singularity exec -B {{ gentoo_prefix_path }}:{{ gentoo_prefix_path }}"
prefix_source: "docker://ghcr.io/eessi/bootstrap-prefix:centos8"
prefix_source_options: "{{ gentoo_prefix_path }} noninteractive"
prefix_install: >-
SINGULARITYENV_USE_CPU_CORES={{ ansible_processor_vcpus }}
SINGULARITYENV_CUSTOM_SNAPSHOT_URL="{{ prefix_snapshot_url }}"
SINGULARITYENV_CUSTOM_SNAPSHOT_VERSION="{{ prefix_snapshot_version }}"
{{ prefix_singularity_command }} {{ prefix_source }} {{ prefix_source_options }}
{{ prefix_singularity_command }} {{ prefix_source }}
{{ prefix_use_builtin_bootstrap | ternary('/usr/local/bin/bootstrap-prefix.sh', prefix_custom_bootstrap_script.remote) }}
{{ prefix_source_options }}

# Logging
eessi_log_dir: "/tmp/eessi-logs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,33 @@
tags:
- build_prefix

- name: "Copy custom bootstrap script"
copy:
src: "{{ prefix_custom_bootstrap_script.local }}"
dest: "{{ prefix_custom_bootstrap_script.remote }}"
mode: 0755
when: not prefix_use_builtin_bootstrap
tags:
- build_prefix

- name: "Create $EPREFIX/etc/portage directory"
file:
path: "{{ gentoo_prefix_path }}/etc/portage"
state: directory
mode: 0755
when: prefix_mask_packages is defined and prefix_mask_packages | length > 0
tags:
- build_prefix

- name: "Mask packages for the bootstrap"
copy:
dest: "{{ gentoo_prefix_path }}/etc/portage/package.mask"
content: "{{ prefix_mask_packages }}"
mode: 0644
when: prefix_mask_packages is defined and prefix_mask_packages | length > 0
tags:
- build_prefix

- name: "Give {{ username_on_host.stdout }} recursive user and group ownership of {{ gentoo_prefix_path }}"
file:
dest: "{{ gentoo_prefix_path }}"
Expand All @@ -81,8 +108,12 @@
stat:
path: "{{ gentoo_prefix_path }}/startprefix"
register: startprefix
tags:
- build_prefix

- name: "Fail if startprefix script has not been created"
fail:
msg: "The resulting Gentoo Prefix installation does not have a startprefix script. Something went wrong!"
when: not startprefix.stat.exists
tags:
- build_prefix
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# Make sure that glibc is always compiled with a user-defined-trusted-dirs option
---
- name: Find all strings in libc library
command: "strings {{ gentoo_prefix_path }}/usr/lib64/libc.a"
register: libc_strings
- name: Check the EXTRA_EMAKE flags of glibc
command: "equery has --package glibc EXTRA_EMAKE"
changed_when: false
ignore_errors: yes
register: glibc_extra_emake
when: eessi_host_os == "linux"

- name: Find user defined trusted dirs in libc strings output
set_fact: match='{{ libc_strings.stdout | regex_search("\n" + item + "/?\n") | default('', True) | string | length>0 }}'
with_items: "{{ prefix_user_defined_trusted_dirs }}"
register: trusted_dirs_in_libc

- name: (Re)install glibc with the user-defined-trusted-dirs option
portage:
package: sys-libs/glibc
Expand All @@ -20,7 +17,7 @@
EXTRA_EMAKE: "user-defined-trusted-dirs={{ prefix_user_defined_trusted_dirs | join(':') }}"
when:
- eessi_host_os == "linux"
- trusted_dirs_in_libc.results | selectattr('ansible_facts.match', 'equalto', False) | list | length>0
- glibc_extra_emake.stdout != "user-defined-trusted-dirs=" + ":".join(prefix_user_defined_trusted_dirs)

- name: Create portage env directory
file:
Expand Down
Loading