-
Notifications
You must be signed in to change notification settings - Fork 17
EbbRT System Interface (Proposal)
This document proposes organizing the distributed system components of EbbRT
behind a shared ebbrt:sys
namespace. The interfaces, objects, and Ebbs
included in the ebbrt:sys
namespace would be those responsible for cross-node and system-wide actions.
In particular, the following existing Ebbs would be moved/reorganized
under the ebbrt::sys
namespace:
- NodeAllocator
- PoolAllocator
- Runtime
- Messenger
- GlobalIdMap
Instead of exposing one or many static Ebb references (e.g.,
ebbrt::node_allocator->Alloc()
), a standard set of system-wide actions will be made available via static interfaces, included by a single header: (#include <ebbrt/Sys.h>
).
These methods will not replace the functionality of any existing Ebbs (like those listed above). Instead, the "system" methods with implemented using existing static EbbRef
s. Existing ebbs will be still accessed directly by programmers through the appropriate headers (e.g., #include <ebbrt/sys/NodeAllocator.h
)
ebbrt::sys::GetNodeCount();
ebbrt::sys::GetNodeInfo(nid);
ebbrt::sys::GetSysInfo();
ebbrt::sys::AllocateNode(ninfo);
ebbrt::sys::AllocateNodeSet(ninfo, count);
ebbrt::sys::ReleaseNode(nid);
ebbrt::sys::ReleaseNodeSet(vector<nid>);
ebbrt::sys::IdMap::Set(EbbId, val);
ebbrt::sys::IdMap::Get(EbbId);
Globally accessible system information (read-only):
- total_native_nodes
- total_hosted_nodes
- total_cpu
- total_ram
Node-specific information (read-only)
- nid
- type {native,hosted}
- has_frontend
- frontend_ip
- local_cpu
- local_ram
Standard I/O streams that are shared across all nodes.
By default, system-wide out and error streams are forwarded (via Messenger) to the stdin and stderr of the hosted front-end process (otherwise, to the local node's stdout/stderr). The could be configurable at a system level.
#include <ebbrt/Sys.h>
void Foo( int bar ){
if( bar < 0 ){
ebbrt::sys::cerr << "Warning: negative bar" << std::endl;
}
ebbrt::sys::cout << "We have " << bar << " bars" << std::endl;
}
An endl
would trigger the stream to flush and send the message
Not yet sure how/if sys::cin
should work...
An possible extension to the standard system I/O is a simple log interface, which will dump messages to system's stdout but with node-specific tag.
// this code executes on native node bringup
ebbrt::sys::log << "Finish Boot" << std::endl;
if( ebbrt::sys::GetMyNodeId() == 3 ){
ebbrt::sys::log << "Ok!" << std::endl;
}
As each nodes boots the stdout on the front-end would appear as follows:
syslog[node 1]: Finished Boot
syslog[node 3]: Finished Boot
syslog[node 3]: Ok!
syslog[node 2]: Finished Boot
syslog[node 4]: Finished Boot