Skip to content

Commit

Permalink
Zetia/ensure k8s compute (#3265)
Browse files Browse the repository at this point in the history
* add ensure_amlarc_compute function

* ensure k8s compute

* ensure k8s compute

---------

Co-authored-by: Ubuntu <zetia@DevBox-zetia.1jltvvkrfgyuhl3llhmbyldkog.bx.internal.cloudapp.net>
  • Loading branch information
zetiaatgithub and Ubuntu authored Jul 6, 2024
1 parent af8f6f3 commit b2f5869
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ jobs:
python check-readme.py "${{ github.workspace }}/cli/endpoints/online/kubernetes"
working-directory: infra/bootstrapping
continue-on-error: false
- name: ensure k8s compute
run: |
source "${{ github.workspace }}/infra/bootstrapping/sdk_helpers.sh";
source "${{ github.workspace }}/infra/bootstrapping/init_environment.sh";
"${{ github.workspace }}/infra/bootstrapping/sdk_helpers.sh" ensure_k8s_compute;
working-directory: cli
continue-on-error: true
- name: delete endpoint if existing
run: |
source "${{ github.workspace }}/infra/bootstrapping/sdk_helpers.sh";
Expand Down
22 changes: 22 additions & 0 deletions infra/bootstrapping/sdk_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,28 @@ function replace_version(){
echo "$(<"${FILENAME}")"
}

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

# Check current state of AKS
provisioning_state=$(az aks show --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

LOCATION=eastus2 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 b2f5869

Please sign in to comment.