本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
透過 SageMaker AI 主控台的推論運算子安裝失敗
概觀:使用快速安裝或自訂安裝透過 SageMaker AI 主控台安裝推論運算子時,基礎 CloudFormation 堆疊可能會因為各種問題而失敗。本節涵蓋常見的失敗案例及其解決方法。
透過快速或自訂安裝的推論運算子附加元件安裝失敗
問題:HyperPod 叢集建立成功完成,但推論運算子附加元件安裝失敗。
常見原因:
叢集節點超過 Pod 容量限制。推論運算子安裝至少需要 13 個 Pod。建議的最低執行個體類型為
ml.c5.4xlarge。IAM 許可問題
資源配額限制
網路或 VPC 組態問題
症狀和診斷
徵狀:
推論運算子附加元件會在主控台中顯示 CREATE_FAILED 或 DEGRADED 狀態
與附加元件相關聯的 CloudFormation 堆疊處於 CREATE_FAILED 狀態
安裝進度會停止或顯示錯誤訊息
診斷步驟:
-
檢查推論運算子附加元件狀態:
aws eks describe-addon \ --cluster-name $EKS_CLUSTER_NAME \ --addon-name amazon-sagemaker-hyperpod-inference \ --region $REGION \ --query "addon.{Status:status,Health:health,Issues:issues}" \ --output json -
檢查 Pod 限制問題:
# Check current pod count per node kubectl get nodes -o json | jq '.items[] | {name: .metadata.name, allocatable: .status.allocatable.pods, capacity: .status.capacity.pods}' # Check pods running on each node kubectl get pods --all-namespaces -o wide | awk '{print $8}' | sort | uniq -c # Check for pod evictions or failures kubectl get events --all-namespaces --sort-by='.lastTimestamp' | grep -i "pod\|limit\|quota" -
檢查 CloudFormation 堆疊狀態 (如果使用主控台安裝):
# List CloudFormation stacks related to the cluster aws cloudformation list-stacks \ --region $REGION \ --query "StackSummaries[?contains(StackName, '$EKS_CLUSTER_NAME') && StackStatus=='CREATE_FAILED'].{Name:StackName,Status:StackStatus,Reason:StackStatusReason}" \ --output table # Get detailed stack events aws cloudformation describe-stack-events \ --stack-name <stack-name> \ --region $REGION \ --query "StackEvents[?ResourceStatus=='CREATE_FAILED']" \ --output table
Resolution
若要解決安裝失敗,請儲存目前的組態、刪除失敗的附加元件、修正基礎問題,然後透過 SageMaker AI 主控台 (建議) 或 AWS CLI 重新安裝推論運算子。
步驟 1:儲存目前的組態
-
在刪除之前擷取並儲存附加元件組態:
# Save the current configuration aws eks describe-addon \ --cluster-name $EKS_CLUSTER_NAME \ --addon-name amazon-sagemaker-hyperpod-inference \ --region $REGION \ --query 'addon.configurationValues' \ --output text > addon-config-backup.json # Verify the configuration was saved cat addon-config-backup.json # Pretty print for readability cat addon-config-backup.json | jq '.'
步驟 2:刪除失敗的附加元件
-
刪除推論運算子附加元件:
aws eks delete-addon \ --cluster-name $EKS_CLUSTER_NAME \ --addon-name amazon-sagemaker-hyperpod-inference \ --region $REGION # Wait for deletion to complete echo "Waiting for add-on deletion..." aws eks wait addon-deleted \ --cluster-name $EKS_CLUSTER_NAME \ --addon-name amazon-sagemaker-hyperpod-inference \ --region $REGION 2>/dev/null || sleep 60
步驟 3:修正基礎問題
根據失敗原因選擇適當的解決方案:
如果問題超過 Pod 限制:
# The inference operator requires a minimum of 13 pods. # The minimum recommended instance type is ml.c5.4xlarge. # # Option 1: Add instance group with higher pod capacity # Different instance types support different maximum pod counts # For example: m5.large (29 pods), m5.xlarge (58 pods), m5.2xlarge (58 pods) aws sagemaker update-cluster \ --cluster-name $HYPERPOD_CLUSTER_NAME \ --region $REGION \ --instance-groups '[{"InstanceGroupName":"worker-group-2","InstanceType":"ml.m5.xlarge","InstanceCount":2}]' # Option 2: Scale existing node group to add more nodes aws eks update-nodegroup-config \ --cluster-name $EKS_CLUSTER_NAME \ --nodegroup-name <nodegroup-name> \ --scaling-config minSize=2,maxSize=10,desiredSize=5 \ --region $REGION # Option 3: Clean up unused pods kubectl delete pods --field-selector status.phase=Failed --all-namespaces kubectl delete pods --field-selector status.phase=Succeeded --all-namespaces
步驟 4:重新安裝推論運算子
修正基礎問題後,請使用下列其中一種方法重新安裝推論運算子:
-
SageMaker AI 主控台搭配自訂安裝 (建議):重複使用先前安裝的現有 IAM 角色和 TLS 儲存貯體。如需這些步驟,請參閱 方法 1:透過 SageMaker AI 主控台安裝 HyperPod 推論附加元件 (建議)。
-
AWS 具有已儲存組態的 CLI:使用您在步驟 1 中備份的組態來重新安裝附加元件。如需完整的 CLI 安裝步驟,請參閱 方法 2:使用 AWS CLI 安裝推論運算子。
aws eks create-addon \ --cluster-name $EKS_CLUSTER_NAME \ --addon-name amazon-sagemaker-hyperpod-inference \ --addon-version v1.0.0-eksbuild.1 \ --configuration-values file://addon-config-backup.json \ --region $REGION -
具有快速安裝的 SageMaker AI 主控台:自動建立新的 IAM 角色、TLS 儲存貯體和相依性附加元件。如需這些步驟,請參閱 方法 1:透過 SageMaker AI 主控台安裝 HyperPod 推論附加元件 (建議)。
步驟 5:確認安裝成功
# Check add-on status aws eks describe-addon \ --cluster-name $EKS_CLUSTER_NAME \ --addon-name amazon-sagemaker-hyperpod-inference \ --region $REGION \ --query "addon.{Status:status,Health:health}" \ --output table # Verify pods are running kubectl get pods -n hyperpod-inference-system # Check operator logs kubectl logs -n hyperpod-inference-system deployment/hyperpod-inference-controller-manager --tail=50
由於 Kueue Webhook 未就緒,Cert-manager 安裝失敗
問題:cert-manager 附加元件安裝失敗並出現 Webhook 錯誤,因為任務控管 (Kueue) Webhook 服務沒有可用的端點。這是當 cert-manager 在任務控管 Webhook Pod 完全執行之前嘗試建立資源時發生的競爭條件。當任務控管附加元件在叢集建立期間與推論運算子一起安裝時,可能會發生這種情況。
症狀和診斷
錯誤訊息:
AdmissionRequestDenied Internal error occurred: failed calling webhook "mdeployment.kb.io": failed to call webhook: Post "https://kueue-webhook-service.kueue-system.svc:443/mutate-apps-v1-deployment?timeout=10s": no endpoints available for service "kueue-webhook-service"
根本原因:
任務控管附加元件會安裝並註冊可攔截所有部署建立的變動 Webhook
Cert-manager 附加元件會在任務控管 Webhook Pod 就緒之前嘗試建立部署資源
Kubernetes 許可控制會呼叫任務控管 Webhook,但沒有端點 (Pod 尚未執行)
診斷步驟:
-
檢查 cert-manager 附加元件狀態:
aws eks describe-addon \ --cluster-name $EKS_CLUSTER_NAME \ --addon-name cert-manager \ --region $REGION \ --query "addon.{Status:status,Health:health,Issues:issues}" \ --output json
Resolution
解決方案:刪除和重新安裝 cert-manager
任務控管 Webhook 會在 60 秒內就緒。只要刪除並重新安裝 cert-manager 附加元件:
-
刪除失敗的 cert-manager 附加元件:
aws eks delete-addon \ --cluster-name $EKS_CLUSTER_NAME \ --addon-name cert-manager \ --region $REGION -
等待 30-60 秒,讓任務控管 Webhook 就緒,然後重新安裝 cert-manager 附加元件:
sleep 60 aws eks create-addon \ --cluster-name $EKS_CLUSTER_NAME \ --addon-name cert-manager \ --region $REGION