Skip to content

Support rpm-based and apk-based runners in job-level and workflow-level instrumentation#3268

Draft
Copilot wants to merge 19 commits into
mainfrom
copilot/support-rpm-based-runners
Draft

Support rpm-based and apk-based runners in job-level and workflow-level instrumentation#3268
Copilot wants to merge 19 commits into
mainfrom
copilot/support-rpm-based-runners

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

Instrumentation actions blindly assumed Debian runners—fetching .deb and calling apt-get—causing failures on RPM-based runners (type: dpkg: not found, then otelapi.sh: No such file or directory).

Shared install logic (actions/instrument/shared/install.sh)

  • Detect OS via dpkg / rpm / apk presence and set pkg_ext and install_package accordingly
  • install_package is the only OS-specific function, exported and accepting multiple arguments; ensure_installed is a single common function that uses it via xargs
  • Debian path preserves existing apt cache optimization
  • RPM path supports dnfyumzypperrpm fallback chain
  • APK path uses apk add --allow-untrusted
  • Non-deb paths do plain fetch-and-install (no caching), per design intent

Callers (workflow/main.sh, repository/main.sh, checksuite/main.sh)

  • Call install.sh unconditionally (it's always one of the three package managers)

Job-level (inject_and_init.sh)

  • Gate all caching optimization (@actions/cache restore/save, fast deb install) behind type dpkg
  • Add RPM and APK branches for otelcol-contrib download and install

Tests

  • Add job-rpm test job using container: registry.access.redhat.com/ubi9:latest with a simple hello-world step
  • Add job-apk test job using container: alpine:latest with a simple hello-world step
Original prompt

This section details on the original issue you should resolve

<issue_title>Support rpm-based runners in job-level and workflow-level instrumentation</issue_title>
<issue_description>in the shared code handlign the install, we shouldnt blindly fetch the debian and install it, but check the OS and fetch the apk/rpm if the os fits. for these new ones, lets not do all the caching opimiztation, just plain fetching and installing. for that, limit the caching optimization for job-level to debians only. debians shall be identified by the presence of dpkg. rpm based on when rpm is present, and alpines in a similar way

2026-03-16T17:36:03.0568903Z Current runner version: '2.332.0'
2026-03-16T17:36:03.0575252Z Runner name: '***'
2026-03-16T17:36:03.0576238Z Runner group name: '***'
2026-03-16T17:36:03.0577170Z Machine name: '***'
2026-03-16T17:36:03.0581358Z ##[group]GITHUB_TOKEN Permissions
2026-03-16T17:36:03.0583880Z Actions: write
2026-03-16T17:36:03.0584380Z ArtifactMetadata: write
2026-03-16T17:36:03.0584905Z Attestations: write
2026-03-16T17:36:03.0585353Z Checks: write
2026-03-16T17:36:03.0585814Z Contents: write
2026-03-16T17:36:03.0586279Z Deployments: write
2026-03-16T17:36:03.0586789Z Discussions: write
2026-03-16T17:36:03.0587243Z Issues: write
2026-03-16T17:36:03.0587698Z Metadata: read
2026-03-16T17:36:03.0588126Z Models: read
2026-03-16T17:36:03.0588579Z Packages: write
2026-03-16T17:36:03.0589039Z Pages: write
2026-03-16T17:36:03.0589495Z PullRequests: write
2026-03-16T17:36:03.0590084Z RepositoryProjects: write
2026-03-16T17:36:03.0590671Z SecurityEvents: write
2026-03-16T17:36:03.0591412Z Statuses: write
2026-03-16T17:36:03.0591957Z ##[endgroup]
2026-03-16T17:36:03.0594291Z Secret source: Actions
2026-03-16T17:36:03.0595049Z Prepare workflow directory
2026-03-16T17:36:03.0899061Z Prepare all required actions
2026-03-16T17:36:03.0934839Z Getting action download info
2026-03-16T17:36:03.6405445Z Download action repository 'plengauer/Thoth@v5.43' (SHA:b9414156be4866abb8fb061ac000611b2196bbf2)
2026-03-16T17:36:05.7275904Z Complete job name: export
2026-03-16T17:36:05.7921715Z ##[group]Run plengauer/Thoth/actions/instrument/workflow@v5.43
2026-03-16T17:36:05.7923712Z with:
2026-03-16T17:36:05.7924623Z   self_monitoring: false
2026-03-16T17:36:05.7925641Z   debug: true
2026-03-16T17:36:05.7926876Z   github_token: ***
2026-03-16T17:36:05.7928112Z   repository: ENG-TD-Universe/java-maven-sdlc-event-gimbet2
2026-03-16T17:36:05.7929586Z   workflow_run_id: 23157386077
2026-03-16T17:36:05.7930684Z   workflow_run_attempt: 1
2026-03-16T17:36:05.7931752Z   self_monitoring_anonymize: true
2026-03-16T17:36:05.7933435Z env:
2026-03-16T17:36:05.7934441Z   OTEL_SERVICE_NAME: eng-td-universe-workflows
2026-03-16T17:36:05.7936319Z   OTEL_EXPORTER_OTLP_ENDPOINT: ***
2026-03-16T17:36:05.7939179Z   OTEL_EXPORTER_OTLP_HEADERS: ***
2026-03-16T17:36:05.7940392Z   OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
2026-03-16T17:36:05.7941596Z ##[endgroup]
2026-03-16T17:36:05.9248070Z ##[group]Validate Configuration
2026-03-16T17:36:05.9250191Z ##[endgroup]
2026-03-16T17:36:05.9251887Z ##[group]Ensuring rate limit
2026-03-16T17:36:06.1833750Z ##[endgroup]
2026-03-16T17:36:06.1835465Z ##[group]Install Dependencies
2026-03-16T17:36:06.1837675Z /home/runner/_work/_actions/plengauer/Thoth/v5.43/actions/instrument/workflow/main.sh: line 16: type: dpkg: not found
2026-03-16T17:36:06.1840004Z No debian, assuming dependencies are preinstalled.
2026-03-16T17:36:06.1841875Z ##[endgroup]
2026-03-16T17:36:06.1843567Z ##[group]Resolving Workflow Run Attempt
2026-03-16T17:36:06.1976293Z ##[endgroup]
2026-03-16T17:36:06.1978197Z ##[group]Resolving Jobs, Steps, Logs, and Artifacts
2026-03-16T17:36:06.8997428Z Artifacts ... done
2026-03-16T17:36:07.0997106Z Jobs and Steps ... done
2026-03-16T17:36:07.2026426Z Logs ... done
2026-03-16T17:36:07.2051287Z ##[endgroup]
2026-03-16T17:36:07.5511532Z ##[group]Determine Trace ID
2026-03-16T17:36:07.5512151Z ##[endgroup]
2026-03-16T17:36:07.5512678Z ##[group]Export
2026-03-16T17:36:07.5529053Z /home/runner/_work/_actions/plengauer/Thoth/v5.43/actions/instrument/workflow/main.sh: line 96: otelapi.sh: No such file or directory
2026-03-16T17:36:07.5547717Z node:internal/process/promises:392
2026-03-16T17:36:07.5548357Z       new UnhandledPromiseRejection(reason);
2026-03-16T17:36:07.5548929Z       ^
2026-03-16T17:36:07.5549100Z
2026-03-16T17:36:07.5553377Z UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "1".
2026-03-16T17:36:07.5555139Z     at throwUnhandledRejectionsMode (node:internal/process/promises:392:7)
2026-03-16T17:36:07.5555806Z     at processPromiseRejections (node:internal/process/promises:475:17)
2026-03-16T17:36:07.5556601Z     at process.processTicksAndRejections (node:internal/process/task_queues:104:32) {
2026-03-...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes plengauer/Thoth#3260

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 Send tasks to Copilot coding agent from [Slack](https://gh.io/cca-slack-docs) and [Teams](https://gh.io/cca-teams-docs) to turn conversations into code. Copilot posts an update in your thread when it's finished.

…el instrumentation

- Update shared install.sh to detect OS type (dpkg/rpm/apk) and install the
  correct package format with the appropriate package manager
- Update workflow, repository, and checksuite callers to invoke install.sh for
  rpm and apk systems too (not just dpkg)
- Limit caching optimization in job-level instrumentation to Debian only
- Add rpm and apk support for otelcol-contrib installation in job-level
- Add job-rpm test using Red Hat UBI9 container image

Co-authored-by: plengauer <100447901+plengauer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/plengauer/Thoth/sessions/a8d32120-5c08-4eba-aa58-2e031cb93188
Copilot AI changed the title [WIP] Implement support for rpm-based runners in instrumentation Support rpm-based and apk-based runners in job-level and workflow-level instrumentation Mar 24, 2026
Copilot AI requested a review from plengauer March 24, 2026 13:09
Copy link
Copy Markdown
Owner

@plengauer plengauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot pls address feedback

Comment thread .github/workflows/test_github.yml
Comment thread actions/instrument/checksuite/main.sh Outdated
Comment thread actions/instrument/repository/main.sh Outdated
Comment thread actions/instrument/shared/install.sh Outdated
Comment thread actions/instrument/workflow/main.sh Outdated
…all unconditionally, add job-apk test

- Refactor install.sh: install_package is the only OS-specific function,
  accepts multiple args, is exported and used by ensure_installed
- Remove conditional around install.sh calls in checksuite, repository,
  and workflow main.sh - call unconditionally
- Add job-apk test using alpine:latest container

Co-authored-by: plengauer <100447901+plengauer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/plengauer/Thoth/sessions/a024e1b9-d469-47ee-a982-de657b789fe7
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 24, 2026

@copilot pls address feedback

All feedback addressed in 33e1574:

  • Extracted common code in install.shinstall_package is the only OS-specific function (accepts multiple args, exported), ensure_installed uses it
  • Callers (checksuite, repository, workflow) now call install.sh unconditionally
  • Added job-apk test using alpine:latest container

Copilot AI requested a review from plengauer March 24, 2026 22:42
@plengauer
Copy link
Copy Markdown
Owner

@copilot rebase and resolve conflicts

…ased-runners

# Conflicts:
#	actions/instrument/shared/install.sh

Co-authored-by: plengauer <100447901+plengauer@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 11, 2026

@copilot rebase and resolve conflicts

Merged latest main in 3dc14d5, resolving conflicts in install.sh to incorporate architecture-specific package naming while preserving multi-OS support.

@plengauer
Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts in this pull request

…ased-runners

# Conflicts:
#	.github/workflows/observability_workflow.yml

Co-authored-by: plengauer <100447901+plengauer@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 15, 2026

@copilot resolve the merge conflicts in this pull request

Resolved in ffefffb — merged latest main and resolved the conflict in observability_workflow.yml (added "Autofix" to the workflows allowlist from main).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support rpm-based runners in job-level and workflow-level instrumentation

2 participants