Configuration
Local Repositories
To enable calculation of Conda metadata, in the Administration module, go to Repositories | Repositories | Local and select Conda as the Package Type when you create your local repository.
Local Repository Layout
The local Conda repository in Artifactory gives you the flexibility of deploying your packages in a layout of your choice. When deploying Conda binaries into nested paths, it is important to ensure that the channel URL inside your .condarc
file correctly reflects the path of the packages. The Conda client automatically appends the host machine platform as a subdirectory in the channel URL. When you deploy these packages, you need to meet this requirement and upload your packages into the relevant subdirectories. For example, consider the following valid package path in Artifactory:
conda-local/osx-64/my-conda-package.tar.bz2
Based on this layout, the corresponding channel URL in your .condarc
file is:
<YOUR_SERVER_URL>/artifactory/api/conda/conda-local
In the above example, Conda will be appending the platform automatically (i.e osx-64
).
Another example shows a more detailed deployment path such as:
conda-local/my/own/layout/osx-64/my-conda-package.tar.bz2
In this example, the channel URL should be set as follows:
<YOUR_SERVER_URL>/artifactory/api/conda/conda-local/my/own/layout
Best Practice for Scaling Up
The Conda repository metadata is maintained on the package level, meaning that the parent directory of a Conda package is also the parent of the Conda repodata.json
metadata file. To scale with maximum efficiency, refrain from deploying large amounts of packages into a single parent directory when possible. To enable Artifactory metadata calculation processes to provide maximal performance, try to plan your local repository layouts in a way that supports modularity by avoiding directories with large amounts of artifacts as their direct children.
Remote Repositories
You can create a Conda remote repository to proxy and cache remote repositories or other Artifactory instances.
Note that the index files for remote Conda repositories are stored and renewed according to the Retrieval Cache Period setting on your remote repository.
Virtual Repositories
A virtual repository in Artifactory aggregates packages from both local and remote repositories allowing you to access both locally hosted Conda packages and remote proxied Conda libraries from a single URL defined for the virtual repository.
To create a virtual Conda repository, set Conda as the Package Type, and select the underlying local and remote Conda repositories to include under the Repositories section.
Virtual Repository Metadata
Resolving Conda Packages
Resolving Conda Packages in the UI
When a Conda repository is selected in the Artifacts Tree Browser, click Set Me Up to view the code snippets you can use to publish a Conda package or to configure your Conda client to resolve artifacts using the selected repository.
Resolving Conda Packages Using the Conda Client
1. Perform the process of settings up your .condarc
file according to the instructions in the Set Me Up page for Conda.
2. Install a package from your Artifatory Conda repository:
conda install <PACKAGE_NAME>
3. Install a package from a specific sub-channel inside your Conda repository:
conda install -c <CHANNEL_NAME> <PACKAGE_NAME>
4. Search for a package in your Artifactory Conda repository:
conda search <PACKGE_NAME>
Deploying Conda Packages
You can deploy packages to a local or virtual Conda repository using the Deploy feature in the UI or using an HTTP client of your choice.
Metadata Updates
The Conda metadata is automatically calculated and updated when adding, removing, copying or moving Conda packages. The calculation is only invoked after a package-related action is completed.
It may sometimes take up to 30 seconds to complete as the process is asynchronous and its performance depends on the overall system load.
Although rarely required, you may wish to invoke metadata calculation on the entire repository. This can be done using the Recalculate Index option after you right-click the repository in the Tree Browser, or via the REST API.
Setting the Default Deployment Repository
To deploy Conda packages to a virtual Conda repository, make sure you have set the Default Deployment Repository.
Deploying a Package Using the UI
You can drag and drop, or select a Conda package to upload in Deploy in the UI.
Deploying a Source Package
When deploying sources, the Target Path is automatically displayed and we recommend not changing this path. Changing the 'src/contrib
' path will result in Artifactory not identifying the package as a Conda package since Artifactory will not be able to index it.
Deploying a Package Using cURL
To deploy your package to an Artifactory repository you can either use the Artifactory web UI, or upload the package using an HTTP client such as cURL:
curl -XPUT ${USERNAME}:${PASSWORD} "http://localhost:8080/artifactory/conda-local/" -T my-package-1.0.0.tar.bz2
Viewing Individual Conda Package Information
In the Artifact Repository Browser, select your virtual Conda repository and scroll down to find and select the package you want to inspect. The metadata is displayed in the Conda Info tab.
Reindexing a Conda Repository
You can trigger asynchronous reindexing of a local Conda repository either through the UI or using the REST API.
Through the UI, select your Conda repository in the Repositories List and select Recalculate Index. This requires Admin permissions.
To reindex a Conda repository through the REST API, please refer to Calculate Conda Repository Metadata.
Tuning Metadata Worker Threads
Conda Metadata Workers
Conda calculates metadata asynchronously based on repository storage events. The number of total worker threads that handle metadata calculation in parallel (specifically for Conda tasks) defaults to 5. In larger scales, you may modify this parameter by editing your $JFROG_HOME/artifactory/var/etc/artifactory/artifactory.system.properties
file and adding the following parameter:
artifactory.conda.metadata.calculation.workers=<NUMBER_OF_WORKERS>