Manage model metadata using Gravitino
This page introduces how to manage model metadata in Apache Gravitino. Gravitino model catalog is a kind of model registry, which provides the ability to manage machine learning models' versioned metadata. It follows the typical Gravitino 3-level namespace (catalog, schema, and model) and supports managing the versions for each model.
Currently, it supports model and model version registering, listing, loading, and deleting.
To use the model catalog, please make sure that:
- The Gravitino server has started, and is serving at, e.g. http://localhost:8090.
- A metalake has been created and enabled
Catalog operations
Create a catalog
For a model catalog, you must specify the catalog type
as MODEL
when creating the catalog.
Please also be aware that the provider
is not required for a model catalog.
You can create a catalog by sending a POST
request to the /api/metalakes/{metalake_name}/catalogs
endpoint or just use the Gravitino Java/Python client. The following is an example of creating a
catalog:
- Shell
- Java
- Python
curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
-H "Content-Type: application/json" -d '{
"name": "model_catalog",
"type": "MODEL",
"comment": "This is a model catalog",
"properties": {
"k1": "v1"
}
}' http://localhost:8090/api/metalakes/example/catalogs
GravitinoClient gravitinoClient = GravitinoClient
.builder("http://localhost:8090")
.withMetalake("example")
.build();
Map<String, String> properties = ImmutableMap.<String, String>builder()
.put("k1", "v1")
.build();
Catalog catalog = gravitinoClient.createCatalog(
"model_catalog",
Type.MODEL,
"This is a model catalog",
properties);
gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="example")
catalog = gravitino_client.create_catalog(name="model_catalog",
catalog_type=Catalog.Type.MODEL,
provider=None,
comment="This is a model catalog",
properties={"k1": "v1"})
Load a catalog
Refer to Load a catalog in relational catalog for more details. For a model catalog, the load operation is the same.
Alter a catalog
Refer to Alter a catalog in relational catalog for more details. For a model catalog, the alter operation is the same.