docker-stacks icon indicating copy to clipboard operation
docker-stacks copied to clipboard

Docker stacks foundation image build fails with current mamba

Open vizeit opened this issue 1 year ago • 9 comments

What docker image(s) are you using?

base-notebook, docker-stacks-foundation, minimal-notebook, pytorch-notebook, scipy-notebook

Host OS system

Ubuntu 22.04

Host architecture

x86_64

What Docker command are you running?

Docker build

How to Reproduce the problem?

Build docker stacks foundation image, the build throws an error

Command output

No response

Expected behavior

No response

Actual behavior

build results into the following error,

#15 ERROR: process "/bin/bash -o pipefail -c set -x &&     arch=$(uname -m) &&     if [ \"${arch}\" = \"x86_64\" ]; then         arch=\"64\";     fi &&     wget --progress=dot:giga -O -         \"[https://micro.mamba.pm/api/micromamba/linux-${arch}/latest\](https://micro.mamba.pm/api/micromamba/linux-$%7Barch%7D/latest/)" | tar -xvj bin/micromamba &&     PYTHON_SPECIFIER=\"python=${PYTHON_VERSION}\" &&     if [[ \"${PYTHON_VERSION}\" == \"default\" ]]; then PYTHON_SPECIFIER=\"python\"; fi &&     ./bin/micromamba install         --root-prefix=\"${CONDA_DIR}\"         --prefix=\"${CONDA_DIR}\"         --yes         \"${PYTHON_SPECIFIER}\"         'mamba'         'jupyter_core' &&     rm -rf /tmp/bin/ &&     mamba list --full-name 'python' | tail -1 | tr -s ' ' | cut -d ' ' -f 1,2 | sed 's/\\.[^.]*$/.*/' >> \"${CONDA_DIR}/conda-meta/pinned\" &&     mamba clean --all -f -y &&     fix-permissions \"${CONDA_DIR}\" &&     fix-permissions \"/home/${NB_USER}\"" did not complete successfully: exit code: 109
------
 > [10/14] RUN set -x &&     arch=$(uname -m) &&     if [ "${arch}" = "x86_64" ]; then         arch="64";     fi &&     wget --progress=dot:giga -O -         "[https://micro.mamba.pm/api/micromamba/linux-${arch}/latest](https://micro.mamba.pm/api/micromamba/linux-$%7Barch%7D/latest)" | tar -xvj bin/micromamba &&     PYTHON_SPECIFIER="python=3.11" &&     if [[ "3.11" == "default" ]]; then PYTHON_SPECIFIER="python"; fi &&     ./bin/micromamba install         --root-prefix="/opt/conda"         --prefix="/opt/conda"         --yes         "${PYTHON_SPECIFIER}"         'mamba'         'jupyter_core' &&     rm -rf /tmp/bin/ &&     mamba list --full-name 'python' | tail -1 | tr -s ' ' | cut -d ' ' -f 1,2 | sed 's/\.[^.]*$/.*/' >> "/opt/conda/conda-meta/pinned" &&     mamba clean --all -f -y &&     fix-permissions "/opt/conda" &&     fix-permissions "/home/jovyan":
16.42     micromamba run -n base mycommand
16.42 
16.43 + rm -rf /tmp/bin/
16.44 + mamba list --full-name python
16.44 + tail -1
16.44 + tr -s ' '
16.44 + cut -d ' ' -f 1,2
16.44 + sed 's/\.[^.]*$/.*/'
16.45 The following argument was not expected: --full-name
16.45 Run with --help for more information.
------
Dockerfile:104
--------------------
 103 |     WORKDIR /tmp
 104 | >>> RUN set -x && \
 105 | >>>     arch=$(uname -m) && \
 106 | >>>     if [ "${arch}" = "x86_64" ]; then \
 107 | >>>         # Should be simpler, see <https://github.com/mamba-org/mamba/issues/1437>
 108 | >>>         arch="64"; \
 109 | >>>     fi && \
 110 | >>>     # https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html#linux-and-macos
 111 | >>>     wget --progress=dot:giga -O - \
 112 | >>>         "[https://micro.mamba.pm/api/micromamba/linux-${arch}/latest](https://micro.mamba.pm/api/micromamba/linux-$%7Barch%7D/latest)" | tar -xvj bin/micromamba && \
 113 | >>>     PYTHON_SPECIFIER="python=${PYTHON_VERSION}" && \
 114 | >>>     if [[ "${PYTHON_VERSION}" == "default" ]]; then PYTHON_SPECIFIER="python"; fi && \
 115 | >>>     # Install the packages
 116 | >>>     ./bin/micromamba install \
 117 | >>>         --root-prefix="${CONDA_DIR}" \
 118 | >>>         --prefix="${CONDA_DIR}" \
 119 | >>>         --yes \
 120 | >>>         "${PYTHON_SPECIFIER}" \
 121 | >>>         'mamba' \
 122 | >>>         'jupyter_core' && \
 123 | >>>     rm -rf /tmp/bin/ && \
 124 | >>>     # Pin major.minor version of python
 125 | >>>     # https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#preventing-packages-from-updating-pinning
 126 | >>>     mamba list --full-name 'python' | tail -1 | tr -s ' ' | cut -d ' ' -f 1,2 | sed 's/\.[^.]*$/.*/' >> "${CONDA_DIR}/conda-meta/pinned" && \
 127 | >>>     mamba clean --all -f -y && \
 128 | >>>     fix-permissions "${CONDA_DIR}" && \
 129 | >>>     fix-permissions "/home/${NB_USER}"
 130 |     
