Skip to content

Commit bb72c1b

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 bb72c1b

18 files changed

+1136
-104
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

+31-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
21
# Anaconda (anaconda)
32

4-
5-
63
## Example Usage
74

85
```json
@@ -16,29 +13,54 @@
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
1922

20-
## Using Conda
23+
This Feature includes [the `conda` package manager](https://docs.conda.io/projects/conda/en/latest/index.html) and by default also includes [the `mamba` package manager](https://mamba.readthedocs.io/en/latest/) for faster dependency resolution and package installation.
2124

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 ).
25+
When Mamba is installed, you can use it with the same syntax as conda:
2326

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.
27+
```bash
28+
mamba install numpy pandas
29+
```
30+
31+
The feature also sets up helpful aliases:
32+
```bash
33+
conda-fast install numpy pandas # Uses mamba
34+
cf install numpy pandas # Another alias for mamba
35+
```
36+
37+
Additional packages will be downloaded from conda-forge by default (more permissive licensing) or from Anaconda if you change the configuration. To reconfigure channels, please see information on [configuring Conda channels here](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/channels.html).
38+
39+
## Licensing Information
40+
41+
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.
42+
43+
By default, this feature uses conda-forge as the primary channel, which has more permissive licensing than the default Anaconda repository.
44+
45+
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.
2546

2647
## Installing a different version of Python
2748

2849
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:
2950

3051
```bash
3152
conda install python=3.7
53+
# Or faster with mamba
54+
mamba install python=3.7
3255
```
3356

34-
3557
## OS Support
3658

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

3961
`bash` is required to execute the `install.sh` script.
4062

4163

4264
---
4365

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

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)