Artifactory natively supports Conda repositories for Python, R, Ruby, Lua, Scala, Java, JavaScript, C/ C++, FORTRAN and additional programming languages, giving you full control of your deployment and resolution process of Conda packages.

📘

Minimal supported Conda client version

Artifactory supports Conda Client version 4.12.0 and above. The latest version is recommended.

Conda repositories streamline package management by offering secure local hosting with fine-grained access control, proxying and caching remote packages for network independence, and aggregating all resources under a single virtual URL with built-in metadata calculation and version management.

For more information, refer to the Conda documentation.

art-packages-conda-repositories.png

Get Started with Conda

To get started working with Conda, complete the following main steps:

  1. Create a Conda Repository
  2. Deploy Conda Packages
  3. Resolve Conda Packages

Create a Conda Repository

This topic describes how to create a Conda Repository. This is required before publishing and installing Conda packages. There are three primary types of repositories:

  • Local repositories: Where you store and share 1st and 2nd party packages with your organization
  • Remote repositories: Enable you to download from any remote location, including external package registries or other Artifactory instances
  • Virtual repositories: Enable aggregating remote and local repositories, enabling your organization to scale by providing a single URL that provides access to multiple repositories and types

For more information on JFrog repositories, see Repository Management.

Prerequisite: You need Admin or Project Admin permissions to create a Conda repository. If you don't have Admin permissions, the option will not be available.

To create a Conda repository:

  1. In the Administration tab, click Repositories > Create a Repository

    art-debian-package-create-repository-06-30.png
  2. Select the repository type you want to create.

  3. Select the Conda package type.

  4. Configure the required fields:

    • For Local Repositories, in the Repository Key field, type a meaningful name for the repository. For example, conda-local-repository-1. For more information on local repositories and all their possible settings, see Local Repositories.

    • For Remote Repositories, additionally, verify the Repository URL and update if needed. For more information on Remote Repositories and all their possible settings, see Remote Repositories.

📘

Note

The index files for remote Conda repositories are stored and renewed according to the Retrieval Cache Period setting on your remote repository.

  • For Virtual Repositories, additionally select one or more local or remote repository types to include in the virtual repository. For more information on virtual repositories and all their possible settings, see Virtual Repositories.
📘

Virtual Repository Metadata

Artifactory maintains your aggregated virtual repository metadata in a clever way that keeps your metadata up-to-date by reflecting changes in the aggregated local repositories in real-time. For aggregated remote repositories, the virtual repository metadata is renewed on demand, in minimal intervals of 10 minutes by default. The renewal period is controlled using the Retrieval Cache Period parameter of your virtual repository.

  1. Click Create Repository. The repository is created, and the Repositories window is displayed.

Deploy Conda Packages

Deploying Conda packages makes them available to other users.

The following options are available for publishing Conda packages:

Deploy Conda Package Using the UI

  1. In the Platform tab, click Artifactory > Artifacts, then on the actions button, click Deploy (Upload). Deploy options are displayed.

    art-packages-conda-deploy-ui-07-08.png
  2. Select your Conda repository as the Target Repository, and upload the file you want to deploy.

  3. Check the Deploy as Conda Artifact checkbox. When deploying, ensure you upload the package to the correct Target Path that reflects its subdirectory (e.g., your-repo/linux-64/package-name.tar.bz2). Artifactory uses this path to correctly index the package.

  4. Verify the deploy options, then click Deploy. The package is deployed.

📘

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.

📘

Deploy a Conda 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.

Deploy a Conda Package Using cURL

You can deploy a Conda package using cURL, leveraging the Matrix Parameters to specify the distribution, component, and architecture.

To deploy your package to an Artifactory repository, you can either use the Artifactory web UI or upload the package using an HTTP client like cURL:

curl -L -<USERNAME>u:<PASSWORD> -T <PATH_TO_FILE> "https://company.jfrog.io/artifactory/conda-local/<TARGET_FILE_PATH>"

Where:

  • <username>:<password>: Your Artifactory credentials
  • <PATH_TO_FILE>: Local path to your .tar.bz2 Conda package
  • <TARGET_FILE_PATH>: Remote path in the repository
  • conda.channel: (Optional) Matrix param for channel name

Example

curl -L -john:<PASSWORD> -T ./linux-64/sample-1.0.0-py38_0.tar.bz2 \
"https://[JFrogPlatformURL]https://company.jfrog.io/artifactory/conda-local/linux-64/sample-1.0.0-py38_0.tar.bz2;conda.channel=main"

Resolve Conda Packages

You can resolve Conda packages from Local, Remote, and Virtual Conda Repositories specified as supporting Conda packages.

📘

Note

Applicable for Local, Remote, and Virtual repositories.

After setting up your .condarc, you may use the following command to resolve packages from Artifactory:

conda install <PACKAGE_NAME>

Example

conda install numpy

To install a package from a specific conda sub-channel, use the "-c" flag with the install command:

conda install -c <CHANNEL_NAME> <PACKAGE_NAME> 

Example

conda install -c https://company.jfrog.io/artifactory/api/conda/conda-virtual pandas

Additional Conda Actions

The following additional actions are available with Conda repositories:

Reindex a Conda Repository

You can trigger asynchronous reindexing of a local Conda repository either through the UI or using the REST API.

In the Artifacts tab, navigate to the Tree Browser, right-click your Conda repository, and select Recalculate Index.

For more information about how to reindex a Conda repository through the REST API, see Calculate Conda Repository Metadata API.

📘

Note

Reindexing Conda repositories is not instantaneous and may take up to a few hours. Reindexing time varies based on the number and size of packages in the repository.

Tune Conda Metadata Worker Threads

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>

View Individual Conda Package Information

Artifactory supports viewing selected Conda package metadata directly from the UI.

In the Artifacts tab, expand the repository in the browser and select the package file you want to inspect.