diff --git a/frameworks/autosklearn/setup.sh b/frameworks/autosklearn/setup.sh index f0099c3e3..63edcf04f 100755 --- a/frameworks/autosklearn/setup.sh +++ b/frameworks/autosklearn/setup.sh @@ -36,6 +36,7 @@ else git clone --recurse-submodules --shallow-submodules ${DEPTH} ${REPO} ${TARGET_DIR} cd ${TARGET_DIR} git checkout "${COMMIT}" + git submodule update --init --recursive cd ${HERE} PIP install -U -e ${TARGET_DIR} fi diff --git a/frameworks/shared/caller.py b/frameworks/shared/caller.py index ee60b42d4..2c82148e5 100644 --- a/frameworks/shared/caller.py +++ b/frameworks/shared/caller.py @@ -3,7 +3,7 @@ import os import re from tempfile import TemporaryDirectory, mktemp -from typing import Optional, Union +from typing import List, Optional, Union import numpy as np @@ -82,7 +82,8 @@ def run_in_venv(caller_file, script_file: str, *args, input_data: Union[dict, ns], dataset: Dataset, config: TaskConfig, options: Union[None, dict, ns] = None, process_results=None, - python_exec=None): + python_exec=None, + retained_env_vars: Optional[List[str]] = ['TMP', 'TEMP', 'TMPDIR']): here = dir_of(caller_file) if python_exec is None: # use local virtual env by default python_exec = venv_python_exec(here) @@ -93,6 +94,13 @@ def run_in_venv(caller_file, script_file: str, *args, ser_config = options['serialization'] env = options['env'] or ns() + # Add any env variables specified if they are defined in the environment + if retained_env_vars: + for env_var in retained_env_vars: + env_val = os.environ.get(env_var) + if env_val is not None: + env[env_var] = env_val + with TemporaryDirectory() as tmpdir: ds = _make_input_dataset(input_data, dataset, tmpdir, serialization=ser_config)