Skip to content

POSIX supervisor / Remote context RPC mechanism#159

Draft
casaroli wants to merge 19 commits intomainfrom
posix-ipc
Draft

POSIX supervisor / Remote context RPC mechanism#159
casaroli wants to merge 19 commits intomainfrom
posix-ipc

Conversation

@casaroli
Copy link
Contributor

@casaroli casaroli commented Feb 5, 2026

Description

Experimental Work in Progress!

This will require some refactor before we can merge.

Supervisor support on POSIX.

For this, we need a way to remote control the context. This is done by using CBOR with sockets to make a RPC mechanism.

TODO

  • zcbor
  • fix build system short-circuits
  • add initial client
  • add initial server
  • ocre-common library with container id checker
  • Version system (client/server)
  • System tests (with IPC on POSIX)
  • ocred cmdline arguments (workdir, socket)
  • server can do unix domain sockets
  • client can do unix domain sockets
  • handle wait (server blocking call)
  • fix race condition in waiter
  • handle non-detached container
  • server support multiple clients (poll)
  • handle interrupt from client
  • all relevant system tests should pass
  • CI
  • posix supervisor documentation
  • fix message framing (handle partial reads) (CBOR-in-CBOR)
  • error checking / propagation to client
  • refactor cbor IPC protocol (so it can be unit tested)
  • cbor IPC protocol unit testing

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update
  • CI system update
  • Test Coverage update

How Has This Been Tested?

System tests should be added to test this in the CI

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Future / out of scope

  • protocol documentation
  • handle remote images (even download)
  • multiple control sockets
  • zephyr support
  • use heap instead of stack for strings
  • log redirection
  • server can do TCP/IP
  • client can do TCP/IP
  • ocred pidfile
  • client verbose mode
  • split supervisor into "daemon" (posix supervisor) and "daemonless" (zephyr supervisor + posix static check)

@casaroli casaroli force-pushed the posix-ipc branch 2 times, most recently from 2ff5ca5 to ddd75d9 Compare February 5, 2026 22:12
@casaroli casaroli changed the title Posix ipc POSIX supervisor / Remote context RPC mechanism Feb 5, 2026
@casaroli casaroli force-pushed the posix-ipc branch 7 times, most recently from d61b708 to d268aa7 Compare February 10, 2026 12:39
@casaroli casaroli linked an issue Feb 10, 2026 that may be closed by this pull request
@casaroli casaroli force-pushed the posix-ipc branch 8 times, most recently from 7461dc3 to d1ebf1b Compare February 18, 2026 15:49
@casaroli casaroli mentioned this pull request Feb 18, 2026
9 tasks
@casaroli casaroli force-pushed the posix-ipc branch 5 times, most recently from 600ff2b to 3eb066a Compare February 18, 2026 18:22
We will use CBOR as the serialization mechanism for making IPC
between ocre-cli and ocred.

This is only useful for MPU systems like Linux, and not Zephyr.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Initial draft of the RPC mechanism so that we can manage remote
contexts.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
The socket thread will be used in pthread_join, but the run thread
must be detached, and will not be joined.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.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.

Implement POSIX Supervisor sample application

1 participant