Python client migration guide
From v1.3.x to v1.4.x
This guide compares the H2O MLOps Python client in version 1.3.x and version 1.4.x. Each table shows the version 1.3.x way of performing an operation in the left column and the version 1.4.x way in the right column, so you can easily compare what has changed and update your code accordingly.
Imports
v1.3.x | v1.4.x |
---|---|
|
|
Client creation
From v1.4.x onwards, support for creating the client using gateway_url
and token_provider
has been removed. Instead, you must use refresh_token
and h2o_cloud_url
.
v1.3.x | v1.4.x |
---|---|
|
|
Get allowed affinities and tolerations
v1.3.x | v1.4.x |
---|---|
|
|
|
|
Get the current user
v1.3.x | v1.4.x |
---|---|
|
|
Returns the user's information as a Python dictionary. | Returns the user's information as an |
Access project-related services
In version 1.4.x, the concept of projects has been replaced by workspaces. Update your code by replacing references to projects
with workspaces
.
v1.3.x | v1.4.x |
---|---|
|
|
Create and register an experiment into a model
The previous method of creating experiments and registering them with models is still supported.
v1.3.x | v1.4.x |
---|---|
|
Users can pass an instance of the |
- When you link an experiment to a workspace from H2O Driverless AI, a new model version is automatically registered under the model that matches the experiment’s name.
- If no matching model exists, a new model is created with the experiment name, and the experiment is registered as its first version.
- Therefore, you don’t need to manually register experiments in MLOps. You can use the model directly.
Update an artifact’s parent
v1.3.x | v1.4.x |
---|---|
|
|
Get artifact's model-specific metadata (if applicable)
v1.3.x | v1.4.x |
---|---|
|
|
Convert JSON artifact to a dictionary
v1.3.x | v1.4.x |
---|---|
|
|
Get the experiment associated with a model version
v1.3.x | v1.4.x |
---|---|
|
|
List scoring runtimes
The experiment.scoring_artifact_types
property was removed in 1.4.x.
v1.3.x | v1.4.x |
---|---|
|
|
|
|
When creating a deployment, instead of passing scoring_runtimes[correct_index]
, you can use mlops.runtimes.scoring.get(artifact_type=..., runtime_uid=...)
to get the scoring_runtime
, if you already know the corresponding artifact_type
and runtime_uid
.
Create a deployment
v1.3.x | v1.4.x |
---|---|
|
|
Starting in v1.4.x, when you create a deployment with hash-based security options, provide the passphrase directly. In earlier versions, you had to provide the hashed value instead.
Create a deployment with new model monitoring options
v1.3.x | v1.4.x |
---|---|
|
|
This is equivalent to how users created deployments with the old monitoring in the previous client. After the old monitoring was removed, this change was introduced. Note that the parameters accepted by options.MonitoringOptions
differ from those used in the old monitoring.
Wait for deployment to become healthy
The previous method is still supported.
v1.3.x | v1.4.x |
---|---|
|
|
Get deployment state
v1.3.x | v1.4.x |
---|---|
|
|
|
|
Update a deployment
v1.3.x | v1.4.x |
---|---|
|
|
| |
| |
|
In v1.4.x, you can update multiple settings at once.
Access deployment scorer
v1.3.x | v1.4.x |
---|---|
You do not need to fetch the scorer. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Score against a deployment
The previous method is still supported if the correct scoring endpoint URL is provided.
v1.3.x | v1.4.x |
---|---|
|
|
Get entity creator (if applicable)
v1.3.x | v1.4.x |
---|---|
|
|
View the complete Table
v1.3.x | v1.4.x |
---|---|
|
|
In version 1.4.x, a Table
instance renders a nicely formatted view but displays only up to 50 rows by default.
- Submit and view feedback for this page
- Send feedback about H2O MLOps to cloud-feedback@h2o.ai