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

Test check result #1

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b8c1b8e
added helper scripts and improved bot/build.sh
truib Apr 3, 2023
d742027
updates to install_compatibility_layer.sh
truib Apr 3, 2023
882e6b5
add default version + create own /tmp + fix id for tgz
truib Apr 3, 2023
0dfcf90
use version and repository from job.cfg or default + some cleanup
truib Apr 3, 2023
73af988
bump version to 2023.04
truib Apr 3, 2023
cfc0604
replace community.general.portage with calling emerge in shell
truib Apr 3, 2023
486257e
add tasks to install and deselect build dependencies + use emerge to …
truib Apr 3, 2023
c4034a7
use emerge to install package set (don't rebuild though and only inst…
truib Apr 3, 2023
6037645
provide missing profile for arm64 + make sure bash is used for bootst…
truib Apr 3, 2023
1db0017
replacing community.general.portage with emerge (noreplace false is d…
truib Apr 3, 2023
f816a83
ensure ReFrame tests are working
truib Apr 3, 2023
0a5f11c
attempt to fix Ansible lint issues
truib Apr 3, 2023
a756141
attempt to fix Ansible lint issues, part 2
truib Apr 3, 2023
3173d4c
attempt to fix Ansible lint issues, part 3
truib Apr 3, 2023
ae8ea3d
attempt to fix Ansible lint issues, part 4
truib Apr 3, 2023
2648ddf
attempt to fix Ansible lint issues, part 5
truib Apr 3, 2023
f92e956
fix typo
truib Apr 3, 2023
6b2cf67
add arg to retain eessi_tmpdir + improved messages
truib Apr 3, 2023
61997e1
add missing APPTAINER_BIND
truib Apr 3, 2023
016509a
a few fixes + removing commented out code
truib Apr 4, 2023
7bfa90d
reverted removal of community.general.portage
truib Apr 4, 2023
8f5f5fa
test commit from March 13
truib Apr 9, 2023
1cc55a0
initial version of script to check result of building compat layer
truib Apr 9, 2023
937eb6d
generate output for successful job
truib Apr 9, 2023
49d2a4a
make check fail
truib Apr 9, 2023
33b6548
simulate different scenarios
truib Apr 9, 2023
98a842e
sync gentoo commit section
truib Apr 10, 2023
92f4e46
remove obsolete commented out code
truib Apr 10, 2023
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
18 changes: 15 additions & 3 deletions ansible/playbooks/roles/compatibility_layer/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Defaults file for the compatibility layer role.
---
eessi_version: "2023.03"
eessi_version: "2023.04"

custom_overlays:
- name: eessi
source: git
url: https://github.com/EESSI/gentoo-overlay.git
url: https://github.com/trz42/gentoo-overlay.git
eclass-overrides: true

cvmfs_repository: pilot.eessi-hpc.org
Expand All @@ -16,7 +16,19 @@ gentoo_prefix_path: /cvmfs/{{ cvmfs_repository }}/versions/{{ eessi_version }}/c
gentoo_git_repo: https://github.com/gentoo/gentoo.git
# Select a specific commit in the gentoo_git_repo that should be used for the bootstrap,
# e.g. by checking: https://github.com/gentoo/gentoo/commits/master
gentoo_git_commit: 4ca74e7abe4f2b14e686267b517c59d43bb580b4
# March 7 (4ca74e7abe4f2b14e686267b517c59d43bb580b4)
# gentoo_git_commit: 4ca74e7abe4f2b14e686267b517c59d43bb580b4
# April 4 (b9ebfbaef10f4740671c8bd90c6d2c929f8379bc) --> failed with circular dependencies (cmake, curl, nghttp2), cmake was update early on April 5
# gentoo_git_commit: b9ebfbaef10f4740671c8bd90c6d2c929f8379bc
# April 5 (8c0ce1bcd089d5badcb39afce98111bf4cfbc8f0)
# gentoo_git_commit: 8c0ce1bcd089d5badcb39afce98111bf4cfbc8f0
# March 13 (3a38f9b245e674722d5d58dfbb6baafca2b26975) commit which introduced
# version 1.52.0 of nghttp2 (this commit switched to using cmake and likely
# caused a circular dependency)
# gentoo_git_commit: 3a38f9b245e674722d5d58dfbb6baafca2b26975
# March 13 (7db97f5a3fc7ca8eced2a94e5f9481f7556cf908) one commit before
# 3a38f9b245e674722d5d58dfbb6baafca2b26975
gentoo_git_commit: 7db97f5a3fc7ca8eced2a94e5f9481f7556cf908
prefix_required_space: 15 GB
prefix_default_gcc: 9.5.0
prefix_user_defined_trusted_dirs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
community.general.portage:
package: eselect-repository
state: present
vars:
ansible_python_interpreter: "{{ gentoo_prefix_path }}/usr/bin/python3"

# We need git in order to add Gentoo overlays hosted on git repositories.
- name: Install git
community.general.portage:
package: dev-vcs/git
state: present
vars:
ansible_python_interpreter: "{{ gentoo_prefix_path }}/usr/bin/python3"

- name: Check which repositories have been installed
ansible.builtin.command: eselect repository list -i
Expand All @@ -41,6 +45,9 @@
- name: Sync the repositories
community.general.portage:
sync: 'yes'
verbose: true
vars:
ansible_python_interpreter: "{{ gentoo_prefix_path }}/usr/bin/python3"

- name: Find all files and directories in the etc/portage directory of the overlay
ansible.builtin.find:
Expand Down
2 changes: 2 additions & 0 deletions ansible/playbooks/roles/compatibility_layer/tasks/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
package: "{{ item }}"
state: absent
with_items: "{{ prefix_remove_packages }}"
vars:
ansible_python_interpreter: "{{ gentoo_prefix_path }}/usr/bin/python3"
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
package: "@{{ item }}"
state: present
with_items: "{{ package_sets }}"
vars:
ansible_python_interpreter: "{{ gentoo_prefix_path }}/usr/bin/python3"
tags:
- set

Expand All @@ -13,3 +15,5 @@
package: "{{ item }}"
state: present
with_items: "{{ prefix_packages }}"
vars:
ansible_python_interpreter: "{{ gentoo_prefix_path }}/usr/bin/python3"
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,51 @@
tags:
- build_prefix

- name: "Fix missing profile for arm64 - create directory"
ansible.builtin.file:
path: "{{ gentoo_prefix_path }}/var/db/repos/gentoo/profiles/prefix/linux/arm64"
mode: '0755'
state: directory
when: eessi_host_arch == "aarch64"
tags:
- build_prefix

- name: "Fix missing profile for arm64 - eapi"
ansible.builtin.copy:
content: "5"
dest: "{{ gentoo_prefix_path }}/var/db/repos/gentoo/profiles/prefix/linux/arm64/eapi"
mode: 0644
when: eessi_host_arch == "aarch64"
tags:
- build_prefix

- name: "Fix missing profile for arm64 - parent"
ansible.builtin.copy:
content: |
../../../default/linux/arm64/17.0
..
dest: "{{ gentoo_prefix_path }}/var/db/repos/gentoo/profiles/prefix/linux/arm64/parent"
mode: 0644
when: eessi_host_arch == "aarch64"
tags:
- build_prefix

- name: "Fix missing profile for arm64 - make.defaults"
ansible.builtin.copy:
content: |
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

ACCEPT_KEYWORDS="arm64 ~arm64"

# Not sure if this is required as well, seems to be the default:
# CHOST=aarch64-unknown-linux-gnu
dest: "{{ gentoo_prefix_path }}/var/db/repos/gentoo/profiles/prefix/linux/arm64/make.defaults"
mode: 0644
when: eessi_host_arch == "aarch64"
tags:
- build_prefix

- name: "Mask packages for the bootstrap"
ansible.builtin.copy:
dest: "{{ gentoo_prefix_path }}/etc/portage/package.mask"
Expand All @@ -154,7 +199,10 @@
- build_prefix

- name: "Run Gentoo Prefix bootstrap stages 1-3 via {{ prefix_install }}"
ansible.builtin.shell: "set -o pipefail && {{ prefix_install }} | tee -a {{ prefix_build_log }} | grep -E '^(>>> Installing|\\* )'"
ansible.builtin.shell: set -o pipefail && ( {{ prefix_install }} | tee -a {{ prefix_build_log }} | grep -E '^(>>> Installing|\\* )' )
args:
executable: /bin/bash
become: false
changed_when: true
environment:
STOP_BOOTSTRAP_AFTER: stage3
Expand All @@ -171,7 +219,10 @@
- build_prefix

- name: "Continue Gentoo Prefix bootstrap via {{ prefix_install }}"
ansible.builtin.shell: "set -o pipefail && {{ prefix_install }} | tee -a {{ prefix_build_log }} | grep -E '^(>>> Installing|\\* )'"
ansible.builtin.shell: set -o pipefail && ( {{ prefix_install }} | tee -a {{ prefix_build_log }} | grep -E '^(>>> Installing|\\* )' )
args:
executable: /bin/bash
become: false
changed_when: true
tags:
- build_prefix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
oneshot: true
environment:
EXTRA_EMAKE: "user-defined-trusted-dirs={{ prefix_user_defined_trusted_dirs | join(':') }}"
vars:
ansible_python_interpreter: "{{ gentoo_prefix_path }}/usr/bin/python3"
when:
- eessi_host_os == "linux"
- glibc_extra_emake.stdout != "user-defined-trusted-dirs=" + ":".join(prefix_user_defined_trusted_dirs)
Expand Down
40 changes: 40 additions & 0 deletions ansible/playbooks/roles/compatibility_layer/tasks/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,51 @@
tags:
- test

- name: Check for python3
ansible.builtin.command:
cmd: "which python3"
register: which_python3
changed_when: which_python3.rc != 0

- name: Result for python3 check
ansible.builtin.debug:
msg: "{{ which_python3.stdout }}"
changed_when: false

- name: "Check if venv exists {{ reframe_venv_dir }}"
ansible.builtin.command:
cmd: "ls -l {{ reframe_venv_dir }}"
register: ls_reframe_venv_dir
ignore_errors: true
changed_when: false
tags:
- test

- name: "Result for checking {{ reframe_venv_dir }}"
ansible.builtin.debug:
msg: "{{ ls_reframe_venv_dir }}"
changed_when: false

- name: Remove venv
ansible.builtin.file:
path: "{{ reframe_venv_dir }}"
state: absent
register: remove_venv
when: ls_reframe_venv_dir.rc == 0
ignore_errors: true

- name: Result for removing venv
ansible.builtin.debug:
msg: "{{ remove_venv }}"
when: ls_reframe_venv_dir.rc == 0
changed_when: false

- name: Install Reframe using pip if it's not installed yet
ansible.builtin.pip:
name: ReFrame-HPC
virtualenv: "{{ reframe_venv_dir }}"
virtualenv_command: python3 -m venv
state: forcereinstall
when: reframe_exists.rc != 0

- name: Copy ReFrame test file
Expand Down
110 changes: 105 additions & 5 deletions bot/build.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,119 @@
#!/bin/bash
#
# script to build the EESSI compatibility layer. Intended use is that it is called
# by a (batch) job running on a compute node.
#
# This script is part of the EESSI compatibility layer, see
# https://github.com/EESSI/compatibility-layer.git
#
# author: Bob Droege (@bedroge)
# author: Thomas Roeblitz (@trz42)
#
# license: GPLv2
#

cpu_target_arch=$(echo ${CPU_TARGET} | cut -d/ -f1)
# ASSUMPTIONs:
# - working directory has been prepared by the bot with a checkout of a
# pull request (OR by some other means)
# - the working directory contains a directory 'cfg' where the main config
# file 'job.cfg' has been deposited
# - the directory may contain any additional files referenced in job.cfg

# stop as soon as something fails
set -e

# source utils.sh and cfg_files.sh
source scripts/utils.sh
source scripts/cfg_files.sh

# defaults
export JOB_CFG_FILE="${JOB_CFG_FILE_OVERRIDE:=./cfg/job.cfg}"

# check if ${JOB_CFG_FILE} exists
if [[ ! -r "${JOB_CFG_FILE}" ]]; then
fatal_error "job config file (JOB_CFG_FILE=${JOB_CFG_FILE}) does not exist or not readable"
fi
echo "bot/build.sh: showing ${JOB_CFG_FILE} from software-layer side"
cat ${JOB_CFG_FILE}

echo "bot/build.sh: obtaining configuration settings from '${JOB_CFG_FILE}'"
cfg_load ${JOB_CFG_FILE}

# if http_proxy is defined in ${JOB_CFG_FILE} use it, if not use env var $http_proxy
HTTP_PROXY=$(cfg_get_value "site_config" "http_proxy")
HTTP_PROXY=${HTTP_PROXY:-${http_proxy}}
echo "bot/build.sh: HTTP_PROXY='${HTTP_PROXY}'"

# if https_proxy is defined in ${JOB_CFG_FILE} use it, if not use env var $https_proxy
HTTPS_PROXY=$(cfg_get_value "site_config" "https_proxy")
HTTPS_PROXY=${HTTPS_PROXY:-${https_proxy}}
echo "bot/build.sh: HTTPS_PROXY='${HTTPS_PROXY}'"

LOCAL_TMP=$(cfg_get_value "site_config" "local_tmp")
echo "bot/build.sh: LOCAL_TMP='${LOCAL_TMP}'"

echo -n "setting \$STORAGE by replacing any var in '${LOCAL_TMP}' -> "
# replace any env variable in ${LOCAL_TMP} with its
# current value (e.g., a value that is local to the job)
STORAGE=$(envsubst <<< ${LOCAL_TMP})
echo "'${STORAGE}'"

# make sure ${STORAGE} exists
mkdir -p ${STORAGE}

# obtain list of modules to be loaded
LOAD_MODULES=$(cfg_get_value "site_config" "load_modules")
echo "bot/build.sh: LOAD_MODULES='${LOAD_MODULES}'"

# load modules if LOAD_MODULES is not empty
if [[ ! -z ${LOAD_MODULES} ]]; then
for mod in $(echo ${LOAD_MODULES} | tr ',' '\n')
do
echo "bot/build.sh: loading module '${mod}'"
module load ${mod}
done
else
echo "bot/build.sh: no modules to be loaded"
fi

cpu_target_arch=$(cfg_get_value "architecture" "software_subdir" | cut -d/ -f1)
host_arch=$(uname -m)
eessi_arch=${cpu_target_arch:-${host_arch}}
eessi_os=linux
eessi_version=2023.02
eessi_repo=pilot.eessi-hpc.org
job_version=$(cfg_get_value "repository" "repo_version")
eessi_version=${job_version:-2023.04}
job_repo=$(cfg_get_value "repository" "repo_name")
eessi_repo=${job_repo:-pilot.eessi-hpc.org}
tar_topdir=/cvmfs/${eessi_repo}/versions

# fake build job: create outfile with searched for lines & empty tarball
if [[ ${eessi_arch} == "x86_64" ]] && [[ ${eessi_repo} == *nessi* ]]; then
echo "check unknown case"
exit 1
fi

echo "PLAY RECAP"
if [[ ${eessi_arch} == "aarch64" ]]; then
echo "failed=1"
else
echo "failed=0"
fi

if [[ ${eessi_repo} == *nessi* ]]; then
target_tgz=nessi-${eessi_version}-compat-linux-${eessi_arch}-$(date +%s).tar.gz
else
target_tgz=eessi-${eessi_version}-compat-linux-${eessi_arch}-$(date +%s).tar.gz
fi
touch ${target_tgz}
exit 0

if [ "${eessi_arch}" != "${host_arch}" ]; then
echo "Requested architecture (${eessi_arch}) is different from this machine's architecture ($(uname -m))!"
exit 1
fi

./install_compatibility_layer.sh -a ${eessi_arch} -v ${eessi_version} -r ${eessi_repo} -c ~/compat.sif
# option -k is used for retaining ${eessi_tmp}
./install_compatibility_layer.sh -a ${eessi_arch} -v ${eessi_version} -r ${eessi_repo} -g ${STORAGE} -k

# create tarball -> should go into a separate script when this is supported by the bot
target_tgz=eessi-${eessi_version}-compat-linux-${eessi_arch}-$(date +%s).tar.gz
Expand All @@ -22,6 +122,6 @@ if [ -d ${eessi_tmp}/${tar_topdir}/${eessi_version} ]; then
tar cfvz ${target_tgz} -C ${eessi_tmp}/${tar_topdir} ${eessi_version}/compat/${eessi_os}/${eessi_arch}
echo ${target_tgz} created!
else
echo "Directory ${tar_topdir}/${eessi_version} was not created, not creating tarball."
echo "Directory ${eessi_tmp}/${tar_topdir}/${eessi_version} was not created, not creating tarball."
exit 1
fi
Loading