Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion metaflow/runner/deployer_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ class variable that matches the name of the CLI group.
directory is used.
file_read_timeout : int, default 3600
The timeout until which we try to read the deployer attribute file (in seconds).
extend_existing_env : bool, default True
If True, the environment variables from the current process are extended
with the ones specified in `env`. If False, the environment variables
specified in `env` will be used as the only environment variables
**kwargs : Any
Additional arguments that you would pass to `python myflow.py` before
the deployment command.
Expand All @@ -55,6 +59,7 @@ def __init__(
env: Optional[Dict] = None,
cwd: Optional[str] = None,
file_read_timeout: int = 3600,
extend_existing_env: bool = True,
**kwargs
):
if self.TYPE is None:
Expand Down Expand Up @@ -88,7 +93,7 @@ def __init__(
self.cwd = cwd or os.getcwd()
self.file_read_timeout = file_read_timeout

self.env_vars = os.environ.copy()
self.env_vars = os.environ.copy() if extend_existing_env else {}
self.env_vars.update(self.env or {})
if self.profile:
self.env_vars["METAFLOW_PROFILE"] = profile
Expand Down
8 changes: 6 additions & 2 deletions metaflow/runner/metaflow_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ class Runner(metaclass=RunnerMeta):
directory is used.
file_read_timeout : int, default 3600
The timeout until which we try to read the runner attribute file (in seconds).
extend_existing_env : bool, default True
If True, the environment variables from the current process are extended
with the ones specified in `env`. If False, the environment variables
specified in `env` will be used as the only environment variables
**kwargs : Any
Additional arguments that you would pass to `python myflow.py` before
the `run` command.
Expand All @@ -275,6 +279,7 @@ def __init__(
env: Optional[Dict[str, str]] = None,
cwd: Optional[str] = None,
file_read_timeout: int = 3600,
extend_existing_env: bool = True,
**kwargs
):
# these imports are required here and not at the top
Expand Down Expand Up @@ -311,8 +316,7 @@ def __init__(
self.flow_file = flow_file

self.show_output = show_output

self.env_vars = os.environ.copy()
self.env_vars = os.environ.copy() if extend_existing_env else {}
self.env_vars.update(env or {})
if profile:
self.env_vars["METAFLOW_PROFILE"] = profile
Expand Down
Loading