Using packages within channels/subchannels

There are several ways to get packages into a channel or subchannel:

  • Upload a package file directly to a channel

  • Create a mirror configuration and specify the source channel

  • Copy/move specific packages from another channel

This topic provides guidance on the following actions:


Uploading to a channel

Via the UI:

  1. Visit the channel you wish to upload packages to.

  2. Click on the action button on the right side of the Mirror button and select the option to Upload.

  3. In the modal that appears, select the file from your local computer that you wish to upload.

../_images/uploadtochan.png

A toast notification will appear informing you of success or failure.

or

  1. Click on the user icon and choose Upload Package.

  2. Choose the file to upload and what channel to upload it to.

../_images/uploadtochan2.png

Via the API:

POST /api/channels/{channel_name}/artifacts

Via the CLI:

conda repo upload -c <channel_name><file_path>

Uploading to a subchannel

Via the UI:

  1. Visit the subchannel you wish to upload packages to.

  2. Click on the action button on the right side and select the option to Upload.

  3. In the modal that appears, select the file from your local computer that you wish to upload.

A toast notification will appear informing you of success or failure.

or

  1. Click on the user icon and choose Upload Package.

  2. Choose the file to upload and what channel/subchannel combination to upload it to.

Via the API:

POST /api/channels/{channel_name}/subchannels/{subchannel_name}/artifacts

Via the CLI:

conda repo upload -c <channel_name>/<subchannel_name><file_path>

Mirror to/from a channel

Via the UI:

  1. As an admin user, visit the channel you wish to mirror to (the destination) and click the green Mirror button.

  2. Enter the source of the mirror and whether that source is internal (a channel on this repo) or external (a channel on some other repo such as http://www.anaconda.org).

  3. Indicate whether you wish for the mirror to be passive (one time only) or active (synced with the source channel).

Additionally, you will be presented with other options for your mirror such as CVE score restrictions and frequency.

Via the API:

POST /api/channels/{channel_name}/mirrors

Via the CLI:

conda repo mirror --create<mirror_name> -c <destination_channel> -s <source> --mode<mode>

# For example:
# conda repo mirror --create tm3 -c mychannel -s "https://conda.anaconda.org/conda-t est" --mode passive

Mirror to/from a subchannel

Via the UI:

TBD

Via the API:

POST /api/channels/{channel_name}/subchannels/{subchannel_name}/mirrors

Via the CLI:

conda repo mirror --create<mirror_name> -c <channel>/<subchannel> -s <source> --mode<mode>

# For example:
# conda repo mirror --create tm3 -c mychannel/dev -s "https://conda.anaconda.org/conda-test " --mode passive

Copy/move packages to/from a channel

Via the UI:

  1. Go to the channel you wish to copy packages to/move packages from.

  2. Click on the Packages tab, where you will see a list of all the packages in that channel.

  3. Select one or more packages, and then click move or copy to a new or existing channel.

Via the API:

POST /channels/{channel_name}/artifacts/bulk

Via the CLI:

conda repo copy <spec> -d<destination_channel>
conda repo move <spec> -d<destination_channel>

# where dest = <channel>[/<subchannel>][::<package>[/<version>[/<filename>]]]

# If filename is not given, copy all files in the version

# For example:
# conda repo copy john::bokeh/1.0.2/bokeh-1.0.2-py37_0.tar.bz2 -d john2
# conda repo move john::bokeh/1.0.2/bokeh-1.0.2-py37_0.tar.bz2 -d john2

Copy/move packages to/from a subchannel

Via the UI:

  1. Go to the subchannel you wish to copy packages to/move packages from.

  2. Click on the Packages tab, where you will see a list of all the packages in that subchannel.

  3. Select one or more packages, and then click move or copy to a new or existing channel or subchannel.

Via the API:

POST /channels/{channel_name}/artifacts/bulk

Via the CLI:

conda repo copy <spec> -d <channel>/<subchannel>
conda repo move <spec> -d <channel>/<subchannel>

# where dest =<channel>/<subchannel>[::<package>[/<version>[/<filename>]]]

#If filename is not given, copy all files in the version

# For example:
# conda repo copy john::bokeh/1.0.2/bokeh-1.0.2-py37_0.tar.bz2 -d john/ts2
# conda repo move john::bokeh/1.0.2/bokeh-1.0.2-py37_0.tar.bz2 -d john/ts2