"build_log_file":f"build_toolchains_mpsd_spack_ver_{time.strftime('%Y%m%d-%H%M%S')}.log",# TODO: modify toolchains,mpsd_spack_ver when the variable is available
"build_log_file":f"build_toolchains_mpsd_spack_ver_{time.strftime('%Y%m%d-%H%M%S')}.log",# TODO: modify toolchains,mpsd_spack_ver when the variable is available
('prepare','Prepare the environment for installation on the disk'),
("prepare","Prepare the environment for installation on the disk"),
('install','Install a software environment'),
("install","Install a software environment"),
('reinstall','Reinstall a software environment'),
("reinstall","Reinstall a software environment"),
('remove','Remove a software environment or toolchains from an environment'),
("remove","Remove a software environment or toolchains from an environment"),
('start-new','Start a new software environment version')
("start-new","Start a new software environment version"),
]
]
forcmd,help_textinlist_of_cmds:
forcmd,help_textinlist_of_cmds:
subp=subparsers.add_parser(cmd,help=help_text)
subp=subparsers.add_parser(cmd,help=help_text)
ifcmd=='start-new':
ifcmd=="start-new":
subp.add_argument('--from-release',dest='from_release',type=str,required=True,help='Release version to start from')
subp.add_argument(
subp.add_argument('--to-release',dest='to_release',type=str,required=True,help='Release version to create')
"--from-release",
dest="from_release",
type=str,
required=True,
help="Release version to start from",
)
subp.add_argument(
"--to-release",
dest="to_release",
type=str,
required=True,
help="Release version to create",
)
else:
else:
subp.add_argument('release',type=str,help='Release version to install or remove')
subp.add_argument(
ifcmdin['install','reinstall']:
"release",type=str,help="Release version to install or remove"
subp.add_argument('--toolchains',type=str,nargs='*',default='ALL',help='List of toolchains to install (use ALL to install all toolchains)')
)
subp.add_argument('--enable-build-cache',action='store_true',help='Enable Spack build cache. Useful for reinstallation but consumes time and disk space')
ifcmdin["install","reinstall"]:
subp.add_argument(
"--toolchains",
type=str,
nargs="*",
default="ALL",
help="List of toolchains to install (use ALL to install all toolchains)",
)
subp.add_argument(
"--enable-build-cache",
action="store_true",
help="Enable Spack build cache. Useful for reinstallation but consumes time and disk space",
)
# Carry out the action
# Carry out the action
args=parser.parse_args()
args=parser.parse_args()
# target dir is the place where this script exists. the release `dev` in script_dir/dev-23a
# target dir is the place where this script exists. the release `dev` in script_dir/dev-23a