Skip to content

Commit

Permalink
Fix aks environment setup for deployment (#119)
Browse files Browse the repository at this point in the history
Co-authored-by: Ritesh Modi <[email protected]>
  • Loading branch information
machteldbogels and ritesh-modi authored Mar 12, 2024
1 parent ef848ec commit 8e48fa2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions llmops/common/deployment/kubernetes_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@

import json
import argparse
import os

from azure.ai.ml import MLClient
from azure.ai.ml.entities import (
KubernetesOnlineDeployment,
Environment,
OnlineRequestSettings,
BuildContext
)
from azure.identity import DefaultAzureCredential
from azure.ai.ml.entities._deployment.resource_requirements_settings import (
Expand Down Expand Up @@ -85,6 +87,7 @@

resource_group_name = config["RESOURCE_GROUP_NAME"]
workspace_name = config["WORKSPACE_NAME"]
flow_path = config["STANDARD_FLOW_PATH"]
real_config = f"{flow_to_execute}/configs/deployment_config.json"

logger.info(f"Model name: {model_name}")
Expand Down Expand Up @@ -129,12 +132,17 @@
f"deployment.deployment_name={deployment_name}"
)
environment = Environment(
image=deployment_base_image,
build = BuildContext(
path = os.path.join(flow_to_execute, flow_path),
dockerfile_path = "docker/dockerfile"
),
name=deployment_name,
description="Environment created from a Docker context.",
inference_config={
"liveness_route": {"path": "/health", "port": "8080"},
"readiness_route": {"path": "/health", "port": "8080"},
"scoring_route": {"path": "/score", "port": "8080"},
},
}
)

traffic_allocation = {}
Expand Down

0 comments on commit 8e48fa2

Please sign in to comment.