vetiver_prepare_docker {vetiver} | R Documentation |
Generate files necessary to build a Docker container for a vetiver model
Description
Deploying a vetiver model via Docker requires several files. Use this
function to create these needed files in the directory located at path
.
Usage
vetiver_prepare_docker(
board,
name,
version = NULL,
path = ".",
predict_args = list(),
docker_args = list()
)
Arguments
board |
A pin board, created by |
name |
Pin name. |
version |
Retrieve a specific version of a pin. Use |
path |
A path to write the Plumber file, Dockerfile, and lockfile, capturing the model's dependencies. |
predict_args |
A list of optional arguments passed to |
docker_args |
A list of optional arguments passed to
|
Details
The function vetiver_prepare_docker()
uses:
-
vetiver_write_plumber()
to create a Plumber file and -
vetiver_write_docker()
to create a Dockerfile and renv lockfile
These modular functions are available for more advanced use cases. For
models such as keras and torch, you will need to edit the generated
Dockerfile to, for example, COPY requirements.txt requirements.txt
or
similar.
Value
An invisible TRUE
.
Examples
library(pins)
b <- board_temp(versioned = TRUE)
cars_lm <- lm(mpg ~ ., data = mtcars)
v <- vetiver_model(cars_lm, "cars_linear")
vetiver_pin_write(b, v)
vetiver_prepare_docker(b, "cars_linear", path = tempdir())