This is an automated email from the ASF dual-hosted git repository.
bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
The following commit(s) were added to refs/heads/master by this push:
new 043c6aa8c [device manager] Add device state file path helper.
043c6aa8c is described below
commit 043c6aa8c76c997354a6a46cb0823db6dcbde91e
Author: Jason Zhou <[email protected]>
AuthorDate: Wed Aug 7 14:40:41 2024 -0400
[device manager] Add device state file path helper.
Currently we do not have a place to keep the checkpoint file for the
device manager.
This patch adds a path helper that gives us a file that lets us
checkpoint the device manager state.
Review: https://reviews.apache.org/r/75142/
---
src/slave/containerizer/device_manager/state.proto | 6 +++---
src/slave/paths.cpp | 7 +++++++
src/slave/paths.hpp | 3 +++
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/slave/containerizer/device_manager/state.proto
b/src/slave/containerizer/device_manager/state.proto
index 5b7ab36c3..1272cf595 100644
--- a/src/slave/containerizer/device_manager/state.proto
+++ b/src/slave/containerizer/device_manager/state.proto
@@ -18,11 +18,11 @@ syntax = "proto2";
package mesos.internal.slave;
-message CgroupDeviceAccessMessage {
+message CgroupDeviceAccessState {
repeated string allow_list = 1;
repeated string deny_list = 2;
}
-message CgroupsDeviceAccess {
- map<string, CgroupDeviceAccessMessage> device_access_per_cgroup = 1;
+message CgroupDeviceAccessStates {
+ map<string, CgroupDeviceAccessState> device_access_per_cgroup = 1;
}
\ No newline at end of file
diff --git a/src/slave/paths.cpp b/src/slave/paths.cpp
index 3e44b636c..79f1b537e 100644
--- a/src/slave/paths.cpp
+++ b/src/slave/paths.cpp
@@ -72,6 +72,7 @@ const char RESOURCES_TARGET_FILE[] = "resources.target";
const char RESOURCE_PROVIDER_STATE_FILE[] = "resource_provider.state";
const char OPERATION_UPDATES_FILE[] = "operation.updates";
const char VOLUME_GIDS_FILE[] = "volume_gids";
+const char DEVICE_STATE_FILE[] = "device.state";
const char CONTAINERS_DIR[] = "containers";
@@ -809,6 +810,12 @@ string getVolumeGidsPath(const string& rootDir)
}
+string getDevicesStatePath(const string& rootDir)
+{
+ return path::join(rootDir, "device_manager", DEVICE_STATE_FILE);
+}
+
+
Try<string> createExecutorDirectory(
const string& rootDir,
const SlaveID& slaveId,
diff --git a/src/slave/paths.hpp b/src/slave/paths.hpp
index 7d43e9c01..4307d2f1d 100644
--- a/src/slave/paths.hpp
+++ b/src/slave/paths.hpp
@@ -457,6 +457,9 @@ std::string getPersistentVolumePath(
std::string getVolumeGidsPath(const std::string& rootDir);
+std::string getDevicesStatePath(const std::string& rootDir);
+
+
Try<std::string> createExecutorDirectory(
const std::string& rootDir,
const SlaveID& slaveId,