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

Adrian Velez Aristizabal 1 Reputation point

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 python:3.9.12  
# Keeps Python from generating .pyc files in the container  
# Turns off buffering for easier container logging  
# 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='',)  
deployment_config = LocalWebservice.deploy_configuration(port=6789)  
service = Model.deploy(ws, "myservice", [model], inference_config, deployment_config, overwrite=True,)  

This is what I get from the logs:


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 Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,664 questions
{count} votes