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

kfp component ml_engine deploy version param is incorrectly typed #4291

Closed
jphines opened this issue Jul 29, 2020 · 0 comments
Closed

kfp component ml_engine deploy version param is incorrectly typed #4291

jphines opened this issue Jul 29, 2020 · 0 comments

Comments

@jphines
Copy link
Contributor

jphines commented Jul 29, 2020

What steps did you take:

I tried to specify the version param to the gcp ml_engine deploy component via:

 mlengine_deploy_op = comp.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/1.0.0/components/gcp/ml_engine/deploy/component.yaml')

. . .

 upload_task = mlengine_deploy_op(
    model_id=model_id,
    project_id=project_id,
    python_version=python_version,
    runtime_version=runtime_version,
    version_id=version_id,
    model_uri=model_uri,
    model={
        'onlinePredictionLogging': True,
        'onlinePredictionConsoleLogging': True,
    },
    version={
        'packageUris': package_uris,
        'predictionClass': prediction_class,
    },
)

What happened:

Received a type error that str object (version) does not support assignment

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/ml/kfp_component/launcher/__main__.py", line 34, in <module>
    main()
  File "/ml/kfp_component/launcher/__main__.py", line 31, in main
    launch(args.file_or_module, args.args)
  File "kfp_component/launcher/launcher.py", line 45, in launch
    return fire.Fire(module, command=args, name=module.__name__)
  File "/usr/local/lib/python2.7/site-packages/fire/core.py", line 127, in Fire
    component_trace = _Fire(component, args, context, name)
  File "/usr/local/lib/python2.7/site-packages/fire/core.py", line 366, in _Fire
    component, remaining_args)
  File "/usr/local/lib/python2.7/site-packages/fire/core.py", line 542, in _CallCallable
    result = fn(*varargs, **kwargs)
  File "kfp_component/google/ml_engine/_deploy.py", line 68, in deploy
    wait_interval)
  File "kfp_component/google/ml_engine/_create_version.py", line 55, in create_version
    version['deploymentUri'] = deployemnt_uri
TypeError: 'str' object does not support item assignment

What did you expect to happen:

I expected to be able to pass additional version parameters as a dictionary as described in https://cloud.google.com/ml-engine/reference/rest/v1/projects.models.versions and https://github.com/kubeflow/pipelines/blob/master/components/gcp/ml_engine/deploy/component.yaml#L64:L69

However, this type is being declared as a str when it should be a dict: https://github.com/kubeflow/pipelines/blob/master/components/gcp/container/component_sdk/python/kfp_component/google/ml_engine/_create_version.py#L47

This is ultimately based on the assumption that fire is using the docstring to do type hinting.

Environment:

How did you deploy Kubeflow Pipelines (KFP)?
Deployed via AI-Platform Pipelines

KFP version:

Build commit: 9c16e12

KFP SDK version:

kfp                      0.5.1
kfp-server-api           0.5.0

/kind bug
/area sdk

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

No branches or pull requests

5 participants