pipelines icon indicating copy to clipboard operation
pipelines copied to clipboard

[feature] Allow GCP ModelUploadOp to upload a model version

Open parthmishra opened this issue 2 years ago • 1 comments

Feature Area

/area components

What feature would you like to see?

The ability to upload a Vertex Model version to the model registry

What is the use case or pain point?

In the REST API for model upload, the request body has several fields including parentModel which can be supplied if uploading a new model version.

The current version of ModelUploadOp only supplies the model field in the request:

  upload_model_request = {
      # TODO(IronPan) temporarily remove the empty fields from the spec
      'model':
          json_util.recursive_remove_empty(
              append_unmanaged_model_artifact_into_payload(
                  executor_input, model_spec))
  }

Is there a workaround currently?

I believe this can be done by creating a custom component that uses the gcloud sdk and then gcloud ai model upload ... --parent-model ... --version-aliases but I haven't tried it yet.


Love this idea? Give it a 👍.

parthmishra avatar Sep 12 '22 23:09 parthmishra

/cc @chongyouquan

connor-mccarthy avatar Sep 15 '22 22:09 connor-mccarthy

Similarly other Ops that can generate a model (CustomTrainingJobRunOp, AutoMLTrainingJobRunOp etc) should support adding new versions of a model as well.

meken avatar Sep 28 '22 13:09 meken

+1

edday1 avatar Nov 15 '22 11:11 edday1

This should now be supported by the latest release, via the parent_model parameter. Please reopen if you see it's not working. https://google-cloud-pipeline-components.readthedocs.io/en/google-cloud-pipeline-components-1.0.34/google_cloud_pipeline_components.v1.model.html

IronPan avatar Jan 26 '23 17:01 IronPan

Was this functionality also added to components that use the uploaded models? For example how would one reference a specific model version (with a version alias) in BatchPredictOp in python? Maybe I missed it but can't seem to find documentation on this.

xRagnorokx avatar May 31 '23 09:05 xRagnorokx