Skip to content

Commit 75a2350

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 75a2350

19 files changed

+1194
-102
lines changed

src/anaconda/NOTES.md

+40-5
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

+46-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
```json
99
"features": {
10-
"ghcr.io/devcontainers/features/anaconda:1": {}
10+
"ghcr.io/ran-dall/devcontainer-features/anaconda:1": {}
1111
}
1212
```
1313

@@ -16,29 +16,68 @@
1616
| Options Id | Description | Type | Default Value |
1717
|-----|-----|-----|-----|
1818
| version | Select or enter an anaconda version. | string | latest |
19+
| useCondaForge | Set conda-forge as the default channel for better package compatibility | boolean | true |
20+
| installMamba | Install mamba for faster package management | boolean | true |
21+
| useSystemPackages | Use system package manager on Debian/Ubuntu systems to install Conda | boolean | true |
22+
| installFullAnaconda | Install full Anaconda distribution instead of minimal Miniconda | boolean | false |
1923

20-
## Using Conda
24+
## Using Conda and Mamba
2125

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 ).
26+
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.
2327

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.
28+
### Configuration Options
29+
30+
This Feature offers several configuration options:
31+
32+
- **useCondaForge**: Set to `true` (default) to use conda-forge as the default channel, which offers better package compatibility and more permissive licensing.
33+
- **installMamba**: Set to `true` (default) to install Mamba alongside Conda for faster package management.
34+
- **useSystemPackages**: Set to `true` (default) to use the system package manager on Debian/Ubuntu systems to install Conda.
35+
- **installFullAnaconda**: Set to `true` to install the full Anaconda distribution instead of the minimal Miniconda. Defaults to `false`.
36+
37+
### Using Mamba
38+
39+
When Mamba is installed, you can use the following commands and aliases for faster package management:
40+
41+
```bash
42+
# Use mamba directly
43+
mamba install package-name
44+
45+
# Use aliases that are automatically set up
46+
conda-fast install package-name
47+
cf install package-name
48+
```
49+
50+
Mamba uses the same command syntax as conda but resolves dependencies much faster, especially for complex environments.
51+
52+
### Conda Channels
53+
54+
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).
55+
56+
## Licensing Information
57+
58+
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.
59+
60+
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.
61+
62+
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.
2563

2664
## Installing a different version of Python
2765

2866
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:
2967

3068
```bash
3169
conda install python=3.7
70+
# Or faster with mamba
71+
mamba install python=3.7
3272
```
3373

34-
3574
## OS Support
3675

37-
This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed.
76+
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.
3877

3978
`bash` is required to execute the `install.sh` script.
4079

4180

4281
---
4382

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`._
83+
_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`._

src/anaconda/devcontainer-feature.json

+22-2
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)