From 29664fc481ae0a7b0a3bb0d6575d2c3043aa783c Mon Sep 17 00:00:00 2001 From: Moritz Eckert Date: Wed, 1 Mar 2023 16:46:23 +0100 Subject: [PATCH] ci: upload benchmark results to opensearch Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> --- .github/actions/e2e_benchmark/action.yml | 27 ++++++++++++++++++------ .github/actions/e2e_test/action.yml | 12 +++++++++++ .github/workflows/e2e-test-manual.yml | 3 +++ .github/workflows/e2e-test-weekly.yml | 3 +++ 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/.github/actions/e2e_benchmark/action.yml b/.github/actions/e2e_benchmark/action.yml index ecd0af49d..3bbeb0c74 100644 --- a/.github/actions/e2e_benchmark/action.yml +++ b/.github/actions/e2e_benchmark/action.yml @@ -8,6 +8,15 @@ inputs: kubeconfig: description: "The kubeconfig of the cluster to test." required: true + awsOpenSearchDomain: + description: "AWS OpenSearch Endpoint Domain to upload the results." + required: false + awsOpenSearchUsers: + description: "AWS OpenSearch User to upload the results." + required: false + awsOpenSearchPwd: + description: "AWS OpenSearch Password to upload the results." + required: false runs: using: "composite" @@ -126,15 +135,19 @@ runs: benchmarks/constellation-${{ inputs.cloudProvider }}.json name: "benchmarks" - - name: Check performance comparison result + - name: Upload benchmark results to opensearch + if: (!env.ACT) shell: bash + env: + OPENSEARCH_DOMAIN: ${{ inputs.awsOpenSearchDomain }} + OPENSEARCH_USER: ${{ inputs.awsOpenSearchUsers }} + OPENSEARCH_PWD: ${{ inputs.awsOpenSearchPwd }} run: | - if [ $COMPARISON_SUCCESS = true ] ; then - echo "Comparison successful" - else - echo "Comparison failed" - exit 1 - fi + curl -XPOST \ + -u "${OPENSEARCH_USER}:${OPENSEARCH_PWD}" \ + "${OPENSEARCH_DOMAIN}/benchmarks-${{ inputs.cloudProvider }}-$(date '+%Y')"/_doc \ + --data-binary @benchmarks/constellation-${{ inputs.cloudProvider }}.json \ + -H 'Content-Type: application/json' - name: Update benchmark records in S3 if: github.ref_name == 'main' diff --git a/.github/actions/e2e_test/action.yml b/.github/actions/e2e_test/action.yml index 7c8883d3c..0ee86cd96 100644 --- a/.github/actions/e2e_test/action.yml +++ b/.github/actions/e2e_test/action.yml @@ -38,6 +38,15 @@ inputs: gcpClusterServiceAccountKey: description: "Service account to use inside the created Constellation cluster on GCP." required: false + awsOpenSearchDomain: + description: "AWS OpenSearch Endpoint Domain to upload the benchmark results." + required: false + awsOpenSearchUsers: + description: "AWS OpenSearch User to upload the benchmark results." + required: false + awsOpenSearchPwd: + description: "AWS OpenSearch Password to upload the benchmark results." + required: false azureSubscription: description: "The Azure subscription ID to deploy Constellation in." required: false @@ -236,6 +245,9 @@ runs: with: cloudProvider: ${{ inputs.cloudProvider }} kubeconfig: ${{ steps.constellation-create.outputs.kubeconfig }} + awsOpenSearchDomain: ${{ inputs.awsOpenSearchDomain }} + awsOpenSearchUsers: ${{ inputs.awsOpenSearchUsers }} + awsOpenSearchPwd: ${{ inputs.awsOpenSearchPwd }} - name: Run constellation verify test if: inputs.test == 'verify' diff --git a/.github/workflows/e2e-test-manual.yml b/.github/workflows/e2e-test-manual.yml index fcd149ed5..2de0e867b 100644 --- a/.github/workflows/e2e-test-manual.yml +++ b/.github/workflows/e2e-test-manual.yml @@ -296,6 +296,9 @@ jobs: test: ${{ inputs.test }} kubernetesVersion: ${{ inputs.kubernetesVersion }} keepMeasurements: ${{ inputs.keepMeasurements }} + awsOpenSearchDomain: ${{ secrets.AWS_OPENSEARCH_DOMAIN }} + awsOpenSearchUsers: ${{ secrets.AWS_OPENSEARCH_USER }} + awsOpenSearchPwd: ${{ secrets.AWS_OPENSEARCH_PWD }} azureSubscription: ${{ secrets.AZURE_E2E_SUBSCRIPTION_ID }} azureTenant: ${{ secrets.AZURE_E2E_TENANT_ID }} azureClientID: ${{ secrets.AZURE_E2E_CLIENT_ID }} diff --git a/.github/workflows/e2e-test-weekly.yml b/.github/workflows/e2e-test-weekly.yml index 955541322..9a92b9d2d 100644 --- a/.github/workflows/e2e-test-weekly.yml +++ b/.github/workflows/e2e-test-weekly.yml @@ -127,6 +127,9 @@ jobs: cloudProvider: ${{ matrix.provider }} osImage: ${{ needs.find-latest-image.outputs.image }} kubernetesVersion: ${{ matrix.version }} + awsOpenSearchDomain: ${{ secrets.AWS_OPENSEARCH_DOMAIN }} + awsOpenSearchUsers: ${{ secrets.AWS_OPENSEARCH_USER }} + awsOpenSearchPwd: ${{ secrets.AWS_OPENSEARCH_PWD }} azureSubscription: ${{ secrets.AZURE_E2E_SUBSCRIPTION_ID }} azureTenant: ${{ secrets.AZURE_E2E_TENANT_ID }} azureClientID: ${{ secrets.AZURE_E2E_CLIENT_ID }}