https://github.com/bast/apptainer-conda

Local Conda environments via Apptainer.

https://github.com/bast/apptainer-conda

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.6%) to scientific vocabulary

Keywords

apptainer conda containers micromamba singularity
Last synced: 5 months ago · JSON representation

Repository

Local Conda environments via Apptainer.

Basic Info
  • Host: GitHub
  • Owner: bast
  • License: mit
  • Default Branch: main
  • Homepage:
  • Size: 22.5 KB
Statistics
  • Stars: 10
  • Watchers: 3
  • Forks: 0
  • Open Issues: 0
  • Releases: 2
Topics
apptainer conda containers micromamba singularity
Created about 4 years ago · Last pushed 9 months ago
Metadata Files
Readme License

README.md

Local Conda environments via Apptainer

The nice thing about this approach is that you don't need to install Conda and you don't need to modify your environment/bashrc/settings.

I use it to install dependencies that may be tough to install on a supercomputer or on my NixOS environment.

How to fetch the image: $ apptainer pull https://github.com/bast/apptainer-conda/releases/download/0.8.0/conda.sif

Usage

  • Reads the Conda environment file environment.yml.
  • Creates the folder environment.

Run myscript.py inside the Conda environment defined by environment.yml: $ ./conda.sif python myscript.py

Open Python shell inside the Conda environment defined by environment.yml: $ ./conda.sif python

First time you run either of the above commands it will take a bit of time since it needs to install the dependencies into the environment folder. However, subsequent runs will start basically immediately since the environment is then there.

Micromamba and environment files

Under the hood, it uses Micromamba instead of Conda in order to speed up installations but it should not really matter for the functionality.

The one place where I found it to matter is that you have to specify channels in the environment file.

Instead of this (example taken from conda documentation): yaml name: stats dependencies: - numpy - pandas You need to do this: yaml name: stats channels: - defaults dependencies: - numpy - pandas

But I believe that specifying channels explicitly is anyway good practice.

Running on a supercomputer/cluster

On a cluster you might need to bind folders like here: $ env APPTAINER_BIND="/cluster" ./conda.sif python


To build the image, I have used this wonderful guide as starting point and inspiration.

Owner

  • Name: Radovan Bast
  • Login: bast
  • Kind: user
  • Location: Tromsø, Norway
  • Company: @uit-no @neicnordic

Theoretical chemist turned research software engineer. Leads @coderefinery.

GitHub Events

Total
  • Release event: 1
  • Delete event: 2
  • Push event: 3
  • Pull request event: 3
  • Fork event: 1
  • Create event: 3
Last Year
  • Release event: 1
  • Delete event: 2
  • Push event: 3
  • Pull request event: 3
  • Fork event: 1
  • Create event: 3

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 4
  • Total pull requests: 7
  • Average time to close issues: 10 days
  • Average time to close pull requests: 4 minutes
  • Total issue authors: 3
  • Total pull request authors: 1
  • Average comments per issue: 2.75
  • Average comments per pull request: 0.0
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 minute
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • bast (2)
  • knutfrode (1)
  • gauteh (1)
Pull Request Authors
  • bast (9)
Top Labels
Issue Labels
Pull Request Labels