Accepting request 1084588 from network:cluster
OBS-URL: https://build.opensuse.org/request/show/1084588 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/spack?expand=0&rev=32
This commit is contained in:
commit
b4ba70e162
39
Add-zypper-to-the-valid-container.os_packages-commands.patch
Normal file
39
Add-zypper-to-the-valid-container.os_packages-commands.patch
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
From: Egbert Eich <eich@suse.com>
|
||||||
|
Date: Thu Apr 6 11:29:30 2023 +0200
|
||||||
|
Subject: Add 'zypper' to the valid container.os_packages commands
|
||||||
|
Patch-mainline: Not yet
|
||||||
|
Git-commit: 0614150f86a3554118f60614e9b0cfaf8fb2aa12
|
||||||
|
References:
|
||||||
|
|
||||||
|
Signed-off-by: Egbert Eich <eich@suse.com>
|
||||||
|
Signed-off-by: Egbert Eich <eich@suse.de>
|
||||||
|
---
|
||||||
|
lib/spack/docs/containers.rst | 2 +-
|
||||||
|
lib/spack/spack/schema/container.py | 2 +-
|
||||||
|
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
diff --git a/lib/spack/docs/containers.rst b/lib/spack/docs/containers.rst
|
||||||
|
index 9c6f8a26..1452b6a0 100644
|
||||||
|
--- a/lib/spack/docs/containers.rst
|
||||||
|
+++ b/lib/spack/docs/containers.rst
|
||||||
|
@@ -498,7 +498,7 @@ to customize the generation of container recipes:
|
||||||
|
- No
|
||||||
|
* - ``os_packages:command``
|
||||||
|
- Tool used to manage system packages
|
||||||
|
- - ``apt``, ``yum``
|
||||||
|
+ - ``apt``, ``yum``, ``zypper``
|
||||||
|
- Only with custom base images
|
||||||
|
* - ``os_packages:update``
|
||||||
|
- Whether or not to update the list of available packages
|
||||||
|
diff --git a/lib/spack/spack/schema/container.py b/lib/spack/spack/schema/container.py
|
||||||
|
index b05199f8..7c98a1db 100644
|
||||||
|
--- a/lib/spack/spack/schema/container.py
|
||||||
|
+++ b/lib/spack/spack/schema/container.py
|
||||||
|
@@ -54,7 +54,7 @@
|
||||||
|
"os_packages": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
- "command": {"type": "string", "enum": ["apt", "yum"]},
|
||||||
|
+ "command": {"type": "string", "enum": ["apt", "yum", "zypper"]},
|
||||||
|
"update": {"type": "boolean"},
|
||||||
|
"build": _list_of_packages,
|
||||||
|
"final": _list_of_packages,
|
@ -1,40 +0,0 @@
|
|||||||
From: Egbert Eich <eich@suse.com>
|
|
||||||
Date: Tue Jan 31 09:24:46 2023 +0100
|
|
||||||
Subject: Make sure spack environment is set up in Dockerfile template
|
|
||||||
Patch-mainline: Not yet
|
|
||||||
Git-commit: 865116877fe2536485326aa0fb53943160fa5e25
|
|
||||||
References:
|
|
||||||
|
|
||||||
The Dockerfile template did source the script
|
|
||||||
/opt/spack/share/spack/setup-env.sh
|
|
||||||
which lead to the binary 'spack' not being found and the
|
|
||||||
environment not being set up properly for `spack env activate .`.
|
|
||||||
|
|
||||||
Signed-off-by: Egbert Eich <eich@suse.com>
|
|
||||||
Signed-off-by: Egbert Eich <eich@suse.de>
|
|
||||||
---
|
|
||||||
share/spack/templates/container/Dockerfile | 5 +++--
|
|
||||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
||||||
diff --git a/share/spack/templates/container/Dockerfile b/share/spack/templates/container/Dockerfile
|
|
||||||
index b10dcf08..dc9b91e5 100644
|
|
||||||
--- a/share/spack/templates/container/Dockerfile
|
|
||||||
+++ b/share/spack/templates/container/Dockerfile
|
|
||||||
@@ -19,7 +19,8 @@ RUN mkdir {{ paths.environment }} \
|
|
||||||
{{ manifest }} > {{ paths.environment }}/spack.yaml
|
|
||||||
|
|
||||||
# Install the software, remove unnecessary deps
|
|
||||||
-RUN cd {{ paths.environment }} && spack env activate . && spack install --fail-fast && spack gc -y
|
|
||||||
+RUN . /opt/spack/share/spack/setup-env.sh && \
|
|
||||||
+ cd {{ paths.environment }} && spack env activate . && spack install --fail-fast && spack gc -y
|
|
||||||
{% if strip %}
|
|
||||||
|
|
||||||
# Strip all the binaries
|
|
||||||
@@ -31,7 +32,7 @@ RUN find -L {{ paths.view }}/* -type f -exec readlink -f '{}' \; | \
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
# Modifications to the environment that are necessary to run
|
|
||||||
-RUN cd {{ paths.environment }} && \
|
|
||||||
+RUN . /opt/spack/share/spack/setup-env.sh && cd {{ paths.environment }} && \
|
|
||||||
spack env activate --sh -d . >> /etc/profile.d/z10_spack_environment.sh
|
|
||||||
|
|
||||||
{% if extra_instructions.build %}
|
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:c9666f0b22ccf3cbda2736104d5d4e3b9cad5b4b4f01874a501e97d2c9477452
|
|
||||||
size 9420035
|
|
3
spack-0.19.2.tar.gz
Normal file
3
spack-0.19.2.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:4978b37da50f5690f4e1aa0cfe3975a89ccef85d96c68d417ea0716a8ce3aa98
|
||||||
|
size 9424447
|
@ -1,3 +1,61 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Apr 17 06:59:15 UTC 2023 - Egbert Eich <eich@suse.com>
|
||||||
|
|
||||||
|
- Update to version 0.19.2 with the following bug fixes:
|
||||||
|
* Ignore global variant requirement for packages that do not define it.
|
||||||
|
* Compiler wrapper: improved parsing of linker arguments.
|
||||||
|
* Views: fix support for optional Python extensions.
|
||||||
|
* Views: fix issue where Python executable gets symlinked instead of copied.
|
||||||
|
* Fix a bug where tests were not added when concretizing together.
|
||||||
|
* Increase db timeout from 3s to 60s to improve stability of parallel
|
||||||
|
installs.
|
||||||
|
* Buildcache: improve error handling in downloads.
|
||||||
|
* Module files for packages installed from buildcache have long placeholder
|
||||||
|
paths abbreviated in configure args section.
|
||||||
|
* Ensure file with build environment variables is truncated when writing
|
||||||
|
to it.
|
||||||
|
* spack config update now works on active environments;
|
||||||
|
- Add:
|
||||||
|
Add-zypper-to-the-valid-container.os_packages-commands.patch
|
||||||
|
This adds `zypper` to the valid OS package managers that can
|
||||||
|
be specified in a slack.yaml container description like:
|
||||||
|
spack:
|
||||||
|
...
|
||||||
|
container:
|
||||||
|
..
|
||||||
|
os_packages:
|
||||||
|
command: zypper
|
||||||
|
..
|
||||||
|
- Add: spack_get_libs.sh
|
||||||
|
This scripts obtains library and include paths for spack-build
|
||||||
|
libraries and outputs shell commands which set these as
|
||||||
|
environment variables.
|
||||||
|
Additionally, it generates a command line to prepend these lib
|
||||||
|
directories to LD_LIBRARY_PATH. Thus, the variables can be set
|
||||||
|
in the current shell by running `source $(spack_get_libs.sh foo)`.
|
||||||
|
When using `bash` this script may also be sourced directly.
|
||||||
|
The names of the environment variables are the upper-cased library
|
||||||
|
names with the strings 'LIB_' and 'INC_' prepended. Thus, for a
|
||||||
|
library 'foo', they would be 'INC_FOO' and 'LIB_FOO'.
|
||||||
|
These variables may be used at build time to point the compiler
|
||||||
|
to the include and library files (bsc#1208751).
|
||||||
|
- Drop:
|
||||||
|
Make-sure-spack-environment-is-set-up-in-Dockerfile-template.patch
|
||||||
|
This patch should not be needed. When building using `podman` use:
|
||||||
|
`podman build --format docker ...` to enable the non-OCI compliant
|
||||||
|
instructions in a Dockerfile.
|
||||||
|
- Add info, makeinfo, libcurl-devel, patchelf to the recommended
|
||||||
|
packages to add.
|
||||||
|
Fix: openssl-devel -> libopenssl-devel
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Apr 6 09:30:50 UTC 2023 - Egbert Eich <eich@suse.com>
|
||||||
|
|
||||||
|
- Add 'zypper' as valid command to container.os_packages. This
|
||||||
|
allows to build SUSE container using non-default registries.
|
||||||
|
- Add 'awk', 'git', 'gzip' and 'gunzip' to the requires.
|
||||||
|
- Add 'patchelf' to the recommended packages.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Mar 30 09:34:39 UTC 2023 - Egbert Eich <eich@suse.com>
|
Thu Mar 30 09:34:39 UTC 2023 - Egbert Eich <eich@suse.com>
|
||||||
|
|
||||||
|
13
spack.spec
13
spack.spec
@ -31,7 +31,7 @@ ExclusiveArch: do_not_build
|
|||||||
# These packages are found and can be used by spack, %{_sysconfdir}/spack/packages-yaml
|
# These packages are found and can be used by spack, %{_sysconfdir}/spack/packages-yaml
|
||||||
# needs to be updated when one of these packages is updated or uninstalled.
|
# needs to be updated when one of these packages is updated or uninstalled.
|
||||||
# Distinguish between packages we recommend and packages which
|
# Distinguish between packages we recommend and packages which
|
||||||
%define spack_trigger_recommended_packages autoconf bash bison bzip2 libzip-devel cmake-full ccache cpio diffutils findutils flex git-lfs make m4 ncurses-devel libtool openssl-devel perl-base pkgconf pkg-config python3-base tar info xz xz-devel
|
%define spack_trigger_recommended_packages autoconf bash bison bzip2 libzip-devel cmake-full ccache cpio diffutils findutils flex git-lfs info make makeinfo m4 ncurses-devel libtool libcurl-devel libopenssl-devel perl-base pkgconf pkg-config python3-base tar xz xz-devel patchelf
|
||||||
|
|
||||||
%define spack_trigger_recommended_compilers gcc gcc-c++ gcc-fortran
|
%define spack_trigger_recommended_compilers gcc gcc-c++ gcc-fortran
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ ExclusiveArch: do_not_build
|
|||||||
# non oss packages
|
# non oss packages
|
||||||
%define spack_trigger_external cuda-nvcc
|
%define spack_trigger_external cuda-nvcc
|
||||||
Name: spack
|
Name: spack
|
||||||
Version: 0.19.1
|
Version: 0.19.2
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Package manager for HPC systems
|
Summary: Package manager for HPC systems
|
||||||
License: Apache-2.0 AND MIT AND Python-2.0 AND BSD-3-Clause
|
License: Apache-2.0 AND MIT AND Python-2.0 AND BSD-3-Clause
|
||||||
@ -55,6 +55,7 @@ Source3: run-find-external.sh.in
|
|||||||
Source4: https://en.opensuse.org/index.php?title=Spack&action=raw&ref=157522#/README-oo-wiki
|
Source4: https://en.opensuse.org/index.php?title=Spack&action=raw&ref=157522#/README-oo-wiki
|
||||||
# Source5 is from https://docs.python.org/3/objects.inv, but has permanent changes so using a static version
|
# Source5 is from https://docs.python.org/3/objects.inv, but has permanent changes so using a static version
|
||||||
Source5: objects.inv
|
Source5: objects.inv
|
||||||
|
Source6: spack_get_libs.sh
|
||||||
Patch2: Adapt-shell-scripts-that-set-up-the-environment-for-different-shells.patch
|
Patch2: Adapt-shell-scripts-that-set-up-the-environment-for-different-shells.patch
|
||||||
Patch4: added-target-and-os-calls-to-output-of-spack-spec-co.patch
|
Patch4: added-target-and-os-calls-to-output-of-spack-spec-co.patch
|
||||||
Patch5: Make-spack-paths-compliant-to-distro-installation.patch
|
Patch5: Make-spack-paths-compliant-to-distro-installation.patch
|
||||||
@ -62,7 +63,7 @@ Patch6: Fix-error-during-documentation-build-due-to-recursive-module-inc
|
|||||||
Patch7: Fix-Spinx-configuration-to-avoid-throwing-errors.patch
|
Patch7: Fix-Spinx-configuration-to-avoid-throwing-errors.patch
|
||||||
Patch8: Set-modules-default-to-lmod.patch
|
Patch8: Set-modules-default-to-lmod.patch
|
||||||
Patch9: Add-support-for-container-building-using-a-SLE-base-container.patch
|
Patch9: Add-support-for-container-building-using-a-SLE-base-container.patch
|
||||||
Patch100: Make-sure-spack-environment-is-set-up-in-Dockerfile-template.patch
|
Patch10: Add-zypper-to-the-valid-container.os_packages-commands.patch
|
||||||
%if %{without doc}
|
%if %{without doc}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: lua-lmod
|
BuildRequires: lua-lmod
|
||||||
@ -71,12 +72,15 @@ BuildRequires: python3-urllib3
|
|||||||
BuildRequires: sudo
|
BuildRequires: sudo
|
||||||
BuildRequires: sysuser-tools
|
BuildRequires: sysuser-tools
|
||||||
Requires: %{name}-recipes = %{version}
|
Requires: %{name}-recipes = %{version}
|
||||||
|
Requires: awk
|
||||||
Requires: bzip2
|
Requires: bzip2
|
||||||
Requires: coreutils
|
Requires: coreutils
|
||||||
Requires: curl
|
Requires: curl
|
||||||
Requires: gcc-c++
|
Requires: gcc-c++
|
||||||
Requires: gcc-fortran
|
Requires: gcc-fortran
|
||||||
|
Requires: git
|
||||||
Requires: gpg2
|
Requires: gpg2
|
||||||
|
Requires: gzip
|
||||||
Requires: libbz2-devel
|
Requires: libbz2-devel
|
||||||
Requires: lua-lmod
|
Requires: lua-lmod
|
||||||
Requires: make
|
Requires: make
|
||||||
@ -85,6 +89,7 @@ Requires: polkit
|
|||||||
Requires: python3-clingo
|
Requires: python3-clingo
|
||||||
Requires: sudo
|
Requires: sudo
|
||||||
Requires: tar
|
Requires: tar
|
||||||
|
Requires: unzip
|
||||||
Requires: xz
|
Requires: xz
|
||||||
Recommends: %spack_trigger_recommended_packages %spack_trigger_recommended_compilers
|
Recommends: %spack_trigger_recommended_packages %spack_trigger_recommended_compilers
|
||||||
%else
|
%else
|
||||||
@ -304,6 +309,8 @@ cp -r var/spack/* %{buildroot}%{_localstatedir}/lib/spack
|
|||||||
mv %{buildroot}%{_localstatedir}/lib/spack/repos %{buildroot}%{_datarootdir}/spack
|
mv %{buildroot}%{_localstatedir}/lib/spack/repos %{buildroot}%{_datarootdir}/spack
|
||||||
cp -r bin/sbang %{buildroot}/%{_bindir}
|
cp -r bin/sbang %{buildroot}/%{_bindir}
|
||||||
cp -r bin/spack* %{buildroot}%{_bindir}/
|
cp -r bin/spack* %{buildroot}%{_bindir}/
|
||||||
|
cp %{S:6} %{buildroot}%{_bindir}/
|
||||||
|
chmod 0755 %{buildroot}%{_bindir}/%{basename:%{S:6}}
|
||||||
cp etc/spack/defaults/config.yaml %{buildroot}%{_sysconfdir}/skel/.spack/
|
cp etc/spack/defaults/config.yaml %{buildroot}%{_sysconfdir}/skel/.spack/
|
||||||
install -m 755 %{S:3} %{buildroot}/%{spack_dir}/run-find-external.sh
|
install -m 755 %{S:3} %{buildroot}/%{spack_dir}/run-find-external.sh
|
||||||
sed -i -e 's#@@_sysconfdir@@#%{_sysconfdir}#' %{buildroot}/%{spack_dir}/run-find-external.sh
|
sed -i -e 's#@@_sysconfdir@@#%{_sysconfdir}#' %{buildroot}/%{spack_dir}/run-find-external.sh
|
||||||
|
124
spack_get_libs.sh
Normal file
124
spack_get_libs.sh
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
#set -x
|
||||||
|
|
||||||
|
spack_shtyp=bash
|
||||||
|
|
||||||
|
help() {
|
||||||
|
echo -e "$0 [--help][--csh] lib ...
|
||||||
|
Print set commands to set or set LD_LIBRARY_PATH to libraries
|
||||||
|
specified as arguments as well as variables holding each library
|
||||||
|
directory individually. These are usful when linking applications
|
||||||
|
against these libraries.
|
||||||
|
The variable names of the latter begin with 'LIB_' followed by
|
||||||
|
the upper cased library name."
|
||||||
|
}
|
||||||
|
|
||||||
|
error() {
|
||||||
|
echo -e "$1" >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
contains() {
|
||||||
|
local a=$1
|
||||||
|
shift
|
||||||
|
local -a b=($@)
|
||||||
|
local i
|
||||||
|
for i in ${b[*]}; do
|
||||||
|
[ "$i" == "$a" ] && return 0
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
path_contains() {
|
||||||
|
local a=$1
|
||||||
|
local i
|
||||||
|
[ -n "$2" ] || return 1
|
||||||
|
OFS=$IFS
|
||||||
|
IFS=:
|
||||||
|
for i in $2; do
|
||||||
|
IFS=$OFS
|
||||||
|
[ "$i" == "$a" ] && return 0
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
print_env() {
|
||||||
|
case $spack_shtyp in
|
||||||
|
csh)
|
||||||
|
echo "setenv $1 $2" ;;
|
||||||
|
bash)
|
||||||
|
if $spack_srcd; then
|
||||||
|
eval $1=$2
|
||||||
|
export $1
|
||||||
|
else
|
||||||
|
echo -e "$1=$2\nexport $1"
|
||||||
|
fi ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
get_paths()
|
||||||
|
{
|
||||||
|
local -A libpaths includepaths
|
||||||
|
local OFS=$IFS
|
||||||
|
local ld_exist=$LD_LIBRARY_PATH
|
||||||
|
IFS="
|
||||||
|
"
|
||||||
|
local package_list="$1"
|
||||||
|
local format="> {hash:7} {name}{@version}{%compiler}{arch=architecture}"
|
||||||
|
|
||||||
|
local l i
|
||||||
|
for l in $(spack find --format "{name}" --paths $package_list); do
|
||||||
|
local lib=${l%% *}
|
||||||
|
local path=${l##* }
|
||||||
|
if contains $lib "${!libpaths[@]}"; then
|
||||||
|
error "$lib matches multiple packages\n Matching packages:"
|
||||||
|
spack find --format ${format} ${lib} >&2
|
||||||
|
error " Use a more specific spec (e.g., prepend '/' to the hash)."
|
||||||
|
$spack_srcd || exit 1
|
||||||
|
fi
|
||||||
|
for i in lib64 lib; do
|
||||||
|
if [ -d $path/$i ]; then
|
||||||
|
libpaths[$lib]="$path/$i"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ -d $path/include ]; then
|
||||||
|
includepaths[$lib]="$path/include"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
IFS=$OFS
|
||||||
|
|
||||||
|
local -A libs
|
||||||
|
local ld_library_path
|
||||||
|
for i in ${!libpaths[@]}; do
|
||||||
|
libs[LIB_${i^^*}]="${libpaths[$i]}"
|
||||||
|
path_contains ${libpaths[$i]} "${ld_exist}" || \
|
||||||
|
ld_library_path+="${libpaths[$i]}:"
|
||||||
|
done
|
||||||
|
for i in ${!includepaths[@]}; do
|
||||||
|
eval [ "unset" = "\${INC_${i}:-unset}" ] &&
|
||||||
|
print_env "INC_${i^^*}" "${includepaths[$i]}"
|
||||||
|
done
|
||||||
|
for i in ${!libs[@]}; do
|
||||||
|
eval [ "unset" = "\${${i}:-unset}" ] && print_env $i "${libs[$i]}"
|
||||||
|
done
|
||||||
|
[ -n "$ld_library_path" ] && \
|
||||||
|
print_env LD_LIBRARY_PATH "${ld_library_path}\$LD_LIBRARY_PATH"
|
||||||
|
}
|
||||||
|
|
||||||
|
spack_srcd=false
|
||||||
|
(
|
||||||
|
[[ -n $ZSH_VERSION && $ZSH_EVAL_CONTEXT =~ :file$ ]] ||
|
||||||
|
[[ -n $BASH_VERSION ]] && (return 0 2>/dev/null)
|
||||||
|
) && spack_srcd=true
|
||||||
|
|
||||||
|
while [ -n "$1" ]; do
|
||||||
|
case $1 in
|
||||||
|
*-help|*-h) help; $spack_srcd || exit 0 ;;
|
||||||
|
*-csh|*-tcsh)
|
||||||
|
spack_shtyp=csh ;;
|
||||||
|
*) package_list+=" $1" ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
get_paths "$package_list"
|
Loading…
Reference in New Issue
Block a user