Dobby 3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
|
Factory that spawns the DobbyDaemon and supplies a proxy to it. More...
#include <DobbyFactory.h>
Public Member Functions | |
DobbyFactory (const std::shared_ptr< AI_IPC::IIpcService > &ipcService) | |
void | setWorkspacePath (const std::string &path) |
void | setFlashMountPath (const std::string &path) |
void | setPlatformIdent (const std::string &platformIdent) |
void | setPlatformType (const std::string &platformType) |
void | setPlatformModel (const std::string &platformModel) |
std::shared_ptr< IDobbyProxy > | getProxy () |
Starts the Dobby 'Hypervisor' daemon and returns a proxy object. | |
Private Member Functions | |
bool | startDobbyDaemon () |
Starts the Dobby 'Hypervisor' daemon. | |
bool | pingDobbyDaemon () |
Sends pings to the Dobby 'Hypervisor' daemon until a pong is received or we timeout. | |
Private Attributes | |
std::mutex | mLock |
std::string | mWorkspacePath |
std::string | mFlashMountPath |
std::string | mPlatformIdent |
std::string | mPlatformType |
std::string | mPlatformModel |
std::shared_ptr< AI_IPC::IIpcService > | mIpcService |
std::shared_ptr< IDobbyProxy > | mProxy |
Factory that spawns the DobbyDaemon and supplies a proxy to it.
The setters on the factory should be called prior to the getProxy call, this is because the paths and platform ident is passed to the daemon when it is launched.
std::shared_ptr< IDobbyProxy > DobbyFactory::getProxy | ( | ) |
Starts the Dobby 'Hypervisor' daemon and returns a proxy object.
The function first tries to the start the daemon using Upstart, if this fails we're in trouble and just returns an invalid proxy.
If the daemon did start then we try and open a connection to it, if that was successful we wrap it in a proxy object and return that. The proxy is just a lightweight wrapper around the dbus method calls into the daemon.
|
private |
Sends pings to the Dobby 'Hypervisor' daemon until a pong is received or we timeout.
This sends ping method calls to the daemon and waits for a second for a reply, we do this for 60 seconds before giving up.
This method shouldn't be required, but we've seen timeouts at start-up and this is an attempt to recover.
|
private |