Artifactory#
Advanced
This section explains why you would use Posit Package Manager in addition to Artifactory, and provides the necessary integration steps.
Why use 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 Package Manager.
Do I need Artifactory if I only have Package Manager?
No, Package Manager is a complete solution for data science teams using R.
Why should I consider 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. Package Manager makes this process easier by versioning the CRAN repository and 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. Package Manager uses knowledge of package dependencies to help organizations maintain these validated subsets.
- Linux Binary Packages: Artifactory proxies directly from CRAN, which means its support on Linux systems is limited to source packages that can take a long time to compile. Package Manager provides access to pre-compiled binary packages that make package installation fast enough to prevent disruptions and make it drastically easier to implement automation.
Fortunately, teams do not have to pick between IT-supported Artifactory and the benefits of Package Manager; the two tools can be combined.
This integration is especially helpful for organizations that wish to have Package Manager offline and are able to use Artifactory as a pass-through proxy to online package sources.
Note
In the Package Manager and Artifactory integration, Package Manager still configures CRAN, Bioconductor, and PyPI repositories, not Artifactory. Package Manager downloads packages through the Artifactory proxy, rather than the Posit Package Service directly.
How to use Package Manager with Artifactory#
The purpose of these steps is to enable Package Manager to sync CRAN, Bioconductor, and PyPI packages from Artifactory.
Important
Artifactory integration requires Artifactory version 6.13 or above. Artifactory version 7.x or above is highly recommended.
Integrating Artifactory and Package Manager#
-
In Artifactory, create a Remote Repository with the Generic type.
For the Repository Key, enter:
For the repository URL, enter:
Set the Exclude Patterns to the following patterns:
-
Navigate to the Advanced tab of the New Remote Repository and clear the Store Artifacts Locally checkbox. The remaining default settings are appropriate.
-
Create another Remote Repository with the Generic type. For the Repository Key, enter:
For the Repository URL, enter:
Set Include Patterns to the following patterns:
-
Create a Virtual Repository with the Generic type. For the Repository Key, enter:
Add the
package-manager-sync-remote
andpackage-manager-sync-cached
repositories to the list of selected repositories. -
If your Artifactory repository requires authentication, ensure that the user account to be used has both Read and Deploy/Cache permissions for both the
package-manager-sync-remote
andpackage-manager-sync-cached
remote repositories. -
Find the Artifactory repository URL for the
package-manager-sync
repository.- For Artifactory Self-Hosted instances, the default URL is typically
http://localhost:8081/artifactory/package-manager-sync
. - For Artifactory Cloud instances, the the default URL is typically
https://<server-address>/artifactory/package-manager-sync
.
- For Artifactory Self-Hosted instances, the default URL is typically
-
Edit the Package Manager configuration file to configure Package Manager to sync packages from Artifactory.
Add a "Manifest.URL" setting with the Artifactory repository URL as the value.
/etc/rstudio-pm/rstudio-pm.gcfg[Manifest] URL = "http://<server-address>:<port>/artifactory/package-manager-sync"
If your Artifactory repository requires authentication, include the username and password in the URL:
/etc/rstudio-pm/rstudio-pm.gcfg[Manifest] URL = "http://<username>:<password>@<server-address>:<port>/artifactory/package-manager-sync"
Tip
As of Posit Package Manager 2022.11.0, you can alternatively use the
Manifest.User
andManifest.Password
settings to provide a more secure, encrypted password. See the Configuration Encryption section of this admin guide for more details. -
Edit the configuration file to skip duplicating packages served from Artifactory:
-
Restart Package Manager:
-
Follow the Quick Start section of this admin guide to create and sync a CRAN, Bioconductor, or PyPI repository.
To verify the integration is complete, navigate to the Activity page in your instance of Package Manager. A repository with an Activity Log showing the addition of CRAN, Bioconductor, or PyPI packages displays.
Note
R and Python users will install packages from Package Manager instead of installing them directly from Artifactory.