-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Heba Elayoty <[email protected]>
- Loading branch information
Showing
18 changed files
with
403 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,8 @@ jobs: | |
environment: e2e-test | ||
env: | ||
GO_VERSION: "1.22" | ||
|
||
KARPENTER_NAMESPACE: "karpenter" | ||
GPU_PROVISIONER_NAMESPACE: "gpu-provisioner" | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 | ||
|
@@ -146,20 +147,40 @@ jobs: | |
- name: create cluster | ||
shell: bash | ||
run: | | ||
make create-aks-cluster | ||
if [ "${{ inputs.suite }}" == "gpuprovisioner" ]; then | ||
make create-aks-cluster | ||
else | ||
make create-aks-cluster-for-karpenter | ||
fi | ||
env: | ||
AZURE_ACR_NAME: ${{ env.CLUSTER_NAME }} | ||
AZURE_RESOURCE_GROUP: ${{ env.CLUSTER_NAME }} | ||
AZURE_CLUSTER_NAME: ${{ env.CLUSTER_NAME }} | ||
AZURE_LOCATION: ${{ inputs.region }} | ||
AKS_K8S_VERSION: ${{ inputs.k8s_version }} | ||
|
||
- name: Az login | ||
uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1 | ||
with: | ||
client-id: ${{ secrets.E2E_CLIENT_ID }} | ||
tenant-id: ${{ secrets.E2E_TENANT_ID }} | ||
subscription-id: ${{ secrets.E2E_SUBSCRIPTION_ID }} | ||
|
||
- name: Create Identities and Permissions for ${{ inputs.suite }} | ||
shell: bash | ||
run: | | ||
make generate-identities | ||
env: | ||
AZURE_RESOURCE_GROUP: ${{ env.CLUSTER_NAME }} | ||
AZURE_CLUSTER_NAME: ${{ env.CLUSTER_NAME }} | ||
TEST_SUITE: ${{ inputs.suite }} | ||
AZURE_SUBSCRIPTION_ID: ${{ secrets.E2E_SUBSCRIPTION_ID }} | ||
|
||
- name: Install gpu-provisioner helm chart | ||
if: ${{ inputs.suite == 'gpuprov' }} | ||
if: ${{ inputs.suite == 'gpuprovisioner' }} | ||
shell: bash | ||
run: | | ||
make gpu-provisioner-helm | ||
kubectl wait --for=condition=available deploy "gpu-provisioner" -n gpu-provisioner --timeout=300s | ||
env: | ||
AZURE_RESOURCE_GROUP: ${{ env.CLUSTER_NAME }} | ||
AZURE_CLUSTER_NAME: ${{ env.CLUSTER_NAME }} | ||
|
@@ -172,45 +193,28 @@ jobs: | |
shell: bash | ||
run: | | ||
make azure-karpenter-helm | ||
# taint nodes as karpenter-system | ||
kubectl taint nodes CriticalAddonsOnly=true:NoSchedule --all | ||
kubectl wait --for=condition=available deploy "karpenter" -n karpenter --timeout=300s | ||
env: | ||
AZURE_RESOURCE_GROUP: ${{ env.CLUSTER_NAME }} | ||
AZURE_CLUSTER_NAME: ${{ env.CLUSTER_NAME }} | ||
AZURE_TENANT_ID: ${{ secrets.E2E_TENANT_ID }} | ||
AZURE_SUBSCRIPTION_ID: ${{ secrets.E2E_SUBSCRIPTION_ID }} | ||
KARPENTER_VERSION: ${{ vars.KARPENTER_VERSION }} | ||
KARPENTER_NAMESPACE: ${{ env.KARPENTER_NAMESPACE }} | ||
|
||
- uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1 | ||
with: | ||
client-id: ${{ secrets.E2E_CLIENT_ID }} | ||
tenant-id: ${{ secrets.E2E_TENANT_ID }} | ||
subscription-id: ${{ secrets.E2E_SUBSCRIPTION_ID }} | ||
|
||
- name: Create Role Assignment | ||
uses: azure/[email protected] | ||
with: | ||
inlineScript: | | ||
IDENTITY_PRINCIPAL_ID="$(az identity show --name ${{ inputs.suite }}Identity --resource-group ${{ env.CLUSTER_NAME }} --query 'principalId' -otsv)" | ||
az role assignment create --assignee ${IDENTITY_PRINCIPAL_ID} --scope "/subscriptions/${{ secrets.E2E_SUBSCRIPTION_ID }}/resourceGroups/${{ env.CLUSTER_NAME }}" --role "Contributor" | ||
if [ "${{ inputs.suite }}" == "azkarpenter" ]; then | ||
fi | ||
- name: Create Azure Federated Identity | ||
uses: azure/[email protected] | ||
with: | ||
inlineScript: | | ||
AKS_OIDC_ISSUER="$(az aks show -n "${{ env.CLUSTER_NAME }}" -g "${{ env.CLUSTER_NAME }}" --query 'oidcIssuerProfile.issuerUrl' -otsv)" | ||
if [ "${{ inputs.suite }}" == "gpuprov" ]; then | ||
az identity federated-credential create --name ${{ inputs.suite }}-fed --identity-name ${{ inputs.suite }}Identity --resource-group "${{ env.CLUSTER_NAME }}" \ | ||
--issuer "${AKS_OIDC_ISSUER}" --subject system:serviceaccount:"gpu-provisioner:gpu-provisioner" --audience api://AzureADTokenExchange | ||
fi | ||
if [ "${{ inputs.suite }}" == "azkarpenter" ]; then | ||
az identity federated-credential create --name ${{ inputs.suite }}-fed --identity-name ${{ inputs.suite }}Identity --resource-group "${{ env.CLUSTER_NAME }}" \ | ||
--issuer "${AKS_OIDC_ISSUER}" --subject system:serviceaccount:"karpenter:karpenter-sa" --audience api://AzureADTokenExchange | ||
fi | ||
- name: build KAITO image | ||
if: ${{ !inputs.isRelease }} | ||
shell: bash | ||
run: | | ||
make docker-build-kaito | ||
env: | ||
REGISTRY: ${{ env.REGISTRY }} | ||
VERSION: ${{ env.VERSION }} | ||
|
||
- name: Install KAITO Workspace helm chart | ||
shell: bash | ||
|
@@ -222,6 +226,7 @@ jobs: | |
AZURE_CLUSTER_NAME: ${{ env.CLUSTER_NAME }} | ||
REGISTRY: ${{ env.REGISTRY }} | ||
VERSION: ${{ env.VERSION }} | ||
TEST_SUITE: ${{ inputs.suite }} | ||
|
||
# Retrieve E2E ACR credentials and create Kubernetes secret | ||
- name: Set up E2E ACR Credentials and Secret | ||
|
@@ -251,6 +256,14 @@ jobs: | |
--docker-username=${{ secrets.E2E_ACR_AMRT_USERNAME }} \ | ||
--docker-password=${{ secrets.E2E_ACR_AMRT_PASSWORD }} | ||
- name: Log ${{ inputs.suite }} | ||
run: | | ||
if [ "${{ inputs.suite }}" == "gpuprovisioner" ]; then | ||
kubectl logs -n "${{ env.GPU_PROVISIONER_NAMESPACE }}" -l app.kubernetes.io/name=gpu-provisioner -c controller | ||
else | ||
kubectl logs -n "${{ env.KARPENTER_NAMESPACE }}" -l app.kubernetes.io/name=karpenter -c controller | ||
fi | ||
- name: Log kaito-workspace | ||
run: | | ||
kubectl get pods -n kaito-workspace -o name | grep "^pod/kaito-workspace" | sed 's/^pod\///' | xargs -I {} kubectl logs -n kaito-workspace {} | ||
|
@@ -264,6 +277,7 @@ jobs: | |
REGISTRY: ${{ env.REGISTRY }} | ||
AI_MODELS_REGISTRY: ${{ secrets.E2E_ACR_AMRT_USERNAME }}.azurecr.io | ||
AI_MODELS_REGISTRY_SECRET: ${{ secrets.E2E_AMRT_SECRET_NAME }} | ||
TEST_SUITE: ${{ inputs.suite }} | ||
E2E_ACR_REGISTRY: ${{ env.CLUSTER_NAME }}.azurecr.io | ||
E2E_ACR_REGISTRY_SECRET: ${{ env.CLUSTER_NAME }}-acr-secret | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.