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 and Python.

Why should I consider Package Manager if I already have Artifactory?

While Artifactory provides basic support for CRAN and PyPI packages, many data science teams face additional challenges:

  • Version Management: While Artifactory provides access to CRAN and PyPI 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 and PyPI repositories, making it possible for old code to “just work”.
  • Approved Subsets of CRAN and PyPI: Artifactory proxies all of CRAN and PyPI, but often organizations require restricted access to approved subsets of CRAN or PyPI. Package Manager allows organizations to create curated subsets of CRAN and curated subsets of PyPI.
  • Linux Binary Packages for CRAN: 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.
  • Bioconductor Packages: Artifactory does not natively support Bioconductor packages for R. Package Manager supports mirroring Bioconductor packages as either a Bioconductor mirror or a CRAN-like repository.

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

Artifactory and Posit Flowchart

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

  1. In Artifactory, create a Remote Repository with the Generic type.

    For the Repository Key, enter:

    package-manager-sync-remote

    For the repository URL, enter:

    https://rspm-sync.rstudio.com

    Set the Exclude Patterns to the following patterns:

    **/checkpoints/*.json
    **/bin/**
    **/packages/**
    **/rsf/**

    Screenshot in Artifactory showing the settings for the Remote Repository - Generic Type

    Screenshot in Artifactory showing the Patterns settings

  2. Navigate to the Advanced tab of the New Remote Repository and clear the Store Artifacts Locally checkbox. The remaining default settings are appropriate.

    Advanced Tab Screenshot

  3. Create another Remote Repository with the Generic type. For the Repository Key, enter:

    package-manager-sync-cached

    For the Repository URL, enter:

    https://rspm-sync.rstudio.com

    Set Include Patterns to the following patterns:

    **/checkpoints/*.json
    **/bin/**
    **/packages/**
    **/rsf/**

    Screenshot in Artifactory showing the settings for the second Remote Repository

    Screenshot in Artifactory showing the Patterns settings for the second Remote Repository

  4. Create a Virtual Repository with the Generic type. For the Repository Key, enter:

    package-manager-sync

    Add the package-manager-sync-remote and package-manager-sync-cached repositories to the list of selected repositories.

    Screenshot showing how to add the repositories to the generic virtual repository

  5. 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 and package-manager-sync-cached remote repositories.

    Screenshot showing authentication steps for Artifactory repository

  6. 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.
  7. 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, add the credentials to the Manifest.User and Manifest.Password settings. The password may be encrypted for better security. See the Configuration Encryption section for more details.

    /etc/rstudio-pm/rstudio-pm.gcfg
    [Manifest]
    URL = "http://<server-address>:<port>/artifactory/package-manager-sync"
    User = "<username>"
    Password = "<encrypted or plain text password>"
  8. Edit the configuration file to skip duplicating packages served from Artifactory:

    [Server]
    RetainFetchedPackages = no
  9. Restart Package Manager:

    Terminal
    sudo systemctl restart rstudio-pm
  10. 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

    Screenshot showing successful Activity Log in Posit Package Manager

    Note

    R and Python users will install packages from Package Manager instead of installing them directly from Artifactory.

Back to top