Skip to content

galaxyproject/ansible-miniconda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

galaxyproject.miniconda

An Ansible role for installing and managing Conda using Miniforge, micromamba, Miniconda or Anaconda. Additionally, the role can manage the creation of a Conda environment that can be used to create a venv for Galaxy.

Warning

Use of Miniconda and Anaconda by those at organizations with more than 200 employees or contractors (including Affiliates) requires a paid Anaconda Business license.

Requirements

A Conda-compatible version of Linux or macOS is required.

Role Variables

See defaults/main.yml for a full list.

The only required variable is miniconda_prefix, the root of the Conda installation.

The following two variables can be used to select the Conda installer and executable:

  • miniconda_distribution: the values can be miniforge (default), micromamba, miniconda or anaconda
  • miniconda_executable: the default value depend on the value of miniconda_distribution
    • mamba: when the distribution is miniforge
    • micromamba: when the distribution is micromamba
    • conda: when the distribution is miniconda or anaconda

To create arbitrary conda environments, use the variable miniconda_conda_environments as shown in the defaults, or the example below. The role will also update these environments if you change their list of packages or package versions.

To create an env named _galaxy_ for creating a venv for Galaxy, set galaxy_conda_create_env to true. You can then use {{ miniconda_prefix }}/envs/_galaxy_/bin/virtualenv as the value to galaxy_virtualenv_command in galaxyproject.galaxy. This is particularly useful if you need a cross-platform copy of Python and Galaxy's venv to be deployed on a shared filesystem between a Galaxy server and cluster that may not have matching OS distributions and versions.

Terms of Service (ToS) for Conda Channels

Some Conda channels require explicit acceptance of their Terms of Service (ToS) before you can use them.

Configuring ToS Acceptance

You can pre-accept the ToS for specific channels by setting the following variables in your playbook or inventory:

miniconda_tos_channels:
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r

miniconda_tos_packages:
  - conda-anaconda-tos  # required for Miniforge and older versions of Miniconda/Anaconda

Important: The galaxyproject.miniconda role does not accept any Terms of Service automatically. If you need to use channels that require ToS acceptance, you must configure the variables above explicitly.

Legal Note

Packages from these main and r channels are subject to the Anaconda Repository Terms of Service.

Among other restrictions, the ToS prohibits:

  • heavy commercial use without a license, and
  • mirroring by third parties for commercial purposes.

ToS Support by Distribution

  • miniconda: Supported out of the box in recent versions.
  • anaconda: Supported out of the box in recent versions.
  • miniforge: Supported when miniconda_tos_packages: [conda-anaconda-tos] is defined.
  • micromamba: Not supported.

Dependencies

None

Example Playbook

- hosts: localhost
  vars:
    miniconda_prefix: /conda           # required
    miniconda_distribution: miniforge  # optional
    miniconda_executable: mamba        # optional
    miniconda_conda_environments:
      python@3.9:
        channels:                     # optional, defaults to miniconda_channels
          - conda-forge
          - defaults
        packages:
          - python=3.9
  connection: local
  roles:
     - galaxyproject.miniconda

License

MIT

Author Information

View contributors on GitHub

About

An Ansible role for managing a Miniconda installation.

Topics

Resources

Contributing

Stars

6 stars

Watchers

8 watching

Forks

Contributors