Commit f9502b5
committed
[hyperactor] skeleton for mesh controller behavior
Pull Request resolved: #1729
# Basic idea: meshes are just resources like any other
The idea is that we treat meshes like any other resource. We define a common behavior for mesh controllers.
We stand up a controller actor, and ActorMesh::allocate, ProcMesh::spawn, ActorMesh::spawn, etc. -- all they do is issue a CreateOrUpdate. (This makes them nonblocking -- which is our eventual goal -- but we have a few more things to do before we're fully ready for this.)
We can now query states, etc., by just calling GetState on the *mesh* resource. This is managed by the controller, and returns immediately (nonblocking). The controller is responsible for polling/pushing/keepaliving the underlying resources.
# Supervision events
The mesh controller can "raise" supervision events in the following way: when we create a resource, we include a "supervisor". The controller synthesizes and then pushes supervision events to this port. In effect, any time a rank in a mesh enters non-running status, we generate a supervision event. The controller keeps track of which events have been raised so as to not duplicate them.
# Rationale
Having a common resource model is very powerful. For one, it establishes a clean separation of concerns (controller responsible for managing a mesh vs. the owner of the mesh), and it allows us to build common tooling for managing all mesh types centered around a common interface (the mesh resource behavior). It also means that 1) we can have common tooling for *all* resources (a mesh is now named just by its controller actor+Name, and we can query it like any other resource, e.g., with `hyper`); 2) it integrates cleanly with observability / "Monarchy".
ghstack-source-id: 322923566
@exported-using-ghexport
Differential Revision: [D85982104](https://our.internmc.facebook.com/intern/diff/D85982104/)
**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D85982104/)!1 parent e0920bb commit f9502b5
2 files changed
+55
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
0 commit comments