Skip to content
Snippets Groups Projects
Commit 511c4d0f authored by Philipp Spilger's avatar Philipp Spilger
Browse files

feat: Add style-wise yaml-based configuration lookup

Change-Id: I4b070a419600cc2d64b1ba0e0dcfdcda1c895c01
parent 920befac
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ import pathlib ...@@ -6,6 +6,7 @@ import pathlib
import subprocess import subprocess
import tempfile import tempfile
import textwrap import textwrap
import yaml
from typing import Optional from typing import Optional
...@@ -136,18 +137,22 @@ paths = [ ...@@ -136,18 +137,22 @@ paths = [
for path_to_check in paths: for path_to_check in paths:
check_no_globbing(path_to_check) check_no_globbing(path_to_check)
config = None
with open(os.path.join("share", "yashchiki", "styles", args.style, "config.yaml")) as config_file:
config = yaml.safe_load(config_file)
# collection of environment variables used to configure the shell scripts' # collection of environment variables used to configure the shell scripts'
# behavior # behavior
env = { env = {
"DOCKER_BASE_IMAGE": "debian:bullseye" if args.style == "visionary" else "centos:7", "DOCKER_BASE_IMAGE": config["docker_base_image"],
# This needs to be here because otherwise the default python # This needs to be here because otherwise the default python
# (2.7.18) will pollute the spec and lead to a conflict # (2.7.18) will pollute the spec and lead to a conflict
# can be removed as soon as the explicit preferred version # can be removed as soon as the explicit preferred version
# is dropped # is dropped
"DEPENDENCY_PYTHON": "python@3." + ("8.2" if args.style == "visionary" else "6.8"), "DEPENDENCY_PYTHON": "python@" + config["dependency_python"],
"YASHCHIKI_BUILD_SPACK_GCC": "1" if args.style == "visionary" else "0", "YASHCHIKI_BUILD_SPACK_GCC": str(int(config["spack_gcc"]["build"])),
"YASHCHIKI_SPACK_GCC_VERSION": "11.2.0" if args.style == "visionary" else "4.8.5", "YASHCHIKI_SPACK_GCC_VERSION": config["spack_gcc"]["version"],
"YASHCHIKI_SPACK_GCC": "gcc@11.2.0" if args.style == "visionary" else "gcc@4.8.5", "YASHCHIKI_SPACK_GCC": "gcc@" + config["spack_gcc"]["version"],
"WORKSPACE": os.getcwd(), # FIXME: should not be required "WORKSPACE": os.getcwd(), # FIXME: should not be required
"CONTAINER_STYLE": args.style, "CONTAINER_STYLE": args.style,
"CONTAINER_BUILD_TYPE": "testing", # FIXME: should not be required "CONTAINER_BUILD_TYPE": "testing", # FIXME: should not be required
......
docker_base_image: "centos:7"
dependency_python: "3.8.3"
spack_gcc:
build: false
version: "4.8.5"
docker_base_image: "debian:bullseye"
dependency_python: "3.8.2"
spack_gcc:
# Whether to build the specified gcc via spack or assume existance.
build: true
# Version to use as compiler for spack build.
version: "11.2.0"
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