conda-quickstart
Last updated on
Prerequisites
- Ensure you have the Conda CLI (
conda) and Harness CLI installed on your local machine. - Access to a Harness account with appropriate permissions to create registries and connectors.
Create a Conda Artifact Registry
- Interactive Guide
- Step-by-Step
- Navigate to the Artifact Registry module in your Harness project.
- Click on New Artifact Registry.
- In the Registry Type dropdown, select Conda Registry.
- Provide a Registry Name.
- Your registry name must start with a letter and can include
lowercase alphanumerics,_,.and-.
- Your registry name must start with a letter and can include
- Optionally, add a Description and Labels for better organization.
- Choose visibility between Public and Private. By default, the visibility is set to Private.
- Click Create Registry to finalize.
private registry
This registry will serve as your private Conda registry within Harness.
Configure an Upstream Proxy (Optional)
An upstream proxy allows your registry to fetch Conda packages from external sources if they are not available locally.
- Interactive Guide
- Step-by-Step
Create an upstream proxy
Configure the upstream proxy in your registry
Create an upstream proxy
- In the Artifact Registry module, click the dropdown next to New Artifact Registry and select Upstream Proxy.
- Choose Conda Registry as the proxy type.
- Click Create Proxy to establish the connection.
Configure the upstream proxy in your registry
- In the Artifact Registry module, select an existing Conda Artifact Registry.
- Select the Configuration tab.
- Under Advanced (Optional), select Configure Upstream.
- Select from the list of compatible proxies to add them to your registry.
- Click Save to save the configuration.
upstream proxy caching
If a Conda package isn’t found in your Harness registry, the upstream proxy fetches it from an external registry like bioconda, reducing duplication and improving package resolution.
Publish & Install Conda packages
Authenticate the Conda client
- In your Harness Conda Artifact Registry, click Setup Client.
- Click Generate Token to generate an identity token.
Publish a Conda package
- Build a conda package using Conda CLI
conda build <PATH_TO_CONDA>
- Deploy the conda package to your Harness registry using the following command (using Harness CLI).
hc artifact push conda <REGISTRY_NAME> <FILE_PATH> --pkg-url pkg.app.harness.io
Install a Conda package
- Install the conda package using Conda.
conda install --channel https://<HARNESS_USERNAME>:<TOKEN>@pkg.harness.io/pkg/<HARNESS_ACCOUNT_ID>/<CONDA_REGISTRY_NAME>/conda <ARTIFACT_NAME>=<VERSION>
Troubleshooting
If you encounter issues with package installation or updates, try clearing the Conda cache:
Clear Index Cache:
conda clean --index-cache
This removes the cached channel index, forcing Conda to fetch fresh package metadata.
Clear Cached Packages:
conda clean --packages --tarballs -y
This removes unused packages and compressed package files from the cache, freeing up disk space and resolving potential corruption issues.