diff --git a/metaflow/metaflow_config.py b/metaflow/metaflow_config.py index bb42e0f5e3c..a1063f7e8d3 100644 --- a/metaflow/metaflow_config.py +++ b/metaflow/metaflow_config.py @@ -546,7 +546,7 @@ # Feature flag (experimental features that are *explicitly* unsupported) # Process configs even when using the click_api for Runner/Deployer -CLICK_API_PROCESS_CONFIG = from_conf("CLICK_API_PROCESS_CONFIG", False) +CLICK_API_PROCESS_CONFIG = from_conf("CLICK_API_PROCESS_CONFIG", True) # PINNED_CONDA_LIBS are the libraries that metaflow depends on for execution diff --git a/metaflow/runner/click_api.py b/metaflow/runner/click_api.py index bda7ddb0157..e86d7b0a0ad 100644 --- a/metaflow/runner/click_api.py +++ b/metaflow/runner/click_api.py @@ -474,11 +474,22 @@ def _compute_flow_parameters(self): ds = opts.get("datastore", defaults["datastore"]) quiet = opts.get("quiet", defaults["quiet"]) + + # Check for environment variables first + is_default = False config_file = opts.get("config") if config_file is None: - is_default = True - config_file = defaults.get("config") + # Check if it was set through an environment variable -- we + # don't have click process them here so we need to "fake" it. + env_config_file = os.environ.get("METAFLOW_FLOW_CONFIG") + if env_config_file: + # Convert dict items to list of tuples + config_file = list(json.loads(env_config_file).items()) + is_default = False + else: + is_default = True + config_file = defaults.get("config") if config_file: config_file = dict( @@ -494,8 +505,19 @@ def _compute_flow_parameters(self): is_default = False config_value = opts.get("config-value") if config_value is None: - is_default = True - config_value = defaults.get("config_value") + env_config_value = os.environ.get("METAFLOW_FLOW_CONFIG_VALUE") + if env_config_value: + # Parse environment variable using MultipleTuple logic + loaded = json.loads(env_config_value) + # Convert dict items to list of tuples with JSON-serialized values + config_value = [ + (k, json.dumps(v) if not isinstance(v, str) else v) + for k, v in loaded.items() + ] + is_default = False + else: + is_default = True + config_value = defaults.get("config_value") if config_value: config_value = dict(