dodo
0.0.1
A C++ library to create containerized Linux services
|
Dodo is a C++ framework to integrate seamlessly with Docker containers and k8s (kubernetes), hiding much of the red tape, as well as providing frameworks for typical demands such as DNS resolving, TLS-enabled TCP services, REST services, database accces and so on.
C++ offers high capability/requirement ratio, perfect for microservices.
Dodo applies c++17 features. It relies on and assumes the STL by using STL primitives such as std::string in interfaces. A dodo install comprises a bunch of header files and a shared library to which applications or 'services' are linked.
This is a pet project. Do not take it too seriously.
The dodo::common::Application
reads its run-time configuration from a YAML file, typically presented to the container as a ConfigMap. Framework objects can be iniltialized (constructed) with a YAML document fragment, so the application can retrieve its runtime configuration from a single source.
An dodo::common::Application
instance implicitly installs signal handlers that are triggered on container stop requests, allowing the application to shutdown cleanly.
Logging (dodo::common::Logger
) is implicit and can be configured to write to one or more of these targets:
Docker healthchecks that run an in-container command (such as pidof myservice
) are expensive on CPU, especially if the healthchecks need to be frequent or there are a lot of pods. The dodo::common::Application class starts a tiny TCP healthcheck listener (dodo::common::Application::HealthChecker) that responds to network-probes by the Docker host, which is much more efficient. The HealthChecker stops reponding when the Application exits.
Most services will require at least some of the functionality dodo provides as high-level C++ abstractions without compromising low-level C/Linux performance.
dodo::common::Bytes
datatype used as primitive by dodo interfaces.See the developer manual for an overview.
The source code is documented for Doxygen and automatically generated to github pages.
See the maintainer manual for an overview.
If installed to a location outside the system library paths, set the LD_LIBRARY_PATH
to <CMAKE_INSTALL_PREFIX>/lib
.
In the configured build directory
target | build command | What |
---|---|---|
all | cmake --build . | builds the dodo library, examples and tests |
dodo | cmake --build . --target dodo | Only builds libdodo.so |
doc | cmake --build . --target doc | Creates the doxygen documentation in ./doxygen/html . |
cppcheck | cmake --build . --target cppcheck | Run cppcheck code quality check |
A multistage build example (src/examples/docker/minideb/Dockerfile).