question

AdrianVelezAristizabal-6510 avatar image
0 Votes"
AdrianVelezAristizabal-6510 asked romungi-MSFT commented

AzureML webservice deployment with custom Environment - /var/runit does not exist

Hi everyone.

I'm struggling to deploy a model with a custom environment through the azureml SDK.

I have built a docker image locally and pushed it to azure container registry to use it for environment instantiating. This is how my dockerfile looks like:

 FROM mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04
 FROM python:3.9.12
    
 # Keeps Python from generating .pyc files in the container
 ENV PYTHONDONTWRITEBYTECODE=1
    
 # Turns off buffering for easier container logging
 ENV PYTHONUNBUFFERED=1
    
 # Install requirement for deploying the service
 RUN apt-get update
 RUN apt-get install -y runit
    
 # Install pip requirements
 RUN pip install --upgrade pip
 COPY requirements.txt .
 RUN pip install azureml-defaults
 RUN pip install -r requirements.txt

I want to deploy the webservice locally for testing, so I am following the steps according to official documentation:

 ws = Workspace(subscription_id='***', resource_group='***', workspace_name='***')
    
 model = Model.register(ws, model_name='***', model_path='./Azure_Deployment/Algorithm')
    
 container = ContainerRegistry()
 container.address = '***'
 myenv = Environment.from_docker_image('***', '***/***-img:v1', container)
    
 inference_config = InferenceConfig(environment=myenv, source_directory='./Azure_Deployment', entry_script='echo_score.py',)
    
 deployment_config = LocalWebservice.deploy_configuration(port=6789)
    
 service = Model.deploy(ws, "myservice", [model], inference_config, deployment_config, overwrite=True,)
 service.wait_for_deployment(show_output=True)


This is what I get from the logs:


188074-logs-2.png



Checking into the resulting container for the service I can see indeed there is no /runit folder inside /var. There is also no other folders created for the service besides the azureml-app containing my model's files.

I would really appreciate any insights to what's going on here as I have no clue at this point.

azure-machine-learningazure-machine-learning-inference
logs-2.png (418.2 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@AdrianVelezAristizabal-6510 I think there could be an issue with your scoring script echo_score.py, has the script defined the init() method to load the model path that is created when the web service is created?
Since you have used custom docker file and the path azureml-app has loaded the files instead of azureml-models I think this could be the issue where the model is not loaded correctly. Please check the example here for details on loading the model in the entry script.

Also, you could try other images which are latest instead of the one used above.

 mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04

You can check the complete catalog with tags here.









0 Votes 0 ·

@AdrainVelezAristizabal-6510 Did the below suggestion help to load the model and hit the endpoint for scoring?

0 Votes 0 ·

0 Answers