From c7ebba83dfd724784acb908c83018bea2c1169f1 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 18 Jul 2022 15:58:10 +0200 Subject: [PATCH 1/3] overlay doc updated --- doc/Overlays.adoc | 53 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/doc/Overlays.adoc b/doc/Overlays.adoc index d08004b..b486cc6 100644 --- a/doc/Overlays.adoc +++ b/doc/Overlays.adoc @@ -10,6 +10,7 @@ Please note: This document is work in progress! === System wide +==== Example .A system wide configuration file `/opt/psi/config/Pmodules.yaml` ==== .... @@ -22,11 +23,34 @@ DistfilesDir: /opt/psi/var/distfiles Overlays: base: install_root: /opt/psi + modulefiles_root: /opt/psi devel: install_root: /opt/psi modulefiles_root: ${HOME}/modulefiles .... ==== +==== YAML Format +.Format +==== +.... +Overlays: + : + install_root: + modulefiles_root: + type: + ... +.... +==== +``:: Name of overlay. Note: whitespace in the name is not supported. +`.install_root`:: The root of the software installation. This key is mandatory. +`.modulefiles_root`:: The root of the modulefile hierarchy. This key is optional and defaults to `.install_root> +`.type`:: The type of the overlay, see below. This key is optional and the default value is `n`. + +==== Overlay types +`n`:: Normal overlay. +`h`:: Hiding overlay. +`r`:: Replacing overlay. + === User defined overlays Each user can define his own overlays in `$HOME/.Pmodules/Pmodules.yaml`. @@ -39,6 +63,7 @@ The old format of the variants file is simple but very limited and almost imposs === With a YAML variants file +==== Example of a variants file in YAML format .A YAML variants file ==== .... @@ -53,13 +78,15 @@ hdf5_serial/1.12.2: .... ==== -.YAML format of varaints file +==== Format specification +.YAML format .... +relstage: overlay: systems: -/: - - with: +/: + - with: dependencies: relstate: overlay: @@ -67,6 +94,24 @@ systems: ... ... .... +==== Defaults +Default values can be overriden per version/variant. +`overlay`:: The default overlay the module will be installed in. This value can be overriden for dedicated versions/variants. +`systems`:: The default for supported systems. -=== With a legacy variants file +==== Versions and Variants + +`/`:: An array with variants for this version. + +`/.[i].with`:: Hierarchical dependencies for variant `i`. + +`/.[i].dependencies`:: Build/run-time dependencies for variant `i`. + +`/.[i].relstage`:: Relase stage of variant `i`. + +`/.[i].overlay`:: Overlay of variant `i`. + +`/.[i].systems`:: Supported systems. + +=== Legacy format From 542684551fffbd934cfefa297fe0a028fb8f2ff7 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 25 Jul 2022 13:52:27 +0200 Subject: [PATCH 2/3] profile.zsh: export PMODULES_VERSION --- Pmodules/profile.zsh.in | 1 + 1 file changed, 1 insertion(+) diff --git a/Pmodules/profile.zsh.in b/Pmodules/profile.zsh.in index b0a7f4a..a2f9d58 100644 --- a/Pmodules/profile.zsh.in +++ b/Pmodules/profile.zsh.in @@ -5,6 +5,7 @@ : ${PMODULES_VERSION:=@PMODULES_VERSION@} ##### no changes below this line ###### +export PMODULES_VERSION declare __pm_root__=${(%):-%N} declare -x PMODULES_HOME="${__pm_root__:h:h}/Tools/Pmodules/${PMODULES_VERSION}" From 247c861582b49effc035a077fccffaf5dd04cafe Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 27 Jul 2022 00:22:57 +0200 Subject: [PATCH 3/3] modbuild: queries from YAML module config file added --- Pmodules/modbuild.in | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Pmodules/modbuild.in b/Pmodules/modbuild.in index 6620c9b..a87ab5f 100755 --- a/Pmodules/modbuild.in +++ b/Pmodules/modbuild.in @@ -115,6 +115,9 @@ MISCELLANEOUS OPTIONS: -v | --verbose ) Verbose output. +--debug ) + Run in debug mode. + -j N | --jobs=N Run N parallel make jobs. @@ -498,6 +501,19 @@ build_modules_yaml(){ _result='base' } + yaml_get_group(){ + local -n _result="$1" + local fname="$2" + local version="$3" + local idx="$4" + _result=$(${yq} -Ne e ".\"${version}\"[${idx}].group" \ + "${fname}" 2>/dev/null) + (( $? == 0 )) && return + _result=$(${yq} -Ne e ".group" "${fname}" 2>/dev/null) + (( $? == 0 )) && return + _result='' + } + yaml_get_systems(){ local -n _result="$1" local fname="$2" @@ -511,6 +527,19 @@ build_modules_yaml(){ _result='any' } + yaml_get_operating_systems(){ + local -n _result="$1" + local fname="$2" + local version="$3" + local idx="$4" + _result=$(${yq} -Ne e ".\"${version}\"[${idx}].operating_systems" \ + "${fname}" 2>/dev/null) + (( $? == 0 )) && return + _result=$(${yq} -Ne e ".operating_systems" "${fname}" 2>/dev/null) + (( $? == 0 )) && return + _result='any' + } + yaml_get_dependencies(){ local -n _result="$1" local fname="$2"