ADD: Gitlab pages

This commit is contained in:
2023-02-08 08:42:32 +00:00
parent b46367b842
commit ce55fc1c23
5 changed files with 49 additions and 10 deletions

View File

@ -32,12 +32,14 @@ def db_check_diff(current_pmodule_state, Pmodules_db_path, Pmodules_states):
print_pmodules_differences(
current_pmodule_state, old_pmodule_state, Pmodules_states
)
else:
print_to_markdown([], [], [])
# There is no database available or there are differences with the old pmodule state, writing current state.
if no_current_db or compare_states_sha(
current_pmodule_state, old_pmodule_state, current_sha
):
write_curent_state(current_pmodule_state, current_sha, Pmodules_db_path)
write_current_state(current_pmodule_state, current_sha, Pmodules_db_path)
def compare_states_sha(current_pmodule_state, old_pmodule_state, current_sha):
@ -58,11 +60,11 @@ def print_to_markdown(new_module_list, deleted_module_list, changed_module_list)
for index in range(0, len(changed_module_list) - 1, 2):
md_file.write(
changed_module_list[index]
+ "<br>Changed state from "
+ "<br/>Changed state from "
+ changed_module_list[index + 1].split()[1]
+ " to ---> "
+ changed_module_list[index].split()[1]
+ "<br>"
+ "<br/>"
)
standard_print(md_file, deleted_module_list, "Deleted modules:")
@ -143,10 +145,10 @@ def standard_print(file, module_list, string):
file.write("\n# " + string + " \n")
for diff in module_list:
if diff != "":
file.write(diff + "<br>")
file.write(diff + "<br/>")
def write_curent_state(current_pmodule_state, current_sha, Pmodules_db_path):
def write_current_state(current_pmodule_state, current_sha, Pmodules_db_path):
# Emptying Pmodules database first
if os.path.exists(Pmodules_db_path):
shutil.rmtree(Pmodules_db_path)

View File

@ -72,7 +72,11 @@ class PmodulePackage:
@staticmethod
@cache
def Pmoduliser(pckg_name="", compiler="", mpi_provider=""):
default_module_cmd = "module search " + pckg_name + " -a --all-deps --no-header"
default_module_cmd = (
"$PMODULES_HOME/bin/modulecmd bash search "
+ pckg_name
+ " -a --all-deps --no-header"
)
# try to precise the module search if compiler and/or mpi_provider are given
module_cmd = default_module_cmd

View File

@ -43,12 +43,14 @@ def main():
cli_args = parse_args()
# Global variables
Pmodules_db_path = "/afs/psi.ch/sys/spack-rhel7/test/"
Pmodules_db_path = "/opt/psi/var/cache/pmodules_db/"
Pmodules_states = ["deprecated", "stable", "unstable"]
# Main search to analyse
module_cmd = (
"module search -a " + cli_args.select_module + " --all-deps --no-header"
"$PMODULES_HOME/bin/modulecmd bash search -a "
+ cli_args.select_module
+ " --all-deps --no-header"
)
module_cmd_process = subprocess_cmd(module_cmd)