Machine Learning at Scale with Databricks and Kubernetes

Published Jan 10 2022 02:43 PM 7,116 Views
Microsoft

 

Overview

 

Machine Learning Operationalisation (MLOps) is a set of practices that aim to quickly and reliably build, deploy and monitor machine learning applications. Many organizations standardize around certain tools to develop a platform to enable these goals.

 

One combination of tools includes using Databricks to build and manage machine learning models and Kubernetes to deploy models. This article will explore how to design this solution on Microsoft Azure followed by step-by-step instructions on how to implement this solution as a proof-of-concept. This approach aims to use common open source technologies and can easily be adapted for other workloads.

 

This article is targeted towards:

  • Organizations looking to build and manage machine learning models on Databricks.
  • Organizations that have experience deploying and managing Kubernetes workloads.
  • Organizations looking to deploy workloads that require low latency and interactive model predictions (e.g. a product recommendation API or integration with external applications).

 

A GitHub repository with more details can be found here.

 

 

Design

 

This high-level design uses Azure Databricks and Azure Kubernetes Service to develop an MLOps platform for the two main types of machine learning model deployment patterns — online inference and batch inference. This solution can manage the end-to-end machine learning life cycle and incorporates important MLOps principles when developing, deploying, and monitoring machine learning models at scale.

 

nimoore_2-1643237734797.png

 

At a high level, this solution design addresses each stage of the machine learning lifecycle:

  • Data Preparation: this includes sourcing, cleaning, and transforming the data for processing and analysis. Data can live in a data lake or data warehouse and be stored in a feature store after it’s curated.
  • Model Development: this includes core components of the model development process such as experiment tracking and model registration using MLflow.
  • Model Deployment: this includes implementing a CI/CD pipeline to build and deploy solutions for batch inference workloads and online inference workloads. For online inference workloads, machine learning models will be containerized as API services and deployed to an Azure Kubernetes cluster with Azure API Management exposing them to the outside world. For batch inference workloads, jobs consuming the model will be executed using an orchestration tool (such as Apache Airflow).
  • Model Monitoring: this includes monitoring the API performance and data drift by analyzing log telemetry with Azure Monitor.

 

Keep in mind this high-level diagram does not depict any security features large organizations would require when adopting cloud services (e.g. firewall, virtual networks, etc.). Moreover, MLOps is an organizational shift that requires changes in people, processes, and technology. This might influence the different services, features, or workflows your organization adopts which are not considered in this design. The Machine Learning DevOps guide from Microsoft is one view that provides guidance around best practices to consider.

 

 

Build

 

Next, we will share how an end-to-end proof of concept illustrating how an MLflow model can be trained on Databricks, packaged as a web service, deployed to Kubernetes via CI/CD and monitored within Microsoft Azure. This proof of concept will only cover the online inference deployment pattern and focus on a simplified architecture compared to that shown above.

 

Detailed step-by-step instructions describing how to implement the solution can be found in the Implementation Guide of the GitHub repository. This article will focus on what actions are being performed and why.

 

A high-level workflow of this proof-of-concept is shown below:

 

nimoore_4-1643237868990.png

 

 

Follow the Implementation Guide to implement the proof-of-concept in your Azure subscription.

 

Infrastructure Setup

 

The services required to implement this proof-of-concept include:

  • Azure Databricks workspace to build machine learning models, track experiments, and manage machine learning models.
  • Azure Kubernetes Service (AKS) to deploy containers exposing a web service to end-users (one for a staging and production environment respectively).
  • Azure Container Registry (ACR) to manage and store Docker containers.
  • Azure Log Analytics Workspace to query log telemetry in Azure Monitor.
  • GitHub to store code for the project and enable automation by building and deploying artifacts.

 

By default, this proof-of-concept has been implemented by deploying all resources into a single resource group. However, for production scenarios, many resource groups across multiple subscriptions would be preferred for security and governance purposes (see Azure Enterprise-Scale Landing Zones) with services deployed using infrastructure as code (IaC).

 

Some services have been further configured as part of this proof-of-concept:

  • Azure Kubernetes Service: container insights has been enabled to collect metrics and logs from containers running on AKS. This will be used to monitor API performance and analyze logs.
  • Azure Databricks: the files in repo feature has been enabled (not enabled by default at the time of developing this proof-of-concept) and a cluster has been created for Data Scientists, Machine Learning Engineers, and Data Analysts to use to develop models.
  • GitHub: two GitHub Environments have been created for Staging and Production environments along with GitHub Secrets to be used during the CI/CD pipeline.

 

In practice within an organization, a Cloud Administrator will provision and configure this infrastructure. Data Scientists and Machine Learning Engineers who build, deploy, and monitor machine learning models will not be responsible for these activities.

 

Model Development

 

Once the infrastructure is provisioned and data is sourced a Data Scientist can commence developing machine learning models. The Data Scientist can add a Git repository with Databricks Repos for each project they (or the team) are working on within the Databricks workspace.

 

For this proof-of-concept, the model development process has been encapsulated in a single notebook called develop_model. This notebook will develop and register an MLflow Model for deployment consisting of:

  • a machine learning model to predict the liklihood of employee attrition
  • a statistical model to determine data drift in features
  • a statistical model to determine outliers in features

nimoore_6-1643238529223.png

Training notebook in Azure Databricks

 

After executing this notebook the MLflow model will be registered and training metrics will be captured in the MLflow model registry and Experiments tracker respectively.

 

In practice, the model development process requires more effort than illustrated in this notebook and will often span multiple notebooks. Note that important aspects of well-developed MLOps processes such as explainability, performance profiling, pipelines, etc. have been ignored in this proof-of-concept implementation but foundational components such as experiment tracking and model registration and versioning have been included.

 

nimoore_7-1643238601631.png

Experiment metrics for hyperparameter tuning in Azure Databricks

 

nimoore_8-1643238646465.png

Registered models in Azure Databricks

 

A JSON configuration file is used to define which version of each model from the MLflow model registry should be deployed as part of the API. All three models need to be referenced since they perform different functions (predictions, drift detection, and outlier detection respectively).

 

Data scientists can edit this file once models are ready to be deployed and commit the file to the Git repository. The configuration file service/configuration.json is structured as follows:

 
{
  "model_name": "employee_attrition",
  "model_version": "1"
}

 

Model Deployment

 

A Machine Learning Engineer will work to develop an automated process to deploy and monitor these models as part of an ML system. Part of this requires developing a continuous integration/continuous delivery (CI/CD) to automate the building and deploying artifacts. A simple CI/CD pipeline has been implemented using GitHub Actions for this proof-of-concept. The pipeline is triggered when commits are pushed, or a pull request is made to either the main or development branch.

 

The CI/CD pipeline consists of three jobs:

  • Build: this job will create a Docker container and register it in ACR. This Docker container will be the model inference API which end-users will consume. This container has been developed using FastAPI and a custom python function MLflow model consisting of a machine learning classifier and two statistical models calculating data drift and outliers respectively.
  • Staging: this job will deploy the Docker container to the AKS cluster in the staging environment. Once deployed, the model’s state will transition to the Staging state in the MLflow model registry.
  • Production: this job will deploy the Docker container to the AKS cluster in the production environment. Once deployed, the model’s state will transition to the Production state in the MLflow model registry.

 

FastAPI is a high-performance and intuitive web framework for building web services. The MLflow model will be packaged with this web service, along with its dependencies, to build a docker container image.

 

The prediction service used in this proof-of-concept consists of a single endpoint called predict. It is implemented using the MLflow model, a file specifying Python dependencies and code describing the web service. When a user calls this endpoint the request will be passed and the records will be consumed by the MLflow model which will call the three individual models and return the consolidated results. This will generate a list of predictions, output to indicate if data drift is present for any of the features, and output to indicate if outliers are present for any of the features. The results will be returned to the client and the drift and outlier metrics will be logged for future analysis.

 

The prediction service used in this proof-of-concept is defined in the service/app directory. An extract of the code used to define the prediction service an outline shown below:

 

# Define global variables
SERVICE_NAME = "Employee Attrition API"
MODEL_ARTIFACT_PATH = "./employee_attrition_model"

# Initialize the FastAPI app
app = FastAPI(title=SERVICE_NAME, docs_url="/")

# Configure logger
log = logging.getLogger("uvicorn")
log.setLevel(logging.INFO)


@app.on_event("startup")
async def startup_load_model():
    global MODEL
    MODEL = load_model(MODEL_ARTIFACT_PATH)


@app.post("/predict")
async def predict(data: List[EmployeeAttritionRecord]):
    # Parse data
    input_df = pd.DataFrame(jsonable_encoder(data))

    # Define UUID for the request
    request_id = uuid.uuid4().hex

    # Log input data
    log.info(json.dumps({
        "service_name": SERVICE_NAME,
        "type": "InputData",
        "request_id": request_id,
        "data": input_df.to_json(orient='records'),
    }))

    # Make predictions and log
    model_output = MODEL.predict(input_df)

    # Log output data
    log.info(json.dumps({
        "service_name": SERVICE_NAME,
        "type": "OutputData",
        "request_id": request_id,
        "data": model_output
    }))

    # Make response payload
    response_payload = jsonable_encoder(model_output)

    return response_payload

 

