Dobby 3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
Loading...
Searching...
No Matches
IDobbySettings.h
1/*
2* If not stated otherwise in this file or this component's LICENSE file the
3* following copyright and licenses apply:
4*
5* Copyright 2020 Sky UK
6*
7* Licensed under the Apache License, Version 2.0 (the "License");
8* you may not use this file except in compliance with the License.
9* You may obtain a copy of the License at
10*
11* http://www.apache.org/licenses/LICENSE-2.0
12*
13* Unless required by applicable law or agreed to in writing, software
14* distributed under the License is distributed on an "AS IS" BASIS,
15* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16* See the License for the specific language governing permissions and
17* limitations under the License.
18*/
19/*
20 * File: IDobbySettings.h
21 *
22 */
23#ifndef IDOBBYSETTINGS_H
24#define IDOBBYSETTINGS_H
25
26#include <memory>
27#include <string>
28#include <list>
29#include <vector>
30#include <map>
31#include <set>
32#include <netinet/in.h>
33
34#if defined(RDK)
35# include <json/json.h>
36#else
37# include <jsoncpp/json.h>
38#endif
39
40// -----------------------------------------------------------------------------
50{
51public:
52 virtual ~IDobbySettings() = default;
53
54public:
55 // -------------------------------------------------------------------------
69 virtual std::string workspaceDir() const = 0;
70
71 // -------------------------------------------------------------------------
78 virtual std::string persistentDir() const = 0;
79
80
81 // -------------------------------------------------------------------------
89 virtual std::map<std::string, std::string> extraEnvVariables() const = 0;
90
91 // -------------------------------------------------------------------------
97 virtual std::string consoleSocketPath() const = 0;
98
99public:
100 // -------------------------------------------------------------------------
107 {
108 std::string source;
109 std::string target;
110 std::string type;
111 std::set<std::string> flags;
112 };
113
114 // -------------------------------------------------------------------------
137 {
138 std::list<std::string> deviceNodes;
139 std::set<int> groupIds;
140 std::list<ExtraMount> extraMounts;
141 std::map<std::string, std::string> extraEnvVariables;
142 };
143
144 // -------------------------------------------------------------------------
150 virtual std::shared_ptr<HardwareAccessSettings> gpuAccessSettings() const = 0;
151
152 // -------------------------------------------------------------------------
158 virtual std::shared_ptr<HardwareAccessSettings> vpuAccessSettings() const = 0;
159
160 // -------------------------------------------------------------------------
168 virtual std::vector<std::string> externalInterfaces() const = 0;
169
170 // -------------------------------------------------------------------------
177 virtual std::string addressRangeStr() const = 0;
178
179 // -------------------------------------------------------------------------
186 virtual in_addr_t addressRange() const = 0;
187
188 // -------------------------------------------------------------------------
196 virtual std::vector<std::string> defaultPlugins() const = 0;
197
198 virtual Json::Value rdkPluginsData() const = 0;
199
201 {
202 bool syslogEnabled;
203 bool journaldEnabled;
204
205 std::string syslogSocketPath;
206 std::string journaldSocketPath;
207 };
208
209 virtual LogRelaySettings logRelaySettings() const = 0;
210
211 // -------------------------------------------------------------------------
223 {
224 std::string logsDir;
225 std::vector<std::string> apps;
226 };
227
228 virtual StraceSettings straceSettings() const = 0;
229
230 // -------------------------------------------------------------------------
241 {
242 bool enabled;
243 std::string profileName;
244 };
245
246 virtual ApparmorSettings apparmorSettings() const = 0;
247
248 // -------------------------------------------------------------------------
261 {
262 bool enabled;
263 int limit;
264 };
265
266 virtual PidsSettings pidsSettings() const = 0;
267};
268
269#endif // !defined(IDOBBYSETTINGS_H)
Interface provided to the library at startup, contains the configuration options for Dobby.
Definition IDobbySettings.h:50
virtual std::string addressRangeStr() const =0
Returns the Dobby network address range in string format.
virtual std::map< std::string, std::string > extraEnvVariables() const =0
A list of extra environment variables that will be set for all containers.
virtual std::shared_ptr< HardwareAccessSettings > vpuAccessSettings() const =0
Returns any extra details needed to access the VPU (video pipeline) inside the container.
virtual std::vector< std::string > externalInterfaces() const =0
Returns the set of external interface that container traffic maybe routed through.
virtual std::string consoleSocketPath() const =0
Location to create the socket used for capturing container logs.
virtual in_addr_t addressRange() const =0
Returns the Dobby network address range in in_addr_t format.
virtual std::vector< std::string > defaultPlugins() const =0
Returns any default plugins the platform should run.
virtual std::shared_ptr< HardwareAccessSettings > gpuAccessSettings() const =0
Returns any extra details needed to access the GPU inside the container.
virtual std::string workspaceDir() const =0
Should return the path to a directory used to store temporary data like runc bundles.
virtual std::string persistentDir() const =0
Should return a path to a directory on a persistent storage mount.
Definition IDobbySettings.h:241
Definition IDobbySettings.h:107
Definition IDobbySettings.h:137
Definition IDobbySettings.h:201
Definition IDobbySettings.h:261
Definition IDobbySettings.h:223