vetiver_prepare_docker | R Documentation |
Deploying a vetiver model via Docker requires several files. Use this
function to create these needed files in the directory located at path
.
vetiver_prepare_docker(
board,
name,
version = NULL,
path = ".",
predict_args = list(),
docker_args = list()
)
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
|
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.
An invisible TRUE
.
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())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.