Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sdk] KFPv2: Custom Container component set bool default value False to 0 which caused runtime failure #8302

Closed
zijianjoy opened this issue Sep 25, 2022 · 0 comments

Comments

@zijianjoy
Copy link
Collaborator

Environment

  • KFP version:
    KFP 2.0.0-alpha.4
  • KFP SDK version:
    SDK 2.0.0-beta4

Steps to reproduce

Create the following custom container component:

from kfp.dsl import Input, Output, Artifact, container_component, ContainerSpec

@dsl.container_component
def create_dataset(experiment_name: str, experiment_namespace: str, experiment_timeout_minutes: int, 
                   experiment_spec_json: Input[Artifact], parameter_set: Output[Artifact], delete_finished_experiment: bool = False):

    return ContainerSpec(
        image='docker.io/kubeflowkatib/kubeflow-pipelines-launcher',
        command=['python', 'src/launch_experiment.py'],
        args=[
          '--experiment-name',           experiment_name,
          '--experiment-namespace',      experiment_namespace,
          '--experiment-spec',           experiment_spec_json.path,
          '--experiment-timeout-minutes',experiment_timeout_minutes,
          '--delete-after-done',         delete_finished_experiment,
          '--output-file',               parameter_set.path,
        ])

Note that delete_finished_experiment has a default value False.

When compiling the pipeline, this component is converted to IR with the following format:


    tasks:
      create-dataset:
        cachingOptions:
          enableCache: true
        componentRef:
          name: comp-create-dataset
        dependentTasks:
          - create-katib-experiment-task
        inputs:
          artifacts:
            experiment_spec_json:
              taskOutputArtifact:
                outputArtifactKey: experiment_spec_json
                producerTask: create-katib-experiment-task
          parameters:
            delete_finished_experiment:
              runtimeValue:
                constant: 0
            experiment_name:
              componentInputParameter: name
            experiment_namespace:
              componentInputParameter: namespace
            experiment_timeout_minutes:
              runtimeValue:
                constant: 60
        taskInfo:
          name: create-dataset

Note that delete_finished_experiment has a runtime value as 0.

Expected result

What should the type of boolean default value be? I am expecting the value to be either of followings: bool false, bool False or string False. I didn't expect the value to be number 0.

Materials and Reference


Impacted by this bug? Give it a 👍.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

3 participants