Closed juliasilge closed 1 year ago
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.
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:
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.