prepare_docker
prepare_docker(
board,
pin_name,='./',
path=None,
version=False,
rspm_env='0.0.0.0',
host='8080',
port )
Create all files needed for Docker
Parameters
Name | Type | Description | Default |
---|---|---|---|
board | Pin board for model | required | |
pin_name | str | Name of pin | required |
path | str | Path to output | './' |
version | Pin version to be used | None |
|
rspm_env | bool | Whether or not Posit Package Manager should be used | False |
host | str | Host address to run VetiverAPI from Dockerfile | '0.0.0.0' |
port | str | Port to run VetiverAPI from Dockerfile | '8080' |
Examples
>>> import vetiver
>>> import tempfile
>>> import pins
>>> tmp = tempfile.TemporaryDirectory()
>>> board = pins.board_temp(allow_pickle_read=True)
>>> X, y = vetiver.get_mock_data()
>>> model = vetiver.get_mock_model().fit(X, y)
>>> v = vetiver.VetiverModel(model, "my_model", prototype_data = X)
>>> vetiver.vetiver_pin_write(board, v)
>>> vetiver.prepare_docker(board = board, pin_name = "my_model", path = tmp.name)
Notes
This function uses vetiver.get_board_pkgs(board)
for generating requirements. For more complex use cases, call write_docker()
, load_pkgs()
, and write_app()
individually.