Skip to content

feat(ocm-agent): port ocm-agent to DragonOS - #2571

Open
sparkzky wants to merge 6 commits into
DragonOS-Community:masterfrom
sparkzky:feat/ocm-agent
Open

sparkzky wants to merge 6 commits into
DragonOS-Community:masterfrom
sparkzky:feat/ocm-agent

Conversation

@sparkzky

Copy link
Copy Markdown
Member

Summary

Port OpenCloudOS ocm-agent to DragonOS and add an end-to-end acceptance harness.

  • Build ocm-agent as a fully static musl binary (CGO is required by go-sqlite3), plus static os_monitor / sysinfo_collector plugins.
  • Reference upstream via DADK git source and Nix fetchgit, both pinned to sparkzky/ocm-agent (dragonos branch, d08b700). No submodule and no vendored upstream source.
  • Add DADK installation to /opt/ocm-agent and Nix rootfs integration.
  • Add a protocol-compatible mock gateway (TLS 1.3, registration/cert issuance, DATA_SMALL ACK, large-data fragments, protobuf decoding), a smoke driver, an end-to-end acceptance driver, and the acceptance report with raw artifacts.
  • Rebased on latest master; the prerequisite kernel /proc/uptime (feat(procfs): add /proc/uptime #2565) and busybox build (fix(busybox): build with modern kernel headers #2566) fixes are already merged.

Validation

make kernel
make user
SKIP_GRUB=1 make write_diskimage
python3 user/apps/ocm-agent/scripts/dragonos-acceptance.py --duration 60

Result: PASS (after rebase onto the merged fixes).

  • TLS 1.3 -> REGISTER -> client certificate -> mTLS reconnect.
  • 13 HEARTBEAT, 11 DATA_SMALL frames, 11/11 ACKs.
  • os_monitor: 10 frames / 154 metric values (CPU, load, memory, df disk usage).
  • sysinfo_collector: 53 metric values (hostname, kernel, CPU model, memory, disks, NICs, sysctls, users, DNS).
  • Large-data path: 120KB synthetic payload -> 4 fragments -> 832 metrics decoded.
  • Agent produced 0 errors; only the expected chattr +i warning.
  • Guest runtime: 11 threads, ~11.3MB RSS, os_monitor resident, sysinfo_collector one-shot.

Acceptance details and artifacts: user/apps/ocm-agent/ACCEPTANCE.md,
user/apps/ocm-agent/test-results/2026-10-25/.

Notes

  • This PR contains no kernel changes; /proc/uptime and the busybox Makefile fix are from the already-merged PRs.
  • Known DragonOS gaps (missing /proc/diskstats, netdev statistics, MemAvailable, DMI/RPM/systemd) are documented in ACCEPTANCE.md and PORTING.md.
  • If GitHub access is restricted, DADK's first clone can be pre-populated at bin/dadk_cache/source/ocm_agent_0_1_0; the revision is pinned.

- add static musl build, DADK and Nix integration for ocm-agent
- reference upstream via sparkzky/ocm-agent submodule (dragonos branch, d08b700);
  Nix fetchgit pins the same revision
- add protocol-compatible mock gateway, smoke and acceptance drivers
- record the 2026-10-25 end-to-end acceptance report and raw artifacts
- kernel /proc/uptime and busybox build fixes are intentionally excluded;
  they are submitted as separate PRs and remain in the working tree

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>
Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>
Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>
- DADK source is now git + https://github.com/sparkzky/ocm-agent.git,
  pinned to the verified dragonos commit d08b700; the build command uses
  the DADK_SOURCE_CACHE_DIR_OCM_AGENT_0_1_0 checkout.
- remove the ocm-agent git submodule and its .gitmodules entry.
- add  for local direct builds (clones into the ignored
  upstream/ directory); ROOT_PATH is exported by user/Makefile so DADK's
  build command can locate the DragonOS wrapper.
- Nix keeps using fetchgit with the same revision.

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>
After dropping the ocm-agent source submodule, the acceptance injector must
read collector YAMLs from the files staged by `make plugins` instead of a
local upstream/ checkout.

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>
Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>
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.

1 participant