Skip to content

Commit

Permalink
fix(sdk) sanitize paths in artifact_items. Fixes kubeflow#738 (kubefl…
Browse files Browse the repository at this point in the history
…ow#739)

* sanitize paths in artifact_items

* update tests
Udiknedormin authored Sep 27, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 4185284 commit a968417
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sdk/python/kfp_tekton/compiler/_op_to_template.py
Original file line number Diff line number Diff line change
@@ -613,6 +613,6 @@ def _op_to_template(op: BaseOp,
# Update actifact item location to the latest stage in order to properly track and store all the artifacts.
for i, artifact in enumerate(artifact_items[op.name]):
if artifact[0] not in verified_result_size_map[step_counter].keys():
artifact[1] = '%s%s' % (TEKTON_HOME_RESULT_PATH, artifact[0])
artifact[1] = '%s%s' % (TEKTON_HOME_RESULT_PATH, sanitize_k8s_name(artifact[0]))
artifact_items[op.name][i] = artifact
return template
2 changes: 1 addition & 1 deletion sdk/python/tests/compiler/testdata/many_results.yaml
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ metadata:
tekton.dev/artifact_endpoint: minio-service.kubeflow:9000
tekton.dev/artifact_endpoint_scheme: http://
tekton.dev/artifact_items: '{"print": [], "print4results": [["param1", "/tekton/home/tep-results/param1"],
["param2A", "$(results.param2a.path)"], ["param3_b", "/tekton/home/tep-results/param3_b"],
["param2A", "$(results.param2a.path)"], ["param3_b", "/tekton/home/tep-results/param3-b"],
["param4c", "$(results.param4c.path)"]]}'
sidecar.istio.io/inject: "false"
pipelines.kubeflow.org/pipeline_spec: '{"description": "A pipeline that produce
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ metadata:
tekton.dev/artifact_endpoint: minio-service.kubeflow:9000
tekton.dev/artifact_endpoint_scheme: http://
tekton.dev/artifact_items: '{"print": [], "print4results": [["param1", "/tekton/home/tep-results/param1"],
["param2A", "$(results.param2a.path)"], ["param3_b", "/tekton/home/tep-results/param3_b"],
["param2A", "$(results.param2a.path)"], ["param3_b", "/tekton/home/tep-results/param3-b"],
["param4c", "$(results.param4c.path)"]]}'
sidecar.istio.io/inject: "false"
pipelines.kubeflow.org/pipeline_spec: '{"description": "A pipeline that produce

0 comments on commit a968417

Please sign in to comment.