From 9239f8071cf920a9cc86013d3b14c590678fda59 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Tue, 26 Aug 2025 15:50:48 -0700 Subject: [PATCH 01/19] infra Signed-off-by: ruokun-niu --- .github/workflows/building-comfort.yml | 64 ++++++++++++++++++++++++++ infra/aks/aks-cluster.bicep | 42 +++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 .github/workflows/building-comfort.yml create mode 100644 infra/aks/aks-cluster.bicep diff --git a/.github/workflows/building-comfort.yml b/.github/workflows/building-comfort.yml new file mode 100644 index 0000000..f0836b1 --- /dev/null +++ b/.github/workflows/building-comfort.yml @@ -0,0 +1,64 @@ +# Copyright 2025 The Drasi Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Building Comfort E2E Test + +on: + workflow_dispatch: + repository_dispatch: + types: [building-comfort-trigger] + +permissions: + contents: read + id-token: write + +env: + CLUSTER_NAME: "building-comfort-aks-${{ github.run_number }}" + RESOURCE_GROUP_NAME: "project-drasi" + +jobs: + infra: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Azure Login + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + + - name: Deploy AKS cluster + run: | + az deployment group create \ + --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + --template-file infra/aks/aks-cluster.bicep \ + --parameters clusterName=${{ env.CLUSTER_NAME }} + + deploy-tests: + runs-on: ubuntu-latest + needs: infra + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Deploy building comfort tests + run: | + echo "Deploying building comfort E2E tests..." + # Add test deployment commands here \ No newline at end of file diff --git a/infra/aks/aks-cluster.bicep b/infra/aks/aks-cluster.bicep new file mode 100644 index 0000000..6a8414b --- /dev/null +++ b/infra/aks/aks-cluster.bicep @@ -0,0 +1,42 @@ +@description('The name of the AKS cluster') +param clusterName string + +@description('The location of the AKS cluster') +param location string = resourceGroup().location + +@description('Optional DNS prefix to use with hosted Kubernetes API server FQDN') +param dnsPrefix string = 'drasi-aks-${uniqueString(resourceGroup().id)}' + +@description('The number of nodes for the system pool') +param systemNodeCount int = 2 + +@description('The size of the Virtual Machine') +param vmSize string = 'Standard_D8ds_v5' + +resource aks 'Microsoft.ContainerService/managedClusters@2024-02-01' = { + name: clusterName + location: location + identity: { + type: 'SystemAssigned' + } + properties: { + dnsPrefix: dnsPrefix + autoUpgradeProfile: { + nodeOSUpgradeChannel: 'NodeImage' + upgradeChannel: 'stable' + } + agentPoolProfiles: [ + { + name: 'agentpool' + count: systemNodeCount + vmSize: vmSize + osType: 'Linux' + osSKU: 'AzureLinux' + mode: 'System' + type: 'VirtualMachineScaleSets' + } + ] + } +} + +output controlPlaneFQDN string = aks.properties.fqdn From 9b4fc927b9b13ae7d256acec8c41b0a9263747a6 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Tue, 26 Aug 2025 16:09:05 -0700 Subject: [PATCH 02/19] test trigger Signed-off-by: ruokun-niu --- .github/workflows/building-comfort.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/building-comfort.yml b/.github/workflows/building-comfort.yml index f0836b1..bd21b0a 100644 --- a/.github/workflows/building-comfort.yml +++ b/.github/workflows/building-comfort.yml @@ -15,6 +15,9 @@ name: Building Comfort E2E Test on: + push: + branches: + - e2e-framework-automation workflow_dispatch: repository_dispatch: types: [building-comfort-trigger] From ffc11157e3dc46d62e3370253c5b0c388f73d8c1 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Tue, 26 Aug 2025 17:02:51 -0700 Subject: [PATCH 03/19] test and cleanup --- .github/workflows/building-comfort.yml | 57 +++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/.github/workflows/building-comfort.yml b/.github/workflows/building-comfort.yml index bd21b0a..56fb246 100644 --- a/.github/workflows/building-comfort.yml +++ b/.github/workflows/building-comfort.yml @@ -27,12 +27,17 @@ permissions: id-token: write env: - CLUSTER_NAME: "building-comfort-aks-${{ github.run_number }}" + CLUSTER_NAME_REDIS: "building-comfort-aks-${{ github.run_number }}-redis" + CLUSTER_NAME_ROCKS: "building-comfort-aks-${{ github.run_number }}-rocks" + CLUSTER_NAME_MEMORY: "building-comfort-aks-${{ github.run_number }}-memory" RESOURCE_GROUP_NAME: "project-drasi" jobs: infra: runs-on: ubuntu-latest + strategy: + matrix: + cluster_type: [redis, rocks, memory] steps: - name: Checkout repository @@ -45,23 +50,65 @@ jobs: tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - name: Deploy AKS cluster run: | az deployment group create \ --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ --template-file infra/aks/aks-cluster.bicep \ - --parameters clusterName=${{ env.CLUSTER_NAME }} + --parameters clusterName="building-comfort-aks-${{ github.run_number }}-${{ matrix.cluster_type }}" deploy-tests: runs-on: ubuntu-latest needs: infra + strategy: + matrix: + cluster_type: [redis, rocks, memory] steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Azure Login + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + - name: Get AKS credentials + run: | + az aks get-credentials \ + --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + --name "building-comfort-aks-${{ github.run_number }}-${{ matrix.cluster_type }}" \ + --overwrite-existing + - name: Deploy building comfort tests run: | - echo "Deploying building comfort E2E tests..." - # Add test deployment commands here \ No newline at end of file + cd e2e-test-framework + ./run_test_with_${{ matrix.cluster_type }}.sh + + + + cleanup: + runs-on: ubuntu-latest + needs: deploy-tests + if: always() + strategy: + matrix: + cluster_type: [redis, rocks, memory] + + steps: + - name: Azure Login + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + - name: Delete AKS cluster + run: | + az aks delete \ + --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + --name "building-comfort-aks-${{ github.run_number }}-${{ matrix.cluster_type }}" \ + --yes --no-wait + \ No newline at end of file From 1b9a2bbfb7e3a1a41c5c48d5fc022a5bb7c99916 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Wed, 27 Aug 2025 09:20:22 -0700 Subject: [PATCH 04/19] test Signed-off-by: ruokun-niu --- .github/workflows/building-comfort.yml | 40 +++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/building-comfort.yml b/.github/workflows/building-comfort.yml index 56fb246..161b15f 100644 --- a/.github/workflows/building-comfort.yml +++ b/.github/workflows/building-comfort.yml @@ -89,26 +89,26 @@ jobs: - cleanup: - runs-on: ubuntu-latest - needs: deploy-tests - if: always() - strategy: - matrix: - cluster_type: [redis, rocks, memory] + # cleanup: + # runs-on: ubuntu-latest + # needs: deploy-tests + # if: always() + # strategy: + # matrix: + # cluster_type: [redis, rocks, memory] - steps: - - name: Azure Login - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + # steps: + # - name: Azure Login + # uses: azure/login@v2 + # with: + # client-id: ${{ secrets.AZURE_CLIENT_ID }} + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - name: Delete AKS cluster - run: | - az aks delete \ - --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - --name "building-comfort-aks-${{ github.run_number }}-${{ matrix.cluster_type }}" \ - --yes --no-wait + # - name: Delete AKS cluster + # run: | + # az aks delete \ + # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + # --name "building-comfort-aks-${{ github.run_number }}-${{ matrix.cluster_type }}" \ + # --yes --no-wait \ No newline at end of file From f5c8812646a9f9deeaecf11178279fec341211e4 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Wed, 27 Aug 2025 09:23:48 -0700 Subject: [PATCH 05/19] nit Signed-off-by: ruokun-niu --- .github/workflows/building-comfort.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/building-comfort.yml b/.github/workflows/building-comfort.yml index 161b15f..57103a8 100644 --- a/.github/workflows/building-comfort.yml +++ b/.github/workflows/building-comfort.yml @@ -55,7 +55,8 @@ jobs: az deployment group create \ --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ --template-file infra/aks/aks-cluster.bicep \ - --parameters clusterName="building-comfort-aks-${{ github.run_number }}-${{ matrix.cluster_type }}" + --parameters clusterName="building-comfort-aks-${{ github.run_number }}-${{ matrix.cluster_type }}" \ + --name "aks-cluster-${{ github.run_number }}-${{ matrix.cluster_type }}" deploy-tests: runs-on: ubuntu-latest From 817bb1b3c92eb3223fde47e63b99570148d8186c Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Wed, 27 Aug 2025 09:38:29 -0700 Subject: [PATCH 06/19] script path Signed-off-by: ruokun-niu --- .github/workflows/building-comfort.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/building-comfort.yml b/.github/workflows/building-comfort.yml index 57103a8..2b43138 100644 --- a/.github/workflows/building-comfort.yml +++ b/.github/workflows/building-comfort.yml @@ -86,7 +86,7 @@ jobs: - name: Deploy building comfort tests run: | cd e2e-test-framework - ./run_test_with_${{ matrix.cluster_type }}.sh + ./examples/building_comfort/drasi/run_test_with_${{ matrix.cluster_type }}.sh From 7ba95cc42f5cf36cf291b10a5a389e1db2ca093d Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Wed, 27 Aug 2025 09:57:51 -0700 Subject: [PATCH 07/19] install drasi CLI Signed-off-by: ruokun-niu --- .github/workflows/building-comfort.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/building-comfort.yml b/.github/workflows/building-comfort.yml index 2b43138..9ec54d7 100644 --- a/.github/workflows/building-comfort.yml +++ b/.github/workflows/building-comfort.yml @@ -82,6 +82,11 @@ jobs: --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ --name "building-comfort-aks-${{ github.run_number }}-${{ matrix.cluster_type }}" \ --overwrite-existing + + - name: Install Drasi CLI + run: | + curl -fsSL https://raw.githubusercontent.com/drasi-project/drasi-platform/main/cli/installers/install-drasi-cli.sh | /bin/bash + - name: Deploy building comfort tests run: | From 0b9d7da1b42bda22353ea44515242bac52e4adfe Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Wed, 27 Aug 2025 11:16:41 -0700 Subject: [PATCH 08/19] updated draft release with repo dispatch trigger Signed-off-by: ruokun-niu --- infra/aks/aks-cluster.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/aks/aks-cluster.bicep b/infra/aks/aks-cluster.bicep index 6a8414b..681b7f0 100644 --- a/infra/aks/aks-cluster.bicep +++ b/infra/aks/aks-cluster.bicep @@ -2,7 +2,7 @@ param clusterName string @description('The location of the AKS cluster') -param location string = resourceGroup().location +param location string = 'westus3' @description('Optional DNS prefix to use with hosted Kubernetes API server FQDN') param dnsPrefix string = 'drasi-aks-${uniqueString(resourceGroup().id)}' From bb74714ab922630c88b6155f623408abe27f1525 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Wed, 27 Aug 2025 15:24:04 -0700 Subject: [PATCH 09/19] added storageaccount upload --- .github/workflows/building-comfort.yml | 27 ++++++++++++++++++++++ .github/workflows/draft-release.yml | 32 +++++++++++++++----------- 2 files changed, 45 insertions(+), 14 deletions(-) diff --git a/.github/workflows/building-comfort.yml b/.github/workflows/building-comfort.yml index 9ec54d7..b4b38db 100644 --- a/.github/workflows/building-comfort.yml +++ b/.github/workflows/building-comfort.yml @@ -92,6 +92,33 @@ jobs: run: | cd e2e-test-framework ./examples/building_comfort/drasi/run_test_with_${{ matrix.cluster_type }}.sh + + - name: Export test results + run: | + cd e2e-test-framework + ./examples/building_comfort/drasi/get_test_run_results.sh "building-comfort-aks-${{ github.run_number }}-${{ matrix.cluster_type }}" + + - name: Upload test results to storage account + run: | + cd e2e-test-framework + CLUSTER_NAME="building-comfort-aks-${{ github.run_number }}-${{ matrix.cluster_type }}" + CONTAINER_NAME="test-results" + STORAGE_ACCOUNT="drasidev" + + # Create container if it doesn't exist + az storage container create \ + --name $CONTAINER_NAME \ + --account-name $STORAGE_ACCOUNT \ + --auth-mode login \ + --only-show-errors + + # Upload all files from the results directory + az storage blob upload-batch \ + --destination $CONTAINER_NAME \ + --source "./$CLUSTER_NAME" \ + --destination-path "building-comfort/$CLUSTER_NAME" \ + --account-name $STORAGE_ACCOUNT \ + --auth-mode login diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 62500a4..7e697a9 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -23,7 +23,9 @@ on: image_prefix: description: 'Image Prefix' required: false - default: 'ghcr.io/drasi-project' + default: 'ghcr.io/drasi-project' + repository_dispatch: + types: [draft-release-trigger] permissions: id-token: write # Required for requesting the JWT @@ -32,6 +34,8 @@ permissions: env: RELEASE_PATH: ./release + TAG: ${{ github.event.client_payload.tag || inputs.tag }} + IMAGE_PREFIX: ${{ github.event.client_payload.image_prefix || inputs.image_prefix }} TEST_INFRA_COMPONENTS: '[ {"label": "E2E proxy", "path": "e2e-test-framework/proxy", "name": "e2e-proxy", "platforms": "linux/amd64,linux/arm64"}, @@ -94,8 +98,8 @@ jobs: if: contains(matrix.component.platforms, steps.platform.outputs.platform) run: | cd ${{ matrix.component.path }} - DOCKER_TAG_VERSION=${{ inputs.tag }}${{ steps.platform.outputs.suffix }} \ - IMAGE_PREFIX=${{ inputs.image_prefix }} \ + DOCKER_TAG_VERSION=${{ env.TAG }}${{ steps.platform.outputs.suffix }} \ + IMAGE_PREFIX=${{ env.IMAGE_PREFIX }} \ DOCKERX_OPTS="--push --platform ${{ steps.platform.outputs.platform }}" \ make @@ -117,32 +121,32 @@ jobs: expected_platforms=$(echo '${{ env.TEST_INFRA_COMPONENTS }}' | jq -r ".[] | select(.name == \"$component\") | .platforms") if echo "$expected_platforms" | grep -q "linux/amd64"; then - if docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-amd64 > /dev/null 2>&1; then - echo "Manifest for $component:${{ inputs.tag }}-amd64:" - docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-amd64 - manifests+=("ghcr.io/drasi-project/$component:${{ inputs.tag }}-amd64") + if docker manifest inspect ${{ env.IMAGE_PREFIX }}/$component:${{ env.TAG }}-amd64 > /dev/null 2>&1; then + echo "Manifest for $component:${{ env.TAG }}-amd64:" + docker manifest inspect ${{ env.IMAGE_PREFIX }}/$component:${{ env.TAG }}-amd64 + manifests+=("${{ env.IMAGE_PREFIX }}/$component:${{ env.TAG }}-amd64") else - echo "Error: Expected amd64 manifest not found for $component:${{ inputs.tag }}-amd64" >&2 + echo "Error: Expected amd64 manifest not found for $component:${{ env.TAG }}-amd64" >&2 exit 1 fi fi if echo "$expected_platforms" | grep -q "linux/arm64"; then - if docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-arm64 > /dev/null 2>&1; then - echo "Manifest for $component:${{ inputs.tag }}-arm64:" - docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-arm64 - manifests+=("ghcr.io/drasi-project/$component:${{ inputs.tag }}-arm64") + if docker manifest inspect ${{ env.IMAGE_PREFIX }}/$component:${{ env.TAG }}-arm64 > /dev/null 2>&1; then + echo "Manifest for $component:${{ env.TAG }}-arm64:" + docker manifest inspect ${{ env.IMAGE_PREFIX }}/$component:${{ env.TAG }}-arm64 + manifests+=("${{ env.IMAGE_PREFIX }}/$component:${{ env.TAG }}-arm64") else - echo "Error: Expected arm64 manifest not found for $component:${{ inputs.tag }}-arm64" >&2 + echo "Error: Expected arm64 manifest not found for $component:${{ env.TAG }}-arm64" >&2 exit 1 fi fi if [ ${#manifests[@]} -gt 0 ]; then - docker buildx imagetools create -t ghcr.io/drasi-project/$component:${{ inputs.tag }} ${manifests[@]} + docker buildx imagetools create -t ${{ env.IMAGE_PREFIX }}/$component:${{ env.TAG }} ${manifests[@]} else echo "No manifests found for $component, skipping manifest creation." fi From a4b1c6ef3ce412136d04854fc40d9683f4707890 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Wed, 27 Aug 2025 16:36:32 -0700 Subject: [PATCH 10/19] scriptchange Signed-off-by: ruokun-niu --- .../drasi/get_test_run_results.sh | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/e2e-test-framework/examples/building_comfort/drasi/get_test_run_results.sh b/e2e-test-framework/examples/building_comfort/drasi/get_test_run_results.sh index c6c7a9c..66cb11d 100755 --- a/e2e-test-framework/examples/building_comfort/drasi/get_test_run_results.sh +++ b/e2e-test-framework/examples/building_comfort/drasi/get_test_run_results.sh @@ -39,20 +39,20 @@ if [ -z "$POD_NAME" ]; then fi # Source -kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/az_dev_repo.building_comfort.test_run_001/sources/facilities-db/test_run_summary.json" "./${TEST_RUN_ID}/source_summary.json" +kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/github_dev_repo.building_comfort.test_run_001/sources/facilities-db/test_run_summary.json" "./${TEST_RUN_ID}/source_summary.json" # Query Observer -kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/az_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/test_run_summary.json" "./${TEST_RUN_ID}/query_summary.json" +kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/github_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/test_run_summary.json" "./${TEST_RUN_ID}/query_summary.json" # Query Result Profiler -kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/az_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/result_stream_log/profiler/summary.json" "./${TEST_RUN_ID}/query_profiler_summary.json" +kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/github_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/result_stream_log/profiler/summary.json" "./${TEST_RUN_ID}/query_profiler_summary.json" -kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/az_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/result_stream_log/profiler/change_all_abs.png" "./${TEST_RUN_ID}/query_profiler_viz_all_abs.png" -kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/az_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/result_stream_log/profiler/change_all_rel.png" "./${TEST_RUN_ID}/query_profiler_viz_all_rel.png" -kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/az_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/result_stream_log/profiler/change_drasi_only_abs.png" "./${TEST_RUN_ID}/query_profiler_viz_drasi_only_abs.png" -kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/az_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/result_stream_log/profiler/change_drasi_only_rel.png" "./${TEST_RUN_ID}/query_profiler_viz_drasi_only_rel.png" +kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/github_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/result_stream_log/profiler/change_all_abs.png" "./${TEST_RUN_ID}/query_profiler_viz_all_abs.png" +kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/github_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/result_stream_log/profiler/change_all_rel.png" "./${TEST_RUN_ID}/query_profiler_viz_all_rel.png" +kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/github_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/result_stream_log/profiler/change_drasi_only_abs.png" "./${TEST_RUN_ID}/query_profiler_viz_drasi_only_abs.png" +kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/github_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/result_stream_log/profiler/change_drasi_only_rel.png" "./${TEST_RUN_ID}/query_profiler_viz_drasi_only_rel.png" -kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/az_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/result_stream_log/profiler/change_rates.csv" "./${TEST_RUN_ID}/query_profiler_change_rates.csv" -kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/az_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/result_stream_log/profiler/change_distributions.csv" "./${TEST_RUN_ID}/query_profiler_change_distributions.csv" +kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/github_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/result_stream_log/profiler/change_rates.csv" "./${TEST_RUN_ID}/query_profiler_change_rates.csv" +kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/github_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/result_stream_log/profiler/change_distributions.csv" "./${TEST_RUN_ID}/query_profiler_change_distributions.csv" -# kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/az_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/result_stream_log/profiler/change_00000.jsonl" "./${TEST_RUN_ID}/query_profiler_change_log_sample.jsonl" +# kubectl cp -c "$CONTAINER" "$NAMESPACE/$POD_NAME:/drasi_data_store/test_runs/github_dev_repo.building_comfort.test_run_001/queries/room-comfort-level/result_stream_log/profiler/change_00000.jsonl" "./${TEST_RUN_ID}/query_profiler_change_log_sample.jsonl" From e6c18e14db8094a57f5fcc0043ab9caea9e18c50 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Thu, 28 Aug 2025 11:42:11 -0700 Subject: [PATCH 11/19] add sleep Signed-off-by: ruokun-niu --- .github/workflows/building-comfort.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/building-comfort.yml b/.github/workflows/building-comfort.yml index b4b38db..a7a109a 100644 --- a/.github/workflows/building-comfort.yml +++ b/.github/workflows/building-comfort.yml @@ -96,6 +96,7 @@ jobs: - name: Export test results run: | cd e2e-test-framework + sleep 30 ./examples/building_comfort/drasi/get_test_run_results.sh "building-comfort-aks-${{ github.run_number }}-${{ matrix.cluster_type }}" - name: Upload test results to storage account From 0f975002856e4aa008efd48ab49f7becc2565fd2 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Thu, 28 Aug 2025 12:09:06 -0700 Subject: [PATCH 12/19] testing --- .github/workflows/building-comfort.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/building-comfort.yml b/.github/workflows/building-comfort.yml index a7a109a..d9150cb 100644 --- a/.github/workflows/building-comfort.yml +++ b/.github/workflows/building-comfort.yml @@ -96,7 +96,7 @@ jobs: - name: Export test results run: | cd e2e-test-framework - sleep 30 + sleep 90 ./examples/building_comfort/drasi/get_test_run_results.sh "building-comfort-aks-${{ github.run_number }}-${{ matrix.cluster_type }}" - name: Upload test results to storage account From 63e4482465c15d71fb6aba398119b9cceb2cbec2 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Thu, 28 Aug 2025 12:57:03 -0700 Subject: [PATCH 13/19] add a status checker --- .github/workflows/building-comfort.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/building-comfort.yml b/.github/workflows/building-comfort.yml index d9150cb..40e48b5 100644 --- a/.github/workflows/building-comfort.yml +++ b/.github/workflows/building-comfort.yml @@ -93,10 +93,31 @@ jobs: cd e2e-test-framework ./examples/building_comfort/drasi/run_test_with_${{ matrix.cluster_type }}.sh + # Wait for tests to complete by polling the query status + echo "Waiting for tests to complete..." + while true; do + # Get the service IP for the test service + SERVICE_IP=$(kubectl get svc drasi-test-service -n drasi-system -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + if [ -z "$SERVICE_IP" ]; then + SERVICE_IP=$(kubectl get svc drasi-test-service -n drasi-system -o jsonpath='{.spec.clusterIP}') + fi + + # Check query status + STATUS=$(curl -s "http://$SERVICE_IP:80/test_run_host/queries/github_dev_repo.building_comfort.test_run_001.room-comfort-level" | jq -r '.query_observer.status // "Running"') + + echo "Current status: $STATUS" + if [ "$STATUS" = "Stopped" ]; then + echo "Tests completed successfully!" + break + fi + + echo "Tests still running, waiting 10 seconds..." + sleep 10 + done + - name: Export test results run: | cd e2e-test-framework - sleep 90 ./examples/building_comfort/drasi/get_test_run_results.sh "building-comfort-aks-${{ github.run_number }}-${{ matrix.cluster_type }}" - name: Upload test results to storage account From 10a7d6c8fa2e0e1be81503325b8b580cb8c6fe9c Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Thu, 28 Aug 2025 13:40:45 -0700 Subject: [PATCH 14/19] condition update Signed-off-by: ruokun-niu --- .github/workflows/building-comfort.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/building-comfort.yml b/.github/workflows/building-comfort.yml index 40e48b5..e1e94cb 100644 --- a/.github/workflows/building-comfort.yml +++ b/.github/workflows/building-comfort.yml @@ -96,15 +96,13 @@ jobs: # Wait for tests to complete by polling the query status echo "Waiting for tests to complete..." while true; do - # Get the service IP for the test service - SERVICE_IP=$(kubectl get svc drasi-test-service -n drasi-system -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - if [ -z "$SERVICE_IP" ]; then - SERVICE_IP=$(kubectl get svc drasi-test-service -n drasi-system -o jsonpath='{.spec.clusterIP}') - fi + # Check query status - STATUS=$(curl -s "http://$SERVICE_IP:80/test_run_host/queries/github_dev_repo.building_comfort.test_run_001.room-comfort-level" | jq -r '.query_observer.status // "Running"') + RESPONSE=$(curl -s "http://localhost:63123/test_run_host/queries/github_dev_repo.building_comfort.test_run_001.room-comfort-level") + echo "API Response: $RESPONSE" + STATUS=$(echo "$RESPONSE" | jq -r '.query_observer.status // "Running"') echo "Current status: $STATUS" if [ "$STATUS" = "Stopped" ]; then echo "Tests completed successfully!" From 1ac4c0bb89c2bb9e5f0a5f701052d56ae1d80bca Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Thu, 28 Aug 2025 13:56:50 -0700 Subject: [PATCH 15/19] nit; Signed-off-by: ruokun-niu --- .github/workflows/building-comfort.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/building-comfort.yml b/.github/workflows/building-comfort.yml index e1e94cb..16c8f71 100644 --- a/.github/workflows/building-comfort.yml +++ b/.github/workflows/building-comfort.yml @@ -96,7 +96,6 @@ jobs: # Wait for tests to complete by polling the query status echo "Waiting for tests to complete..." while true; do - # Check query status RESPONSE=$(curl -s "http://localhost:63123/test_run_host/queries/github_dev_repo.building_comfort.test_run_001.room-comfort-level") From 64e03eb19a8b453c151e687601db2f0ea4ad270b Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Thu, 28 Aug 2025 14:22:10 -0700 Subject: [PATCH 16/19] sleep for kubectl --- .github/workflows/building-comfort.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/building-comfort.yml b/.github/workflows/building-comfort.yml index 16c8f71..59a7ce6 100644 --- a/.github/workflows/building-comfort.yml +++ b/.github/workflows/building-comfort.yml @@ -93,6 +93,8 @@ jobs: cd e2e-test-framework ./examples/building_comfort/drasi/run_test_with_${{ matrix.cluster_type }}.sh + sleep 10 + # Wait for tests to complete by polling the query status echo "Waiting for tests to complete..." while true; do From 6353e96b2e897d369a275e0531315ddf781433cf Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Thu, 28 Aug 2025 15:11:17 -0700 Subject: [PATCH 17/19] refresh token --- .github/workflows/building-comfort.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/building-comfort.yml b/.github/workflows/building-comfort.yml index 59a7ce6..b29a55b 100644 --- a/.github/workflows/building-comfort.yml +++ b/.github/workflows/building-comfort.yml @@ -83,6 +83,7 @@ jobs: --name "building-comfort-aks-${{ github.run_number }}-${{ matrix.cluster_type }}" \ --overwrite-existing + - name: Install Drasi CLI run: | curl -fsSL https://raw.githubusercontent.com/drasi-project/drasi-platform/main/cli/installers/install-drasi-cli.sh | /bin/bash @@ -119,6 +120,13 @@ jobs: cd e2e-test-framework ./examples/building_comfort/drasi/get_test_run_results.sh "building-comfort-aks-${{ github.run_number }}-${{ matrix.cluster_type }}" + - name: Re-authenticate with Azure (refresh token) + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + - name: Upload test results to storage account run: | cd e2e-test-framework From 32fd9eb126367be20552619da85a3e053d9ced28 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Tue, 2 Sep 2025 11:46:01 -0700 Subject: [PATCH 18/19] cold tier Signed-off-by: ruokun-niu --- .github/workflows/building-comfort.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/building-comfort.yml b/.github/workflows/building-comfort.yml index b29a55b..430698f 100644 --- a/.github/workflows/building-comfort.yml +++ b/.github/workflows/building-comfort.yml @@ -141,13 +141,14 @@ jobs: --auth-mode login \ --only-show-errors - # Upload all files from the results directory + # Upload all files from the results directory with Cold tier az storage blob upload-batch \ --destination $CONTAINER_NAME \ --source "./$CLUSTER_NAME" \ --destination-path "building-comfort/$CLUSTER_NAME" \ --account-name $STORAGE_ACCOUNT \ - --auth-mode login + --auth-mode login \ + --tier Cold From d6f28302f4007ba06040c2377a4ac82d03a0388b Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Mon, 15 Sep 2025 11:55:24 -0700 Subject: [PATCH 19/19] added cleanup and modified trigger rules Signed-off-by: ruokun-niu --- .github/workflows/building-comfort.yml | 47 +++++++++++++------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/.github/workflows/building-comfort.yml b/.github/workflows/building-comfort.yml index 430698f..eb0a488 100644 --- a/.github/workflows/building-comfort.yml +++ b/.github/workflows/building-comfort.yml @@ -17,7 +17,10 @@ name: Building Comfort E2E Test on: push: branches: - - e2e-framework-automation + - main + pull_request: + branches: + - main workflow_dispatch: repository_dispatch: types: [building-comfort-trigger] @@ -151,27 +154,25 @@ jobs: --tier Cold - - # cleanup: - # runs-on: ubuntu-latest - # needs: deploy-tests - # if: always() - # strategy: - # matrix: - # cluster_type: [redis, rocks, memory] + cleanup: + runs-on: ubuntu-latest + needs: deploy-tests + if: always() + strategy: + matrix: + cluster_type: [redis, rocks, memory] - # steps: - # - name: Azure Login - # uses: azure/login@v2 - # with: - # client-id: ${{ secrets.AZURE_CLIENT_ID }} - # tenant-id: ${{ secrets.AZURE_TENANT_ID }} - # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + steps: + - name: Azure Login + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - # - name: Delete AKS cluster - # run: | - # az aks delete \ - # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - # --name "building-comfort-aks-${{ github.run_number }}-${{ matrix.cluster_type }}" \ - # --yes --no-wait - \ No newline at end of file + - name: Delete AKS cluster + run: | + az aks delete \ + --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + --name "building-comfort-aks-${{ github.run_number }}-${{ matrix.cluster_type }}" \ + --yes --no-wait \ No newline at end of file