Skip to content

Commit

Permalink
Merge pull request #313 from tarilabs/tarilabs-20230901-pipelineimage…
Browse files Browse the repository at this point in the history
…alignment

align example pipeline yaml images
  • Loading branch information
openshift-merge-robot authored Sep 7, 2023
2 parents e10c33f + ace1992 commit 5b756cf
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Dockerfile.cross
*.code-workspace
*.vscode

.DS_Store

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
13 changes: 9 additions & 4 deletions docs/example_pipelines/condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ def print_msg(msg: str):


flip_coin_op = components.create_component_from_func(
flip_coin, base_image='quay.io/hukhan/python:alpine3.6')
flip_coin, base_image='registry.access.redhat.com/ubi8/python-39')
print_op = components.create_component_from_func(
print_msg, base_image='quay.io/hukhan/python:alpine3.6')
print_msg, base_image='registry.access.redhat.com/ubi8/python-39')
random_num_op = components.create_component_from_func(
random_num, base_image='quay.io/hukhan/python:alpine3.6')
random_num, base_image='registry.access.redhat.com/ubi8/python-39')


@dsl.pipeline(
Expand All @@ -54,4 +54,9 @@ def flipcoin_pipeline():

if __name__ == '__main__':
from kfp_tekton.compiler import TektonCompiler
TektonCompiler().compile(flipcoin_pipeline, __file__.replace('.py', '.yaml'))
from kfp_tekton.compiler.pipeline_utils import TektonPipelineConf
config = TektonPipelineConf()
config.set_condition_image_name("registry.access.redhat.com/ubi8/python-39")
compiler = TektonCompiler()
compiler._set_pipeline_conf(config)
compiler.compile(flipcoin_pipeline, __file__.replace('.py', '.yaml'))
40 changes: 20 additions & 20 deletions docs/example_pipelines/condition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ spec:
pass
with open(output_file, 'w') as f:
f.write(_output_serializers[idx](_outputs[idx]))
image: quay.io/hukhan/python:alpine3.6
image: registry.access.redhat.com/ubi8/python-39
results:
- name: Output
type: string
Expand All @@ -91,7 +91,7 @@ spec:
pipelines.kubeflow.org/cache_enabled: "true"
annotations:
pipelines.kubeflow.org/component_spec_digest: '{"name": "Flip coin", "outputs":
[{"name": "Output", "type": "String"}], "version": "Flip coin@sha256=2895da7ed0b52f45e6d6a4d8837e4c1ee4ba99e14e5877320155243c67e4610e"}'
[{"name": "Output", "type": "String"}], "version": "Flip coin@sha256=32d5bd05b9fa18850505b73d6fb8489cc61f83033306230c8e4da12bdd8890e0"}'
- name: random-num
taskSpec:
steps:
Expand Down Expand Up @@ -151,7 +151,7 @@ spec:
pass
with open(output_file, 'w') as f:
f.write(_output_serializers[idx](_outputs[idx]))
image: quay.io/hukhan/python:alpine3.6
image: registry.access.redhat.com/ubi8/python-39
results:
- name: Output
type: string
Expand All @@ -162,7 +162,7 @@ spec:
annotations:
pipelines.kubeflow.org/component_spec_digest: '{"name": "Random num",
"outputs": [{"name": "Output", "type": "Integer"}], "version": "Random
num@sha256=28d899c9492aeb0e45072bedfa35313fbe788233de0fc7a14a81ff8ee071d627"}'
num@sha256=053403c9d093bbdb07a6da42e22012e69fa5132e38cc179dae5f3a629543650c"}'
when:
- input: $(tasks.condition-1.results.outcome)
operator: in
Expand Down Expand Up @@ -196,15 +196,15 @@ spec:
_parsed_args = vars(_parser.parse_args())
_outputs = print_msg(**_parsed_args)
image: quay.io/hukhan/python:alpine3.6
image: registry.access.redhat.com/ubi8/python-39
params:
- name: random-num-Output
metadata:
labels:
pipelines.kubeflow.org/cache_enabled: "true"
annotations:
pipelines.kubeflow.org/component_spec_digest: '{"name": "Print msg", "outputs":
[], "version": "Print msg@sha256=c8484b77b0a3f045a812bd6b570ef17df03d4fde0ef50480243561a339f7b024"}'
[], "version": "Print msg@sha256=1d475b025fa0e9910c3c2827a8280bb0fb85abeba446658a944570e1de7f0f98"}'
when:
- input: $(tasks.condition-2.results.outcome)
operator: in
Expand Down Expand Up @@ -238,15 +238,15 @@ spec:
_parsed_args = vars(_parser.parse_args())
_outputs = print_msg(**_parsed_args)
image: quay.io/hukhan/python:alpine3.6
image: registry.access.redhat.com/ubi8/python-39
params:
- name: random-num-Output
metadata:
labels:
pipelines.kubeflow.org/cache_enabled: "true"
annotations:
pipelines.kubeflow.org/component_spec_digest: '{"name": "Print msg", "outputs":
[], "version": "Print msg@sha256=c8484b77b0a3f045a812bd6b570ef17df03d4fde0ef50480243561a339f7b024"}'
[], "version": "Print msg@sha256=1d475b025fa0e9910c3c2827a8280bb0fb85abeba446658a944570e1de7f0f98"}'
when:
- input: $(tasks.condition-3.results.outcome)
operator: in
Expand Down Expand Up @@ -311,7 +311,7 @@ spec:
pass
with open(output_file, 'w') as f:
f.write(_output_serializers[idx](_outputs[idx]))
image: quay.io/hukhan/python:alpine3.6
image: registry.access.redhat.com/ubi8/python-39
results:
- name: Output
type: string
Expand All @@ -322,7 +322,7 @@ spec:
annotations:
pipelines.kubeflow.org/component_spec_digest: '{"name": "Random num",
"outputs": [{"name": "Output", "type": "Integer"}], "version": "Random
num@sha256=28d899c9492aeb0e45072bedfa35313fbe788233de0fc7a14a81ff8ee071d627"}'
num@sha256=053403c9d093bbdb07a6da42e22012e69fa5132e38cc179dae5f3a629543650c"}'
when:
- input: $(tasks.condition-4.results.outcome)
operator: in
Expand Down Expand Up @@ -356,15 +356,15 @@ spec:
_parsed_args = vars(_parser.parse_args())
_outputs = print_msg(**_parsed_args)
image: quay.io/hukhan/python:alpine3.6
image: registry.access.redhat.com/ubi8/python-39
params:
- name: random-num-2-Output
metadata:
labels:
pipelines.kubeflow.org/cache_enabled: "true"
annotations:
pipelines.kubeflow.org/component_spec_digest: '{"name": "Print msg", "outputs":
[], "version": "Print msg@sha256=c8484b77b0a3f045a812bd6b570ef17df03d4fde0ef50480243561a339f7b024"}'
[], "version": "Print msg@sha256=1d475b025fa0e9910c3c2827a8280bb0fb85abeba446658a944570e1de7f0f98"}'
when:
- input: $(tasks.condition-5.results.outcome)
operator: in
Expand Down Expand Up @@ -398,15 +398,15 @@ spec:
_parsed_args = vars(_parser.parse_args())
_outputs = print_msg(**_parsed_args)
image: quay.io/hukhan/python:alpine3.6
image: registry.access.redhat.com/ubi8/python-39
params:
- name: random-num-2-Output
metadata:
labels:
pipelines.kubeflow.org/cache_enabled: "true"
annotations:
pipelines.kubeflow.org/component_spec_digest: '{"name": "Print msg", "outputs":
[], "version": "Print msg@sha256=c8484b77b0a3f045a812bd6b570ef17df03d4fde0ef50480243561a339f7b024"}'
[], "version": "Print msg@sha256=1d475b025fa0e9910c3c2827a8280bb0fb85abeba446658a944570e1de7f0f98"}'
when:
- input: $(tasks.condition-6.results.outcome)
operator: in
Expand Down Expand Up @@ -452,7 +452,7 @@ spec:
f.close()
- $(inputs.params.operand1)
- $(inputs.params.operand2)
image: python:alpine3.6
image: registry.access.redhat.com/ubi8/python-39
- name: condition-2
params:
- name: operand1
Expand Down Expand Up @@ -493,7 +493,7 @@ spec:
f.close()
- $(inputs.params.operand1)
- $(inputs.params.operand2)
image: python:alpine3.6
image: registry.access.redhat.com/ubi8/python-39
when:
- input: $(tasks.condition-1.results.outcome)
operator: in
Expand Down Expand Up @@ -539,7 +539,7 @@ spec:
f.close()
- $(inputs.params.operand1)
- $(inputs.params.operand2)
image: python:alpine3.6
image: registry.access.redhat.com/ubi8/python-39
when:
- input: $(tasks.condition-1.results.outcome)
operator: in
Expand Down Expand Up @@ -585,7 +585,7 @@ spec:
f.close()
- $(inputs.params.operand1)
- $(inputs.params.operand2)
image: python:alpine3.6
image: registry.access.redhat.com/ubi8/python-39
- name: condition-5
params:
- name: operand1
Expand Down Expand Up @@ -626,7 +626,7 @@ spec:
f.close()
- $(inputs.params.operand1)
- $(inputs.params.operand2)
image: python:alpine3.6
image: registry.access.redhat.com/ubi8/python-39
when:
- input: $(tasks.condition-4.results.outcome)
operator: in
Expand Down Expand Up @@ -672,7 +672,7 @@ spec:
f.close()
- $(inputs.params.operand1)
- $(inputs.params.operand2)
image: python:alpine3.6
image: registry.access.redhat.com/ubi8/python-39
when:
- input: $(tasks.condition-4.results.outcome)
operator: in
Expand Down

0 comments on commit 5b756cf

Please sign in to comment.