Merge branch 'gitlab_pages' into 'master'
ADD: Gitlab pages See merge request Pmodules/dependency-checker!6
This commit is contained in:
commit
d4f3faf6a1
@ -1,4 +1,6 @@
|
|||||||
stages: [check]
|
stages:
|
||||||
|
- check
|
||||||
|
- pages
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
COLUMNS: 9000
|
COLUMNS: 9000
|
||||||
@ -15,3 +17,29 @@ check:
|
|||||||
- export COLUMNS=$COLUMNS
|
- export COLUMNS=$COLUMNS
|
||||||
- export TERM=$TERM
|
- export TERM=$TERM
|
||||||
- python3 pmodules_tools/pmodules_tools.py --deps-check
|
- python3 pmodules_tools/pmodules_tools.py --deps-check
|
||||||
|
|
||||||
|
pages:
|
||||||
|
stage: pages
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- public
|
||||||
|
image: ubuntu:20.04
|
||||||
|
script:
|
||||||
|
- apt update
|
||||||
|
- apt -y install pandoc
|
||||||
|
- mkdir -p /opt && pushd $_
|
||||||
|
- ln -s /afs/psi.ch/sys/psi.x86_64_el6 psi
|
||||||
|
- popd
|
||||||
|
|
||||||
|
- export PMODULES_VERSION=1.0.0rc14
|
||||||
|
- export COLUMNS=$COLUMNS
|
||||||
|
- export TERM=$TERM
|
||||||
|
|
||||||
|
- source /opt/psi/config/profile.bash
|
||||||
|
- module load Python
|
||||||
|
- mkdir public
|
||||||
|
- cd pmodules_tools/
|
||||||
|
- python3 pmodules_tools.py --db-check
|
||||||
|
- pandoc pmodules_changes.md -o index.html
|
||||||
|
- cp -v index.html $CI_PROJECT_DIR/public
|
||||||
|
when: always
|
@ -1,8 +1,11 @@
|
|||||||
# Pmodules tools
|
# Pmodules tools
|
||||||
|
|
||||||
Dependency checker: <br>
|
|
||||||
[](https://git.psi.ch/Pmodules/dependency-checker)
|
[](https://git.psi.ch/Pmodules/dependency-checker)
|
||||||
|
|
||||||
|
## Pages
|
||||||
|
|
||||||
|
[Pmodules Database Report](https://pmodules.gitpages.psi.ch/dependency-checker)
|
||||||
|
|
||||||
## Intro
|
## Intro
|
||||||
A python project to analyse Pmodules modules and their status changes.
|
A python project to analyse Pmodules modules and their status changes.
|
||||||
|
|
||||||
|
@ -32,12 +32,14 @@ def db_check_diff(current_pmodule_state, Pmodules_db_path, Pmodules_states):
|
|||||||
print_pmodules_differences(
|
print_pmodules_differences(
|
||||||
current_pmodule_state, old_pmodule_state, Pmodules_states
|
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.
|
# 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(
|
if no_current_db or compare_states_sha(
|
||||||
current_pmodule_state, old_pmodule_state, current_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):
|
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):
|
for index in range(0, len(changed_module_list) - 1, 2):
|
||||||
md_file.write(
|
md_file.write(
|
||||||
changed_module_list[index]
|
changed_module_list[index]
|
||||||
+ "<br>Changed state from "
|
+ "<br/>Changed state from "
|
||||||
+ changed_module_list[index + 1].split()[1]
|
+ changed_module_list[index + 1].split()[1]
|
||||||
+ " to ---> "
|
+ " to ---> "
|
||||||
+ changed_module_list[index].split()[1]
|
+ changed_module_list[index].split()[1]
|
||||||
+ "<br>"
|
+ "<br/>"
|
||||||
)
|
)
|
||||||
|
|
||||||
standard_print(md_file, deleted_module_list, "Deleted modules:")
|
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")
|
file.write("\n# " + string + " \n")
|
||||||
for diff in module_list:
|
for diff in module_list:
|
||||||
if diff != "":
|
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
|
# Emptying Pmodules database first
|
||||||
if os.path.exists(Pmodules_db_path):
|
if os.path.exists(Pmodules_db_path):
|
||||||
shutil.rmtree(Pmodules_db_path)
|
shutil.rmtree(Pmodules_db_path)
|
||||||
|
@ -72,7 +72,11 @@ class PmodulePackage:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
@cache
|
@cache
|
||||||
def Pmoduliser(pckg_name="", compiler="", mpi_provider=""):
|
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
|
# try to precise the module search if compiler and/or mpi_provider are given
|
||||||
module_cmd = default_module_cmd
|
module_cmd = default_module_cmd
|
||||||
|
@ -43,12 +43,14 @@ def main():
|
|||||||
cli_args = parse_args()
|
cli_args = parse_args()
|
||||||
|
|
||||||
# Global variables
|
# 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"]
|
Pmodules_states = ["deprecated", "stable", "unstable"]
|
||||||
|
|
||||||
# Main search to analyse
|
# Main search to analyse
|
||||||
module_cmd = (
|
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)
|
module_cmd_process = subprocess_cmd(module_cmd)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user