-
Notifications
You must be signed in to change notification settings - Fork 82
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
Allow separate "sources of truth" for R packages collected in deployment manifest #671
Comments
For 2, do you think we could just use a renv.lock/pkg.lock if present? Isn't presence of those files sufficient to indicate that you want to manage the versions yourself? (TBH I had always assumed this is what rsconnect did; I didn't realise that it always re-ran packrat, even if an existing lock file already existed) |
The historical reasons for running an rsconnect-time dependency scan:
Using an existing lock file is compelling, especially if this is a narrowly-scoped project and we can ignore unnecessary dependencies from information in that lock file. If folks are deploying from a "kitchen sink" project, the cost to restore the environment at deploy-time will be fairly high. The automatic scanning has simultaneously been convenient, surprising (especially for packages without explicit in-code dependencies), and inflexible. |
FWIW we allow python users to make this decision with the |
I'd love the ability to specify my R dependencies via an renv lockfile during deployment to Posit Connect. The existing dependency discovery via packrat has caused headaches for our team in the past. We had also assumed that renv would be the preferred solution for an RStudio product. Thanks for continuing this discussion! |
Currently, rsconnect relies on Packrat for lockfile generation, which implies that package dependencies are always inferred based on what's currently installed or available in the user's R library.
However, users might reasonably want to be able to declare their project's package requirements in other ways. For example, they may want to:
renv.lock
; pkg.lock; something else.I believe part of (1) is supported on the Connect side with some side-channels for providing packages during a deployment, but (2) could be useful for users who want to be able to declaratively state what packages are to be used during deployment.
For an implementation sketch, I think we could have a function like
askManifestType()
that (if appropriate) would prompt the user for the "source of truth" for R packages, and then that could be passed as a parameter todeployApp()
. There could also be a mechanism for setting these via R options / environment variables if it felt appropriate, or was asked for.This request was from a professional customer, who would like more granular control over what packages are used and installed in deployments.
The text was updated successfully, but these errors were encountered: