Created
May 21, 2024 18:38
-
-
Save HumairAK/f624200a3b894a632d8ffd84e038b7d1 to your computer and use it in GitHub Desktop.
gen_10.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], | |
output_artifact_6: Output[Dataset], | |
output_artifact_7: Output[Dataset], | |
output_artifact_8: Output[Dataset], | |
output_artifact_9: Output[Dataset], | |
output_artifact_10: Output[Dataset], | |
): | |
artifact_outputs = [ | |
output_artifact_1, | |
output_artifact_2, | |
output_artifact_3, | |
output_artifact_4, | |
output_artifact_5, | |
output_artifact_6, | |
output_artifact_7, | |
output_artifact_8, | |
output_artifact_9, | |
output_artifact_10, | |
] | |
for ao in artifact_outputs: | |
with open(ao.path, 'w') as f: | |
f.write(message) | |
@dsl.pipeline(pipeline_root='', name='generate-artifacts') | |
def gen_10(message: str = 'message'): | |
output = generate_artifacts(message=message) | |
output.set_caching_options(enable_caching=False) | |
if __name__ == '__main__': | |
compiler.Compiler().compile(gen_10, __file__ + '.yaml') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment