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

add required interface

parent ef654f1d
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"
......@@ -4,7 +4,13 @@ import subprocess
import time
import argparse
about_tool="""
Build toolchains using Spack.
This function builds toolchains for toolchains at the appropriate directory for the current system architecture
and MPSD software stack version.
The toolchains are built using the bash script spack_setup.sh, and the results are logged.
"""
# Helper class to change directory via context manager
class os_chdir:
def __init__(self, new_dir):
......@@ -25,13 +31,7 @@ def build_toolchains(
skip_build_cache=False,
skip_dir_check=False,
):
"""
Build toolchains using Spack.
This function builds toolchains for toolchains at the appropriate directory for the current system architecture
and MPSD software stack version.
The toolchains are built using the bash script spack_setup.sh, and the results are logged.
"""
mpsd_os = os.environ["MPSD_OS"]
mpsd_microarch = os.environ["MPSD_MICROARCH"]
current_branch = (
......@@ -103,3 +103,43 @@ def build_toolchains(
)
# copy the octopus configs to the toolchain directory
# subprocess.run(f"cp -r {current_dir}/octopus
def main():
parser = argparse.ArgumentParser(description=about_tool)
parser.add_argument('--release', type=str, required=True,
help='Specify the release version to install')
parser.add_argument('--target-directory', type=str,
help='Specify the target directory for installation (use DEFAULT to use /opt_mpsd/<MPSD_OS>/<MPSD_RELEASE>/<MPSD_MICROARCH)')
parser.add_argument('--install', nargs='+',
help='Specify toolchain(s) to install eg foss2021a-mpi (use ALL to install all available toolchains)')
parser.add_argument('--remove', type=str,
help='Specify toolchain to remove')
parser.add_argument('--set-up', type=str,
help='Start a new software environment version, must specify --from <release>')
parser.add_argument('--from', dest='from_release', type=str,
help='Specify the release version to start from')
parser.add_argument('--force-reinstall', action='store_true',
help='Delete and reinstall an existing toolchain directory')
parser.add_argument('--skip-build-cache', action='store_true',
help='Skip Spack build cache during installation')
parser.add_argument('--skip-dir-check', action='store_true',
help='Skip checking if the target directory already exists')
args = parser.parse_args()
if args.remove:
remove_toolchain(args.release, args.remove)
elif args.set_up:
start_new_env(args.set_up, args.from_release)
else:
target_dir = args.target_directory
if args.install:
install_toolchains(args.release, args.install, target_dir, args.force_reinstall,
args.skip_build_cache, args.skip_dir_check)
else:
prepare_env(args.release, target_dir)
if __name__ == "__main__":
main()
\ No newline at end of file
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