User interface for top level install command

/opt_mpsd/linux-debian11$ ./install-mpsd-software-environment.py 

-> show help or show to ask for help (--help / -h)

Prepare installation of MPSD software environments

/opt_mpsd/linux-debian11$ ./install-software-environment.py --release dev-23a
/opt_mpsd/linux-debian11$ ./install-software-environment.py --release 23a
/opt_mpsd/linux-debian11$ ./install-software-environment.py --release 23b

The first command would create the dev-23a subdirectory; clone the spack environments in there (dev-23a/spack-environments) and checkout branch dev-23a in dev-23a/spack-environments repo.

Install selected or all toolchains

/opt_mpsd/linux-debian11$ ./install-software-environment.py --release dev-23a --install foss2021a foss2021a-mpi
/opt_mpsd/linux-debian11$ ./install-software-environment.py --release 23a --install ALL 

What to do if a directory exists already?

Generally desirable if calling the script multiple times is possible: not interfering (and skipping) existing directories: if 23a/foss2021a exists already, we assume it is correctly installed and skip it.

We probably could do with a flag like --force-reinstall which deletes an existing toolchain directory and re-executes the installation of that toolchain.

Possible additional features for development

Use a target directory name that deviates from the release name

/opt_mpsd/linux-debian11$ ./install-software-environment.py --release dev-23a --target-directory ashwins-playground/dev-23a
/opt_mpsd/linux-debian11$ ./install-software-environment.py --release dev-23a --target-directory /tmp/ashwins-playground2
/opt_mpsd/linux-debian11$ ./install-software-environment.py --release dev-23a --target-directory /tmp/ashwins-playground2 --install generic

After execution of line 1, we expect:

/opt_mpsd/linux-debian11$ ls ashwins-playground/dev-23a
spack-environments

After execution of line 3, we expect:

/opt_mpsd/linux-debian11$ tree --without-tree ashwins-playground/dev-23a
spack-environments
sandybridge/spack
sandybridge/lmod

Removing an existing toolchain

/opt_mpsd/linux-debian11$ ./install-software-environment.py --release dev-23a --remove foss2021a 

Remove a single toolchain. Needs to remove the environment from the spack instance, and uninstall the packages from that environment (so spack actually deletes them), and updating of the modules files.

Should not be needed in production but is likely to be useful in development.

Starting an new software environment version

/opt_mpsd/linux-debian11$ ./install-software-environment.py --set-up dev-23b --from 23a

Prepares creating a new spack-environments branch based on an old one (in subdirectory of the same name). The use case here is to start work on a new release (such as dev-23b) based on an old one (23a). This ensures consistent naming of directories and branches, and documents what steps need to be taken to prepare a new release.

Logging

The install-software-environment.py should create an argument log file that records at what date and time the script was called, and with what arguments, for example logs/install-software-environment.log.

2023-02-29T23:32:01, COMMIT, install-software-environment.py --release dev-23a --install ALL
2023-04-23T09:32:01, COMMIT, install-software-environment.py --release 23a --install ALL

where the COMMIT is the commit of the mpsd-software-environments.

Logfiles should be gathered in a logs folder (i.e. /opt_mpsd/linux-debian11/logs).

Additional information should be logged in a separate log file, perhaps even one per call or toolchain (file name could DATE-TIME.log, such as 2023-04-23T09:32:01.log.

Edited by Hans Fangohr