Skip to content
Snippets Groups Projects
Commit 0c0d5827 authored by Ashwin Kumar Karnad's avatar Ashwin Kumar Karnad
Browse files

Update task to be independent of spack-environments

parent ebc96c85
No related branches found
No related tags found
2 merge requests!19Move linux-debian11 into main,!1Resolve "First draft for user interface for top level install command"
.vscode
\ No newline at end of file
......@@ -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}")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment