Table of Contents generated with DocToc
TensorFlow serving is a server for TensorFlow models.
The following commands use the
io.ksonnet.pkg.tf-serving prototype to generate Kubernetes YAML for tf-serving, and then deploys it to your Kubernetes cluster.
First, create a cluster and install the ksonnet CLI (see root-level README.md).
If you haven't yet created a ksonnet application, do so using
ks init <app-name>.
Finally, in the ksonnet application directory, run the following:
# Expand prototype as a Jsonnet file, place in a file in the # `components/` directory. (YAML and JSON are also available.) $ ks prototype use io.ksonnet.pkg.tf-serving tf-serving \ --name tf-serving \ --namespace default # Apply to server. $ ks apply -f tf-serving.jsonnet
Using the library
The library files for tf-serving define a set of relevant parts (e.g., deployments, services, secrets, and so on) that can be combined to configure tf-serving for a wide variety of scenarios. For example, a database like Redis may need a secret to hold the user password, or it may have no password if it's acting as a cache.
This library provides a set of pre-fabricated "flavors" (or "distributions") of tf-serving, each of which is configured for a different use case. These are captured as ksonnet prototypes, which allow users to interactively customize these distributions for their specific needs.
These prototypes, as well as how to use them, are enumerated below.
# Expand prototype as a Jsonnet file, place in a file in the # `components/` directory. (YAML and JSON are also available.) $ ks prototype use io.ksonnet.pkg.tf-serving tf-serving \ --name YOUR_NAME_HERE \ --model_path YOUR_MODEL_PATH_HERE
The available options to pass prototype are:
--name=<name>: Name to give to each of the components [string]
--model_path=<model_path>: Path to the model. This can be a GCS path. [string]