Azure Machine Learning - Deploy model with DockerFile

G Cocci 216 Reputation points Microsoft Employee
2022-06-09T17:09:09.783+00:00

Hi all,

I'm trying to deploy a model with the azure-cli-ml with the following command:

az ml model deploy --name local-test-endpoint --model name:version --compute-type local --ic inference_config.json --dc deployment_config_local.json -g rg --workspace-name amw

with the following inference configuration:

inference_config.json

{  
    "entryScript": "score.py",  
    "environment": {  
        "docker": {  
            "arguments": [],  
            "baseDockerfile": "dockerFile",  
            "baseImage": null,  
            "enabled": true,  
            "sharedVolumes": true,  
            "shmSize": "2g"  
        },  
        "name": "test-environment",  
        "python": {  
            "baseCondaEnvironment": null,  
            "condaDependencies": {  
                "channels": [  
                    "conda-forge"  
                ],  
                "dependencies": [  
                    "python=3.7"  
                ],  
                "name": "project_environment"  
            },  
            "condaDependenciesFile": null,  
            "interpreterPath": "python",  
            "userManagedDependencies": false  
        },  
        "version": "1"  
    }  
}  

and this is the dockerFile:

FROM pytorch/pytorch:1.11.0-cuda11.3-cudnn8-runtime  
  
RUN pip install \  
    'azureml-mlflow==1.37.0' \  
    'mlflow-skinny' \  
    'pytorch-accelerated>=0.1.22' \  
    'torchmetrics>=0.7.2' \  
    'func_to_script' \  
    'albumentations==1.1.0' \  
    'pandas==1.3.4' \  
    'matplotlib' \  
    'sklearn'  
  

Running the deploy command I get the following error message:

Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
unexpected dockerfile format
failed to run step ID: acb_step_0: failed to scan dependencies: exit status 1

I get the same error even deploying to ACI and AKS.
What am I doing wrong in the configuration?

Thanks!

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,333 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Ramr-msft 17,826 Reputation points
    2022-06-14T09:43:51.18+00:00

    @G Cocci Thanks for the details. Can you please add more details about the version that you are using? environment creation in v1 requires you to provide the dockerfile INLINE, not as a reference. We highly recommend using v2.

    "baseDockerfile": "dockerFile",

    Here is the document to troubleshoot environment image builds.

    -----------------------

    If an answer is helpful, please click on 130616-image.png or upvote 130671-image.png which might help other community members reading this thread.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.