--------------------
ERROR: failed to solve: process "/bin/bash -o pipefail -c set -x &&     arch=$(uname -m) &&     if [ \"${arch}\" = \"x86_64\" ]; then         arch=\"64\";     fi &&     wget --progress=dot:giga -O -         \"[https://micro.mamba.pm/api/micromamba/linux-${arch}/latest\](https://micro.mamba.pm/api/micromamba/linux-$%7Barch%7D/latest/)" | tar -xvj bin/micromamba &&     PYTHON_SPECIFIER=\"python=${PYTHON_VERSION}\" &&     if [[ \"${PYTHON_VERSION}\" == \"default\" ]]; then PYTHON_SPECIFIER=\"python\"; fi &&     ./bin/micromamba install         --root-prefix=\"${CONDA_DIR}\"         --prefix=\"${CONDA_DIR}\"         --yes         \"${PYTHON_SPECIFIER}\"         'mamba'         'jupyter_core' &&     rm -rf /tmp/bin/ &&     mamba list --full-name 'python' | tail -1 | tr -s ' ' | cut -d ' ' -f 1,2 | sed 's/\\.[^.]*$/.*/' >> \"${CONDA_DIR}/conda-meta/pinned\" &&     mamba clean --all -f -y &&     fix-permissions \"${CONDA_DIR}\" &&     fix-permissions \"/home/${NB_USER}\"" did not complete successfully: exit code: 109

Anything else?

No response

Latest Docker version

  • [X] I've updated my Docker version to the latest available, and the issue persists

vizeit avatar Sep 25 '24 22:09 vizeit

+1 here.

jabbera avatar Sep 26 '24 01:09 jabbera

I added the following to my build script to work around it. I'm hoping I don't also have to pin it.

sed -i "s/latest/1.5.10/g" ./docker-stacks/docker-stacks-foundation/Dockerfile sed -i "s/'mamba' /'mamba==1.5.10' /g" ./docker-stacks/docker-stacks-foundation/Dockerfile

jabbera avatar Sep 26 '24 02:09 jabbera

Mamba 2.0.0 has just been released. @jjerphan is the failure above

mamba list --full-name python

The following argument was not expected: --full-name

expected?

manics avatar Sep 26 '24 10:09 manics

It's a regression, we are working on a fix.

JohanMabille avatar Sep 26 '24 12:09 JohanMabille

It would be a good practice to pin micromamba version, regardless of the fix

ktaletsk avatar Sep 26 '24 14:09 ktaletsk

I pushed a fix preventing mamba 2.0.0 from installing. Hope next release will solve the problem and I will revert my change.

It would be a good practice to pin micromamba version, regardless of the fix

Note: the error on our side occurs with mamba, not micromamba during mamba list --full-name 'python'

Pinning micromamba version would not have helped here, as far as I understand: the error is caused by mamba, and the latest mamba would have still been installed, regardless of micromamba version.

Pinning mamba version is also not something I would like to do - I prefer this repo to have unpinned versions for almost everything, and it works well - people eventually get the latest versions of software they use, and maintenance is much easier as well. And if something breaks, it breaks fast, and we should let developers of upstream packages know about failures faster - it makes these bugs easier to track and fix.

mathbunnyru avatar Sep 30 '24 07:09 mathbunnyru

Pinning micromamba version would not have helped here, as far as I understand: the error is caused by mamba, and the latest mamba would have still been installed, regardless of micromamba version.

You are correct.

jabbera avatar Sep 30 '24 18:09 jabbera

We have released micromamba 2.0.2 which should fix this issue, can you confirm it does?

JohanMabille avatar Oct 03 '24 13:10 JohanMabille

We have released micromamba 2.0.2 which should fix this issue, can you confirm it does?

The --full-name issue has been fixed, I confirm.

There are still remaining issues with mamba v2, which prevent us from updating, please, take a look here: https://github.com/jupyter/docker-stacks/pull/2147 The main one is not being able to use conda when mamba v2 is installed.

mathbunnyru avatar Oct 03 '24 13:10 mathbunnyru