Within the Build job of the CI/CD pipeline, the model artifacts will be downloaded from the Databricks MLflow model registry. The MLflow model will be packaged with the FastAPI web service, along with its dependencies, to build a docker container image of the model inference API. This container image is then stored in ACR.

 

The Staging job will automatically be triggered after the Build job has been completed. This job will deploy the container image to the AKS cluster in the staging environment. A Kubernetes manifest file has been defined in manifests/api.yaml that specifies the desired state of the model inference API that Kubernetes will maintain.

 

Environment protection rules have been configured within GitHub Actions to require manual approval from approved reviewers before the Docker container is deployed to the production environment. This provides the team with greater control over when updates are deployed to production.

 

nimoore_9-1643238955971.png

GitHub Action CI/CD workflow production deployment approval

 

At each stage of this process, as the model inference API is deployed to staging and production environments, the corresponding model artifact in the MLflow model registry is updated to reflect the environment of each model version. This is useful since it provides Data Scientists visibility of all operationalized models in real-time while providing a single source of truth.

 

nimoore_11-1643239019640.png

Completed CI/CD pipeline workflow with GitHub Actions

 

nimoore_13-1643239074030.png

Registered models with updated environments in Azure Databricks

 

After approval has been given and the model inference API has been deployed the Swagger UI for the service can be accessed from the IP address of the Kubernetes ingress controller corresponding. This can be found under the AKS service in the Azure Portal or via CLI. 

 

nimoore_15-1643239266298.png
FastAPI Swagger UI

 

For production scenarios, a CI/CD pipeline should consist of other elements such as unit tests, code quality scans, code security scans, integration tests, and performance tests. Moreover, teams might choose to use Helm charts to easily configure and deploy services onto Kubernetes clusters or use a Blue-Green or Canary deployment strategy when releasing their application.

 

Model Monitoring

 

Once the application is operational and integrated with other systems a Machine Learning Engineer can commence monitoring the application to measure the health of the API and track model performance.

 

Once models are operationalized, monitoring their performance is essential to prevent degradation. This can be caused by changes in the data and relationships between the feature and target variables. When these changes are detected it indicates that the machine learning model needs to be re-trained by Data Scientists. This can be accomplished manually through alerts or automatically on a schedule.

 

Within this proof-of-concept, container insights for AKS have been enabled to collect metrics and logs from the model inference API. These can be viewed in Azure Monitor. The Azure Log Analytics workspace can be used to analyze drift and outlier metrics logs from the machine learning service whenever a client makes a request.

 

The model inference API accepts requests from end-users in the following format:

 
[
 {
 "BusinessTravel": "Travel_Rarely",
 "Department": "Research & Development",
 "EducationField": "Medical",
 "Gender": "Male",
 "JobRole": "Manager",
 "MaritalStatus": "Married",
 "Over18": "Yes",
 "OverTime": "No",
 "Age": 36,
 "DailyRate": 989,
 "DistanceFromHome": 8,
 "Education": 1,
 "EmployeeCount": 1,
 "EmployeeNumber": 253,
 "EnvironmentSatisfaction": 4,
 "HourlyRate": 46,
 "JobInvolvement": 3,
 "JobLevel": 5,
 "JobSatisfaction": 3,
 "MonthlyIncome": 19033,
 "MonthlyRate": 6499,
 "NumCompaniesWorked": 1,
 "PercentSalaryHike": 14,
 "PerformanceRating": 3,
 "RelationshipSatisfaction": 2,
 "StandardHours": 65,
 "StockOptionLevel": 1,
 "TotalWorkingYears": 14,
 "TrainingTimesLastYear": 3,
 "WorkLifeBalance": 2,
 "YearsAtCompany": 3,
 "YearsInCurrentRole": 3,
 "YearsSinceLastPromotion": 3,
 "YearsWithCurrManager": 1
 }
]

 

When the model inference API is called it logs telemetry that relates to input data, drift, outliers, and predictions. This telemetry is collected by Azure Monitor and can be queried within an Azure Log Analytics workspace to extract insights.

 

nimoore_16-1643239409664.png
Calling the predict endpoint of the FastAPI service via the Swagger UI

 

Within the Azure Log Analytics workspace, a query can be executed to find all logs relating to the specific model inference API within a time range, Employee Attrition API in this proof-of-concept, and parse the result to extract drift results. These values correspond to p-values and can be used to determine if data drift is present. Any feature with a p-value less than a pre-defined threshold has undergone drift (the threshold is 0.05 for this proof-of-concept). For simplicity, in this proof-of-concept, an attribute called drift_magnitude has been calculated from the p-value for interpretability purposes.

 

The following KQL query can be executed to retrieve drift_magnitude metrics for the model inference API logs:

 

ContainerLog
| where TimeGenerated > ago (30d)
| where LogEntry has 'Employee Attrition API' and LogEntry has 'OutputData'
| project TimeGenerated, ResponsePayload=split(LogEntry, 'INFO:')
| project TimeGenerated, DriftMagnitude=parse_json(tostring(ResponsePayload[1])).data.drift__magnitude
| evaluate bag_unpack(DriftMagnitude)

 

nimoore_17-1643239582138.png

Querying container logs to extract data drift values

 

Azure Log Analytics is capable of executing more complex queries such as moving averages or aggregations over sliding values. These can be tailored to the requirements of your specific workload. The results can be visualized in a workbook or dashboard, or used as part of alerts to proactively notify Data Scientists and Machine Learning Engineers of issues. Such alerts could indicate when Data Scientists or Machine Learning Engineers should re-train models or investigate concerning changes.

 

To re-train models, inference data from requests need to be collected and transformed. This can be achieved by configuring data export in your Log Analytics workspace to export data in near-real-time to a storage account. This data can be curated and stored in a feature store for subsequent use as part of a batch process (using Databricks for example).

 

From this, a continuous training (CT) pipeline can be developed to automate model re-training, update the model version in the MLflow Model Registry, and re-trigger the CI/CD pipeline to re-build and re-deploy the model inference API. A CT pipeline is an important aspect of well-developed MLOps processes.

 

Resources

 

You may also find these related articles useful:

 

This article was originally posted here.

