Once you have fully tested your BentoML Service locally, you can push it to BentoCloud for production deployment. This document explains how to create a Deployment on BentoCloud.
Make sure you have logged in to BentoCloud using an API token with Developer Operations Access.
You have created a BentoML project that contains at least a
service.pyfile and a
bentofile.yamlfile (or you have an available Bento either locally or on BentoCloud). You can use this Quickstart or any project in Use cases.
Deploy a new project to BentoCloud#
You can deploy a new project through either the command line interface (CLI) or Python API.
In your project directory where the
bentofile.yaml file is stored, run the following command:
bentoml deploy .
Specify the path to your BentoML project using the
bentoml.deployment.create(bento = "./path_to_your_project")
BentoML does the following automatically during deployment:
Build: Build your project into a Bento based on
Push: Push the Bento to BentoCloud.
Deploy: Deploy the Bento on BentoCloud by performing the following steps in order:
Containerize the Bento as an OCI-compliant image.
Provision instances on BentoCloud.
Start the BentoML Service on the instances based on the specified configuration.
You DO NOT need to perform the above three steps (Build, Push, and Deploy) manually, which is a long-running automated process.
Deploy an existing Bento to BentoCloud#
If you already have a Bento, either available locally or on BentoCloud, you can use one of the following ways to deploy it.
bentoml deploy bento_name:version -n <deployment_name>
bentoml.deployment.create(bento = "bento_name:version", name = "my_deployment_name")
The BentoCloud console provides a web-based, graphical user interface (UI) that you can use to create and manage your Bento Deployments. When you use the BentoCloud console to deploy a Bento, make sure the Bento is already available on BentoCloud.