Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use renv to track needed packages and versions and store a hash #4

Closed
juliasilge opened this issue Jul 10, 2021 · 1 comment · Fixed by #154
Closed

Use renv to track needed packages and versions and store a hash #4

juliasilge opened this issue Jul 10, 2021 · 1 comment · Fixed by #154
Labels
feature a feature request or enhancement

Comments

@juliasilge
Copy link
Member

In #2 I talk about loading packages but we need to figure out how to have platforms like RSC know what packages to install. RSC currently uses a manifest, not renv, so we'll need to figure out some details here.

If a user has a file that looks like this:

library(deploytidymodels)
library(pins)
library(plumber)

model_board <- board_rsconnect()

#* @plumber
function(pr) {
    pr %>%
        pr_model(model_board, "julia.silge/biv_svm", type = "class")
}

we currently will not successfully install the right packages for prediction into the app.

@topepo has already put work into creating an renv.lock file from a model to track what packages/versions are needed for prediction; I think this can either be used or repurposed.

@juliasilge
Copy link
Member Author

Once we have an renv.lock of the subset of packages needed for prediction, we can take a hash (Barret recommends digest::digest(raw_data, algo = "spookyhash")) and store that hash in the modelops() constructor. This hash can then be looked up during modelops_pin_read() and we can decide whether to warn or error if the current environment doesn't match.

Looking up the hash during modelops_pin_read() has the benefit of covering both API startup and users who read the pin interactively to make a prediction for adhoc analyses.

@juliasilge juliasilge added the feature a feature request or enhancement label Oct 19, 2021
@juliasilge juliasilge changed the title Use renv (probably? maybe?) to track needed packages and versions for platforms like RSC Use renv to track needed packages and versions and store a hash May 23, 2022
@juliasilge juliasilge moved this from Todo to Backlog in MLOps with vetiver 🏺 May 25, 2022
@juliasilge juliasilge moved this from Backlog to In Progress in MLOps with vetiver 🏺 Feb 22, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in MLOps with vetiver 🏺 Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
Development

Successfully merging a pull request may close this issue.

1 participant