'AzureML Pipeline SDK python - Inference file path issue

I got same issue when deploy the model in azure pipeline

Tried with/without source_directory , still that issue persist

inference_config = InferenceConfig(entry_script='score.py', environment=registered_env, source_directory='./')

Error log:

"message": "entry_script /mnt/batch/tasks/shared/LS_root/jobs/fb-aml-ws/azureml/85fc1381-c868-4dc6-a6ab-ce6073fbb68a/wd/azureml/85fc1381-c868-4dc6-a6ab-ce6073fbb68a/score.py doesn't exist. entry_script should be path relative to current working directory"

Any help appreciated!



Solution 1:[1]

Have you considered using ARG in your Dockerfile. Passing an argument to a Dockerfile should work. Take a look at Understand how ARG and FROM interact. Your Dockerfile should look like this:

ARG GIT_TAG
FROM <ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<repoName>:${GIT_TAG}
ADD entrypoint.sh /
EXPOSE 8080 8787 9990
ENTRYPOINT [ "/entrypoint.sh" ]

Then you should be able to build your image using something like this:

docker build --build-arg GIT_TAG=SOME_TAG .

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 zoot