You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the :upgrade action with the package provider in this cookbook results in excessive re-installation of packages because install_package is invoked unconditionally.
R will replace the installed package even if a newer version is unavailable, and this can cause problems for any jobs that attempt to make use of the package while it is being re-installed. Since Chef runs every half hour, this can happen frequently on a busy server.
I've written a short Ruby method to generate a bash command that returns true if the package needs to be updated. It does this by comparing the PACKAGES manifest against the DESCRIPTION of the package in the site-library.
This seems to work, but would need to be generalized instead of hard-coding the paths. The check executes very quickly (~0.01s) compared to calling into R (~0.50s) but I'm not sure if this is a durable approach for checking package versions.
The text was updated successfully, but these errors were encountered:
@nicwaller Apologies that I never responded to this. Somehow notifications got turned off for this repository for me. I'll take a look at the function you've created here to see what we can do.
I had forgotten about this pull request! Warning: This function doesn't actually work.
For our internal (non-CRAN) packages we run a daily cron task to download the latest available packages from S3 into a subfolder under /opt and this process is what allows for rapid comparison of installed vs available versions as shown in the original function.
But obviously that doesn't work for CRAN packages because the latest version cannot be known without a lookup to the CRAN repository. If you want to lookup the latest available package in the CRAN repo you can do something like this.
If this was used to guard upgrade of packages I would expect it to slightly improve Chef runtime, but more importantly it would avoid the chance of breaking running processes that depend on libraries which get re-installed every half hour.
Our workaround is to just use the :install action all the time, then only temporarily set :upgrade when we know it is really required. This has been working well enough for us.
Using the
:upgrade
action with thepackage
provider in this cookbook results in excessive re-installation of packages because install_package is invoked unconditionally.R will replace the installed package even if a newer version is unavailable, and this can cause problems for any jobs that attempt to make use of the package while it is being re-installed. Since Chef runs every half hour, this can happen frequently on a busy server.
I've written a short Ruby method to generate a bash command that returns true if the package needs to be updated. It does this by comparing the PACKAGES manifest against the DESCRIPTION of the package in the site-library.
This seems to work, but would need to be generalized instead of hard-coding the paths. The check executes very quickly (~0.01s) compared to calling into R (~0.50s) but I'm not sure if this is a durable approach for checking package versions.
The text was updated successfully, but these errors were encountered: