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:
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.