Dobby  3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
RtSchedulingPlugin.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 #ifndef RTSCHEDULINGPLUGIN_H
21 #define RTSCHEDULINGPLUGIN_H
22 
23 #include <RdkPluginBase.h>
24 
39 {
40 public:
41  RtSchedulingPlugin(std::shared_ptr<rt_dobby_schema> &containerConfig,
42  const std::shared_ptr<DobbyRdkPluginUtils> &utils,
43  const std::string &rootfsPath);
44 
45 public:
46  inline std::string name() const override
47  {
48  return mName;
49  };
50 
51  unsigned hookHints() const override;
52 
53 public:
54  bool postInstallation() override;
55  bool createRuntime() override;
56 
57 public:
58  std::vector<std::string> getDependencies() const override;
59 
60 private:
61  const std::string mName;
62  const std::shared_ptr<DobbyRdkPluginUtils> mUtils;
63  std::shared_ptr<rt_dobby_schema> mConfig;
64  const std::string mRootfsPath;
65 };
66 
67 #endif // !defined(RTSCHEDULINGPLUGIN_H)
Basic object that provides the default overrides for a plugin.
Definition: RdkPluginBase.h:34
Dobby RtScheduling plugin.
Definition: RtSchedulingPlugin.h:39
bool postInstallation() override
Adds the default value to RLIMIT_RTPRIO in the OCI config file.
Definition: RtSchedulingPlugin.cpp:60
std::string name() const override
Should return the name of the plugin.
Definition: RtSchedulingPlugin.h:46
unsigned hookHints() const override
Should return a bitfield of the hook points implemented by the plugin.
Definition: RtSchedulingPlugin.cpp:46
bool createRuntime() override
Sets the RT scheduling priority on the container's init process.
Definition: RtSchedulingPlugin.cpp:117
std::vector< std::string > getDependencies() const override
Should return the names of the plugins this plugin depends on.
Definition: RtSchedulingPlugin.cpp:174