Skip to content

Commit b4f1bb2

Browse files
committed
refactor(anaconda): ♻️ refactor & update to 24.5.0
This commit completely overhauls the Anaconda DevContainer feature to address outdated containers and compatibility issues across different environments. I've added Mamba support, which provides significantly faster package management alongside traditional Conda. The installation script now detects and adapts to various Linux distributions, making it more robust across platforms.
1 parent c264b4e commit b4f1bb2

19 files changed

+1202
-105
lines changed

src/anaconda/NOTES.md

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,55 @@
1-
## Using Conda
1+
## Using Conda and Mamba
22

3-
This Feature includes [the `conda` package manager](https://docs.conda.io/projects/conda/en/latest/index.html). Additional packages installed using Conda will be downloaded from Anaconda or another repository if you configure one. To reconfigure Conda in this container to access an alternative repository, please see information on [configuring Conda channels here](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/channels.html ).
3+
This Feature includes [the `conda` package manager](https://docs.conda.io/projects/conda/en/latest/index.html) and optionally [the `mamba` package manager](https://mamba.readthedocs.io/en/latest/), which provides faster dependency resolution and package installation. Additional packages will be downloaded from Anaconda, conda-forge, or another repository if you configure one.
44

5-
Access to the Anaconda repository is covered by the [Anaconda Terms of Service](https://legal.anaconda.com/policies/en/?name=terms-of-service), which may require some organizations to obtain a commercial license from Anaconda. **However**, when used with GitHub Codespaces or GitHub Actions, **all users are permitted** to use the Anaconda Repository through the service, including organizations normally required by Anaconda to obtain a paid license for commercial activities. Note that third-party packages may be licensed by their publishers in ways that impact your intellectual property, and are used at your own risk.
5+
### Configuration Options
6+
7+
This Feature offers several configuration options:
8+
9+
- **useCondaForge**: Set to `true` (default) to use conda-forge as the default channel, which offers better package compatibility and more permissive licensing.
10+
- **installMamba**: Set to `true` (default) to install Mamba alongside Conda for faster package management.
11+
- **useSystemPackages**: Set to `true` (default) to use the system package manager on Debian/Ubuntu systems to install Conda.
12+
- **installFullAnaconda**: Set to `true` to install the full Anaconda distribution instead of the minimal Miniconda. Defaults to `false`.
13+
14+
### Using Mamba
15+
16+
When Mamba is installed, you can use the following commands and aliases for faster package management:
17+
18+
```bash
19+
# Use mamba directly
20+
mamba install package-name
21+
22+
# Use aliases that are automatically set up
23+
conda-fast install package-name
24+
cf install package-name
25+
```
26+
27+
Mamba uses the same command syntax as conda but resolves dependencies much faster, especially for complex environments.
28+
29+
### Conda Channels
30+
31+
To reconfigure Conda in this container to access alternative repositories, please see information on [configuring Conda channels here](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/channels.html).
32+
33+
## Licensing Information
34+
35+
Access to the Anaconda repository is covered by the [Anaconda Terms of Service](https://legal.anaconda.com/policies/en/?name=terms-of-service), which may require some organizations to obtain a commercial license from Anaconda. **However**, when used with GitHub Codespaces or GitHub Actions, **all users are permitted** to use the Anaconda Repository through the service, including organizations normally required by Anaconda to obtain a paid license for commercial activities.
36+
37+
If you've enabled the `useCondaForge` option (default), your container will use conda-forge as the default channel, which has more permissive licensing than the default Anaconda repository.
38+
39+
Note that third-party packages may be licensed by their publishers in ways that impact your intellectual property, and are used at your own risk.
640

741
## Installing a different version of Python
842

943
As covered in the [user FAQ](https://docs.anaconda.com/anaconda/user-guide/faq) for Anaconda, you can install different versions of Python than the one in this image by running the following from a terminal:
1044

1145
```bash
1246
conda install python=3.7
47+
# Or faster with mamba
48+
mamba install python=3.7
1349
```
1450

15-
1651
## OS Support
1752

18-
This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed.
53+
This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. It also has limited support for RedHat-based systems, Alpine Linux, and openSUSE/SLES.
1954

2055
`bash` is required to execute the `install.sh` script.

src/anaconda/README.md

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
21
# Anaconda (anaconda)
32

4-
5-
63
## Example Usage
74

85
```json
96
"features": {
10-
"ghcr.io/devcontainers/features/anaconda:1": {}
7+
"ghcr.io/ran-dall/devcontainer-features/anaconda:1": {}
118
}
129
```
1310

@@ -16,29 +13,76 @@
1613
| Options Id | Description | Type | Default Value |
1714
|-----|-----|-----|-----|
1815
| version | Select or enter an anaconda version. | string | latest |
16+
| useCondaForge | Set conda-forge as the default channel for better package compatibility | boolean | true |
17+
| installMamba | Install mamba for faster package management | boolean | true |
18+
| useSystemPackages | Use system package manager on Debian/Ubuntu systems to install Conda | boolean | true |
19+
| installFullAnaconda | Install full Anaconda distribution instead of minimal Miniconda | boolean | false |
20+
21+
## Using Conda and Mamba
22+
23+
This Feature includes [the `conda` package manager](https://docs.conda.io/projects/conda/en/latest/index.html) and optionally [the `mamba` package manager](https://mamba.readthedocs.io/en/latest/), which provides faster dependency resolution and package installation. Additional packages will be downloaded from Anaconda, conda-forge, or another repository if you configure one.
1924

20-
## Using Conda
25+
### Configuration Options
2126

22-
This Feature includes [the `conda` package manager](https://docs.conda.io/projects/conda/en/latest/index.html). Additional packages installed using Conda will be downloaded from Anaconda or another repository if you configure one. To reconfigure Conda in this container to access an alternative repository, please see information on [configuring Conda channels here](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/channels.html ).
27+
This Feature offers several configuration options:
2328

24-
Access to the Anaconda repository is covered by the [Anaconda Terms of Service](https://legal.anaconda.com/policies/en/?name=terms-of-service), which may require some organizations to obtain a commercial license from Anaconda. **However**, when used with GitHub Codespaces or GitHub Actions, **all users are permitted** to use the Anaconda Repository through the service, including organizations normally required by Anaconda to obtain a paid license for commercial activities. Note that third-party packages may be licensed by their publishers in ways that impact your intellectual property, and are used at your own risk.
29+
- **useCondaForge**: Set to `true` (default) to use conda-forge as the default channel, which offers better package compatibility and more permissive licensing.
30+
- **installMamba**: Set to `true` (default) to install Mamba alongside Conda for faster package management.
31+
- **useSystemPackages**: Set to `true` (default) to use the system package manager on Debian/Ubuntu systems to install Conda.
32+
- **installFullAnaconda**: Set to `true` to install the full Anaconda distribution instead of the minimal Miniconda. Defaults to `false`.
33+
34+
### Using Mamba
35+
36+
When Mamba is installed, you can use the following commands and aliases for faster package management:
37+
38+
```bash
39+
# Use mamba directly
40+
mamba install package-name
41+
42+
# Use aliases that are automatically set up
43+
conda-fast install package-name
44+
cf install package-name
45+
```
46+
47+
Mamba uses the same command syntax as conda but resolves dependencies much faster, especially for complex environments.
48+
49+
### Conda Channels
50+
51+
To reconfigure Conda in this container to access alternative repositories, please see information on [configuring Conda channels here](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/channels.html).
52+
53+
## Licensing Information
54+
55+
Access to the Anaconda repository is covered by the [Anaconda Terms of Service](https://legal.anaconda.com/policies/en/?name=terms-of-service), which may require some organizations to obtain a commercial license from Anaconda. **However**, when used with GitHub Codespaces or GitHub Actions, **all users are permitted** to use the Anaconda Repository through the service, including organizations normally required by Anaconda to obtain a paid license for commercial activities.
56+
57+
<<<<<<< HEAD
58+
If you've enabled the `useCondaForge` option (default), your container will use conda-forge as the default channel, which has more permissive licensing than the default Anaconda repository.
59+
=======
60+
By default, this feature uses conda-forge as the primary channel, which has more permissive licensing than the default Anaconda repository.
61+
>>>>>>> bb72c1b1568bd22611e8d6c4f14ab0e936d02d12
62+
63+
Note that third-party packages may be licensed by their publishers in ways that impact your intellectual property, and are used at your own risk.
2564

2665
## Installing a different version of Python
2766

2867
As covered in the [user FAQ](https://docs.anaconda.com/anaconda/user-guide/faq) for Anaconda, you can install different versions of Python than the one in this image by running the following from a terminal:
2968

3069
```bash
3170
conda install python=3.7
71+
# Or faster with mamba
72+
mamba install python=3.7
3273
```
3374

34-
3575
## OS Support
3676

37-
This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed.
77+
This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. It also has limited support for RedHat-based systems, Alpine Linux, and openSUSE/SLES.
3878

3979
`bash` is required to execute the `install.sh` script.
4080

4181

4282
---
4383

44-
_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/devcontainers/features/blob/main/src/anaconda/devcontainer-feature.json). Add additional notes to a `NOTES.md`._
84+
<<<<<<< HEAD
85+
_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/ran-dall/devcontainer-features/blob/main/src/anaconda/devcontainer-feature.json). Add additional notes to a `NOTES.md`._
86+
=======
87+
_Note: This file was NOT auto-generated from the [devcontainer-feature.json](https://github.com/devcontainers/features/blob/main/src/anaconda/devcontainer-feature.json). Add additional notes to a `NOTES.md`._
88+
>>>>>>> bb72c1b1568bd22611e8d6c4f14ab0e936d02d12

src/anaconda/devcontainer-feature.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "anaconda",
3-
"version": "1.0.12",
3+
"version": "1.1.0",
44
"name": "Anaconda",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/anaconda",
66
"options": {
@@ -11,11 +11,31 @@
1111
],
1212
"default": "latest",
1313
"description": "Select or enter an anaconda version."
14+
},
15+
"useCondaForge": {
16+
"type": "boolean",
17+
"default": true,
18+
"description": "Set conda-forge as the default channel for better package compatibility"
19+
},
20+
"installMamba": {
21+
"type": "boolean",
22+
"default": true,
23+
"description": "Install mamba for faster package management"
24+
},
25+
"useSystemPackages": {
26+
"type": "boolean",
27+
"default": true,
28+
"description": "Use system package manager on Debian/Ubuntu systems to install Conda"
29+
},
30+
"installFullAnaconda": {
31+
"type": "boolean",
32+
"default": false,
33+
"description": "Install full Anaconda distribution instead of minimal Miniconda"
1434
}
1535
},
1636
"containerEnv": {
1737
"CONDA_DIR": "/usr/local/conda",
18-
"PATH": "/usr/local/conda/bin:${PATH}"
38+
"PATH": "/usr/local/conda/bin:/opt/conda/bin:${PATH}"
1939
},
2040
"installsAfter": [
2141
"ghcr.io/devcontainers/features/common-utils"

0 commit comments

Comments
 (0)