Sample repository for MLOps (especially Continuous Deployment or Training) with Azure Machine Learning.
- Python >= 3.8
- conda
conda env create -f environment.yml
conda activate env-ml-reposiotry-azureml-cli-v2
pre-commit install
Set below variables for your environment.
- subscription_id = "subscription_id"
- resource_group = "resource_group_name"
- workspace_name = "ml_workspace_name"
python prepare.py
prepare.py script create a compute cluster, a dataset for regression and an environment optionally.
az ml job create -f ./job/search_hyperparameter.yml -g <resource_group> -w <ml_workspace>
- Register application and grant Azure ML access.
- Set below variables from registered application and Azure ML workspace as Github secrets.
- AZURE_CLIENT_ID
- AZURE_TENANT_ID
- AZURE_SUBSCRIPTION_ID
- AZURE_RESOURCE_GROUP_NAME
- AZURE_ML_WORKSPACE_NAME
https://docs.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-portal%2Clinux
To maintain code quality, below libraries are used in this repository.
- flake8 : lint based on PEP8
- black : auto-format based on PEP8 (flake8)
- isort : auto-sort import
- mypy : check type
- pre-commit : check code before commit
Code quality is important for team development.
https://docs.microsoft.com/en-us/azure/machine-learning/how-to-train-cli#sweep-hyperparameters https://docs.microsoft.com/en-us/azure/machine-learning/how-to-create-register-data-assets?tabs=Python-SDK#uris