Skip to content

Commit

Permalink
add ensure_amlarc_compute function
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu authored and Ubuntu committed Jul 4, 2024
1 parent d4c90ee commit d45a109
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions infra/bootstrapping/sdk_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,32 @@ function replace_version(){
echo "$(<"${FILENAME}")"
}

function ensure_amlarc_compute(){
# Arc cluster configuration
arc_compute=${ARC_CLUSTER_NAME}
echo_info "Creating amlarc cluster: '$arc_compute'"

export LOCATION="eastus2"
RESOURCE_GROUP_NAME=test-rg-eastus2euap-240702
AKS_CLUSTER_NAME=op-eastus2euap56a83374b

# Check current state of AKS
provisioning_state=$(az aks show --subscription dd21e9f4-d52f-406f-ab5e-d164e7d7dc65 --resource-group "${RESOURCE_GROUP_NAME}" --name ${arc_compute} --query "provisioningState" -o tsv)
provisioning_state=${provisioning_state,,}
echo_info "AKS provisioning state: '$provisioning_state'"
if [[ $provisioning_state == "failed" ]]; then
echo_info "Remove unhealthy AKS: '$arc_compute' in '$provisioning_state'"
az aks delete --resource-group "${RESOURCE_GROUP_NAME}" --name ${arc_compute} --yes
fi

ensure_aks_compute "${arc_compute}" 1 3 "STANDARD_D3_V2"
install_k8s_extension "${arc_compute}" "connectedClusters" "Microsoft.Kubernetes/connectedClusters"
setup_compute "${arc_compute}-arc" "${ARC_COMPUTE_NAME}" "connectedClusters" "azureml"
setup_instance_type_aml_arc "${arc_compute}"

echo_info ">>> Done creating amlarc clusters"
}

help(){
echo "All functions:"
declare -F
Expand Down

0 comments on commit d45a109

Please sign in to comment.