How Conda caching works
Conda channels publish a repodata.json per platform listing every package, and then the packages themselves. The repodata for conda-forge is large and changes constantly; the packages never change once published. Cacheport refreshes repodata on a schedule and keeps packages permanently.
Setting channel_alias makes short channel names like conda-forge resolve against Cacheport instead of conda.anaconda.org, without editing every environment file.
- repodata.json
- Refreshed every 15 minutes per channel and platform, stale copy on failure.
- Packages
- Both .conda and .tar.bz2 formats, cached forever.
- Channels
- Any public channel on conda.anaconda.org, plus private channels you add.
Set it up
.condarc
channel_alias: https://acme.cacheport.cc/conda/
channels:
- conda-forge
channel_priority: strictCredentials in CI
export CONDA_CHANNEL_ALIAS="https://ci:${CACHEPORT_TOKEN}@acme.cacheport.cc/conda/"
conda env create -f environment.ymlConda maps every setting to a CONDA_ environment variable, so the token can live in your CI secrets and never in .condarc.
Use it in CI
Store the token as a secret named CACHEPORT_TOKEN, then pick your provider.
GitHub Actions
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
env:
CONDA_CHANNEL_ALIAS: https://ci:${{ secrets.CACHEPORT_TOKEN }}@acme.cacheport.cc/conda/
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
environment-file: environment.yml
channels: conda-forge
- run: pytestMore for GitHub Actions: GitHub Actions setup guide.
GitLab CI
test:
image: condaforge/miniforge3
script:
- export CONDA_CHANNEL_ALIAS="https://ci:${CACHEPORT_TOKEN}@acme.cacheport.cc/conda/"
- conda env create -f environment.yml -n ci
- conda run -n ci pytestMore for GitLab CI: GitLab CI setup guide.
Licensing of the defaults channel
Cacheport proxies channels, it does not change their terms. Packages from conda-forge and bioconda are community channels. If you use Anaconda's own channels, the terms of service for those channels still apply to your organisation.