diff --git a/.github/workflows/kaito-e2e.yaml b/.github/workflows/kaito-e2e.yaml index 36c6e7c49..4386300d7 100644 --- a/.github/workflows/kaito-e2e.yaml +++ b/.github/workflows/kaito-e2e.yaml @@ -135,13 +135,13 @@ jobs: AZURE_CLUSTER_NAME: ${{ env.CLUSTER_NAME }} REGISTRY: ${{ env.CLUSTER_NAME }}.azurecr.io VERSION: ${{ env.VERSION }} - - - name: Attach Private Presets ACR - uses: azure/CLI@v1.0.9 - with: - inlineScript: | - az aks update -n ${{ env.CLUSTER_NAME }} -g ${{ env.CLUSTER_NAME }} \ - --attach-acr ${{ secrets.ACR_AMRT_USERNAME }} + + - name: Add Secret Credentials + run: | + kubectl create secret docker-registry ${{secrets.AMRT_SECRET_NAME}} \ + --docker-server=${{secrets.ACR_AMRT_USERNAME}}.azurecr.io \ + --docker-username=${{secrets.ACR_AMRT_USERNAME}} \ + --docker-password=${{secrets.ACR_AMRT_PASSWORD}} - name: Log kaito-workspace run: | @@ -154,6 +154,7 @@ jobs: AZURE_CLUSTER_NAME: ${{ env.CLUSTER_NAME }} RUN_LLAMA_13B: ${{ env.RUN_LLAMA_13B }} AI_MODELS_REGISTRY: ${{secrets.ACR_AMRT_USERNAME}}.azurecr.io + AI_MODELS_REGISTRY_SECRET: ${{secrets.AMRT_SECRET_NAME}} - name: Cleanup e2e resources if: ${{ always() }} diff --git a/test/e2e/preset_test.go b/test/e2e/preset_test.go index be6b5abe9..6c4b705e2 100644 --- a/test/e2e/preset_test.go +++ b/test/e2e/preset_test.go @@ -46,28 +46,28 @@ func createFalconWorkspaceWithPresetPublicMode(numOfNode int) *kaitov1alpha1.Wor return workspaceObj } -func createLlama7BWorkspaceWithPresetPrivateMode(registry, imageVersion string, numOfNode int) *kaitov1alpha1.Workspace { +func createLlama7BWorkspaceWithPresetPrivateMode(registry, registrySecret, imageVersion string, numOfNode int) *kaitov1alpha1.Workspace { workspaceObj := &kaitov1alpha1.Workspace{} By("Creating a workspace CR with Llama 7B Chat preset private mode", func() { uniqueID := fmt.Sprint("preset-", rand.Intn(1000)) workspaceObj = utils.GenerateWorkspaceManifest(uniqueID, namespaceName, fmt.Sprintf("%s/%s:%s", registry, PresetLlama2AChat, imageVersion), numOfNode, "Standard_NC12s_v3", &metav1.LabelSelector{ MatchLabels: map[string]string{"kaito-workspace": "private-preset-e2e-test"}, - }, nil, PresetLlama2AChat, kaitov1alpha1.ModelImageAccessModePrivate, []string{}, nil) + }, nil, PresetLlama2AChat, kaitov1alpha1.ModelImageAccessModePrivate, []string{registrySecret}, nil) createAndValidateWorkspace(workspaceObj) }) return workspaceObj } -func createLlama13BWorkspaceWithPresetPrivateMode(registry, imageVersion string, numOfNode int) *kaitov1alpha1.Workspace { +func createLlama13BWorkspaceWithPresetPrivateMode(registry, registrySecret, imageVersion string, numOfNode int) *kaitov1alpha1.Workspace { workspaceObj := &kaitov1alpha1.Workspace{} By("Creating a workspace CR with Llama 13B Chat preset private mode", func() { uniqueID := fmt.Sprint("preset-", rand.Intn(1000)) workspaceObj = utils.GenerateWorkspaceManifest(uniqueID, namespaceName, fmt.Sprintf("%s/%s:%s", registry, PresetLlama2BChat, imageVersion), numOfNode, "Standard_NC12s_v3", &metav1.LabelSelector{ MatchLabels: map[string]string{"kaito-workspace": "private-preset-e2e-test"}, - }, nil, PresetLlama2BChat, kaitov1alpha1.ModelImageAccessModePrivate, []string{}, nil) + }, nil, PresetLlama2BChat, kaitov1alpha1.ModelImageAccessModePrivate, []string{registrySecret}, nil) createAndValidateWorkspace(workspaceObj) }) @@ -305,6 +305,7 @@ func deleteWorkspace(workspaceObj *kaitov1alpha1.Workspace) error { var runLlama13B bool var aiModelsRegistry string +var aiModelsRegistrySecret string var modelInfo map[string]string var _ = Describe("Workspace Preset", func() { @@ -318,6 +319,7 @@ var _ = Describe("Workspace Preset", func() { } aiModelsRegistry = utils.GetEnv("AI_MODELS_REGISTRY") + aiModelsRegistrySecret = utils.GetEnv("AI_MODELS_REGISTRY_SECRET") // Load stable model versions configs, err := utils.GetModelConfigInfo("/home/runner/work/kaito/kaito/presets/models/supported_models.yaml") @@ -358,7 +360,7 @@ var _ = Describe("Workspace Preset", func() { if !ok { Fail(fmt.Sprintf("Model version for %s not found", PresetLlama2AChat)) } - workspaceObj := createLlama7BWorkspaceWithPresetPrivateMode(aiModelsRegistry, modelVersion, numOfNode) + workspaceObj := createLlama7BWorkspaceWithPresetPrivateMode(aiModelsRegistry, aiModelsRegistrySecret, modelVersion, numOfNode) defer cleanupResources(workspaceObj) time.Sleep(30 * time.Second) @@ -384,7 +386,7 @@ var _ = Describe("Workspace Preset", func() { if !ok { Fail(fmt.Sprintf("Model version for %s not found", PresetLlama2AChat)) } - workspaceObj := createLlama13BWorkspaceWithPresetPrivateMode(aiModelsRegistry, modelVersion, numOfNode) + workspaceObj := createLlama13BWorkspaceWithPresetPrivateMode(aiModelsRegistry, aiModelsRegistrySecret, modelVersion, numOfNode) defer cleanupResources(workspaceObj)