Skip to content

Commit 8422002

Browse files
committed
put micromamba in /usr/local/bin
instead of tmp, since we want it to stick around.
1 parent 8c21b96 commit 8422002

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed

repo2docker/buildpacks/conda/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def get_build_env(self):
5656
("NPM_CONFIG_GLOBALCONFIG", "${NPM_DIR}/npmrc"),
5757
("NB_ENVIRONMENT_FILE", self._nb_environment_file),
5858
("MAMBA_ROOT_PREFIX", "${CONDA_DIR}"),
59-
("MAMBA_EXE", "/tmp/bin/micromamba"),
59+
("MAMBA_EXE", "/usr/local/bin/micromamba"),
6060
]
6161
if self._nb_requirements_file:
6262
env.append(("NB_REQUIREMENTS_FILE", self._nb_requirements_file))

repo2docker/buildpacks/conda/activate-conda.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# enable conda and activate the notebook environment
2-
/tmp/bin/micromamba shell init -s bash -p ${CONDA_DIR}
2+
micromamba shell init -s bash -p ${CONDA_DIR}
33
export MAMBA_ROOT_PREFIX="/srv/conda"
44
CONDA_PROFILE="${CONDA_DIR}/etc/profile.d/mamba.sh"
55
test -f $CONDA_PROFILE && . $CONDA_PROFILE

repo2docker/buildpacks/conda/install-base-env.bash

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ URL="https://anaconda.org/conda-forge/micromamba/${MAMBA_VERSION}/download/linux
1515
unset HOME
1616
mkdir -p ${CONDA_DIR}
1717

18-
time wget -qO- ${URL} | tar -xvj bin/micromamba
19-
chmod 0755 /tmp/bin/micromamba
20-
2118
export MAMBA_ROOT_PREFIX=${CONDA_DIR}
22-
export MAMBA_EXE="/tmp/bin/micromamba"
19+
export MAMBA_EXE="/usr/local/bin/micromamba"
20+
21+
time wget -qO- ${URL} | tar -xvj bin/micromamba
22+
mv bin/micromamba "$MAMBA_EXE"
23+
chmod 0755 "$MAMBA_EXE"
2324

24-
eval "$(/tmp/bin/micromamba shell hook -p ${CONDA_DIR} -s posix)"
25+
eval "$(${MAMBA_EXE} shell hook -p ${CONDA_DIR} -s posix)"
2526

2627
micromamba activate
2728

tests/conda/binder-dir/verify

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from subprocess import check_output
44

55
assert sys.version_info[:2] == (3, 5), sys.version
66

7-
out = check_output(["/tmp/bin/micromamba", "--version"]).decode("utf8").strip()
7+
out = check_output(["micromamba", "--version"]).decode("utf8").strip()
88
assert (
99
out
1010
== """micromamba: 0.19.1

tests/conda/simple-py2/verify

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,13 @@ assert sorted(specs) == ["python2", "python3"], specs.keys()
1414
import json
1515
from subprocess import check_output
1616

17-
envs = json.loads(
18-
check_output(["/tmp/bin/micromamba", "env", "list", "--json"]).decode("utf8")
19-
)
17+
envs = json.loads(check_output(["micromamba", "env", "list", "--json"]).decode("utf8"))
2018
assert envs == {
2119
"envs": ["/srv/conda", "/srv/conda/envs/kernel", "/srv/conda/envs/notebook"]
2220
}, envs
2321

2422
pkgs = json.loads(
25-
check_output(["/tmp/bin/micromamba", "list", "-n", "kernel", "--json"]).decode(
26-
"utf8"
27-
)
23+
check_output(["micromamba", "list", "-n", "kernel", "--json"]).decode("utf8")
2824
)
2925
pkg_names = [pkg["name"] for pkg in pkgs]
3026
assert "ipykernel" in pkg_names, pkg_names

0 commit comments

Comments
 (0)