Mirrors#

Mirroring is the process of copying the contents of an external repository locally, ensuring users have fast and reliable access to its packages. When you run a mirror, it populates your channel with packages from the mirror’s source. Anaconda recommends that channels contain only one mirror each to prevent conflicts between package sources.

For more information on channels, see Channels and subchannels.

Note

Mirroring is restricted to users whose role provides write or manage permissions for Channel Mirrors and/or Subchannel Mirrors categories.

Allowlist the following URLs before attempting to mirror:

Creating a mirror#

When creating a mirror, the recommended workflow is:

  1. Select a channel you want to contain your mirror.

  2. Open the Manage dropdown menu and select Freeze.

  3. Click Freeze.

  4. Open the Manage dropdown menu again and select Create Mirror.

  5. Complete the Create mirror form.

  6. Allow the mirror time to complete.

    How do I know when my mirror is complete?

    You can view the status of in progress mirrors from the All repository mirrors page, or from a channel’s Mirrors tab. In-progress mirrors display which step is currently being performed with a brief description of the operation.

  7. Open the Manage dropdown and select Unfreeze.

  8. Click Unfreeze.

Note

For more information on freezing and unfreezing a channel, see Freezing/Unfreezing Channels.

Create mirror form#

The Create mirror form allows you to set the configurations for your mirror. Let’s take a look at the different sections of the Create mirror form and what configurations they control.

  1. Mirror Name

    Enter a name for your mirror. Anaconda recommends you name your mirror something descriptive for your end users.

  2. Mirroring mode

    Choose whether you want your mirror to be active or passive.

    Active mirroring

    Active mirroring will download all the packages not filtered out of your mirror immediately to your local server. These mirrors can be extremely large in size; the Anaconda’s public repository is 700GB, the conda-forge repository is 3TB, and the PyPI repository is 10TB in their entirety! Due to this, active mirrors can take a long time to complete.

    Passive mirroring

    Passive mirroring creates a metadata file that is a complete list of packages on the mirrored server. When a user needs a package, they can run conda install <PKG_NAME> and the requested package will be downloaded from the source at that time.

    Note

    Regardless of which mirror you choose to create, the packages will be the same. Anaconda recommends establishing your mirrors as passive.

  3. External Source URL

    This is the URL of the server/repository you want to mirror.

    Anaconda recommends creating mirrors for the following external source channels:

    Note

    If your external source channel is another channel within Package Security Manager, you must use the format https://<URL>/api/repo/<CHANNEL_NAME>.

    If your external source channel is a channel from Anaconda Business, you must use the format https://repo.anaconda.cloud/repo/t/<TOKEN>/<ORG_ID>/<CHANNEL_NAME>.

  4. Mirror Type

    Set the type of packages that will be mirrored from the external source channel. This should align with the selection on the Create Channel form. Packages in this mirror that do not match the channel package type will be filtered out.

    You can choose from conda, standard python, or standard R package types. Make sure you have allowlisted the URLs listed at the top of this page before creating mirrors.

  5. Mirroring Frequency

    Set the frequency you want your mirror to run and update your packages. The default value instructs the mirror to update at midnight on the first day of every month.

    Custom frequencies use cron expressions to determine when they run.

    Caution

    Mirroring large channels can take several hours. Anaconda recommends against setting a frequency greater than Daily to avoid collisions between currently running and updating mirrors.

    Warning

    If you are mirroring the full PyPI repository, set your frequency to run once yearly. Once the PyPI mirror is complete, any attempts to re-run the mirror will cause issues.

  6. Run Now

    Check this box to start your mirror when you click Save & Run. If the Run Now box was not checked, your changes are saved, and the mirror runs the next time its frequency configuration instructs it to do so.

  7. Assign Mirror Policy

    Toggle between using the policy that is applied to the channel or selecting a policy to apply to the mirror. For more information about policies, see Policies.

    Note

    You cannot apply a policy to a mirror if it is already applied to the channel.

  8. View Applied Policy

    View the details of the applied policy.

  9. Cancel/Save & Run

    Select Cancel at any time to quit your mirror form completion and discard any set parameters. Select Save & Run to start your mirror.

Managing mirrors#

Select All Mirrors from the left-hand navigation to view mirrors globally for all users.

Note

  • This view is only available to users whose role provides Manage permissions for the mirror attribute. This value must be assigned in Keycloak.

Tip

Use the search box to locate a mirror by name. Click a column header to sort mirrors by Type, Mode, Mirroring Status, or Last Updated.

Mirror actions#

Use the icons in the Actions column to manage your mirrors:

Tip

Mirror actions can also be performed from a channel’s Mirrors tab.

Edit mirror - Edit a mirror’s configurations.

Note

You cannot edit the mode of an established mirror.

Stop running mirror - Stop an in-progress mirror.

Note

It can take up to 10 minutes for a mirror to fully stop. A mirror in the process of stopping will display Stopping as its mirroring status. Once it is complete, it will display Stopped as its status. Stopping a mirror does not discard the progress the mirror has made, and some packages may appear in your channel’s Packages tab.

Restart Mirror - Restart a stopped mirror.

Note

Restarted mirrors run from the beginning of the mirroring process, not from where you stopped the run.

See details - View information about how many packages were filtered from the source, reasons for their exclusion, and whether packages were mirrored passively or actively.

Delete mirror - Delete a mirror.

Download Dependency Report - Download a dependency report (if available)

  • A dependency report is a detailed list of all the software packages required for your specified packages to function correctly. It includes both direct dependencies (packages your specified packages require to run) and indirect dependencies (packages the dependencies require to run). A package dependency report can help you identify exactly which packages are necessary for your channel to be able to create a working environment using conda.

  • Dependency reports are only available for mirrors that have policies with specific configurations applied:
    • You must set package rules to allow packages by their names using MatchSpec protocol—a syntax for specifying package names and versions in conda

    • You must select the Include dependencies checkbox.