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-test" --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_NAME>/<SUBCHANNEL_NAME> -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.

../_images/managepack.png

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_NAME>[/<SUBCHANNEL_NAME>][::<PACKAGE>[/<VERSION>[/<FILE_NAME>]]]

# If file name 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_NAME>/<SUBCHANNEL_NAME>
conda repo move <spec> -d <CHANNEL_NAME>/<SUBCHANNEL_NAME>

# where dest =<CHANNEL_NAME>/<SUBCHANNEL_NAME>[::<PACKAGE>[/<VERSION>[/<FILE_NAME>]]]

#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