From 4657e06fe4e1aa309b003e15f2d64cd5e321c296 Mon Sep 17 00:00:00 2001 From: Techassi Date: Thu, 23 Jan 2025 11:21:42 +0100 Subject: [PATCH 1/5] temp: Testing on pushes to PR --- .github/workflows/pr_actions-smoke-test.yml | 16 ++++ run-integration-test/action.yml | 17 +--- tests/interu.yaml | 17 ++++ tests/test-definition.yaml | 98 +++++++++++++++++++++ 4 files changed, 133 insertions(+), 15 deletions(-) create mode 100644 tests/interu.yaml create mode 100644 tests/test-definition.yaml diff --git a/.github/workflows/pr_actions-smoke-test.yml b/.github/workflows/pr_actions-smoke-test.yml index 97f082e..4300a65 100644 --- a/.github/workflows/pr_actions-smoke-test.yml +++ b/.github/workflows/pr_actions-smoke-test.yml @@ -11,6 +11,7 @@ on: - free-disk-space/action.yml - publish-image/action.yml - publish-index-manifest/action.yml + - run-integration-test/* - shard/action.yml - smoke/* @@ -94,3 +95,18 @@ jobs: image-registry-password: ${{ secrets.HARBOR_ROBOT_STACKABLE_GITHUB_ACTION_BUILD_SECRET }} image-repository: stackable/smoke image-index-manifest-tag: ${{ matrix.versions }}-stackable0.0.0-dev + + run_integration_test: + name: Run Integration Test + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + + - name: Run Integration Test + uses: ./run-integration-test + with: + replicated-api-token: ${{ secrets.REPLICATED_API_TOKEN }} + test-profile: schedule diff --git a/run-integration-test/action.yml b/run-integration-test/action.yml index 02c5ac5..b286d31 100644 --- a/run-integration-test/action.yml +++ b/run-integration-test/action.yml @@ -188,22 +188,9 @@ runs: run: | echo "START_TIME=$(date +'%Y-%m-%dT%H:%M:%S')" | tee -a "$GITHUB_OUTPUT" - - name: Run Integration Test (${{ env.INTERU_TEST_RUN }}=${{ env.INTERU_TEST_PARAMETER }}/${{ env.INTERU_TEST_PARALLELISM }}) - env: - REF_NAME: ${{ github.ref_name }} - GH_TOKEN: ${{ github.token }} + - name: Pause for manual testing shell: bash - run: | - set -euo pipefail - - OPERATOR_VERSION=$("$GITHUB_ACTION_PATH/../.scripts/get_operator_version.sh" "$REF_NAME") - python ./scripts/run-tests --skip-tests --operator "$OPERATOR_NAME=$OPERATOR_VERSION" - - if [ "$INTERU_TEST_RUN" == "all" ]; then - python ./scripts/run-tests --skip-release --log-level debug --parallel "$INTERU_TEST_PARALLELISM" - else - python ./scripts/run-tests --skip-release --log-level debug "--$INTERU_TEST_RUN" "$INTERU_TEST_PARAMETER" --parallel "$INTERU_TEST_PARALLELISM" - fi + run: sleep 1800 - name: Record Test End Time id: end-time diff --git a/tests/interu.yaml b/tests/interu.yaml new file mode 100644 index 0000000..8476de9 --- /dev/null +++ b/tests/interu.yaml @@ -0,0 +1,17 @@ +runners: + amd64: + platform: k3s-1.31 + ttl: 30m + node-groups: + - name: default + arch: amd64 + size: medium + disk-gb: 50 + nodes: 1 + +profiles: + schedule: + strategy: use-runner + runner: amd64 + options: + parallelism: 2 diff --git a/tests/test-definition.yaml b/tests/test-definition.yaml new file mode 100644 index 0000000..bc8508f --- /dev/null +++ b/tests/test-definition.yaml @@ -0,0 +1,98 @@ +# COPIED FROM AIRFLOW-OPERATOR +--- +dimensions: + - name: airflow + values: + - 2.9.2 + - 2.9.3 + - 2.10.2 + # To use a custom image, add a comma and the full name after the product version + # - 2.8.1,docker.stackable.tech/sandbox/airflow:2.8.1-stackable0.0.0-dev + - name: airflow-latest + values: + - 2.10.2 + # To use a custom image, add a comma and the full name after the product version + # - 2.8.1,docker.stackable.tech/sandbox/airflow:2.8.1-stackable0.0.0-dev + - name: ldap-authentication + values: + - no-tls + - insecure-tls + - server-verification-tls + - name: openshift + values: + - "false" + - name: executor + values: + - celery + - kubernetes +tests: + - name: smoke + dimensions: + - airflow + - openshift + - executor + - name: mount-dags-configmap + dimensions: + - airflow-latest + - openshift + - executor + - name: mount-dags-gitsync + dimensions: + - airflow-latest + - openshift + - executor + - name: ldap + dimensions: + - airflow-latest + - openshift + - ldap-authentication + - executor + - name: oidc + dimensions: + - airflow + - openshift + - name: resources + dimensions: + - airflow-latest + - openshift + - name: orphaned-resources + dimensions: + - airflow-latest + - openshift + - name: logging + dimensions: + - airflow + - openshift + - executor + - name: cluster-operation + dimensions: + - airflow-latest + - openshift + - name: overrides + dimensions: + - airflow-latest + - openshift +suites: + - name: nightly + # Run nightly with the latest airflow + patch: + - dimensions: + - name: airflow + expr: last + - name: smoke-latest + # Useful for development + select: + - smoke + patch: + - dimensions: + - expr: last + - name: openshift + # Run on OpenShift with latest airflow + patch: + - dimensions: + - expr: last + - dimensions: + - name: airflow + expr: last + - name: openshift + expr: "true" From 2aa318ec99ce430d2b1357dc3bc4e71acfed2c53 Mon Sep 17 00:00:00 2001 From: Techassi Date: Thu, 23 Jan 2025 11:23:09 +0100 Subject: [PATCH 2/5] feat: Export OTLP logs to Loki --- .../overlays/replicated/kustomization.yml | 13 +++++-------- .../replicated/patch-container-log-scrape.yaml | 17 +++++++++++++++++ .../replicated/patch-kubernetes-events.yaml | 17 +++++++++++++++++ 3 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 run-integration-test/kustomize/overlays/replicated/patch-container-log-scrape.yaml create mode 100644 run-integration-test/kustomize/overlays/replicated/patch-kubernetes-events.yaml diff --git a/run-integration-test/kustomize/overlays/replicated/kustomization.yml b/run-integration-test/kustomize/overlays/replicated/kustomization.yml index 5d967f1..fa65e47 100644 --- a/run-integration-test/kustomize/overlays/replicated/kustomization.yml +++ b/run-integration-test/kustomize/overlays/replicated/kustomization.yml @@ -5,19 +5,16 @@ resources: - ../../bases/opentelemetry-collectors patches: -# Update all collectors to set the exporter endpoints and any other common overrides. +# Update collectors to set the exporter endpoints. +- path: patch-container-log-scrape.yaml +- path: patch-kubernetes-events.yaml + +# Update all collectors to set common overrides. - target: group: opentelemetry.io version: v1beta1 kind: OpenTelemetryCollector patch: |- - - op: add - path: /spec/config/exporters/otlp~1grpc/endpoint - value: 212.227.162.207:30171 - - op: add - path: /spec/config/exporters/otlp~1grpc/tls - value: - insecure: true - op: add path: /spec/envFrom/- value: diff --git a/run-integration-test/kustomize/overlays/replicated/patch-container-log-scrape.yaml b/run-integration-test/kustomize/overlays/replicated/patch-container-log-scrape.yaml new file mode 100644 index 0000000..54bae07 --- /dev/null +++ b/run-integration-test/kustomize/overlays/replicated/patch-container-log-scrape.yaml @@ -0,0 +1,17 @@ +apiVersion: opentelemetry.io/v1beta1 +kind: OpenTelemetryCollector +metadata: + name: container-log-scrape + namespace: opentelemetry-operator +spec: + config: + exporters: + otlp/grpc: + $patch: delete + otlphttp: + endpoint: https://loki.nick.stackable.build/loki/api/v1/push + service: + pipelines: + logs: + exporters: + - otlphttp diff --git a/run-integration-test/kustomize/overlays/replicated/patch-kubernetes-events.yaml b/run-integration-test/kustomize/overlays/replicated/patch-kubernetes-events.yaml new file mode 100644 index 0000000..79b780f --- /dev/null +++ b/run-integration-test/kustomize/overlays/replicated/patch-kubernetes-events.yaml @@ -0,0 +1,17 @@ +apiVersion: opentelemetry.io/v1beta1 +kind: OpenTelemetryCollector +metadata: + name: kubernetes-events + namespace: opentelemetry-operator +spec: + config: + exporters: + otlp/grpc: + $patch: delete + otlphttp: + endpoint: https://loki.nick.stackable.build/loki/api/v1/push + service: + pipelines: + logs: + exporters: + - otlphttp From 43d0bd63c9c8e2df95316a4cfdd3344b00dc0fd7 Mon Sep 17 00:00:00 2001 From: Techassi Date: Thu, 23 Jan 2025 12:54:56 +0100 Subject: [PATCH 3/5] refactor: Change attributes to resource processor --- .../kustomize/overlays/replicated/kustomization.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/run-integration-test/kustomize/overlays/replicated/kustomization.yml b/run-integration-test/kustomize/overlays/replicated/kustomization.yml index fa65e47..738aef1 100644 --- a/run-integration-test/kustomize/overlays/replicated/kustomization.yml +++ b/run-integration-test/kustomize/overlays/replicated/kustomization.yml @@ -21,9 +21,9 @@ patches: configMapRef: name: integration-test-info - op: add - path: /spec/config/processors/attributes + path: /spec/config/processors/resource value: - actions: + attributes: - action: upsert key: k8s.cluster.name value: ${env:KUBERNETES_CLUSTER_NAME} @@ -32,7 +32,7 @@ patches: value: ${env:TRIGGERED_BY} - op: add path: /spec/config/service/pipelines/logs/processors/- - value: attributes + value: resource # Specifically override config for the kubernetes-events collector. - target: From 3797dde35146f25a76aabb3f7f9630182636b70c Mon Sep 17 00:00:00 2001 From: Techassi Date: Thu, 23 Jan 2025 13:29:09 +0100 Subject: [PATCH 4/5] fix: Use correct OTLP endpoints --- .../overlays/replicated/patch-container-log-scrape.yaml | 2 +- .../kustomize/overlays/replicated/patch-kubernetes-events.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/run-integration-test/kustomize/overlays/replicated/patch-container-log-scrape.yaml b/run-integration-test/kustomize/overlays/replicated/patch-container-log-scrape.yaml index 54bae07..a5e7314 100644 --- a/run-integration-test/kustomize/overlays/replicated/patch-container-log-scrape.yaml +++ b/run-integration-test/kustomize/overlays/replicated/patch-container-log-scrape.yaml @@ -9,7 +9,7 @@ spec: otlp/grpc: $patch: delete otlphttp: - endpoint: https://loki.nick.stackable.build/loki/api/v1/push + endpoint: https://loki.nick.stackable.build/otlp service: pipelines: logs: diff --git a/run-integration-test/kustomize/overlays/replicated/patch-kubernetes-events.yaml b/run-integration-test/kustomize/overlays/replicated/patch-kubernetes-events.yaml index 79b780f..3cfc83a 100644 --- a/run-integration-test/kustomize/overlays/replicated/patch-kubernetes-events.yaml +++ b/run-integration-test/kustomize/overlays/replicated/patch-kubernetes-events.yaml @@ -9,7 +9,7 @@ spec: otlp/grpc: $patch: delete otlphttp: - endpoint: https://loki.nick.stackable.build/loki/api/v1/push + endpoint: https://loki.nick.stackable.build/otlp service: pipelines: logs: From 990f74b08b1c3693fb80814c20c44a97531ebf75 Mon Sep 17 00:00:00 2001 From: Techassi Date: Thu, 23 Jan 2025 13:30:20 +0100 Subject: [PATCH 5/5] Revert "temp: Testing on pushes to PR" This reverts commit 4657e06fe4e1aa309b003e15f2d64cd5e321c296. --- .github/workflows/pr_actions-smoke-test.yml | 16 ---- run-integration-test/action.yml | 17 +++- tests/interu.yaml | 17 ---- tests/test-definition.yaml | 98 --------------------- 4 files changed, 15 insertions(+), 133 deletions(-) delete mode 100644 tests/interu.yaml delete mode 100644 tests/test-definition.yaml diff --git a/.github/workflows/pr_actions-smoke-test.yml b/.github/workflows/pr_actions-smoke-test.yml index 4300a65..97f082e 100644 --- a/.github/workflows/pr_actions-smoke-test.yml +++ b/.github/workflows/pr_actions-smoke-test.yml @@ -11,7 +11,6 @@ on: - free-disk-space/action.yml - publish-image/action.yml - publish-index-manifest/action.yml - - run-integration-test/* - shard/action.yml - smoke/* @@ -95,18 +94,3 @@ jobs: image-registry-password: ${{ secrets.HARBOR_ROBOT_STACKABLE_GITHUB_ACTION_BUILD_SECRET }} image-repository: stackable/smoke image-index-manifest-tag: ${{ matrix.versions }}-stackable0.0.0-dev - - run_integration_test: - name: Run Integration Test - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - persist-credentials: false - - - name: Run Integration Test - uses: ./run-integration-test - with: - replicated-api-token: ${{ secrets.REPLICATED_API_TOKEN }} - test-profile: schedule diff --git a/run-integration-test/action.yml b/run-integration-test/action.yml index b286d31..02c5ac5 100644 --- a/run-integration-test/action.yml +++ b/run-integration-test/action.yml @@ -188,9 +188,22 @@ runs: run: | echo "START_TIME=$(date +'%Y-%m-%dT%H:%M:%S')" | tee -a "$GITHUB_OUTPUT" - - name: Pause for manual testing + - name: Run Integration Test (${{ env.INTERU_TEST_RUN }}=${{ env.INTERU_TEST_PARAMETER }}/${{ env.INTERU_TEST_PARALLELISM }}) + env: + REF_NAME: ${{ github.ref_name }} + GH_TOKEN: ${{ github.token }} shell: bash - run: sleep 1800 + run: | + set -euo pipefail + + OPERATOR_VERSION=$("$GITHUB_ACTION_PATH/../.scripts/get_operator_version.sh" "$REF_NAME") + python ./scripts/run-tests --skip-tests --operator "$OPERATOR_NAME=$OPERATOR_VERSION" + + if [ "$INTERU_TEST_RUN" == "all" ]; then + python ./scripts/run-tests --skip-release --log-level debug --parallel "$INTERU_TEST_PARALLELISM" + else + python ./scripts/run-tests --skip-release --log-level debug "--$INTERU_TEST_RUN" "$INTERU_TEST_PARAMETER" --parallel "$INTERU_TEST_PARALLELISM" + fi - name: Record Test End Time id: end-time diff --git a/tests/interu.yaml b/tests/interu.yaml deleted file mode 100644 index 8476de9..0000000 --- a/tests/interu.yaml +++ /dev/null @@ -1,17 +0,0 @@ -runners: - amd64: - platform: k3s-1.31 - ttl: 30m - node-groups: - - name: default - arch: amd64 - size: medium - disk-gb: 50 - nodes: 1 - -profiles: - schedule: - strategy: use-runner - runner: amd64 - options: - parallelism: 2 diff --git a/tests/test-definition.yaml b/tests/test-definition.yaml deleted file mode 100644 index bc8508f..0000000 --- a/tests/test-definition.yaml +++ /dev/null @@ -1,98 +0,0 @@ -# COPIED FROM AIRFLOW-OPERATOR ---- -dimensions: - - name: airflow - values: - - 2.9.2 - - 2.9.3 - - 2.10.2 - # To use a custom image, add a comma and the full name after the product version - # - 2.8.1,docker.stackable.tech/sandbox/airflow:2.8.1-stackable0.0.0-dev - - name: airflow-latest - values: - - 2.10.2 - # To use a custom image, add a comma and the full name after the product version - # - 2.8.1,docker.stackable.tech/sandbox/airflow:2.8.1-stackable0.0.0-dev - - name: ldap-authentication - values: - - no-tls - - insecure-tls - - server-verification-tls - - name: openshift - values: - - "false" - - name: executor - values: - - celery - - kubernetes -tests: - - name: smoke - dimensions: - - airflow - - openshift - - executor - - name: mount-dags-configmap - dimensions: - - airflow-latest - - openshift - - executor - - name: mount-dags-gitsync - dimensions: - - airflow-latest - - openshift - - executor - - name: ldap - dimensions: - - airflow-latest - - openshift - - ldap-authentication - - executor - - name: oidc - dimensions: - - airflow - - openshift - - name: resources - dimensions: - - airflow-latest - - openshift - - name: orphaned-resources - dimensions: - - airflow-latest - - openshift - - name: logging - dimensions: - - airflow - - openshift - - executor - - name: cluster-operation - dimensions: - - airflow-latest - - openshift - - name: overrides - dimensions: - - airflow-latest - - openshift -suites: - - name: nightly - # Run nightly with the latest airflow - patch: - - dimensions: - - name: airflow - expr: last - - name: smoke-latest - # Useful for development - select: - - smoke - patch: - - dimensions: - - expr: last - - name: openshift - # Run on OpenShift with latest airflow - patch: - - dimensions: - - expr: last - - dimensions: - - name: airflow - expr: last - - name: openshift - expr: "true"