Skip to content

Commit

Permalink
tweak with/without cert error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
msarahan committed Nov 8, 2024
1 parent 0f15de0 commit a27e23b
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 10 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/test-child-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 1 addition & 3 deletions .github/workflows/test-telemetry-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
6 changes: 1 addition & 5 deletions telemetry-impls/README.md
Original file line number Diff line number Diff line change
@@ -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.
File renamed without changes.

0 comments on commit a27e23b

Please sign in to comment.