Prepare release v0.150.0 #5827
Workflow file for this run
This file contains hidden or 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
| name: Splunk Platform Functional Test | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| KUBERNETES_DEBUG_INFO: | |
| description: 'KUBERNETES_DEBUG_INFO: Set this to true to collect the debug info of the k8s cluster and upload this info as a Github workflow artifact.' | |
| required: false | |
| default: false | |
| type: choice | |
| options: | |
| - false | |
| - true | |
| permissions: | |
| contents: read | |
| env: | |
| GO_VERSION: 1.26.2 | |
| # Make sure to exit early if cache segment download times out after 2 minutes. | |
| # We limit cache download as a whole to 5 minutes. | |
| SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 | |
| jobs: | |
| get-test-matrix: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: get matrix | |
| id: test_matrix | |
| run: | | |
| echo "Getting test matrix" | |
| matrix=$(jq -r '.functional_test | tostring' ci-matrix.json | tr -d '\n') | |
| echo "matrix=${matrix}" >> "$GITHUB_OUTPUT" | |
| outputs: | |
| matrix: ${{ steps.test_matrix.outputs.matrix }} | |
| functional-test: | |
| name: K8s ${{ matrix.k8s-minikube-version }} ${{ matrix.container_runtime }}, Splunk ${{ matrix.splunk_version }} | |
| runs-on: ubuntu-latest | |
| needs: get-test-matrix | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.get-test-matrix.outputs.matrix) }} | |
| env: | |
| CI_SPLUNK_PORT: 8089 | |
| CI_SPLUNK_USERNAME: admin | |
| CI_SPLUNK_HEC_TOKEN: "00000000-0000-0000-0000-0000000000000" | |
| CI_SPLUNK_PASSWORD: helloworld | |
| CI_INDEX_EVENTS: ci_events | |
| CI_INDEX_METRICS: ci_metrics | |
| CONTAINER_RUNTIME: ${{ matrix.container_runtime }} | |
| KUBERNETES_VERSION: ${{ matrix.k8s-minikube-version }} | |
| SPLUNK_VERSION: ${{ matrix.splunk_version }} | |
| MINIKUBE_VERSION: latest | |
| KUBECONFIG: /tmp/kube-config-splunk-otel-collector-chart-functional-testing | |
| KUBERNETES_DEBUG_INFO: ${{ github.event.inputs.KUBERNETES_DEBUG_INFO || 'false' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache-dependency-path: '**/go.sum' | |
| # # Leave this here for debugging | |
| # - name: Setup upterm session | |
| # uses: lhotari/action-upterm@b0357f23233f5ea6d58947c0c402e0631bab7334 # v1 | |
| - name: Setup Minikube | |
| run: | | |
| # Install Kubectl | |
| curl -Lo kubectl "https://dl.k8s.io/${KUBERNETES_VERSION}/bin/linux/amd64/kubectl" | |
| chmod +x kubectl | |
| sudo mv kubectl /usr/local/bin/ | |
| mkdir -p /tmp/kube-config-splunk-otel-collector-chart-splunk-integration-testing | |
| # Install Minikube | |
| curl -Lo minikube "https://storage.googleapis.com/minikube/releases/${MINIKUBE_VERSION}/minikube-linux-amd64" | |
| chmod +x minikube | |
| sudo mv minikube /usr/local/bin/ | |
| sudo sysctl fs.protected_regular=0 | |
| # Start Minikube and Wait | |
| minikube start --container-runtime="${CONTAINER_RUNTIME}" --cpus 2 --memory 4096 --kubernetes-version="${KUBERNETES_VERSION}" --no-vtx-check | |
| export JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}' | |
| until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do | |
| sleep 1; | |
| done | |
| echo "Kubernetes $(kubectl version --short | grep -E 'Client|Server')" && echo "Container Runtime for Node: $(kubectl get node -o=jsonpath='{.items[0].metadata.name}'): $(kubectl get node -o=jsonpath='{.items[0].status.nodeInfo.containerRuntimeVersion}')" | |
| - name: Install Splunk | |
| run: | | |
| # Wait until default service account is created | |
| until kubectl -n default get serviceaccount default -o name; do | |
| sleep 1; | |
| done | |
| # set splunk version, hec_token, splunk password in k8s-splunk.yaml file | |
| sed -i "s/splunk:9.4.4/splunk:${SPLUNK_VERSION}/g" ci_scripts/k8s-splunk.yml | |
| sed -i "s/value: helloworld/value: ${CI_SPLUNK_PASSWORD}/g" ci_scripts/k8s-splunk.yml | |
| sed -i "s/value: 00000000-0000-0000-0000-0000000000000/value: ${CI_SPLUNK_HEC_TOKEN}/g" ci_scripts/k8s-splunk.yml | |
| cat ci_scripts/k8s-splunk.yml | |
| # Install Splunk on minikube | |
| kubectl apply -f ci_scripts/k8s-splunk.yml | |
| # Wait until splunk is ready | |
| until kubectl logs splunk --tail=2 | grep -q 'Ansible playbook complete'; do | |
| sleep 1; | |
| done | |
| - name: Deploy splunk-otel-collector chart | |
| run: | | |
| make dep-update | |
| CI_SPLUNK_HOST=$(kubectl get pod splunk --template='{{.status.podIP}}') | |
| export CI_SPLUNK_HOST | |
| ci_scripts/deploy_collector.sh | |
| - name: Deploy log generator | |
| run: | | |
| kubectl apply -f test/test_setup.yaml | |
| sleep 60 | |
| - name: Run Splunk Integration Tests | |
| id: run-functional-tests | |
| run: | | |
| CI_SPLUNK_HOST=$(kubectl get pod splunk --template='{{.status.podIP}}') | |
| export CI_SPLUNK_HOST | |
| cd test | |
| go test -v -tags splunk_integration | |
| - name: Collect Kubernetes Cluster debug info on failure | |
| if: always() && (steps.run-functional-tests.outcome == 'failure' || env.KUBERNETES_DEBUG_INFO == 'true') | |
| id: collect-debug-info | |
| run: | | |
| echo "Functional tests failed. Collecting debug info for current state of the Kubernetes cluster..." | |
| cd tools | |
| ./splunk_kubernetes_debug_info.sh | |
| - name: Upload Kubernetes Cluster debug info | |
| if: always() && (steps.run-functional-tests.outcome == 'failure' || env.KUBERNETES_DEBUG_INFO == 'true') | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 | |
| with: | |
| name: k8s-debug-info-${{ matrix.k8s-minikube-version }}-${{ matrix.container_runtime }}-splunk-${{ matrix.splunk_version }} | |
| path: tools/splunk_kubernetes_debug_info_* | |
| retention-days: 5 | |
| - name: Print splunk-otel-collector logs | |
| if: always() && (steps.run-functional-tests.outcome == 'failure' || env.KUBERNETES_DEBUG_INFO == 'true') | |
| run: | | |
| # Echo logs for the collector (agent,cluster-receiver,gateway) for visibility | |
| pods=$(kubectl get pods -l app=splunk-otel-collector -o jsonpath='{.items[*].metadata.name}') | |
| for pod in $pods; do | |
| echo "Logs for $pod:" | |
| kubectl logs "$pod" | head -n 2000 | |
| done |