This article explains why you would use RStudio Package Manager in addition to Artifactory and provides the necessary integration steps.
Why use RStudio Package Manager and Artifactory?
Artifactory is a general purpose manager that supports multiple languages. If you already have Artifactory, or your IT organization has standardized on Artifactory, there are benefits to combining it with RStudio Package Manager.
Do I need Artifactory if I only have RStudio Package Manager?
No, RStudio Package Manager is a complete solution for data science teams using R.
Why should I consider RStudio Package Manager if I already have Artifactory?
Artifactory provides basic support for R packages, but unfortunately most data science teams face additional challenges:
Version Management - While Artifactory provides access to CRAN packages, most data scientists are familiar with the challenges that come with managing package versions over time. RStudio Package Manager makes this process easier by versioning the CRAN repository in addition to versioning individual packages, making it possible for old code to "just work".
Approved Subsets of CRAN - Artifactory proxies all of CRAN, but often organizations require restricted access to approved subsets of CRAN. RStudio Package Manager uses knowledge of package dependencies to help organizations maintain these validated subsets.
Linux Binaries - Artifactory proxies directly from CRAN, which means its support on Linux systems is limited to source packages that can take hours to compile and install. RStudio Package Manager provides access to pre-compiled package binaries that make package installation fast enough to prevent disruptions and make it drastically easier to implement automation.
Luckily, teams do not have to pick between IT supported Artifactory and the benefits of RStudio Package Manager - the two tools can be combined together.
This integration is especially helpful for organizations that wish to have RStudio Package Manager offline and are able to use Artifactory as a proxy to online package sources.
How to use RStudio Package Manager with Artifactory
The goal of these steps is to enable RStudio Package Manager to pull CRAN packages and metadata from Artifactory.
Note: Artifactory integration requires Artifactory version 6.13 or above. Artifactory version 7.x+ is highly recommended.
- Inside of Artifactory, create a remote repository with the generic type. For the Repository Key, enter "rspm-checkpoints". For the repository URL, enter:
- Remove the "**/*" field from the Include Patterns and add "**/bioconductor.json", "**/checkpoints.json", and "**/config.yaml"
- Navigate to the Advanced tab of the New Remote Repository and uncheck the Store Artifacts Locally checkbox:
- Create another remote repository with the generic type. For the Repository Key, enter "rspm-cache". For the repository URL, enter:
- Set the Exclude Patterns to "**/bioconductor.json", "**/checkpoints.json", and "**/config.yaml".
- Create a virtual repository with the generic type. For the Repository Key, enter "rspm-sync". Add the "rspm-checkpoints" and "rspm-cache" repositories to the list of selected repositories.
- ssh into the server where RStudio Package Manager is installed. Make sure that RStudio Package Manager is stopped:
$ sudo systemctl stop rstudio-pm
- Edit the RStudio Package Manager configuration file to add the following configuration section:
URL = "https://<artifactory-server-address>:8081/artifactory/rspm-sync"
If your Artifactory repository requires authentication, include the username and password secret in the URL following Artifactory's instructions for accessing the remote repository created in step 1.
- Restart RStudio Package Manager:
$ sudo systemctl start rstudio-pm
- Follow the Getting Started steps in RStudio Package Manager to sync Package Manager and create a repository that subscribes to CRAN.
To verify the integration is complete, you should see the following signs of success.
In RStudio Package Manager, you should see a repository with an Activity Log showing the addition of CRAN packages.
click to expand
- The integration is complete! Follow the instructions in RStudio Package Manager for configuring access to R packages. R users will access packages from RStudio Package Manager instead of accessing them directly from Artifactory.
For more information on the Virtual Repository and how to cache only certain artifacts, see this article.