Skip to content

Commit

Permalink
fix wrong default branch for shared actions
Browse files Browse the repository at this point in the history
  • Loading branch information
msarahan committed Nov 13, 2024
1 parent 69cb461 commit 855c857
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
29 changes: 29 additions & 0 deletions telemetry-dispatch-load-base-env-vars/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: dispatch-load-base-env-vars
description: |
Wrapper that clones a specific branch/ref of the shared-actions repo, then
calls the `load-base-env-vars` action to download the base environment
variables and load them into the current environment.
This does not overwrite any environment variables that are already set.
inputs:
load_service_name:
description: |
If true, loads OTEL_SERVICE_NAME from the stashed env vars. This is used for top-level workflows.
Otherwise the telemetry service name is obtained from Github job metadata.
Getting the service name from Github job metadata is for child workflows.
default: 'false'

runs:
using: 'composite'
steps:
- name: Clone shared-actions repo
uses: actions/checkout@v4
with:
repository: ${{ env.SHARED_ACTIONS_REPO || 'rapidsai/shared-actions' }}
ref: ${{ env.SHARED_ACTIONS_REF || 'main' }}
path: ./shared-actions
- name: Set OTEL_SERVICE_NAME from job if not loading from stash
if: ${{ inputs.load_service_name != 'true' }}
uses: ./shared-actions/telemetry-impls/set-otel-service-name
- name: Load base env vars
uses: ./shared-actions/telemetry-impls/load-base-env-vars
22 changes: 22 additions & 0 deletions telemetry-dispatch-stash-base-env-vars/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: dispatch-stash-base-env-vars
description: |
Clones a particular branch/ref of a shared-actions repo, then
call the stash-base-env-vars implementation script, which writes
some environment variables so that downstream jobs can refer to them.
Inputs here are all assumed to be env vars set outside of this script.
Set them in your main repo's workflows.
runs:
using: 'composite'
steps:
- name: Clone shared-actions repo
uses: actions/checkout@v4
with:
repository: ${{ env.SHARED_ACTIONS_REPO || 'rapidsai/shared-actions' }}
ref: ${{ env.SHARED_ACTIONS_REF || 'main' }}
path: ./shared-actions
- name: Get traceparent representation of current workflow
uses: ./shared-actions/telemetry-impls/traceparent
- name: Stash base env vars
uses: ./shared-actions/telemetry-impls/stash-base-env-vars
31 changes: 31 additions & 0 deletions telemetry-dispatch-write-summary/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: dispatch-summarize
description: |
Clones a particular branch/ref of a shared-actions repo, then calls its telemetry summarize
action. The summarize action downloads and parses Github job metadata, and creates
OpenTelemetry spans from the job metadata. These are sent to the configured OTLP receiver/endpoint.
inputs:
cert_concat:
description: Concatenation of certs (CA;Client;ClientKey)
extra_attributes:
description:
Additional attributes to add to OTEL_RESOURCE_ATTRIBUTES.
See https://opentelemetry.io/docs/languages/sdk-configuration/general/#otel_resource_attributes

runs:
using: 'composite'
steps:
- name: Clone shared-actions repo
uses: actions/checkout@v4
with:
repository: ${{ env.SHARED_ACTIONS_REPO || 'rapidsai/shared-actions' }}
ref: ${{ env.SHARED_ACTIONS_REF || 'main' }}
path: ./shared-actions
# This is necessary because this action will generally be run in a job separately from
# where the env vars are set
- name: Load base environment variables
uses: ./shared-actions/telemetry-impls/load-base-env-vars
- name: Run summarize action
uses: ./shared-actions/telemetry-impls/summarize
with:
cert_concat: ${{ inputs.cert_concat }}
extra_attributes: ${{ inputs.extra_attributes }}

0 comments on commit 855c857

Please sign in to comment.