diff --git a/.github/workflows/test-child-workflow.yaml b/.github/workflows/test-child-workflow.yaml index 28be3bee..68235e4f 100644 --- a/.github/workflows/test-child-workflow.yaml +++ b/.github/workflows/test-child-workflow.yaml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - something: [1,2] + CERTS: ["with","without"] steps: # These would be things like the top-level traceparent, global resource attributes, and any custom # repo/branch for shared-actions. Note that we have a chicken/egg here. This dispatch action can't @@ -35,7 +35,32 @@ jobs: - name: Dummy work shell: bash run: echo "This is dumm" + - name: Store certs conditionally according to matrix + if: ${{matrix.CERTS}} == "with" + run: | + echo -n CERTS="${{ secrets.OTEL_EXPORTER_OTLP_CA_CERTIFICATE }};${{ secrets.OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE }};${{ secrets.OTEL_EXPORTER_OTLP_CLIENT_KEY }}" >> GITHUB_ENV + - name: Ignore certs conditionally according to matrix + if: ${{matrix.CERTS}} == "without" + run: | + echo -n CERTS="${{ secrets.OTEL_EXPORTER_OTLP_CA_CERTIFICATE }};${{ secrets.OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE }};${{ secrets.OTEL_EXPORTER_OTLP_CLIENT_KEY }}" >> GITHUB_ENV - name: Send telemetry summary uses: rapidsai/shared-actions/telemetry-dispatch-write-summary@telemetry-dispatch-actions with: - cert_concat: "${{ secrets.OTEL_EXPORTER_OTLP_CA_CERTIFICATE }};${{ secrets.OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE }};${{ secrets.OTEL_EXPORTER_OTLP_CLIENT_KEY }}" + cert_concat: "${{env.CERTS}}" + - name: Query the Tempo HTTP API and check that our trace is present and has expected properties + id: get-trace + run: | + TRACE_ID=$( cut -d '-' -f 2 <<< "$TRACEPARENT" ); + echo "Trace ID is: ${TRACE_ID}"; + TRACE_URL="${OTEL_EXPORTER_OTLP_ENDPOINT/4318/3200}/api/traces/${TRACE_ID}" + echo "Trace URL is: ${TRACE_URL}" + curl \ + --cert /tmp/certs/client.crt.pem --key /tmp/certs/client.key.pem --cacert /tmp/certs/ca.crt.pem \ + -Gs "${TRACE_URL}" > trace_record.json; + + - name: Validate error state without certs + if: ${{matrix.CERTS}} == "without" && success() + run: exit 1 + - name: Validate pass state with certs + if: ${{matrix.CERTS}} == "with" && failure() + run: exit 1 diff --git a/.github/workflows/test-telemetry-setup.yaml b/.github/workflows/test-telemetry-setup.yaml index d6715836..27f13e6d 100644 --- a/.github/workflows/test-telemetry-setup.yaml +++ b/.github/workflows/test-telemetry-setup.yaml @@ -61,9 +61,7 @@ jobs: uses: rapidsai/shared-actions/telemetry-dispatch-write-summary@telemetry-dispatch-actions with: cert_concat: "${{ secrets.OTEL_EXPORTER_OTLP_CA_CERTIFICATE }};${{ secrets.OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE }};${{ secrets.OTEL_EXPORTER_OTLP_CLIENT_KEY }}" - # we don't check any values here. We're just checking to see if the absence of certs raises any issues. - - name: Telemetry summarize (without certs) - uses: rapidsai/shared-actions/telemetry-dispatch-write-summary@telemetry-dispatch-actions + - name: Check if service name was altered during telemetry summary run: | echo "(should be the value set to the OTEL_SERVICE_NAME env var in base-env-setup job)" diff --git a/telemetry-impls/README.md b/telemetry-impls/README.md index 548fbb99..b50d6858 100644 --- a/telemetry-impls/README.md +++ b/telemetry-impls/README.md @@ -1,5 +1 @@ -Folders in here that start with a leading underscore are meant to be -sub-routines of other actions. - -Folders without a leading underscore are meant to be called by -"telemetry-dispatch-*" scripts in the folder one level higher than this one. +These actions are meant to be called by "telemetry-dispatch-*" scripts, not directly. \ No newline at end of file diff --git a/telemetry-impls/_ensure-otel-cli-available/action.yml b/telemetry-impls/ensure-otel-cli-available/action.yml similarity index 100% rename from telemetry-impls/_ensure-otel-cli-available/action.yml rename to telemetry-impls/ensure-otel-cli-available/action.yml diff --git a/telemetry-impls/_github-actions-job-info/action.yml b/telemetry-impls/github-actions-job-info/action.yml similarity index 100% rename from telemetry-impls/_github-actions-job-info/action.yml rename to telemetry-impls/github-actions-job-info/action.yml diff --git a/telemetry-impls/_github-actions-job-info/example-gha-job-log.json b/telemetry-impls/github-actions-job-info/example-gha-job-log.json similarity index 100% rename from telemetry-impls/_github-actions-job-info/example-gha-job-log.json rename to telemetry-impls/github-actions-job-info/example-gha-job-log.json diff --git a/telemetry-impls/_load-base-env-vars/action.yml b/telemetry-impls/load-base-env-vars/action.yml similarity index 100% rename from telemetry-impls/_load-base-env-vars/action.yml rename to telemetry-impls/load-base-env-vars/action.yml diff --git a/telemetry-impls/_sanity-checks/action.yml b/telemetry-impls/sanity-checks/action.yml similarity index 100% rename from telemetry-impls/_sanity-checks/action.yml rename to telemetry-impls/sanity-checks/action.yml diff --git a/telemetry-impls/_set-otel-service-name/action.yml b/telemetry-impls/set-otel-service-name/action.yml similarity index 100% rename from telemetry-impls/_set-otel-service-name/action.yml rename to telemetry-impls/set-otel-service-name/action.yml diff --git a/telemetry-impls/_stash-base-env-vars/action.yml b/telemetry-impls/stash-base-env-vars/action.yml similarity index 100% rename from telemetry-impls/_stash-base-env-vars/action.yml rename to telemetry-impls/stash-base-env-vars/action.yml