Setting up a custom repository location
Configure custom Python PIP and R CRAN package repository locations by using environment variables and configuration files to install packages in air-gapped environments. You can set custom default locations for Python and R package repositories. Custom repository locations are useful for air-gapped clusters that are isolated from public PIP and CRAN repositories on the internet.
Configuring Python PIP repositories
Custom PIP repositories can be set as default for all workloads at a site or project level. Site-level environment variables apply across the entire site, while project-level environment variables override site-level settings.
To configure custom PIP repositories, set the environment variables at the appropriate level:
- Site-level configuration:
- In the Cloudera console, click
the Cloudera AI tile.
The Cloudera AI Workbenches page displays.
- Click on the name of the workbench.
The workbenches Home page displays.
-
Go to .
-
Click Add Variable.
-
Enter the following environment variables:
PIP_INDEX_URL = [***PRIMARY INDEX URL***] PIP_EXTRA_INDEX_URL = [***ADDITIONAL INDEX URL***] (OPTIONAL)
- In the Cloudera console, click
the Cloudera AI tile.
- Project-level configuration:
- In the Cloudera console, click
the Cloudera AI tile.
The Cloudera AI Workbenches page displays.
- Click on the name of the workbench.
The workbenches Home page displays.
- Select the applicable workbench.
The workbenches Home page displays.
- Select the applicable Project.
- Click Project Settings from the left navigation menu.
- Select the Advanced tab and go to the Environment variables section.
- Select the
icon to add an environment variable.
- In the Cloudera console, click
the Cloudera AI tile.
Configuring CRAN repository
Custom CRAN repositories must be set within an active session or as part of a custom engine. To set a new default URL for a CRAN repository, add the following line to the /home/cdsw/.Rprofile configuration file:
options(repos=structure(c(CRAN="<mirror URL>")))
