rstudio / rstudio/vetiver-python

Include custom model class with deployment

Open
#187 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

deploy
Dominant language
Python
Stars
71
Forks
20
PR merge metrics
No merged PRs in 30d

Description

When using a custom model (or piece of model), people must include a way to access the source code to recreate the model on pin_read, otherwise they will encounter issues such as:

Unexpected error while running Python API: Can't get attribute 'XXXXXX' on <module '__main__' from 'path_to_app.py'>

Currently, the most ergonomic fix is to include the file where the model is created in deployment bundle, and add an import statement to get the model's class into the file that is being deployed (usually called app.py).

People can do this by hand, but it would be nice to add in programmatically when people use vetiver.write_app() (and consequentially vetiver.prepare_docker and vetiver.deploy_rsconnect).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Trace how vetiver.write_app() builds deployment bundles and how prepare_docker and deploy_rsconnect consume them, then inspect the pin_read failure described for custom model classes. Define how source files and imports should be included so a custom model can be recreated without manual setup, and verify the behavior across the affected deployment paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.