Skip to main content

mb.get_deployment_info()

Retrieves the branch, name, and version of the currently executing deployment. Only works inside deployments.

Returns

A dictionary with the branch, name, and version of the deployment:

{
"branch": str,
"name": str,
"version": str
}

Examples

Getting deployment info

mb.get_deployment_info()

Returns

{
"branch": "main",
"name": "my_deployment",
"version": "9"
}

Returning deployment info with inference

def predict():
return {
"prediction": 7,
"context": mb.get_deployment_info()
}

mb.deploy(predict)

See also