Skip to content

api: experimental management api in the registry - #458

Draft
MariusBgm wants to merge 2 commits into
mainfrom
dev/managemant_api_standalone
Draft

MariusBgm wants to merge 2 commits into
mainfrom
dev/managemant_api_standalone

Conversation

@MariusBgm

Copy link
Copy Markdown
Collaborator

api: experimental management api in the registry

Tools can observe a registry: simulations, connected and required participants, shared configurations. Opt-in, experimental.

  • Registry: Experimental.Management.Enable hosts sil-kit-registry in .well-known/sil-kit/management.
  • Topics for registry info and simulations, RPCs GetInfo, GetSimulations, GetParticipantConfiguration. Plain pub/sub and RPC.
  • Participants: Experimental.Management.ShareConfiguration sends the configuration to the registry (wire change).
  • Clients: C++ ManagementClient (header-only), C API SilKit_Experimental_ManagementClient_*.
  • Demo: SilKitDemoManagementClient.

Wire format change

Only the participant knows its configuration. The ParticipantAnnouncement is the one message every participant sends to the registry, so the configuration rides along.

  • ParticipantAnnouncement::configurationJson: optional trailing string, only towards the registry, only if opted in.
  • Otherwise byte-identical. Protocol version stays 3.1.
Participant Registry Result
sharing this PR, management on available to clients
sharing this PR, management off dropped
sharing <= 5.0.8 trailing bytes ignored
not sharing, or older any unchanged, NotShared

No capability check:

  • The announcement is the first handshake message; the registry's capabilities are unknown at that point.
  • Old registries ignore trailing bytes (4.0.52, 5.0.8 checked).
  • Registry to participant extensions can be gated on participant capabilities, which the registry knows.

Open points:

  • The field is omitted when empty, so future trailing fields must write it unconditionally first. Alternative: always write it.
  • No access control on shared configurations, hence opt-in.

ManagementClient

Hides the URI, topic and function names, media type, SAB payloads and sequence handling:

auto client = CreateManagementClient(config, "silkit://localhost:8500");
client->SetSimulationsHandler([](const Simulations& simulations, const SimulationsChange& change) { /* ... */ });
client->GetParticipantConfiguration("can", "CanWriter", std::chrono::seconds{5},
                                    [](RpcCallStatus status, const ParticipantConfigurationReply& reply) { /* ... */ });
  • Reports created, removed and changed simulations; replays the known state when a handler is set.
  • Destroying the client completes pending requests with UndefinedError.
  • Uses the public C++ API only; the C API mirrors it (Rust bindings).
  • Versioned names, RegistryInfo::features for discovery.

Fixes

  • RpcClient: invalid iterator on timeout of an answered call, reply/timeout race.
  • TimeProvider: deadlock on CallWithTimeout without time sync.

Outlook

Extension Mechanism
Simulation run lifecycle (session management) Management topics/RPCs; registry needs participant states
Remote kill a participant RPC, registry to participant command, capability gated
Acceptor URIs from tools (e.g. container runtimes) RPC, registry rewrites URIs in KnownParticipants
Configuration per simulation URI (remote logging, trace and replay, ...) RPC, delivered at handshake, capability gated

Lets tools observe a registry: simulations, connected and required
participants, and their configurations. Opt-in.

- Registry: Experimental.Management.Enable hosts sil-kit-registry in
  the simulation .well-known/sil-kit/management.
- Topics for registry info and simulations state, RPCs GetInfo,
  GetSimulations, GetParticipantConfiguration. Versioned names.
- Participants: Experimental.Management.ShareConfiguration sends the
  config to the registry on join. Wire format unchanged if unset.
- Client: header-only C++ ManagementClient and C API
  SilKit_Experimental_ManagementClient_*.
- Demo: SilKitDemoManagementClient prints simulations as they change.
- Fix: RpcClient invalid iterator and reply/timeout race.
- Fix: TimeProvider deadlock on CallWithTimeout without time sync.
- Tests, docs, changelog.

Signed-off-by: Marius Börschig <Marius.Boerschig@vector.com>
@MariusBgm MariusBgm added the status: design proposal New design or API. Needs a design review and an agreement on the direction. label Nov 23, 2026
@MariusBgm

Copy link
Copy Markdown
Collaborator Author

@snps-fricke @snps-kratz / CC @KonradBreitsprecherBkd this is the very first rough draft of a management API that lives in the registry process (server side) and is available as a standaline "management client" participant.

CI failures

Signed-off-by: Marius Börschig <Marius.Boerschig@vector.com>

This branch has not been deployed

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

Labels

status: design proposal New design or API. Needs a design review and an agreement on the direction.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant