[BUG] Pip: not found when using mlflow build-docker locally
See original GitHub issueThank you for submitting an issue. Please refer to our issue policy for additional information about bug reports. For help with debugging your code, please refer to Stack Overflow.
Please fill in this bug report template to ensure a timely and thorough response.
Willingness to contribute
The MLflow Community encourages bug fix contributions. Would you or another member of your organization be willing to contribute a fix for this bug to the MLflow code base?
- Yes. I can contribute a fix for this bug independently.
- Yes. I would be willing to contribute a fix for this bug with guidance from the MLflow community.
- No. I cannot contribute a bug fix at this time.
System information
- Have I written custom code (as opposed to using a stock example script provided in MLflow): No
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Mac OS Big Sur 11.3.1 (Apple M1 chip)
- MLflow installed from (source or binary): PiPy
- MLflow version (run
mlflow --version
):1.18.0
- Python version: 3.8.5
- npm version, if running the dev UI:
- Exact command to reproduce:
mlflow models build-docker -m 'models:/{model_name}/{model_version}' -n my-mlflow-image
Describe the problem
I have tried to create a Docker image from a registered model in Mlflow (I am using the Databricks managed version here). The model was registered as a PyFunc.
It will download the model, identify its flavour and run until the 6/12
step, where it breaks with the following message:
#9 0.665 /bin/sh: 1: pip: not found
#9 ERROR: executor failed running [/bin/sh -c pip install mlflow==1.19.0]: exit code: 127
------
> [ 6/12] RUN pip install mlflow==1.19.0:
------
executor failed running [/bin/sh -c pip install mlflow==1.19.0]: exit code: 127
Code to reproduce issue
You must have a registered model or run in an Mlflow artifact storage. Then:
mlflow models build-docker -m 'models:/{model_name}/{model_version}' -n my-mlflow-image
or mlflow models build-docker -m 'runs:/{run_id}/model' -n my-mlflow-image
Other info / logs
The full output from the command is as follows:
mlflow models build-docker -m 'runs:/{my_run}/model' -n direct-mlflow-image
2021/07/14 17:25:44 INFO mlflow.models.cli: Selected backend for flavor 'python_function'
2021/07/14 17:25:49 INFO mlflow.models.docker_utils: Building docker image with name direct-mlflow-image
/var/folders/yx/6fcq_tx96n52vr0kc66ypy9w0000gp/T/tmpyesejo4m/
/var/folders/yx/6fcq_tx96n52vr0kc66ypy9w0000gp/T/tmpyesejo4m//model_dir
/var/folders/yx/6fcq_tx96n52vr0kc66ypy9w0000gp/T/tmpyesejo4m//model_dir/model
/var/folders/yx/6fcq_tx96n52vr0kc66ypy9w0000gp/T/tmpyesejo4m//model_dir/model/MLmodel
/var/folders/yx/6fcq_tx96n52vr0kc66ypy9w0000gp/T/tmpyesejo4m//model_dir/model/model.pkl
/var/folders/yx/6fcq_tx96n52vr0kc66ypy9w0000gp/T/tmpyesejo4m//model_dir/model/input_example.json
/var/folders/yx/6fcq_tx96n52vr0kc66ypy9w0000gp/T/tmpyesejo4m//model_dir/model/conda.yaml
/var/folders/yx/6fcq_tx96n52vr0kc66ypy9w0000gp/T/tmpyesejo4m//Dockerfile
#1 [internal] load build definition from Dockerfile
#1 sha256:c4ce501e24{}
#1 transferring dockerfile: 1.58kB done
#1 DONE 0.0s
#2 [internal] load .dockerignore
#2 sha256:7094b9fc79b9{}
#2 transferring context: 2B done
#2 DONE 0.0s
#3 [internal] load metadata for docker.io/library/ubuntu:18.04
#3 sha256:fbbba859d4013c87{}
#3 DONE 1.8s
#4 [ 1/12] FROM docker.io/library/ubuntu:18.04@sha256:3b8692dc4{}
#4 sha256:f601b492ef7f7c5a96{}
#4 DONE 0.0s
#5 [ 2/12] RUN apt-get -y update && apt-get install -y --no-install-recommends wget curl nginx ca-certificates bzip2 build-essential cmake openjdk-8-jdk git-core maven && rm -rf /var/lib/apt/lists/*
#5 sha256:28ae033a3a{}
#5 CACHED
#6 [ 3/12] RUN curl -L https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh >> miniconda.sh
#6 sha256:3dd39dfce1f4b9{}
#6 CACHED
#7 [ 4/12] RUN bash ./miniconda.sh -b -p /miniconda; rm ./miniconda.sh;
#7 sha256:15001db7c7586{}
#7 CACHED
#8 [ 5/12] WORKDIR /opt/mlflow
#8 sha256:7464451f9d65e5{}
#8 CACHED
#14 [internal] load build context
#14 sha256:e3a6a2a7307c9d8b79dc{}
#14 transferring context: 274.43kB 0.0s done
#14 DONE 0.0s
#9 [ 6/12] RUN pip install mlflow==1.19.0
#9 sha256:d1629c303a1736432{}
#9 0.665 /bin/sh: 1: pip: not found
#9 ERROR: executor failed running [/bin/sh -c pip install mlflow==1.19.0]: exit code: 127
------
> [ 6/12] RUN pip install mlflow==1.19.0:
------
executor failed running [/bin/sh -c pip install mlflow==1.19.0]: exit code: 127
PS: I’m just redacting some sha’s for readability!
What component(s), interfaces, languages, and integrations does this bug affect?
Components
-
area/artifacts
: Artifact stores and artifact logging -
area/build
: Build and test infrastructure for MLflow -
area/docs
: MLflow documentation pages -
area/examples
: Example code -
area/model-registry
: Model Registry service, APIs, and the fluent client calls for Model Registry -
area/models
: MLmodel format, model serialization/deserialization, flavors -
area/projects
: MLproject format, project running backends -
area/scoring
: Local serving, model deployment tools, spark UDFs -
area/server-infra
: MLflow server, JavaScript dev server -
area/tracking
: Tracking Service, tracking client APIs, autologging
Interface
-
area/uiux
: Front-end, user experience, JavaScript, plotting -
area/docker
: Docker use across MLflow’s components, such as MLflow Projects and MLflow Models -
area/sqlalchemy
: Use of SQLAlchemy in the Tracking Service or Model Registry -
area/windows
: Windows support
Language
-
language/r
: R APIs and clients -
language/java
: Java APIs and clients -
language/new
: Proposals for new client languages
Integrations
-
integrations/azure
: Azure and Azure ML integrations -
integrations/sagemaker
: SageMaker integrations -
integrations/databricks
: Databricks integrations
Issue Analytics
- State:
- Created 2 years ago
- Comments:18 (17 by maintainers)
@murilommen I think we should open a PR 😃
It looks like we have two approaches to fix this issue:
--platform=linux/amd64
option when building an image.Miniconda3-latest-Linux-aarch64.sh
if thearch
command returnsaarch64
.