Deploy a web service from zero or more registered models. Types of web services that can be deployed are LocalWebservice, which will deploy a model locally, and AciWebservice and AksWebservice, which will deploy a model to Azure Container Instances (ACI) and Azure Kubernetes Service (AKS), respectively.The type of web service deployed will be determined by the deployment_config specified. Returns a Webservice object corresponding to the deployed web service.

deploy_model(
  workspace,
  name,
  models,
  inference_config,
  deployment_config = NULL,
  deployment_target = NULL
)

Arguments

workspace

The Workspace object.

name

A string of the name to give the deployed service. Must be unique to the workspace, only consist of lowercase letters, numbers, or dashes, start with a letter, and be between 3 and 32 characters long.

models

A list of Model objects. Can be an empty list.

inference_config

The InferenceConfig object used to describe how to configure the model to make predictions.

deployment_config

The deployment configuration of type LocalWebserviceDeploymentConfiguration, AciServiceDeploymentConfiguration, or AksServiceDeploymentConfiguration used to configure the web service. The deployment configuration is specific to the compute target that will host the web service. For example, when you deploy a model locally, you must specify the port where the service accepts requests. If NULL, an empty configuration object will be used based on the desired target specified by deployment_target.

deployment_target

The compute target to deploy the model to. You will only need to specify this parameter if you are deploy to AKS, in which case provide an AksCompute object. If you are deploying locally or to ACI, leave this parameter as NULL.

Value

The LocalWebservice, AciWebservice, or AksWebservice object.

Details

If you encounter any issue in deploying your web service, please visit this troubleshooting guide.

See also

inference_config(), aci_webservice_deployment_config(), aks_webservice_deployment_config(), local_webservice_deployment_config()

Examples

if (FALSE) { ws <- load_workspace_from_config() model <- get_model(ws, name = "my_model") r_env <- r_environment(name = "r_env") inference_config <- inference_config(entry_script = "score.R", source_directory = ".", environment = r_env) deployment_config <- aci_webservice_deployment_config(cpu_cores = 1, memory_gb = 1) service <- deploy_model(ws, name = "my_webservice", models = list(model), inference_config = inference_config, deployment_config = deployment_config) wait_for_deployment(service, show_output = TRUE) }