runnable 0.21.0__tar.gz → 0.22.0__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {runnable-0.21.0 → runnable-0.22.0}/PKG-INFO +1 -1
- {runnable-0.21.0 → runnable-0.22.0}/extensions/pipeline_executor/argo.py +27 -1
- {runnable-0.21.0 → runnable-0.22.0}/pyproject.toml +1 -1
- {runnable-0.21.0 → runnable-0.22.0}/runnable/utils.py +10 -2
- {runnable-0.21.0 → runnable-0.22.0}/.gitignore +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/LICENSE +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/README.md +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/README.md +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/__init__.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/catalog/README.md +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/catalog/file_system.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/catalog/pyproject.toml +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/job_executor/README.md +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/job_executor/__init__.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/job_executor/k8s.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/job_executor/k8s_job_spec.yaml +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/job_executor/local.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/job_executor/local_container.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/job_executor/pyproject.toml +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/nodes/README.md +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/nodes/nodes.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/nodes/pyproject.toml +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/pipeline_executor/README.md +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/pipeline_executor/__init__.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/pipeline_executor/local.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/pipeline_executor/local_container.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/pipeline_executor/mocked.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/pipeline_executor/pyproject.toml +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/pipeline_executor/retry.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/run_log_store/README.md +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/run_log_store/__init__.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/run_log_store/chunked_fs.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/run_log_store/db/implementation_FF.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/run_log_store/db/integration_FF.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/run_log_store/file_system.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/run_log_store/generic_chunked.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/run_log_store/pyproject.toml +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/secrets/README.md +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/secrets/dotenv.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/extensions/secrets/pyproject.toml +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/runnable/__init__.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/runnable/catalog.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/runnable/cli.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/runnable/context.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/runnable/datastore.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/runnable/defaults.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/runnable/entrypoints.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/runnable/exceptions.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/runnable/executor.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/runnable/graph.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/runnable/names.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/runnable/nodes.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/runnable/parameters.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/runnable/pickler.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/runnable/sdk.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/runnable/secrets.py +0 -0
- {runnable-0.21.0 → runnable-0.22.0}/runnable/tasks.py +0 -0
@@ -244,6 +244,7 @@ class TemplateDefaults(BaseModelWIthConfig):
|
|
244
244
|
image: str
|
245
245
|
image_pull_policy: Optional[ImagePullPolicy] = Field(default=ImagePullPolicy.Always)
|
246
246
|
resources: Resources = Field(default_factory=Resources)
|
247
|
+
env: list[EnvVar | SecretEnvVar] = Field(default_factory=list, exclude=True)
|
247
248
|
|
248
249
|
|
249
250
|
# User provides this as part of the argoSpec
|
@@ -365,6 +366,7 @@ class ArgoExecutor(GenericPipelineExecutor):
|
|
365
366
|
custom_volumes: Optional[list[CustomVolume]] = Field(
|
366
367
|
default_factory=list[CustomVolume]
|
367
368
|
)
|
369
|
+
env: list[EnvVar] = Field(default_factory=list[EnvVar])
|
368
370
|
|
369
371
|
expose_parameters_as_inputs: bool = True
|
370
372
|
secret_from_k8s: Optional[str] = Field(default=None)
|
@@ -508,6 +510,10 @@ class ArgoExecutor(GenericPipelineExecutor):
|
|
508
510
|
)
|
509
511
|
|
510
512
|
self._set_up_initial_container(container_template=core_container_template)
|
513
|
+
self._expose_secrets_to_task(
|
514
|
+
working_on=node, container_template=core_container_template
|
515
|
+
)
|
516
|
+
self._set_env_vars_to_task(node, core_container_template)
|
511
517
|
|
512
518
|
container_template = ContainerTemplate(
|
513
519
|
container=core_container_template,
|
@@ -523,12 +529,32 @@ class ArgoExecutor(GenericPipelineExecutor):
|
|
523
529
|
|
524
530
|
return container_template
|
525
531
|
|
532
|
+
def _set_env_vars_to_task(
|
533
|
+
self, working_on: BaseNode, container_template: CoreContainerTemplate
|
534
|
+
):
|
535
|
+
if not isinstance(working_on, TaskNode):
|
536
|
+
return
|
537
|
+
global_envs: dict[str, str] = {}
|
538
|
+
|
539
|
+
for env_var in self.env:
|
540
|
+
global_envs[env_var.name] = env_var.value
|
541
|
+
|
542
|
+
node_overide = {}
|
543
|
+
if hasattr(working_on, "overides"):
|
544
|
+
node_overide = working_on.overides
|
545
|
+
|
546
|
+
global_envs.update(node_overide.get("env", {}))
|
547
|
+
for key, value in global_envs.items():
|
548
|
+
env_var_to_add = EnvVar(name=key, value=value)
|
549
|
+
container_template.env.append(env_var_to_add)
|
550
|
+
|
526
551
|
def _expose_secrets_to_task(
|
527
552
|
self,
|
528
553
|
working_on: BaseNode,
|
529
554
|
container_template: CoreContainerTemplate,
|
530
555
|
):
|
531
|
-
|
556
|
+
if not isinstance(working_on, TaskNode):
|
557
|
+
return
|
532
558
|
secrets = working_on.executable.secrets
|
533
559
|
for secret in secrets:
|
534
560
|
assert self.secret_from_k8s is not None
|
@@ -109,8 +109,16 @@ def apply_variables(
|
|
109
109
|
raise Exception("Argument Variables should be dict")
|
110
110
|
|
111
111
|
json_d = json.dumps(apply_to)
|
112
|
-
|
113
|
-
|
112
|
+
string_template = str_template(json_d)
|
113
|
+
|
114
|
+
template = string_template.safe_substitute(variables)
|
115
|
+
|
116
|
+
if "$" in template:
|
117
|
+
logger.warning(
|
118
|
+
"Not all variables found in the config are found in the variables"
|
119
|
+
)
|
120
|
+
|
121
|
+
return json.loads(template)
|
114
122
|
|
115
123
|
|
116
124
|
def get_module_and_attr_names(command: str) -> Tuple[str, str]:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|