pipelines icon indicating copy to clipboard operation
pipelines copied to clipboard

[frontend] artifacts not compiled in case of an afterwards error

Open iuiu34 opened this issue 2 years ago • 3 comments

given the following component

from kfp.v2.dsl import component, Output, Artifact
@component
def test(
    artifact_url: Output[Artifact]
):
    artifact_url.uri = 'gs://test/bucket/uri'
    raise ValueError

artifact_url will not be compiled. Event though, the uri declaration is before the code error. questions a) would be possible to compile it? b) would be possible to compile it at execution time, before the component execution finishes?

iuiu34 avatar Mar 29 '22 16:03 iuiu34

Hi @iuiu34, could you share more on your compiler mode and version for this code snippet and possibly share more code? Thanks.

ji-yaqi avatar Mar 31 '22 22:03 ji-yaqi

I run it in google-cloud vertex. Using google-cloud-aiplatform. But seems to me more a kfp general problem. Or is not the case?

kfp==1.8.11 google-cloud-aiplatform==1.10.0 from google.cloud import aiplatform

from kfp.v2.dsl import component, Output, Artifact
@component
def test(
    artifact_url: Output[Artifact]
):
    artifact_url.uri = 'gs://test/bucket/uri'
    raise ValueError

@pipeline(
        name=f'{image_name}-pipeline',
        description='An example pipeline that performs arithmetic calculations.',
        pipeline_root=bucket
    )
    def kfp_pipeline():
        test()

print('kfp')
pipeline_filename = 'tmp/kfp_pipeline.json'
compiler.Compiler().compile(pipeline_func=pipeline,
                                package_path=pipeline_filename)

aiplatform.init()
job = aiplatform.PipelineJob(
        display_name='test',
        location='europe-west4',
        template_path=pipeline_filename,
        pipeline_root=bucket,
        labels={'test_env': 'test_env'}
    )

client, _ = google.auth.default()
job.run(service_account=client.service_account_email)

iuiu34 avatar Apr 01 '22 19:04 iuiu34

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar May 04 '24 07:05 github-actions[bot]

This issue has been automatically closed because it has not had recent activity. Please comment "/reopen" to reopen it.

github-actions[bot] avatar May 26 '24 07:05 github-actions[bot]