Created
May 21, 2024 17:58
-
-
Save HumairAK/17dd58d5fb23f8ca67c02216bfcfd26e to your computer and use it in GitHub Desktop.
gen-5.py
This file contains 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
#!/usr/bin/env python3 | |
from typing import Dict, List | |
from kfp import compiler | |
from kfp import dsl | |
from kfp.dsl import Input, InputPath, Output, OutputPath, Dataset, Model, component | |
@dsl.component(base_image="quay.io/opendatahub/ds-pipelines-ci-executor-image:v1.0") | |
def generate_artifacts( | |
message: str, | |
output_artifact_1: Output[Dataset], | |
output_artifact_2: Output[Dataset], | |
output_artifact_3: Output[Dataset], | |
output_artifact_4: Output[Dataset], | |
output_artifact_5: Output[Dataset], | |
): | |
artifact_outputs = [ | |
output_artifact_1, | |
output_artifact_2, | |
output_artifact_3, | |
output_artifact_4, | |
output_artifact_5, | |
] | |
for ao in artifact_outputs: | |
with open(ao.path, 'w') as f: | |
f.write(message) | |
@dsl.pipeline(pipeline_root='', name='generate-artifacts') | |
def data_passing_pipeline(message: str = 'message'): | |
output = generate_artifacts(message=message) | |
output.set_caching_options(enable_caching=False) | |
if __name__ == '__main__': | |
compiler.Compiler().compile(data_passing_pipeline, __file__ + '.yaml') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment