Last active
July 17, 2023 21:12
-
-
Save gregsheremeta/05e0baa807c052ffba6af8f2b37baf63 to your computer and use it in GitHub Desktop.
a2 - without add_pod_annotation - 'Termination message is above max allowed size 4096' error, but 20MB result exists in minio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Test pipeline to exercise various data flow mechanisms.""" | |
import kfp | |
"""Producer""" | |
def send_file( | |
outgoingfile: kfp.components.OutputPath(), | |
): | |
import urllib.request | |
print("starting download...") | |
urllib.request.urlretrieve("http://212.183.159.230/20MB.zip", outgoingfile) | |
print("done") | |
"""Consumer""" | |
def receive_file( | |
incomingfile: kfp.components.InputPath(), | |
saveartifact: kfp.components.OutputPath("saveartifact"), | |
): | |
import os | |
import shutil | |
print("reading %s, size is %s" % (incomingfile, os.path.getsize(incomingfile))) | |
with open(incomingfile, "rb") as f: | |
b = f.read(1) | |
print("read byte: %s" % b) | |
f.close() | |
print("copying in %s to out %s" % (incomingfile, saveartifact)) | |
shutil.copyfile(incomingfile, saveartifact) | |
"""Build the producer component""" | |
send_file_op = kfp.components.create_component_from_func( | |
send_file, | |
base_image="registry.access.redhat.com/ubi8/python-38", | |
) | |
"""Build the consumer component""" | |
receive_file_op = kfp.components.create_component_from_func( | |
receive_file, | |
base_image="registry.access.redhat.com/ubi8/python-38", | |
) | |
"""Wire up the pipeline""" | |
@kfp.dsl.pipeline( | |
name="Test Data Passing Pipeline 1", | |
) | |
def wire_up_pipeline(): | |
import json | |
send_file_task = send_file_op() | |
receive_file_task = receive_file_op( | |
send_file_task.output, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment