From 0c0d5827e6a89f4951f19b370c4572681c4d8a96 Mon Sep 17 00:00:00 2001 From: iamashwin99 <ashwin-kumar.karnad@mpsd.mpg.de> Date: Fri, 21 Apr 2023 11:02:32 +0200 Subject: [PATCH] Update task to be independent of spack-environments --- .gitignore | 1 + install-mpsd-software-environment.py | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..600d2d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode \ No newline at end of file diff --git a/install-mpsd-software-environment.py b/install-mpsd-software-environment.py index db18f24..27cab91 100644 --- a/install-mpsd-software-environment.py +++ b/install-mpsd-software-environment.py @@ -42,20 +42,14 @@ def build_toolchains( # Checks - ## Check if current Git branch name and MPSD_SPACK_VER( If passed ) match + ## Check that some mpsd_spack_ver is passed. if mpsd_spack_ver is None: - mpsd_spack_ver = current_branch - elif current_branch != mpsd_spack_ver: - # Ensure that the current Git branch name matches MPSD_SPACK_VER raise invoke.Exit( - f"Error: Current Git branch name {current_branch} \n\ - does not match argument for MPSD_SPACK_VER: {mpsd_spack_ver}" + "Error: MPSD_SPACK_VER not passed. Please pass the MPSD Software stack version." ) - ## Check if toolchains directory exists - toolchains_path = os.path.join( - toolchain_base_dir, mpsd_os, mpsd_spack_ver, mpsd_microarch - ) + spack_env_path = os.path.join(toolchain_base_dir, mpsd_os, mpsd_spack_ver) + toolchains_path = os.path.join(spack_env_path, mpsd_microarch) if not os.path.exists(toolchains_path): os.makedirs(toolchains_path) else: @@ -64,6 +58,10 @@ def build_toolchains( f"Error: Toolchains directory {toolchains_path} already exists. \n\ Please remove it and try again." ) + ### Clone spack-env repo at spack_env_path + with c.cd(spack_env_path + "/spack-environments"): + c.run("git clone git@gitlab.gwdg.de:mpsd-cs/spack-environments.git .") + c.run(f"git checkout {mpsd_spack_ver}") ## Check if TOOLCHAIN_LIST is valid available_toolchains = os.listdir("toolchains") @@ -85,13 +83,14 @@ def build_toolchains( ) # Build toolchains + log_file = f"build_toolchains_{mpsd_spack_ver}_{time.strftime('%Y%m%d-%H%M%S')}.log" print(f"Building at {toolchains_path}...") for toolchain in toolchains: with c.cd(toolchains_path): c.run(f"echo '>>>> Building {toolchain}...' | tee -a {log_file}") c.run( - f" bash {current_dir}/spack_setup.sh {flags} {toolchain}|tee -a {log_file} 2>&1" + f" bash {spack_env_path}/spack-environments/spack_setup.sh {flags} {toolchain}|tee -a {log_file} 2>&1" ) # copy the octopus configs to the toolchain directory # c.run(f"cp -r {current_dir}/octopus {toolchains_path}") -- GitLab