Supported Formats
Conda Repository
Cloudsmith provides public & private repositories for Conda
Conda is a cross-platform, language-agnostic binary package manager. It is the package manager used by Anaconda installations.
For more information on Conda, please see:
Contextual Documentation
The examples in this document are generic. Cloudsmith provides contextual setup instructions within each repository, complete with copy and paste snippets (with your namespace/repo/rsa-key pre-configured).
In the following examples:
| Identifier | Description |
|---|---|
| OWNER | Your Cloudsmith account name or organization name (namespace) |
| REPOSITORY | Your Cloudsmith Repository name (also called "slug") |
| TOKEN | Your Cloudsmith Entitlement Token (see Entitlements for more details) |
| USERNAME | Your Cloudsmith username |
| PASSWORD | Your Cloudsmith password |
| API-KEY | Your Cloudsmith API Key |
| PACKAGE_NAME | The name of your package |
| PACKAGE_VERSION | The version number of your package |
Upload a Package
Creating Conda Packages
To upload via the Cloudsmith API/CLI, you'll need to generate a package first. You can do this with conda-build:
conda build .This generates a .tar.bz2 file like your-package-0.1.0.tar.bz2 that you can upload.
Upload via the Cloudsmith CLI
For full details of how to install and setup the Cloudsmith CLI, see Command Line Interface.
The command to upload Conda package via the Cloudsmith CLI is:
cloudsmith push conda OWNER/REPOSITORY PACKAGE_NAME-PACKAGE_VERSION.tar.bz2Example:
cloudsmith push conda my-org/my-repo your-package-0.1.0.tar.bz2Upload via Cloudsmith web app
Please see Upload a Package for details of how to upload via the Cloudsmith web app.
Download / Install a Package
Public Repositories
Adding a new channel can be accomplished by using the conda CLI:
conda config --add channels https://conda.cloudsmith.io/OWNER/REPOSITORY/Alternatively, the channel can be added directly to your .condarc:
channels:
- https://conda.cloudsmith.io/OWNER/REPOSITORY/
- defaultsOr if you prefer, directly in your environment.yml file:
name: env-name
channels:
- https://conda.cloudsmith.io/OWNER/REPOSITORY/
- defaults
dependencies:
- python=3.7
- codecovTo confirm the channel exists, you can view the channels configured for Conda by using:
conda config --showPrivate Repositories
Private Repositories
Private Cloudsmith repositories require authentication. You can choose between two types of authentication, Entitlement Token Authentication or HTTP Basic Authentication. The setup method will differ depending on what authentication type you choose to use.
Warning
Entitlement Tokens, User Credentials and API-Keys should be treated as secrets, and you should ensure that you do not commit them in configurations files along with source code, or expose them in any logs.
Adding a new channel can be accomplished by using the conda CLI:
conda config --add channels https://USERNAME:PASSWORD@conda.cloudsmith.io/OWNER/REPOSITORY/Alternatively, the channel can be added directly to your .condarc:
channels:
- https://USERNAME:PASSWORD@conda.cloudsmith.io/OWNER/REPOSITORY/
- defaultsOr if you prefer, directly in your environment.yml file:
name: env-name
channels:
- https://USERNAME:PASSWORD@conda.cloudsmith.io/OWNER/REPOSITORY/
- defaults
dependencies:
- python=3.7
- codecovInstall a Package
Once configured, you can install packages from your channel using the conda CLI:
conda install your-package=1.2.3Or you can search for packages via blended channels (multiple upstreams configured in your Cloudsmith repository) for any package:
conda search your-packageConda repodata patching
In certain scenarios, Conda package metadata may need to be patched. Patching is often required when a package dependency is updated, and backwards compatibility is broken, as in the following example:
package-a, version3.5.0depends onpackage-bwith a version constraint ofpackage-b >= 2.0.0.- A new major version of
package-bis released (3.0.0). This introduces breaking changes, making it incompatible with all previous versions ofpackage-a.
Repodata patching can be used to resolve the above scenario. For example, the dependency constraint can be amended (patched) to the more specific: package-b >= 2.0.0, <3. This approach does not alter the original package artifacts, and means no requirement is placed on package maintainers to re-release corrected versions of any existing (broken) packages.
Applying repodata patching
Patching is accomplished by applying patching instructions to a channel's repodata file (repodata.json). This file format is used by Conda channels to provide an index of all packages and their respective metadata within a specific subdirectory (subdir) of the channel. When a request is made for the relevant repodata.json file, the patch instructions are merged with the repodata, and the patched (modified) repodata is returned. An overview of this process is available here.
Cloudsmith provides a dedicated cloudsmith-conda-repodata-patches repository to facilitate the easy creation of patching instructions. This repository provides relevant scripts and instructions on how to add, generate and submit your patch instructions to Cloudsmith.
Note
Please note that when repodata patching is applied, either through patch instructions uploaded to the repository or from the upstream, the Cloudsmith repository version takes precedence. Patch instructions are applied on a per-package basis.
Upstream Proxying / Caching
Configurable Proxying CachingPlease see Upstream Proxying for more details.
Upstreams provide a way to blend multiple Conda repositories into a single repository. Cloudsmith supports proxying and caching from upstream repositories for any available channels. This means you can connect not just the canonical upstreams, but also other popular channels. For example, some of the largest upstream channels include: