Skip to content

Commit

Permalink
Merge pull request #283 from zillow/tz/AIP-7562-sanitized-workflow-name
Browse files Browse the repository at this point in the history
sanitize_k8s_name workflow template name
  • Loading branch information
talebzeghmi authored Feb 2, 2024
2 parents 90630f1 + 92f5fc4 commit d00ae83
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions metaflow/plugins/aip/aip.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,17 +496,18 @@ def write_workflow_kind(
recurring_run_policy: Optional[str] = None,
max_run_concurrency: Optional[int] = 10,
) -> str:
sanitized_name = sanitize_k8s_name(name if name else self.name)
if kind in ["Workflow", "WorkflowTemplate"]:
workflow: Dict[str, Any] = self._create_workflow_yaml(
flow_parameters,
kind,
max_run_concurrency,
name,
sanitized_name,
)
kfp.compiler.Compiler()._write_workflow(workflow, output_path)
elif kind == "CronWorkflow":
cron_workflow: Dict[str, Any] = KubeflowPipelines._cron_workflow(
sanitize_k8s_name(name if name else self.name),
sanitized_name,
flow_parameters=flow_parameters,
schedule=recurring_run_cron,
concurrency=recurring_run_policy,
Expand All @@ -516,7 +517,7 @@ def write_workflow_kind(
yaml.safe_dump(cron_workflow, yaml_file, default_flow_style=False)
elif kind == "ConfigMap":
config_map = KubeflowPipelines._config_map(
sanitize_k8s_name(name if name else self.name), max_run_concurrency
sanitized_name, max_run_concurrency
)
with open(output_path, "w") as yaml_file:
yaml.safe_dump(config_map, yaml_file, default_flow_style=False)
Expand Down

0 comments on commit d00ae83

Please sign in to comment.