package_model: Create a model package that packages all the assets needed to...

Description Usage Arguments Value See Also Examples

View source: R/model.R

Description

In some cases, you might want to create a Docker image without deploying the model (for example, if you plan to deploy to Azure App Service). Or you might want to download the image and run it on a local Docker installation. You might even want to download the files used to build the image, inspect them, modify them, and build the image manually.

Model packaging enables you to do these things. package_model() packages all the assets needed to host a model as a web service and allows you to download either a fully built Docker image or the files needed to build one. There are two ways to use model packaging:

Usage

1
package_model(workspace, models, inference_config, generate_dockerfile = FALSE)

Arguments

workspace

The Workspace object.

models

A list of Model objects to include in the package. Can be an empty list.

inference_config

The InferenceConfig object to configure the operation of the models.

generate_dockerfile

If TRUE, will create a Dockerfile that can be run locally instead of building an image.

Value

The ModelPackage object.

See Also

wait_for_model_package_creation(), get_model_package_container_registry(), get_model_package_creation_logs(), pull_model_package_image(), save_model_package_files()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Package a registered model
## Not run: 
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)
package <- package_model(ws,
                         models = list(model),
                         inference_config = inference_config)
wait_for_model_package_creation(show_output = TRUE)

## End(Not run)

azuremlsdk documentation built on Oct. 23, 2020, 8:22 p.m.