{"id":17036769,"url":"https://github.com/bast/apptainer-conda","last_synced_at":"2026-02-08T20:17:53.018Z","repository":{"id":45938800,"uuid":"431665851","full_name":"bast/apptainer-conda","owner":"bast","description":"Local Conda environments via Apptainer.","archived":false,"fork":false,"pushed_at":"2024-11-06T00:40:39.000Z","size":20,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-28T02:32:43.553Z","etag":null,"topics":["apptainer","conda","containers","micromamba","singularity"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-25T00:26:30.000Z","updated_at":"2024-11-06T00:40:43.000Z","dependencies_parsed_at":"2024-11-06T01:29:03.754Z","dependency_job_id":"440a96d7-dc0b-4e73-b293-595abf94db85","html_url":"https://github.com/bast/apptainer-conda","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bast%2Fapptainer-conda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bast%2Fapptainer-conda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bast%2Fapptainer-conda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bast%2Fapptainer-conda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bast","download_url":"https://codeload.github.com/bast/apptainer-conda/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245031363,"owners_count":20549914,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apptainer","conda","containers","micromamba","singularity"],"created_at":"2024-10-14T08:51:54.923Z","updated_at":"2026-02-08T20:17:53.012Z","avatar_url":"https://github.com/bast.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Local Conda environments via [Apptainer](https://apptainer.org/)\n\nThe nice thing about this approach is that you don't need to install Conda and\nyou don't need to modify your environment/bashrc/settings.\n\nI use it to install dependencies that may be tough to install on a\nsupercomputer or on my NixOS environment.\n\nHow to fetch the image:\n```\n$ apptainer pull https://github.com/bast/apptainer-conda/releases/download/0.9.0/conda.sif\n```\n\n## Usage\n\n- Reads the Conda environment file\n  [environment.yml](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#create-env-file-manually).\n- Creates the folder `environment`.\n\nRun `myscript.py` inside the Conda environment defined by `environment.yml`:\n```\n$ ./conda.sif python myscript.py\n```\n\nOpen Python shell inside the Conda environment defined by `environment.yml`:\n```\n$ ./conda.sif python\n```\n\nFirst time you run either of the above commands it will take a bit of time\nsince it needs to install the dependencies into the `environment` folder.\nHowever, subsequent runs will start basically immediately since the environment\nis then there.\n\n\n## Micromamba and environment files\n\nUnder the hood, it uses\n[Micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html)\ninstead of Conda in order to speed up installations but it should not really\nmatter for the functionality.\n\nThe one place where I found it to matter is that you have to specify `channels`\nin the environment file.\n\nInstead of this (example taken from [conda\ndocumentation](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#create-env-file-manually)):\n```yaml\nname: stats\ndependencies:\n  - numpy\n  - pandas\n```\n\nYou need to do this:\n```yaml\nname: stats\nchannels:\n  - conda-forge\ndependencies:\n  - numpy\n  - pandas\n```\n\nBut I believe that specifying channels explicitly is anyway good practice.\n\n\n## Running on a supercomputer/cluster\n\nOn a cluster you might need to bind folders like here:\n```\n$ env APPTAINER_BIND=\"/cluster\" ./conda.sif python\n```\n\n---\n\nTo build the image, I have used [this wonderful\nguide](https://github.com/singularityhub/singularity-deploy) as starting point\nand inspiration.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbast%2Fapptainer-conda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbast%2Fapptainer-conda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbast%2Fapptainer-conda/lists"}