Skip to content
Snippets Groups Projects
Commit 8752f8fd authored by Philipp Spilger's avatar Philipp Spilger Committed by Eric Müller
Browse files

feat: Add stages to yashchiki script

Change-Id: Idfeabac17d39bc351c845c002681d7e7f9e7286f
parent 71c4f47a
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,8 @@ parser = argparse.ArgumentParser(
to OUTPUT.
"""))
all_stages=["fetch", "build-base", "build-spack", "image"]
all_styles = list(os.listdir(os.path.dirname(os.path.realpath(__file__)) + "/../share/yashchiki/styles/"))
# mandatory
......@@ -67,6 +69,9 @@ parser.add_argument(
parser.add_argument(
"--update-build-cache", action="store_true",
help="Update build cache.")
parser.add_argument(
"--stages", type=str, nargs="+", choices=all_stages, default=all_stages,
help="Stages of build to perform.")
# optional with persistent default
parser.add_argument(
"--caches-dir", type=pathlib.Path,
......@@ -179,6 +184,22 @@ env.update({
"YASHCHIKI_JOBS": str(args.jobs),
})
if "fetch" in args.stages:
env.update({"YASHCHIKI_ENABLE_STAGE_FETCH": "1"})
if "build-base" in args.stages:
env.update({"YASHCHIKI_ENABLE_STAGE_BUILD_BASE": "1"})
if "build-spack" in args.stages:
env.update({"YASHCHIKI_ENABLE_STAGE_BUILD_SPACK": "1"})
if "image" in args.stages:
env.update({"YASHCHIKI_ENABLE_STAGE_IMAGE": "1"})
if args.stages != all_stages:
if not pathlib.Path(args.sandboxes_dir, args.style).exists():
raise RuntimeError("Using yashchiki with incomplete set of stages is only possible for using an existing sandbox.")
if args.build_cache_on_failure_name:
env.update({"YASHCHIKI_BUILD_CACHE_ON_FAILURE_NAME": args.build_cache_on_failure_name})
......
......@@ -6,6 +6,11 @@ shopt -s inherit_errexit
SOURCE_DIR="$(dirname "$(readlink -m "${BASH_SOURCE[0]}")")"
source "${SOURCE_DIR}/commons.sh"
if [ -z "${YASHCHIKI_ENABLE_STAGE_FETCH:-}" ]; then
echo "Skipping stage fetch."
exit 0
fi
# temporary spack config scope directory for fetching
tmp_config_scope=("$(mktemp -d)")
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment