I am having difficulty trying to understand how to pass a result from a container as an output artifact. I understand that we need to write the output to a file but i need some example how to do it.
https://www.kubeflow.org/docs/components/pipelines/sdk-v2/component-development/
This is the last part of the python container program where i save the url of model file on GCS onto output.txt.
with open('./output.txt', 'w') as f:
logging.info(f"Model path url is in {'./output.txt'}")
f.write(model_path)
This is the component .yaml file
name: Dummy Model Training
description: Train a dummy model and save to GCS
inputs:
- name: input_url
description: 'Input csv url.'
type: String
- name: gcs_url
description: 'GCS bucket url.'
type: String
outputs:
- name: gcs_model_path
description: 'Trained model path.'
type: String
implementation:
container:
image: ${CONTAINER_REGISTRY}
command: [
python, ./app/trainer.py,
--input_url, {inputValue: input_url},
--gcs_url, {inputValue: gcs_url},
]