diff --git a/configuration/environments/environment_inference_dockerfile/BaseDockerfile b/configuration/environments/environment_inference_dockerfile/BaseDockerfile new file mode 100644 index 0000000..014ab6a --- /dev/null +++ b/configuration/environments/environment_inference_dockerfile/BaseDockerfile @@ -0,0 +1,6 @@ + +FROM mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04 +RUN apt-get update +RUN apt-get install ffmpeg libsm6 libxext6 -y +RUN apt-get update && apt-get install -y python3-opencv +RUN pip install opencv-python diff --git a/configuration/environments/environment_inference_dockerfile/azureml_environment.json b/configuration/environments/environment_inference_dockerfile/azureml_environment.json new file mode 100644 index 0000000..3b12a1a --- /dev/null +++ b/configuration/environments/environment_inference_dockerfile/azureml_environment.json @@ -0,0 +1,44 @@ +{ + "name": "environment_inference_dockerfile", + "version": "oct21", + "environmentVariables": { + "EXAMPLE_ENV_VAR": "EXAMPLE_VALUE" + }, + "python": { + "userManagedDependencies": false, + "interpreterPath": "python", + "condaDependenciesFile": null, + "baseCondaEnvironment": null + }, + "docker": { + "enabled": false, + "baseImage": null, + "sharedVolumes": true, + "shmSize": null, + "arguments": [], + "baseImageRegistry": { + "address": null, + "username": null, + "password": null, + "registryIdentity": null + }, + "platform": { + "os": "Linux", + "architecture": "amd64" + } + }, + "spark": { + "repositories": [], + "packages": [], + "precachePackages": true + }, + "databricks": { + "mavenLibraries": [], + "pypiLibraries": [], + "rcranLibraries": [], + "jarLibraries": [], + "eggLibraries": [] + }, + "r": null, + "inferencingStackVersion": null +} diff --git a/configuration/environments/environment_inference_dockerfile/conda_dependencies.yml b/configuration/environments/environment_inference_dockerfile/conda_dependencies.yml new file mode 100644 index 0000000..3150b09 --- /dev/null +++ b/configuration/environments/environment_inference_dockerfile/conda_dependencies.yml @@ -0,0 +1,11 @@ +channels: +- conda-forge +dependencies: +- python=3.8 +- pip: + - azureml-core==1.35.0 + - azureml-defaults==1.35.0 + - pandas + - joblib + +name: basic_env diff --git a/configuration/environments/environment_training_dockerfile/BaseDockerfile b/configuration/environments/environment_training_dockerfile/BaseDockerfile new file mode 100644 index 0000000..014ab6a --- /dev/null +++ b/configuration/environments/environment_training_dockerfile/BaseDockerfile @@ -0,0 +1,6 @@ + +FROM mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04 +RUN apt-get update +RUN apt-get install ffmpeg libsm6 libxext6 -y +RUN apt-get update && apt-get install -y python3-opencv +RUN pip install opencv-python diff --git a/configuration/environments/environment_training_dockerfile/azureml_environment.json b/configuration/environments/environment_training_dockerfile/azureml_environment.json new file mode 100644 index 0000000..93085d2 --- /dev/null +++ b/configuration/environments/environment_training_dockerfile/azureml_environment.json @@ -0,0 +1,44 @@ +{ + "name": "environment_training_dockerfile", + "version": "oct21", + "environmentVariables": { + "EXAMPLE_ENV_VAR": "EXAMPLE_VALUE" + }, + "python": { + "userManagedDependencies": false, + "interpreterPath": "python", + "condaDependenciesFile": null, + "baseCondaEnvironment": null + }, + "docker": { + "enabled": false, + "baseImage": null, + "sharedVolumes": true, + "shmSize": null, + "arguments": [], + "baseImageRegistry": { + "address": null, + "username": null, + "password": null, + "registryIdentity": null + }, + "platform": { + "os": "Linux", + "architecture": "amd64" + } + }, + "spark": { + "repositories": [], + "packages": [], + "precachePackages": true + }, + "databricks": { + "mavenLibraries": [], + "pypiLibraries": [], + "rcranLibraries": [], + "jarLibraries": [], + "eggLibraries": [] + }, + "r": null, + "inferencingStackVersion": null +} diff --git a/configuration/environments/environment_training_dockerfile/conda_dependencies.yml b/configuration/environments/environment_training_dockerfile/conda_dependencies.yml new file mode 100644 index 0000000..3150b09 --- /dev/null +++ b/configuration/environments/environment_training_dockerfile/conda_dependencies.yml @@ -0,0 +1,11 @@ +channels: +- conda-forge +dependencies: +- python=3.8 +- pip: + - azureml-core==1.35.0 + - azureml-defaults==1.35.0 + - pandas + - joblib + +name: basic_env diff --git a/docs/how-to/AdjustingDockerfile.md b/docs/how-to/AdjustingDockerfile.md new file mode 100644 index 0000000..82f0c18 --- /dev/null +++ b/docs/how-to/AdjustingDockerfile.md @@ -0,0 +1,17 @@ +# Customizing the base docker image (mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04:20210922.v1) +You have the option to specify your custom docker images for training and inference separately. + +## First Step: Define your dockerfile +In case you need to upgrade/change packages in Linux (using for example apt-get install / apt-get update) or define additional commands you have the option to configure the Dockerfile on your own. + +**[Environments](../../configuration/environments/)** contains two docker-related folders "environment_inference_dockerfile" and "environment_training_dockerfile" with the corresponding Dockerfile (BaseDockerfile). + +## Second Step: Change the environment path +After having set up your Dockerfile, you need to change the paths here: **[Configurations](../../configuration/configuration-aml.variables.yml)** + +Replace "AML_TRAINING_ENV_PATH" with "configuration/environments/environment_training_dockerfile" if you need the adjusted dockerfile for training. +Replace "AML_BATCHINFERENCE_ENV_PATH" with "configuration/environments/environment_inference_dockerfile" if you need the adjusted dockerfile for training. + +In case you want to deploy your own webservice, you can customize your docker images differently. Issue [#29](https://github.com/microsoft/dstoolkit-mlops-base/issues/29) describes this enhancement. + +For more detail, please refer to *[GettingStarted](GettingStarted.md)* diff --git a/docs/how-to/FAQ.md b/docs/how-to/FAQ.md index 08a44cd..7f32b84 100644 --- a/docs/how-to/FAQ.md +++ b/docs/how-to/FAQ.md @@ -4,4 +4,9 @@ If you see the error below. You have to ensure that the service connection is created at the Azure Machine Learning Workspace level and not Subscription level -![faq-error-invoke](../media/FAQ-invoke.error.png) \ No newline at end of file +![faq-error-invoke](../media/FAQ-invoke.error.png) + +## I would like to adjust the Docker Image. How can I change the Dockerfile? + +Documentation can be found here: +**[Custom Dockerfile](AdjustingDockerfile.md)**