This quick 5 minutes tutorial will show you the basics of using Atalaya to manage model versioning and create a production-grade real-time model serving endpoint.
Atalaya supports a wide range of different Model Formats, this guide we will use a Tensorflow model as example.
To serve a Tensorflow model with Atalaya, the first step is to use the Estimator#export_savedmodel or the tf.savedmodel.simple_save provided in the Tensorflow library to export your TF model to file system. Atalaya supports this format out of the box, there is no need to further modify the exported model. For this guide, you may export your own Tensorflow model or create one from the official mnist example here
After exporting your model to the file system, you can now use
command to push it to Atalaya. And we will help your team to keep track of all
your model repositories and their versions:
atalaya push mnist ./mnist-export Uploading model artifacts... Successfully pushed model mnist:2018-1-01-1532703132464-asb2v7ac
atalaya push command, the first parameter is model repository
name and a tag(uuid) will be generated for this model. If the target model
repository does not exist, a new one will be created. You can also specifiy
your own repo name or tag, see
atalaya push --help for more options.
To manage your models, use
atalaya list command to view all of your models
atalaya label command to add or edit labels on your models.
After a model pushed to Atalaya, you can now use the
atalaya deploy command
to create deployment that serves this model as a real-time API service.
atalaya deploy --help to learn more about this command.
atalaya deploy mnist:latest Deployment 2018-4-27-1532703131793-phi2z5wg created
To read about more options of how to make prediction request to your deployment, such as using our prebuild SDK or accessing REST API or GRPC endpoint directly, login your account in Atalaya Web UI and navigate to the deployment page for further instructions.
To create more complex deployment that involves multiple models and multiple endpoints, we recommend using declarative deployment management. Atalaya users can create deployment configuration YAML file that describes all the models you need for the deployment, how much and what type of resources they each need, and what are the endpoints desired.
Here is an example deployment configuration, that allow users to deploy a production model and a 'dev' model together as three endpoints:
# my-super-cool-app.yaml apiVersion: atalaya.io/v1alpha kind: atalayaDeployment metadata: name: my-super-cool-app spec: operators: - name: mnist-prod modelRepo: mnist tag: 1.0.0 replicas: 3 intanceType: c2 autoScale: min: 1 max: 20 - name: mnist-dev modelRepo: mnist tag: 1.0.2 replicas: 1 intanceType: c1 endpoints: - name: 'prod' operator: mnist-prod - name: 'experimental' operator: mnist-dev
atalaya apply -f command to create a deployment using this configuration:
atalaya apply -f ./my-super-cool-app.yaml
We recommend to always check-in your deployment configuration file to your Git(or other VCS) repository alone with your training code. This way we ensures the production deployment can be easily reproduced in case of an outage.