1 Comment
%3CLINGO-SUB%20id%3D%22lingo-sub-3056840%22%20slang%3D%22en-US%22%3ERe%3A%20Machine%20Learning%20at%20Scale%20with%20Databricks%20and%20Kubernetes%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3056840%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1270277%22%20target%3D%22_blank%22%3E%40nimoore%3C%2FA%3E%26nbsp%3Bfor%20sharing%20this%20Great%20Blogpost%20with%20the%20Community%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fhtml%2F%40A027B0AAF3CA617A1E2E22C4E761B2FE%2Fimages%2Femoticons%2Fstareyes_40x40.gif%22%20alt%3D%22%3Astareyes%3A%22%20title%3D%22%3Astareyes%3A%22%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3056539%22%20slang%3D%22en-US%22%3EMachine%20Learning%20at%20Scale%20with%20Databricks%20and%20Kubernetes%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3056539%22%20slang%3D%22en-US%22%3E%3CH1%20class%3D%22zx%20zy%20yj%20bv%20fs%20ud%20zz%20ue%20qb%20ug%20aba%20uh%20qf%20abb%20abc%20abd%20qj%20abe%20abf%20abg%20qn%20abh%20abi%20abj%20qr%20abk%20by%22%20data-selectable-paragraph%3D%22%22%20id%3D%22toc-hId-2131664444%22%20id%3D%22toc-hId-2134460886%22%3E%26nbsp%3B%3C%2FH1%3E%0A%3CH1%20id%3D%225dc1%22%20class%3D%22zx%20zy%20yj%20bv%20fs%20ud%20zz%20ue%20qb%20ug%20aba%20uh%20qf%20abb%20abc%20abd%20qj%20abe%20abf%20abg%20qn%20abh%20abi%20abj%20qr%20abk%20by%22%20data-selectable-paragraph%3D%22%22%20id%3D%22toc-hId-324209981%22%20id%3D%22toc-hId-327006423%22%3EOverview%3C%2FH1%3E%0A%3CP%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20acb%20ue%20acc%20acd%20ace%20uh%20acf%20acg%20ach%20aci%20acj%20ack%20acl%20acm%20acn%20aco%20acp%20acq%20acr%20acs%20og%20by%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20jv%20il%20jw%20jx%20jy%20ip%20jz%20ka%20kb%20kc%20kd%20ke%20kf%20kg%20kh%20ki%20kj%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3EMachine%20Learning%20Operationalisation%20(MLOps)%20is%20a%20set%20of%20practices%20that%20aim%20to%20quickly%20and%20reliably%20build%2C%20deploy%20and%20monitor%20machine%20learning%20applications.%20Many%20organizations%20standardize%20around%20certain%20tools%20to%20develop%20a%20platform%20to%20enable%20these%20goals.%3C%2FP%3E%0A%3CP%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20acb%20ue%20acc%20acd%20ace%20uh%20acf%20acg%20ach%20aci%20acj%20ack%20acl%20acm%20acn%20aco%20acp%20acq%20acr%20acs%20og%20by%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3EOne%20combination%20of%20tools%20includes%20using%20Databricks%20to%20build%20and%20manage%20machine%20learning%20models%20and%20Kubernetes%20to%20deploy%20models.%20This%20article%20will%20explore%20how%20to%20design%20this%20solution%20on%20Microsoft%20Azure%20followed%20by%20step-by-step%20instructions%20on%20how%20to%20implement%20this%20solution%20as%20a%20proof-of-concept.%20This%20approach%20aims%20to%20use%20common%20open%20source%20technologies%20and%20can%20easily%20be%20adapted%20for%20other%20workloads.%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3ETh%3CSPAN%3Ei%3C%2FSPAN%3Es%20article%20is%20targeted%20towards%3A%3C%2FP%3E%0A%3CUL%20class%3D%22%22%3E%0A%3CLI%20id%3D%22a3f1%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3EOrganizations%20looking%20to%20build%20and%20manage%20machine%20learning%20models%20on%20Databricks.%3C%2FLI%3E%0A%3CLI%20id%3D%2268b4%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kv%20il%20jw%20jx%20kw%20ip%20jz%20ka%20kx%20kc%20kd%20ke%20ky%20kg%20kh%20ki%20kz%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3EOrganizations%20that%20have%20experience%20deploying%20and%20managing%20Kubernetes%20workloads.%3C%2FLI%3E%0A%3CLI%20id%3D%221247%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kv%20il%20jw%20jx%20kw%20ip%20jz%20ka%20kx%20kc%20kd%20ke%20ky%20kg%20kh%20ki%20kz%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3EOrganizations%20looking%20to%20deploy%20workloads%20that%20require%20low%20latency%20and%20interactive%20model%20predictions%20(e.g.%20a%20product%20recommendation%20API%20or%20integration%20with%20external%20applications).%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3EA%20GitHub%20repository%20with%20more%20details%20can%20be%20found%20%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fnfmoore%2Fdatabricks-kubernetes-mlops-poc%2Ftree%2Fv2.0.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3Ehere%3C%2FA%3E.%3C%2FP%3E%0A%3CP%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20act%20ue%20acc%20acd%20acu%20uh%20acf%20acg%20acv%20aci%20acj%20ack%20acw%20acm%20acn%20aco%20acx%20acq%20acr%20acs%20og%20by%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20act%20ue%20acc%20acd%20acu%20uh%20acf%20acg%20acv%20aci%20acj%20ack%20acw%20acm%20acn%20aco%20acx%20acq%20acr%20acs%20og%20by%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%223f46%22%20class%3D%22zx%20zy%20yj%20bv%20fs%20ud%20zz%20ue%20qb%20ug%20aba%20uh%20qf%20abb%20abc%20abd%20qj%20abe%20abf%20abg%20qn%20abh%20abi%20abj%20qr%20abk%20by%22%20data-selectable-paragraph%3D%22%22%20id%3D%22toc-hId--1483244482%22%20id%3D%22toc-hId--1480448040%22%3EDesign%3C%2FH1%3E%0A%3CP%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20acb%20ue%20acc%20acd%20ace%20uh%20acf%20acg%20ach%20aci%20acj%20ack%20acl%20acm%20acn%20aco%20acp%20acq%20acr%20acs%20og%20by%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20jv%20il%20jw%20jx%20jy%20ip%20jz%20ka%20kb%20kc%20kd%20ke%20kf%20kg%20kh%20ki%20kj%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3EThis%20high-level%20design%20uses%20Azure%20Databricks%20and%20Azure%20Kubernetes%20Service%20to%20develop%20an%20%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fmachine-learning%2Fconcept-model-management-and-deployment%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3EMLOps%3C%2FA%3E%20platform%20for%20the%20two%20main%20types%20of%20machine%20learning%20model%20deployment%20patterns%20%E2%80%94%20online%20inference%20and%20batch%20inference.%20This%20solution%20can%20manage%20the%20end-to-end%20machine%20learning%20life%20cycle%20and%20incorporates%20important%20%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fmachine-learning%2Fconcept-model-management-and-deployment%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3EMLOps%3C%2FA%3E%20principles%20when%20developing%2C%20deploying%2C%20and%20monitoring%20machine%20learning%20models%20at%20scale.%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%3A%20center%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22nimoore_2-1643237734797.png%22%20style%3D%22width%3A%20866px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F342800i16866D655086C0AD%2Fimage-dimensions%2F866x623%3Fv%3Dv2%22%20width%3D%22866%22%20height%3D%22623%22%20role%3D%22button%22%20title%3D%22nimoore_2-1643237734797.png%22%20alt%3D%22nimoore_2-1643237734797.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20acb%20ue%20acc%20acd%20ace%20uh%20acf%20acg%20ach%20aci%20acj%20ack%20acl%20acm%20acn%20aco%20acp%20acq%20acr%20acs%20og%20by%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3EAt%20a%20high%20level%2C%20this%20solution%20design%20addresses%20each%20stage%20of%20the%20machine%20learning%20lifecycle%3A%3C%2FP%3E%0A%3CUL%20class%3D%22%22%3E%0A%3CLI%20id%3D%221392%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3EData%20Preparation%3A%20this%20includes%20sourcing%2C%20cleaning%2C%20and%20transforming%20the%20data%20for%20processing%20and%20analysis.%20Data%20can%20live%20in%20a%20data%20lake%20or%20data%20warehouse%20and%20be%20stored%20in%20a%20feature%20store%20after%20it%E2%80%99s%20curated.%3C%2FLI%3E%0A%3CLI%20id%3D%224236%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kv%20il%20jw%20jx%20kw%20ip%20jz%20ka%20kx%20kc%20kd%20ke%20ky%20kg%20kh%20ki%20kz%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3EModel%20Development%3A%20this%20includes%20core%20components%20of%20the%20model%20development%20process%20such%20as%20experiment%20tracking%20and%20model%20registration%20using%20%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdatabricks%2Fapplications%2Fmlflow%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3EMLflow%3C%2FA%3E.%3C%2FLI%3E%0A%3CLI%20id%3D%22bc39%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kv%20il%20jw%20jx%20kw%20ip%20jz%20ka%20kx%20kc%20kd%20ke%20ky%20kg%20kh%20ki%20kz%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3EModel%20Deployment%3A%20this%20includes%20implementing%20a%20CI%2FCD%20pipeline%20to%20build%20and%20deploy%20solutions%20for%20batch%20inference%20workloads%20and%20online%20inference%20workloads.%20For%20online%20inference%20workloads%2C%20machine%20learning%20models%20will%20be%20containerized%20as%20API%20services%20and%20deployed%20to%20an%20Azure%20Kubernetes%20cluster%20with%20Azure%20API%20Management%20exposing%20them%20to%20the%20outside%20world.%20For%20batch%20inference%20workloads%2C%20jobs%20consuming%20the%20model%20will%20be%20executed%20using%20an%20orchestration%20tool%20(such%20as%20Apache%20Airflow).%3C%2FLI%3E%0A%3CLI%20id%3D%220e94%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kv%20il%20jw%20jx%20kw%20ip%20jz%20ka%20kx%20kc%20kd%20ke%20ky%20kg%20kh%20ki%20kz%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3EModel%20Monitoring%3A%20this%20includes%20monitoring%20the%20API%20performance%20and%20data%20drift%20by%20analyzing%20log%20telemetry%20with%20Azure%20Monitor.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3EKeep%20in%20mind%20this%20high-level%20diagram%20does%20not%20depict%20any%20security%20features%20large%20organizations%20would%20require%20when%20adopting%20cloud%20services%20(e.g.%20firewall%2C%20virtual%20networks%2C%20etc.).%20Moreover%2C%20MLOps%20is%20an%20organizational%20shift%20that%20requires%20changes%20in%20people%2C%20processes%2C%20and%20technology.%20This%20might%20influence%20the%20different%20services%2C%20features%2C%20or%20workflows%20your%20organization%20adopts%20which%20are%20not%20considered%20in%20this%20design.%20The%20%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fcloud-adoption-framework%2Fready%2Fazure-best-practices%2Fai-machine-learning-mlops%23machine-learning-devops-mlops-best-practices-with-azure-machine-learning%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3EMachine%20Learning%20DevOps%20guide%3C%2FA%3E%20from%20Microsoft%20is%20one%20view%20that%20provides%20guidance%20around%20best%20practices%20to%20consider.%3C%2FP%3E%0A%3CP%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20act%20ue%20acc%20acd%20acu%20uh%20acf%20acg%20acv%20aci%20acj%20ack%20acw%20acm%20acn%20aco%20acx%20acq%20acr%20acs%20og%20by%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20act%20ue%20acc%20acd%20acu%20uh%20acf%20acg%20acv%20aci%20acj%20ack%20acw%20acm%20acn%20aco%20acx%20acq%20acr%20acs%20og%20by%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%228be6%22%20class%3D%22zx%20zy%20yj%20bv%20fs%20ud%20zz%20ue%20qb%20ug%20aba%20uh%20qf%20abb%20abc%20abd%20qj%20abe%20abf%20abg%20qn%20abh%20abi%20abj%20qr%20abk%20by%22%20data-selectable-paragraph%3D%22%22%20id%3D%22toc-hId-1004268351%22%20id%3D%22toc-hId-1007064793%22%3EBuild%3C%2FH1%3E%0A%3CP%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20acb%20ue%20acc%20acd%20ace%20uh%20acf%20acg%20ach%20aci%20acj%20ack%20acl%20acm%20acn%20aco%20acp%20acq%20acr%20acs%20og%20by%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20jv%20il%20jw%20jx%20jy%20ip%20jz%20ka%20kb%20kc%20kd%20ke%20kf%20kg%20kh%20ki%20kj%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3ENext%2C%20we%20will%20share%20how%20an%20end-to-end%20proof%20of%20concept%20illustrating%20how%20an%20MLflow%20model%20can%20be%20trained%20on%20Databricks%2C%20packaged%20as%20a%20web%20service%2C%20deployed%20to%20Kubernetes%20via%20CI%2FCD%20and%20monitored%20within%20Microsoft%20Azure.%20This%20proof%20of%20concept%20will%20only%20cover%20the%20online%20inference%20deployment%20pattern%20and%20focus%20on%20a%20simplified%20architecture%20compared%20to%20that%20shown%20above.%3C%2FP%3E%0A%3CP%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20acb%20ue%20acc%20acd%20ace%20uh%20acf%20acg%20ach%20aci%20acj%20ack%20acl%20acm%20acn%20aco%20acp%20acq%20acr%20acs%20og%20by%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3EDetailed%20step-by-step%20instructions%20describing%20how%20to%20implement%20the%20solution%20can%20be%20found%20in%20the%20%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fnfmoore%2Fdatabricks-kubernetes-mlops-poc%2Fblob%2Fv2.0.0%2F.github%2Fdocs%2Fimplementation-guide.md%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3EImplementation%20Guide%3C%2FA%3E%20of%20the%20GitHub%20repository.%20This%20article%20will%20focus%20on%20what%20actions%20are%20being%20performed%20and%20why.%3C%2FP%3E%0A%3CP%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20act%20ue%20acc%20acd%20acu%20uh%20acf%20acg%20acv%20aci%20acj%20ack%20acw%20acm%20acn%20aco%20acx%20acq%20acr%20acs%20og%20by%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3EA%20high-level%20workflow%20of%20this%20proof-of-concept%20is%20shown%20below%3A%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%3A%20center%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22nimoore_4-1643237868990.png%22%20style%3D%22width%3A%20865px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F342802iB36621C465282F10%2Fimage-dimensions%2F865x390%3Fv%3Dv2%22%20width%3D%22865%22%20height%3D%22390%22%20role%3D%22button%22%20title%3D%22nimoore_4-1643237868990.png%22%20alt%3D%22nimoore_4-1643237868990.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CBLOCKQUOTE%20class%3D%22lt%20lu%20lv%22%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%3CEM%3EFollow%20the%20%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fnfmoore%2Fdatabricks-kubernetes-mlops-poc%2Fblob%2Fv2.0.0%2F.github%2Fdocs%2Fimplementation-guide.md%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3EImplementation%20Guide%3C%2FA%3E%20to%20implement%20the%20proof-of-concept%20in%20your%20Azure%20subscription.%3C%2FEM%3E%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%20class%3D%22aey%20zy%20yj%20bv%20fs%20aez%20afa%20afb%20qb%20afc%20afd%20afe%20qf%20qg%20aff%20qh%20qj%20qk%20afg%20ql%20qn%20qo%20afh%20qp%20qr%20afi%20by%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22304d%22%20class%3D%22aey%20zy%20yj%20bv%20fs%20aez%20afa%20afb%20qb%20afc%20afd%20afe%20qf%20qg%20aff%20qh%20qj%20qk%20afg%20ql%20qn%20qo%20afh%20qp%20qr%20afi%20by%22%20data-selectable-paragraph%3D%22%22%20id%3D%22toc-hId-1694829825%22%20id%3D%22toc-hId-1697626267%22%3EInfrastructure%20Setup%3C%2FH2%3E%0A%3CP%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20acb%20ue%20acc%20acd%20ace%20uh%20acf%20acg%20ach%20aci%20acj%20ack%20acl%20acm%20acn%20aco%20acp%20acq%20acr%20acs%20og%20by%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20jv%20il%20jw%20jx%20jy%20ip%20jz%20ka%20kb%20kc%20kd%20ke%20kf%20kg%20kh%20ki%20kj%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3EThe%20services%20required%20to%20implement%20this%20proof-of-concept%20include%3A%3C%2FP%3E%0A%3CUL%20class%3D%22%22%3E%0A%3CLI%20id%3D%22d810%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3E%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdatabricks%2Fscenarios%2Fwhat-is-azure-databricks%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3EAzure%20Databricks%3C%2FA%3E%20workspace%20to%20build%20machine%20learning%20models%2C%20track%20experiments%2C%20and%20manage%20machine%20learning%20models.%3C%2FLI%3E%0A%3CLI%20id%3D%22cb97%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kv%20il%20jw%20jx%20kw%20ip%20jz%20ka%20kx%20kc%20kd%20ke%20ky%20kg%20kh%20ki%20kz%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3E%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Faks%2Fintro-kubernetes%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3EAzure%20Kubernetes%20Service%3C%2FA%3E%20(AKS)%20to%20deploy%20containers%20exposing%20a%20web%20service%20to%20end-users%20(one%20for%20a%20staging%20and%20production%20environment%20respectively).%3C%2FLI%3E%0A%3CLI%20id%3D%223ff6%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kv%20il%20jw%20jx%20kw%20ip%20jz%20ka%20kx%20kc%20kd%20ke%20ky%20kg%20kh%20ki%20kz%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3E%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fcontainer-registry%2Fcontainer-registry-intro%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3EAzure%20Container%20Registry%3C%2FA%3E%20(ACR)%20to%20manage%20and%20store%20Docker%20containers.%3C%2FLI%3E%0A%3CLI%20id%3D%22861c%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kv%20il%20jw%20jx%20kw%20ip%20jz%20ka%20kx%20kc%20kd%20ke%20ky%20kg%20kh%20ki%20kz%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3E%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Flogs%2Fdata-platform-logs%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3EAzure%20Log%20Analytics%20Workspace%3C%2FA%3E%20to%20query%20log%20telemetry%20in%20Azure%20Monitor.%3C%2FLI%3E%0A%3CLI%20id%3D%224e51%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kv%20il%20jw%20jx%20kw%20ip%20jz%20ka%20kx%20kc%20kd%20ke%20ky%20kg%20kh%20ki%20kz%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3E%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fproducts%2Fgithub%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3EGitHub%3C%2FA%3E%20to%20store%20code%20for%20the%20project%20and%20enable%20automation%20by%20building%20and%20deploying%20artifacts.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3EBy%20default%2C%20this%20proof-of-concept%20has%20been%20implemented%20by%20deploying%20all%20resources%20into%20a%20single%20resource%20group.%20However%2C%20for%20production%20scenarios%2C%20many%20resource%20groups%20across%20multiple%20subscriptions%20would%20be%20preferred%20for%20security%20and%20governance%20purposes%20(see%20%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fcloud-adoption-framework%2Fready%2Flanding-zone%2F%23%3A~%3Atext%3DEnterprise-scale%2520is%2520an%2520architectural%2520approach%2520and%2520a%2520reference%2Croadmap%2520and%2520the%2520Cloud%2520Adoption%2520Framework%2520for%2520Azure.%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3EAzure%20Enterprise-Scale%20Landing%20Zones%3C%2FA%3E)%20with%20services%20deployed%20using%20%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Farchitecture%2Fframework%2Fdevops%2Fautomation-infrastructure%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3Einfrastructure%20as%20code%20(IaC)%3C%2FA%3E.%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3ESome%20services%20have%20been%20further%20configured%20as%20part%20of%20this%20proof-of-concept%3A%3C%2FP%3E%0A%3CUL%20class%3D%22%22%3E%0A%3CLI%20id%3D%2241e7%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3EAzure%20Kubernetes%20Service%3A%20%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Fcontainers%2Fcontainer-insights-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3Econtainer%20insights%3C%2FA%3E%20has%20been%20enabled%20to%20collect%20metrics%20and%20logs%20from%20containers%20running%20on%20AKS.%20This%20will%20be%20used%20to%20monitor%20API%20performance%20and%20analyze%20logs.%3C%2FLI%3E%0A%3CLI%20id%3D%22cab2%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kv%20il%20jw%20jx%20kw%20ip%20jz%20ka%20kx%20kc%20kd%20ke%20ky%20kg%20kh%20ki%20kz%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3EAzure%20Databricks%3A%20the%20%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdatabricks%2Frepos%23enable-support-for-arbitrary-files-in-databricks-repos%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3Efiles%20in%20repo%3C%2FA%3E%20feature%20has%20been%20enabled%20(not%20enabled%20by%20default%20at%20the%20time%20of%20developing%20this%20proof-of-concept)%20and%20a%20cluster%20has%20been%20created%20for%20Data%20Scientists%2C%20Machine%20Learning%20Engineers%2C%20and%20Data%20Analysts%20to%20use%20to%20develop%20models.%3C%2FLI%3E%0A%3CLI%20id%3D%22fd95%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kv%20il%20jw%20jx%20kw%20ip%20jz%20ka%20kx%20kc%20kd%20ke%20ky%20kg%20kh%20ki%20kz%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3EGitHub%3A%20two%20GitHub%20Environments%20have%20been%20created%20for%20Staging%20and%20Production%20environments%20along%20with%20GitHub%20Secrets%20to%20be%20used%20during%20the%20CI%2FCD%20pipeline.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3EIn%20practice%20within%20an%20organization%2C%20a%20Cloud%20Administrator%20will%20provision%20and%20configure%20this%20infrastructure.%20Data%20Scientists%20and%20Machine%20Learning%20Engineers%20who%20build%2C%20deploy%2C%20and%20monitor%20machine%20learning%20models%20will%20not%20be%20responsible%20for%20these%20activities.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22bcdd%22%20class%3D%22aey%20zy%20yj%20bv%20fs%20aez%20afa%20afb%20qb%20afc%20afd%20afe%20qf%20qg%20aff%20qh%20qj%20qk%20afg%20ql%20qn%20qo%20afh%20qp%20qr%20afi%20by%22%20data-selectable-paragraph%3D%22%22%20id%3D%22toc-hId--112624638%22%20id%3D%22toc-hId--109828196%22%3EModel%20Development%3C%2FH2%3E%0A%3CP%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20acb%20ue%20acc%20acd%20ace%20uh%20acf%20acg%20ach%20aci%20acj%20ack%20acl%20acm%20acn%20aco%20acp%20acq%20acr%20acs%20og%20by%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20jv%20il%20jw%20jx%20jy%20ip%20jz%20ka%20kb%20kc%20kd%20ke%20kf%20kg%20kh%20ki%20kj%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3EOnce%20the%20infrastructure%20is%20provisioned%20and%20data%20is%20sourced%20a%20Data%20Scientist%20can%20commence%20developing%20machine%20learning%20models.%20The%20Data%20Scientist%20can%20add%20a%20Git%20repository%20with%20%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdatabricks.com%2Fproduct%2Frepos%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20nofollow%20noreferrer%22%3EDatabricks%20Repos%3C%2FA%3E%20for%20each%20project%20they%20(or%20the%20team)%20are%20working%20on%20within%20the%20Databricks%20workspace.%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3EFor%20this%20proof-of-concept%2C%20the%20model%20development%20process%20has%20been%20encapsulated%20in%20a%20single%20notebook%20called%3CCODE%20class%3D%22lh%20mo%20mp%20mq%20mr%20b%22%3Edevelop_model%3C%2FCODE%3E.%20This%20notebook%20will%20develop%20and%20register%20an%20MLflow%20Model%20for%20deployment%20consisting%20of%3A%3C%2FP%3E%0A%3CUL%20class%3D%22%22%3E%0A%3CLI%20id%3D%22a743%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3Ea%20machine%20learning%20model%20to%20predict%20the%20liklihood%20of%20employee%20attrition%3C%2FLI%3E%0A%3CLI%20id%3D%229454%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kv%20il%20jw%20jx%20kw%20ip%20jz%20ka%20kx%20kc%20kd%20ke%20ky%20kg%20kh%20ki%20kz%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3Ea%20statistical%20model%20to%20determine%20data%20drift%20in%20features%3C%2FLI%3E%0A%3CLI%20id%3D%2237db%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kv%20il%20jw%20jx%20kw%20ip%20jz%20ka%20kx%20kc%20kd%20ke%20ky%20kg%20kh%20ki%20kz%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3Ea%20statistical%20model%20to%20determine%20outliers%20in%20features%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22nimoore_6-1643238529223.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F342804i0ECC014ED0991CD3%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22nimoore_6-1643238529223.png%22%20alt%3D%22nimoore_6-1643238529223.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%3A%20center%3B%20%22%3E%3CFONT%20size%3D%222%22%3E%3CEM%3ETraining%20notebook%20in%20Azure%20Databricks%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3EAfter%20executing%20this%20notebook%20the%20MLflow%20model%20will%20be%20registered%20and%20training%20metrics%20will%20be%20captured%20in%20the%20MLflow%20model%20registry%20and%20Experiments%20tracker%20respectively.%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3EIn%20practice%2C%20the%20model%20development%20process%20requires%20more%20effort%20than%20illustrated%20in%20this%20notebook%20and%20will%20often%20span%20multiple%20notebooks.%20Note%20that%20important%20aspects%20of%20well-developed%20MLOps%20processes%20such%20as%20explainability%2C%20performance%20profiling%2C%20pipelines%2C%20etc.%20have%20been%20ignored%20in%20this%20proof-of-concept%20implementation%20but%20foundational%20components%20such%20as%20experiment%20tracking%20and%20model%20registration%20and%20versioning%20have%20been%20included.%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22nimoore_7-1643238601631.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F342805i1A52A620F6F42370%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22nimoore_7-1643238601631.png%22%20alt%3D%22nimoore_7-1643238601631.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%3A%20center%3B%20%22%3E%3CFONT%20size%3D%222%22%3E%3CEM%3EExperiment%20metrics%20for%20hyperparameter%20tuning%20in%20Azure%20Databricks%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%3A%20center%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22nimoore_8-1643238646465.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F342806i2BA25E52B442EEFB%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22nimoore_8-1643238646465.png%22%20alt%3D%22nimoore_8-1643238646465.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%3A%20center%3B%20%22%3E%3CFONT%20size%3D%222%22%3E%3CEM%3ERegistered%20models%20in%20Azure%20Databricks%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3EA%20JSON%20configuration%20file%20is%20used%20to%20define%20which%20version%20of%20each%20model%20from%20the%20%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdatabricks%2Fapplications%2Fmachine-learning%2Fmanage-model-lifecycle%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3EMLflow%20model%20registry%3C%2FA%3E%20should%20be%20deployed%20as%20part%20of%20the%20API.%20All%20three%20models%20need%20to%20be%20referenced%20since%20they%20perform%20different%20functions%20(predictions%2C%20drift%20detection%2C%20and%20outlier%20detection%20respectively).%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20dn%20hg%22%20data-selectable-paragraph%3D%22%22%3EData%20scientists%20can%20edit%20this%20file%20once%20models%20are%20ready%20to%20be%20deployed%20and%20commit%20the%20file%20to%20the%20Git%20repository.%20The%20configuration%20file%3CCODE%20class%3D%22lh%20mo%20mp%20mq%20mr%20b%22%3Eservice%2Fconfiguration.json%3C%2FCODE%3Eis%20structured%20as%20follows%3A%3C%2FP%3E%0A%3CFIGURE%20class%3D%22jf%20jg%20jh%20ji%20jj%20jk%22%3E%0A%3CDIV%20class%3D%22lg%20s%20ap%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lg%20s%20ap%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%7B%0A%20%20%22model_name%22%3A%20%22employee_attrition%22%2C%0A%20%20%22model_version%22%3A%20%221%22%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%0A%3C%2FFIGURE%3E%0A%3CFIGURE%20class%3D%22abm%20abn%20abo%20abp%20abq%20abr%22%3E%0A%3CDIV%20style%3D%22%20text-align%3A%20center%3B%20%22%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20style%3D%22%20text-align%20%3A%20left%3B%20%22%20id%3D%22toc-hId--1917282659%22%3EModel%20Deployment%3C%2FH2%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3EA%20Machine%20Learning%20Engineer%20will%20work%20to%20develop%20an%20automated%20process%20to%20deploy%20and%20monitor%20these%20models%20as%20part%20of%20an%20ML%20system.%20Part%20of%20this%20requires%20developing%20a%20%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdevops%2Fdevelop%2Fwhat-is-continuous-integration%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3Econtinuous%20integration%3C%2FA%3E%2F%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdevops%2Fdeliver%2Fwhat-is-continuous-delivery%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3Econtinuous%20delivery%3C%2FA%3E%20(CI%2FCD)%20to%20automate%20the%20building%20and%20deploying%20artifacts.%20A%20simple%20CI%2FCD%20pipeline%20has%20been%20implemented%20using%20GitHub%20Actions%20for%20this%20proof-of-concept.%20The%20pipeline%20is%20triggered%20when%20commits%20are%20pushed%2C%20or%20a%20pull%20request%20is%20made%20to%20either%20the%20%3CEM%20class%3D%22lw%22%3Emain%3C%2FEM%3E%20or%20%3CEM%20class%3D%22lw%22%3Edevelopment%3C%2FEM%3E%20branch.%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3EThe%20CI%2FCD%20pipeline%20consists%20of%20three%20jobs%3A%3C%2FP%3E%0A%3CUL%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%0A%3CLI%20id%3D%22f9fb%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kn%20il%20jw%20jx%20ko%20ip%20jz%20ka%20kp%20kc%20kd%20ke%20kq%20kg%20kh%20ki%20kr%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3EBuild%3A%20this%20job%20will%20create%20a%20Docker%20container%20and%20register%20it%20in%20ACR.%20This%20Docker%20container%20will%20be%20the%20model%20inference%20API%20which%20end-users%20will%20consume.%20This%20container%20has%20been%20developed%20using%20%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Ffastapi.tiangolo.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20nofollow%20noreferrer%22%3EFastAPI%3C%2FA%3E%20and%20a%20custom%20python%20function%20MLflow%20model%20consisting%20of%20a%20machine%20learning%20classifier%20and%20two%20statistical%20models%20calculating%20data%20drift%20and%20outliers%20respectively.%3C%2FLI%3E%0A%3CLI%20id%3D%229a49%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kv%20il%20jw%20jx%20kw%20ip%20jz%20ka%20kx%20kc%20kd%20ke%20ky%20kg%20kh%20ki%20kz%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3EStaging%3A%20this%20job%20will%20deploy%20the%20Docker%20container%20to%20the%20AKS%20cluster%20in%20the%20staging%20environment.%20Once%20deployed%2C%20the%20model%E2%80%99s%20state%20will%20transition%20to%20the%20%3CEM%20class%3D%22lw%22%3EStaging%20%3C%2FEM%3Estate%20in%20the%20MLflow%20model%20registry.%3C%2FLI%3E%0A%3CLI%20id%3D%221f10%22%20class%3D%22jr%20js%20gj%20jt%20b%20ju%20kv%20il%20jw%20jx%20kw%20ip%20jz%20ka%20kx%20kc%20kd%20ke%20ky%20kg%20kh%20ki%20kz%20kk%20kl%20km%20ks%20kt%20ku%20hg%22%20data-selectable-paragraph%3D%22%22%3EProduction%3A%20this%20job%20will%20deploy%20the%20Docker%20container%20to%20the%20AKS%20cluster%20in%20the%20production%20environment.%20Once%20deployed%2C%20the%20model%E2%80%99s%20state%20will%20transition%20to%20the%20%3CEM%20class%3D%22lw%22%3EProduction%20%3C%2FEM%3Estate%20in%20the%20MLflow%20model%20registry.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Ffastapi.tiangolo.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20nofollow%20noreferrer%22%3EFastAPI%3C%2FA%3E%20is%20a%20high-performance%20and%20intuitive%20web%20framework%20for%20building%20web%20services.%20The%20MLflow%20model%20will%20be%20packaged%20with%20this%20web%20service%2C%20along%20with%20its%20dependencies%2C%20to%20build%20a%20docker%20container%20image.%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3EThe%20prediction%20service%20used%20in%20this%20proof-of-concept%20consists%20of%20a%20single%20endpoint%20called%20%3CEM%20class%3D%22lw%22%3Epredict%3C%2FEM%3E.%20It%20is%20implemented%20using%20the%20MLflow%20model%2C%20a%20file%20specifying%20Python%20dependencies%20and%20code%20describing%20the%20web%20service.%20When%20a%20user%20calls%20this%20endpoint%20the%20request%20will%20be%20passed%20and%20the%20records%20will%20be%20consumed%20by%20the%20MLflow%20model%20which%20will%20call%20the%20three%20individual%20models%20and%20return%20the%20consolidated%20results.%20This%20will%20generate%20a%20list%20of%20predictions%2C%20output%20to%20indicate%20if%20data%20drift%20is%20present%20for%20any%20of%20the%20features%2C%20and%20output%20to%20indicate%20if%20outliers%20are%20present%20for%20any%20of%20the%20features.%20The%20results%20will%20be%20returned%20to%20the%20client%20and%20the%20drift%20and%20outlier%20metrics%20will%20be%20logged%20for%20future%20analysis.%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3EThe%20prediction%20service%20used%20in%20this%20proof-of-concept%20is%20defined%20in%20the%3CCODE%20class%3D%22lh%20mo%20mp%20mq%20mr%20b%22%3Eservice%2Fapp%3C%2FCODE%3Edirectory.%20An%20extract%20of%20the%20code%20used%20to%20define%20the%20prediction%20service%20an%20outline%20shown%20below%3A%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-python%22%3E%3CCODE%3E%23%20Define%20global%20variables%0ASERVICE_NAME%20%3D%20%22Employee%20Attrition%20API%22%0AMODEL_ARTIFACT_PATH%20%3D%20%22.%2Femployee_attrition_model%22%0A%0A%23%20Initialize%20the%20FastAPI%20app%0Aapp%20%3D%20FastAPI(title%3DSERVICE_NAME%2C%20docs_url%3D%22%2F%22)%0A%0A%23%20Configure%20logger%0Alog%20%3D%20logging.getLogger(%22uvicorn%22)%0Alog.setLevel(logging.INFO)%0A%0A%0A%40app.on_event(%22startup%22)%0Aasync%20def%20startup_load_model()%3A%0A%20%20%20%20global%20MODEL%0A%20%20%20%20MODEL%20%3D%20load_model(MODEL_ARTIFACT_PATH)%0A%0A%0A%40app.post(%22%2Fpredict%22)%0Aasync%20def%20predict(data%3A%20List%5BEmployeeAttritionRecord%5D)%3A%0A%20%20%20%20%23%20Parse%20data%0A%20%20%20%20input_df%20%3D%20pd.DataFrame(jsonable_encoder(data))%0A%0A%20%20%20%20%23%20Define%20UUID%20for%20the%20request%0A%20%20%20%20request_id%20%3D%20uuid.uuid4().hex%0A%0A%20%20%20%20%23%20Log%20input%20data%0A%20%20%20%20log.info(json.dumps(%7B%0A%20%20%20%20%20%20%20%20%22service_name%22%3A%20SERVICE_NAME%2C%0A%20%20%20%20%20%20%20%20%22type%22%3A%20%22InputData%22%2C%0A%20%20%20%20%20%20%20%20%22request_id%22%3A%20request_id%2C%0A%20%20%20%20%20%20%20%20%22data%22%3A%20input_df.to_json(orient%3D'records')%2C%0A%20%20%20%20%7D))%0A%0A%20%20%20%20%23%20Make%20predictions%20and%20log%0A%20%20%20%20model_output%20%3D%20MODEL.predict(input_df)%0A%0A%20%20%20%20%23%20Log%20output%20data%0A%20%20%20%20log.info(json.dumps(%7B%0A%20%20%20%20%20%20%20%20%22service_name%22%3A%20SERVICE_NAME%2C%0A%20%20%20%20%20%20%20%20%22type%22%3A%20%22OutputData%22%2C%0A%20%20%20%20%20%20%20%20%22request_id%22%3A%20request_id%2C%0A%20%20%20%20%20%20%20%20%22data%22%3A%20model_output%0A%20%20%20%20%7D))%0A%0A%20%20%20%20%23%20Make%20response%20payload%0A%20%20%20%20response_payload%20%3D%20jsonable_encoder(model_output)%0A%0A%20%20%20%20return%20response_payload%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3EWithin%20the%20%3CEM%20class%3D%22lw%22%3EBuild%3C%2FEM%3E%20job%20of%20the%20CI%2FCD%20pipeline%2C%20the%20model%20artifacts%20will%20be%20downloaded%20from%20the%20Databricks%20MLflow%20model%20registry.%20The%20MLflow%20model%20will%20be%20packaged%20with%20the%20FastAPI%20web%20service%2C%20along%20with%20its%20dependencies%2C%20to%20build%20a%20docker%20container%20image%20of%20the%20model%20inference%20API.%20This%20container%20image%20is%20then%20stored%20in%20ACR.%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3EThe%20%3CEM%20class%3D%22lw%22%3EStaging%3C%2FEM%3E%20job%20will%20automatically%20be%20triggered%20after%20the%20%3CEM%20class%3D%22lw%22%3EBuild%3C%2FEM%3E%20job%20has%20been%20completed.%20This%20job%20will%20deploy%20the%20container%20image%20to%20the%20AKS%20cluster%20in%20the%20staging%20environment.%20A%20Kubernetes%20manifest%20file%20has%20been%20defined%20in%3CCODE%20class%3D%22lh%20mo%20mp%20mq%20mr%20b%22%3Emanifests%2Fapi.yaml%3C%2FCODE%3Ethat%20specifies%20the%20desired%20state%20of%20the%20model%20inference%20API%20that%20Kubernetes%20will%20maintain.%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3EEnvironment%20protection%20rules%20have%20been%20configured%20within%20GitHub%20Actions%20to%20require%20manual%20approval%20from%20approved%20reviewers%20before%20the%20Docker%20container%20is%20deployed%20to%20the%20production%20environment.%20This%20provides%20the%20team%20with%20greater%20control%20over%20when%20updates%20are%20deployed%20to%20production.%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22nimoore_9-1643238955971.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F342808iEB9697611DB9979A%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22nimoore_9-1643238955971.png%22%20alt%3D%22nimoore_9-1643238955971.png%22%20%2F%3E%3C%2FSPAN%3E%3CP%20style%3D%22%20text-align%3A%20center%3B%20%22%3E%3CFONT%20size%3D%222%22%3E%3CEM%3EGitHub%20Action%20CI%2FCD%20workflow%20production%20deployment%20approval%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%3A%20center%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3EAt%20each%20stage%20of%20this%20process%2C%20as%20the%20model%20inference%20API%20is%20deployed%20to%20staging%20and%20production%20environments%2C%20the%20corresponding%20model%20artifact%20in%20the%20MLflow%20model%20registry%20is%20updated%20to%20reflect%20the%20environment%20of%20each%20model%20version.%20This%20is%20useful%20since%20it%20provides%20Data%20Scientists%20visibility%20of%20all%20operationalized%20models%20in%20real-time%20while%20providing%20a%20single%20source%20of%20truth.%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22nimoore_11-1643239019640.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F342810i6B4064AA9B33050C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22nimoore_11-1643239019640.png%22%20alt%3D%22nimoore_11-1643239019640.png%22%20%2F%3E%3C%2FSPAN%3E%3CP%3E%3CEM%3E%3CFONT%20size%3D%222%22%3E%3CSPAN%3ECompleted%20CI%2FCD%20pipeline%20workflow%20with%20GitHub%20Actions%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22nimoore_13-1643239074030.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F342812iBAD9D1E60A095B17%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22nimoore_13-1643239074030.png%22%20alt%3D%22nimoore_13-1643239074030.png%22%20%2F%3E%3C%2FSPAN%3E%3CP%3E%3CEM%3E%3CFONT%20size%3D%222%22%3E%3CSPAN%3ERegistered%20models%20with%20updated%20environments%20in%20Azure%20Databricks%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditornimoore_12%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%3CSPAN%3EAfter%20approval%20has%20been%20given%20and%20the%20model%20inference%20API%20has%20been%20deployed%20the%20Swagger%20UI%20for%20the%20service%20can%20be%20accessed%20from%20the%20IP%20address%20of%20the%20Kubernetes%20ingress%20controller%20corresponding.%20This%20can%20be%20found%20under%20the%20AKS%20service%20in%20the%20Azure%20Portal%20or%20via%20CLI.%3C%2FSPAN%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20act%20ue%20acc%20acd%20acu%20uh%20acf%20acg%20acv%20aci%20acj%20ack%20acw%20acm%20acn%20aco%20acx%20acq%20acr%20acs%20og%20by%22%20data-selectable-paragraph%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22nimoore_15-1643239266298.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F342814iE17B56164A63E691%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22nimoore_15-1643239266298.png%22%20alt%3D%22nimoore_15-1643239266298.png%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CFIGURE%20class%3D%22abm%20abn%20abo%20abp%20abq%20abr%20tg%20th%20paragraph-image%22%3E%0A%3CFIGCAPTION%20class%3D%22aeq%20nr%20ya%20tg%20th%20aer%20aes%20bv%20b%20bw%20bx%20ia%22%20data-selectable-paragraph%3D%22%22%3E%3CEM%3E%3CFONT%20size%3D%222%22%3EFastAPI%20Swagger%20UI%3C%2FFONT%3E%3C%2FEM%3E%3C%2FFIGCAPTION%3E%0A%3C%2FFIGURE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%3CSPAN%3EFor%20production%20scenarios%2C%20a%20CI%2FCD%20pipeline%20should%20consist%20of%20other%20elements%20such%20as%20unit%20tests%2C%20code%20quality%20scans%2C%20code%20security%20scans%2C%20integration%20tests%2C%20and%20performance%20tests.%20Moreover%2C%20teams%20might%20choose%20to%20use%20%3C%2FSPAN%3E%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fwww.helm.sh%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20nofollow%20noreferrer%22%3EHelm%3C%2FA%3E%3CSPAN%3E%20charts%20to%20easily%20configure%20and%20deploy%20services%20onto%20Kubernetes%20clusters%20or%20use%20a%20Blue-Green%20or%20Canary%20deployment%20strategy%20when%20releasing%20their%20application.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20style%3D%22%20text-align%20%3A%20left%3B%20%22%20id%3D%22toc-hId-570230174%22%3EModel%20Monitoring%3C%2FH2%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3EOnce%20the%20application%20is%20operational%20and%20integrated%20with%20other%20systems%20a%20Machine%20Learning%20Engineer%20can%20commence%20monitoring%20the%20application%20to%20measure%20the%20health%20of%20the%20API%20and%20track%20model%20performance.%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3EOnce%20models%20are%20operationalized%2C%20monitoring%20their%20performance%20is%20essential%20to%20prevent%20degradation.%20This%20can%20be%20caused%20by%20changes%20in%20the%20data%20and%20relationships%20between%20the%20feature%20and%20target%20variables.%20When%20these%20changes%20are%20detected%20it%20indicates%20that%20the%20machine%20learning%20model%20needs%20to%20be%20re-trained%20by%20Data%20Scientists.%20This%20can%20be%20accomplished%20manually%20through%20alerts%20or%20automatically%20on%20a%20schedule.%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3EWithin%20this%20proof-of-concept%2C%20%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Fcontainers%2Fcontainer-insights-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3Econtainer%20insights%3C%2FA%3E%20for%20AKS%20have%20been%20enabled%20to%20collect%20metrics%20and%20logs%20from%20the%20model%20inference%20API.%20These%20can%20be%20viewed%20in%20Azure%20Monitor.%20The%20Azure%20Log%20Analytics%20workspace%20can%20be%20used%20to%20analyze%20drift%20and%20outlier%20metrics%20logs%20from%20the%20machine%20learning%20service%20whenever%20a%20client%20makes%20a%20request.%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3EThe%20model%20inference%20API%20accepts%20requests%20from%20end-users%20in%20the%20following%20format%3A%3C%2FP%3E%0A%3CFIGURE%20class%3D%22jf%20jg%20jh%20ji%20jj%20jk%22%3E%0A%3CDIV%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lg%20s%20ap%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%5B%0A%20%7B%0A%20%22BusinessTravel%22%3A%20%22Travel_Rarely%22%2C%0A%20%22Department%22%3A%20%22Research%20%26amp%3B%20Development%22%2C%0A%20%22EducationField%22%3A%20%22Medical%22%2C%0A%20%22Gender%22%3A%20%22Male%22%2C%0A%20%22JobRole%22%3A%20%22Manager%22%2C%0A%20%22MaritalStatus%22%3A%20%22Married%22%2C%0A%20%22Over18%22%3A%20%22Yes%22%2C%0A%20%22OverTime%22%3A%20%22No%22%2C%0A%20%22Age%22%3A%2036%2C%0A%20%22DailyRate%22%3A%20989%2C%0A%20%22DistanceFromHome%22%3A%208%2C%0A%20%22Education%22%3A%201%2C%0A%20%22EmployeeCount%22%3A%201%2C%0A%20%22EmployeeNumber%22%3A%20253%2C%0A%20%22EnvironmentSatisfaction%22%3A%204%2C%0A%20%22HourlyRate%22%3A%2046%2C%0A%20%22JobInvolvement%22%3A%203%2C%0A%20%22JobLevel%22%3A%205%2C%0A%20%22JobSatisfaction%22%3A%203%2C%0A%20%22MonthlyIncome%22%3A%2019033%2C%0A%20%22MonthlyRate%22%3A%206499%2C%0A%20%22NumCompaniesWorked%22%3A%201%2C%0A%20%22PercentSalaryHike%22%3A%2014%2C%0A%20%22PerformanceRating%22%3A%203%2C%0A%20%22RelationshipSatisfaction%22%3A%202%2C%0A%20%22StandardHours%22%3A%2065%2C%0A%20%22StockOptionLevel%22%3A%201%2C%0A%20%22TotalWorkingYears%22%3A%2014%2C%0A%20%22TrainingTimesLastYear%22%3A%203%2C%0A%20%22WorkLifeBalance%22%3A%202%2C%0A%20%22YearsAtCompany%22%3A%203%2C%0A%20%22YearsInCurrentRole%22%3A%203%2C%0A%20%22YearsSinceLastPromotion%22%3A%203%2C%0A%20%22YearsWithCurrManager%22%3A%201%0A%20%7D%0A%5D%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%0A%3C%2FFIGURE%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%3CSPAN%3EWhen%20the%20model%20inference%20API%20is%20called%20it%20logs%20telemetry%20that%20relates%20to%20input%20data%2C%20drift%2C%20outliers%2C%20and%20predictions.%20This%20telemetry%20is%20collected%20by%20Azure%20Monitor%20and%20can%20be%20queried%20within%20an%20Azure%20Log%20Analytics%20workspace%20to%20extract%20insights.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22nimoore_16-1643239409664.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F342815i22B8C676306B9DE6%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22nimoore_16-1643239409664.png%22%20alt%3D%22nimoore_16-1643239409664.png%22%20%2F%3E%3C%2FSPAN%3E%3CFIGURE%20class%3D%22abm%20abn%20abo%20abp%20abq%20abr%20tg%20th%20paragraph-image%22%3E%0A%3CFIGCAPTION%20class%3D%22aeq%20nr%20ya%20tg%20th%20aer%20aes%20bv%20b%20bw%20bx%20ia%22%20data-selectable-paragraph%3D%22%22%3E%3CFONT%20size%3D%222%22%3E%3CEM%3ECalling%20the%20predict%20endpoint%20of%20the%20FastAPI%20service%20via%20the%20Swagger%20UI%3C%2FEM%3E%3C%2FFONT%3E%3C%2FFIGCAPTION%3E%0A%3C%2FFIGURE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%3CSPAN%3EWithin%20the%20Azure%20Log%20Analytics%20workspace%2C%20a%20query%20can%20be%20executed%20to%20find%20all%20logs%20relating%20to%20the%20specific%20model%20inference%20API%20within%20a%20time%20range%2C%20%3C%2FSPAN%3E%3CCODE%20class%3D%22lh%20mo%20mp%20mq%20mr%20b%22%3EEmployee%20Attrition%20API%3C%2FCODE%3E%3CSPAN%3E%20in%20this%20proof-of-concept%2C%20and%20parse%20the%20result%20to%20extract%20drift%20results.%20These%20values%20correspond%20to%20p-values%20and%20can%20be%20used%20to%20determine%20if%20data%20drift%20is%20present.%20Any%20feature%20with%20a%20p-value%20less%20than%20a%20pre-defined%20threshold%20has%20undergone%20drift%20(the%20threshold%20is%200.05%20for%20this%20proof-of-concept).%20For%20simplicity%2C%20in%20this%20proof-of-concept%2C%20an%20attribute%20called%20%3C%2FSPAN%3E%3CCODE%20class%3D%22lh%20mo%20mp%20mq%20mr%20b%22%3Edrift_magnitude%3C%2FCODE%3E%3CSPAN%3E%20has%20been%20calculated%20from%20the%20p-value%20for%20interpretability%20purposes.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%3CSPAN%3EThe%20following%20KQL%20query%20can%20be%20executed%20to%26nbsp%3Bretrieve%26nbsp%3B%3CCODE%20class%3D%22lh%20mo%20mp%20mq%20mr%20b%22%3Edrift_magnitude%3C%2FCODE%3Emetrics%20for%20the%20model%20inference%20API%20logs%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3EContainerLog%0A%7C%20where%20TimeGenerated%20%26gt%3B%20ago%20(30d)%0A%7C%20where%20LogEntry%20has%20'Employee%20Attrition%20API'%20and%20LogEntry%20has%20'OutputData'%0A%7C%20project%20TimeGenerated%2C%20ResponsePayload%3Dsplit(LogEntry%2C%20'INFO%3A')%0A%7C%20project%20TimeGenerated%2C%20DriftMagnitude%3Dparse_json(tostring(ResponsePayload%5B1%5D)).data.drift__magnitude%0A%7C%20evaluate%20bag_unpack(DriftMagnitude)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22nimoore_17-1643239582138.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F342816i40124447FE86B72C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22nimoore_17-1643239582138.png%22%20alt%3D%22nimoore_17-1643239582138.png%22%20%2F%3E%3C%2FSPAN%3E%3CP%3E%3CFONT%20size%3D%222%22%3E%3CEM%3EQuerying%20container%20logs%20to%20extract%20data%20drift%20values%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3EAzure%20Log%20Analytics%20is%20capable%20of%20executing%20more%20complex%20queries%20such%20as%20moving%20averages%20or%20aggregations%20over%20sliding%20values.%20These%20can%20be%20tailored%20to%20the%20requirements%20of%20your%20specific%20workload.%20The%20results%20can%20be%20visualized%20in%20a%20workbook%20or%20dashboard%2C%20or%20used%20as%20part%20of%20alerts%20to%20proactively%20notify%20Data%20Scientists%20and%20Machine%20Learning%20Engineers%20of%20issues.%20Such%20alerts%20could%20indicate%20when%20Data%20Scientists%20or%20Machine%20Learning%20Engineers%20should%20re-train%20models%20or%20investigate%20concerning%20changes.%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3ETo%20re-train%20models%2C%20inference%20data%20from%20requests%20need%20to%20be%20collected%20and%20transformed.%20This%20can%20be%20achieved%20by%20configuring%20%3CA%20class%3D%22ea%20la%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Flogs%2Flogs-data-export%3Ftabs%3Dportal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3Edata%20export%3C%2FA%3E%20in%20your%20Log%20Analytics%20workspace%20to%20export%20data%20in%20near-real-time%20to%20a%20storage%20account.%20This%20data%20can%20be%20curated%20and%20stored%20in%20a%20feature%20store%20for%20subsequent%20use%20as%20part%20of%20a%20batch%20process%20(using%20Databricks%20for%20example).%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3EFrom%20this%2C%20a%20continuous%20training%20(CT)%20pipeline%20can%20be%20developed%20to%20automate%20model%20re-training%2C%20update%20the%20model%20version%20in%20the%20MLflow%20Model%20Registry%2C%20and%20re-trigger%20the%20CI%2FCD%20pipeline%20to%20re-build%20and%20re-deploy%20the%20model%20inference%20API.%20A%20CT%20pipeline%20is%20an%20important%20aspect%20of%20well-developed%20MLOps%20processes.%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20style%3D%22%20text-align%20%3A%20left%3B%20%22%20id%3D%22toc-hId-559727070%22%3EResources%3C%2FH1%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3EYou%20may%20also%20find%20these%20related%20articles%20useful%3A%3C%2FP%3E%0A%3CUL%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%0A%3CLI%20id%3D%22d2a4%22%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20act%20ue%20acc%20acd%20acu%20uh%20acf%20acg%20acv%20aci%20acj%20ack%20acw%20acm%20acn%20aco%20acx%20acq%20acr%20acs%20acy%20acz%20aea%20by%22%20data-selectable-paragraph%3D%22%22%3E%3CA%20class%3D%22ay%20aeg%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Farchitecture%2Fexample-scenario%2Fmlops%2Fmlops-maturity-model%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3EMachine%20Learning%20Operations%20Maturity%20Model%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%20id%3D%22b3c1%22%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20aeb%20ue%20acc%20acd%20aec%20uh%20acf%20acg%20aed%20aci%20acj%20ack%20aee%20acm%20acn%20aco%20aef%20acq%20acr%20acs%20acy%20acz%20aea%20by%22%20data-selectable-paragraph%3D%22%22%3E%3CA%20class%3D%22ay%20aeg%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Farchitecture%2Fdata-science-process%2Foverview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3ETeam%20Data%20Science%20Process%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%20id%3D%2224df%22%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20aeb%20ue%20acc%20acd%20aec%20uh%20acf%20acg%20aed%20aci%20acj%20ack%20aee%20acm%20acn%20aco%20aef%20acq%20acr%20acs%20acy%20acz%20aea%20by%22%20data-selectable-paragraph%3D%22%22%3E%3CA%20class%3D%22ay%20aeg%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Farchitecture%2Fsolution-ideas%2Farticles%2Fazure-databricks-modern-analytics-architecture%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20noreferrer%22%3EModern%20Analytics%20Architecture%20with%20Azure%20Databricks%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%20id%3D%223b05%22%20class%3D%22abx%20aby%20yj%20abz%20b%20aca%20aeb%20ue%20acc%20acd%20aec%20uh%20acf%20acg%20aed%20aci%20acj%20ack%20aee%20acm%20acn%20aco%20aef%20acq%20acr%20acs%20acy%20acz%20aea%20by%22%20data-selectable-paragraph%3D%22%22%3E%3CA%20class%3D%22ay%20aeg%22%20href%3D%22https%3A%2F%2Fdocs.databricks.com%2Fapplications%2Fmachine-learning%2Fmanage-model-lifecycle%2Fmultiple-workspaces.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20ugc%20nofollow%20noreferrer%22%3ESharing%20Models%20Across%20Workspaces%20in%20Databricks%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%20%3A%20left%3B%20%22%3E%3CEM%3EThis%20article%20was%20originally%26nbsp%3Bposted%20%3CA%20href%3D%22https%3A%2F%2Fmedium.com%2F%40nfmoore%2Fmachine-learning-at-scale-with-databricks-and-kubernetes-9fa59232bfa6%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%3C%2FEM%3E%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3C%2FFIGURE%3E%0A%3CFIGURE%20class%3D%22abm%20abn%20abo%20abp%20abq%20abr%20tg%20th%20paragraph-image%22%3E%0A%3CFIGCAPTION%20class%3D%22aeq%20nr%20ya%20tg%20th%20aer%20aes%20bv%20b%20bw%20bx%20ia%22%20data-selectable-paragraph%3D%22%22%3E%3C%2FFIGCAPTION%3E%0A%3C%2FFIGURE%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-3056539%22%20slang%3D%22en-US%22%3E%3CH1%20id%3D%2296f0%22%20class%3D%22zx%20zy%20yj%20bv%20fs%20ud%20zz%20ue%20qb%20ug%20aba%20uh%20qf%20abb%20abc%20abd%20qj%20abe%20abf%20abg%20qn%20abh%20abi%20abj%20qr%20abk%20by%22%20data-selectable-paragraph%3D%22%22%20id%3D%22toc-hId--1247727393%22%3ELearn%20how%20to%20design%20and%20build%20an%20end-to-end%20ML%20Ops%20Platform%20using%20Databricks%20and%20Kubernetes%20to%20operationalize%20your%20machine%20learning%20initiatives%3C%2FH1%3E%0A%3CFIGURE%20class%3D%22abm%20abn%20abo%20abp%20abq%20abr%20tg%20th%20paragraph-image%22%3E%0A%3CDIV%20class%3D%22abs%20abt%20gu%20abu%20ae%20abv%22%20tabindex%3D%220%22%20role%3D%22button%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3C%2FFIGURE%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3056539%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Databricks%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMachine%20Learning%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMLflow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMLOps%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Jan 26 2022 03:44 PM
Updated by: