-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Provide a function+script to move user packages #59
Comments
@MatthieuStigler In 485ff09, I added a function that takes a library path and moves packages to the system library: Run this for each user and there will be no more version collisions. |
Should it check for same or lower version before replacing? Would be salty to have a dev package one works on replaced by an older released version. |
It wouldn't be much of a loss, because we are constantly installing and reinstalling the dev versions in which we are working, but it's a fair point. Now that we have |
@MatthieuStigler The PR above includes a safer $ Rscript -e bspm:::scripts mass_move user1 user2 ... lib1 lib2 ... The script requires $ Rscript -e bspm:::scripts mass_move --run user1 user2 ... lib1 lib2 ... And still it will ask whether to proceed or not for each library, so it's pretty safe. |
awesome, thanks! I look forward to testing it on our server very soon! |
Hi @Enchufa2 , I gave a try to One comment: is there any chance there could be an additional check for "github" packages? If one uses Admittedly, I am not exactly sure how one should handle github versions as a sys admin moving to a full bspm server wide, I can think of two cases:
Thanks!! |
Also, is seems to leave some duplicated/shadowed packages? Output from
|
Note that both @Enchufa2 and I work off |
Can't you infer that from bspm::disable()
install.packages("A3")
#> Installing package into '/home/mstigler/R/x86_64-pc-linux-gnu-library/4.2'
#> (as 'lib' is unspecified)
packageDescription("A3", lib.loc=.libPaths()[1])[c("GithubRepo", "Repository")]
#> $<NA>
#> NULL
#>
#> $Repository
#> [1] "CRAN"
remotes::install_github("eddelbuettel/dang")
#> Skipping install of 'dang' from a github remote, the SHA1 (a3d38730) has not changed since last install.
#> Use `force = TRUE` to force installation
packageDescription("dang", lib.loc=.libPaths()[1])[c("GithubRepo", "Repository")]
#> $GithubRepo
#> [1] "dang"
#>
#> $<NA>
#> NULL Created on 2023-02-13 with reprex v2.0.2 |
Calling Reading each DESCRIPTION file is not. Sounds you are on your way towards a local (or released) |
Thanks! :)
I can look into it. Admittedly, speed is not a requirement for this function in particular.
I'd say:
Note that |
Or manually set the Fully agree on 'burn with fire' as the default for older packages we spot. |
@MatthieuStigler The latest commit in the PR marks remotes with the same version as newer, and therefore do not touch them by default. Please let me know if this works for you. |
great, thanks a lot Inaki! Did yo consider adding this as an argument? I have been using Speaking about this, could you clarify how to use the
Error in cat(bspm:::user_lib(), fill = TRUE) : object 'user_lib' not found Thanks! |
I would rather not, because such an option would complicate the interface too much in my opinion. This option would be in effect only if the existing option
Mmmh, it seems that this dev version of bspm is not available from other_user, because you installed in your user library. bspm is supposed to be a system package anyway, so installing it with sudo would solve this. And yes, you can provide users and libraries. If a string is not found as a directory, it's treated as a user, basically. |
makes sense on the first point! on the second: oh my bad, yes running as sudo solves the issue! Surprisingly though, it doesn't seem to show any package for another user, though it seems that user has older packages?
|
Mmmh... What's the output of |
(I also did this 'by hand' on another machine with CRAN data.table and noticed I needed one more line in shadowedPackages. Just committed that.) |
And more importantly, what's the output of |
Here is the output:
Specifically:
|
Wait, does the user exist? Or you just created the directories and put some packages in there for testing purposes? Because the script checks that the user exists with the |
hah, yes it's not a 👻! It's a real user, just changed the real name with Note if the user doesn't exist, the script still runs and returns something, yet slightly different:
|
Ok, another thing... What is the output of
? Maybe the |
Oh, I found it... I forgot that usually home folders don't have any visibility, so we need some more sudo commands there. The last commit (b74c7c2) should fix it. Could you please try it? Thanks! |
Well done, it is working now!
Next question is: I guess I need to install bspm first on each user? Is that something that you would consider eventually adding in the script? Thanks! |
Mmh, thinking about it, installing bspm on other users is just a temporary problem, since I installed it through github, and hence only avaialble for my local libpath, right? Later on when bspm is updated r2u, this won't be an issue I imagine? |
You can tell all install functions to respect a location, from |
bspm is supposed to be a system package anyway (installed via sudo), so all users will have access without installing it one by one. So yes, it's a temporary problem now that we are testing from GitHub. Next thing would be to add Thanks for testing! I'll merge the PR then. |
Initial motivation: eddelbuettel/r2u#30. Deployment of bspm-backed system repositories require an initial deployment that removes from the user library (and installs into the system library) everything that can be installed from the system repos to avoid package shadowing issues. This is more or less straightforward for a single user, but it would be nice to ship a deployment script to help sysadmins set this up for a bunch of users in multitenant servers.
The text was updated successfully, but these errors were encountered: