Implementation:Kubeflow Pipelines MLMD Store Protobuf
| Knowledge Sources | |
|---|---|
| Domains | Metadata_Management, API_Schema |
| Last Updated | 2026-02-13 14:00 GMT |
Overview
Auto-generated Go protobuf bindings defining the core ML Metadata data model types including artifacts, executions, contexts, events, and database configuration structures.
Description
Generated by `protoc-gen-go` (v1.26.0) from `ml_metadata/proto/metadata_store.proto`, this file (6,422 lines) defines Go struct types and methods for all MLMD domain objects. Key types include: Artifact (with states: PENDING, LIVE, MARKED_FOR_DELETION, DELETED, ABANDONED, REFERENCE), Execution, Context, Event (linking artifacts to executions), Attribution (linking artifacts to contexts), Association (linking executions to contexts), LineageGraph, Value (variant container for int/double/string/struct/proto/bool), and various database configuration types (MySQL, SQLite, PostgreSQL).
Usage
Imported by the KFP Go backend to interact with the ML Metadata store for pipeline artifact tracking, execution history, and lineage queries.
Code Reference
Source Location
- Repository: Kubeflow_Pipelines
- File: third_party/ml-metadata/go/ml_metadata/metadata_store.pb.go
- Lines: 1-6422
Signature
package ml_metadata
type Artifact struct {
Id *int64
TypeId *int64
Uri *string
State *Artifact_State
Properties map[string]*Value
// ...
}
type Execution struct {
Id *int64
TypeId *int64
Properties map[string]*Value
// ...
}
type Context struct {
Id *int64
TypeId *int64
Name *string
Properties map[string]*Value
// ...
}
type Event struct {
ArtifactId *int64
ExecutionId *int64
Type *Event_Type // INPUT, OUTPUT, etc.
Path *Event_Path
}
Import
import ml_metadata "github.com/kubeflow/pipelines/third_party/ml-metadata/go/ml_metadata"
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| Proto descriptor | []byte | Yes | Raw protobuf descriptor from metadata_store.proto |
Outputs
| Name | Type | Description |
|---|---|---|
| Domain types | Go structs | Artifact, Execution, Context, Event, Value, LineageGraph, etc. |
| Config types | Go structs | ConnectionConfig, MySQLDatabaseConfig, SqliteMetadataSourceConfig, etc. |
Usage Examples
Creating an Artifact
import ml_metadata "github.com/kubeflow/pipelines/third_party/ml-metadata/go/ml_metadata"
artifact := &ml_metadata.Artifact{
Uri: proto.String("gs://bucket/model/output"),
TypeId: proto.Int64(typeId),
Properties: map[string]*ml_metadata.Value{
"name": {Value: &ml_metadata.Value_StringValue{StringValue: "trained-model"}},
},
}