Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion features/src/mambaforge/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export MAMBA_NO_BANNER="${MAMBA_NO_BANNER:-1}";
# Temporarily allow unbound variables for conda activation.
nounseton="$(shopt -o nounset | tr -d '[:blank:]')";
set +u;
for default_conda_env_name in ${DEFAULT_CONDA_ENV:-} ${CONDA_DEFAULT_ENV:-} base; do
for default_conda_env_name in "${DEFAULT_CONDA_ENV:-}" "${CONDA_DEFAULT_ENV:-}" "${MAMBA_DEFAULT_ENV:-}" base; do
if [ -z "${default_conda_env_name:-}" ]; then continue; fi
if grep -qF "(${default_conda_env_name})" <<< "${CONDA_PROMPT_MODIFIER:-}"; then break; fi
if conda activate "${default_conda_env_name}" 2>/dev/null; then break; else continue; fi
Expand Down
2 changes: 1 addition & 1 deletion features/src/mambaforge/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Mambaforge",
"id": "mambaforge",
"version": "26.8.0",
"version": "26.8.1",
"description": "A feature to install mambaforge",
"options": {
"version": {
Expand Down
4 changes: 1 addition & 3 deletions features/src/mambaforge/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ EOF
# Create and/or replace mamba.sh with a version that doesn't print warnings to stdout (https://github.com/mamba-org/mamba/pull/3788)
# This also protects us when mamba decides to remove this file, which is a decision that is incompatible with this feature.
cat <<"EOF" > /opt/conda/etc/profile.d/mamba.sh
if [ -z "${MAMBA_ROOT_PREFIX:-}" ]; then
export MAMBA_ROOT_PREFIX="${CONDA_PREFIX:-/opt/conda}"
fi
export MAMBA_ROOT_PREFIX="${HOME}/.conda"
__mamba_setup="$("/opt/conda/bin/mamba" shell hook --shell posix 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__mamba_setup"
Expand Down
1 change: 1 addition & 0 deletions features/src/rapids-build-utils/.bashrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export CONDA_ALWAYS_YES="true";
export MAMBA_ALWAYS_YES="true";
export CC="${CC:-"/usr/bin/gcc"}";
export CXX="${CXX:-"/usr/bin/g++"}";
export CUDAHOSTCXX="${CXX}";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "NVIDIA RAPIDS devcontainer build utilities",
"id": "rapids-build-utils",
"version": "26.8.1",
"version": "26.8.2",
"description": "A feature to install the RAPIDS devcontainer build utilities",
"containerEnv": {
"BASH_ENV": "/etc/bash.bash_env"
Expand Down
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like as of #249 we are always making conda envs from scratch rather than updating. That being the case, can we narrow what's done conditionally here and merge more of the code paths for creating/updating? The comments are also a bit out of date relative to the current state of how it's working now.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we always delete and recreate the env instead of updating it, because conda doesn't clean up after itself.

Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ make_conda_env() {
cat "${new_env_path}";
echo "";

conda env create "${q[@]}" -n "${env_name}" -f "${new_env_path}" --solver=libmamba;
mamba env create "${q[@]}" -n "${env_name}" -f "${new_env_path}";
# If the conda env does exist but it's different from the generated one,
# print the diff between the envs and update it
elif ! diff -BNqw "${old_env_path}" "${new_env_path}" >/dev/null 2>&1; then
Expand All @@ -73,7 +73,7 @@ make_conda_env() {
# We mount in the package cache, so this should still be fast in most cases.
rm -rf "${HOME}/.conda/envs/${env_name}";

conda env create "${q[@]}" -n "${env_name}" -f "${new_env_path}" --solver=libmamba;
mamba env create "${q[@]}" -n "${env_name}" -f "${new_env_path}";
fi

cp -a "${new_env_path}" "${old_env_path}";
Expand Down
Loading