-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathapi.proto
More file actions
872 lines (751 loc) · 23.5 KB
/
api.proto
File metadata and controls
872 lines (751 loc) · 23.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
syntax = "proto3";
package nri.pkg.api.v1alpha1;
option go_package = "github.com/containerd/nri/pkg/api;api";
// Runtime service is the public API runtimes expose for NRI plugins.
// On this interface RPC requests are initiated by the plugin. This
// only covers plugin registration and unsolicited container updates.
// The rest of the API is defined by the Plugin service.
service Runtime {
// RegisterPlugin registers the plugin with the runtime.
rpc RegisterPlugin(RegisterPluginRequest) returns (Empty);
// UpdateContainers requests unsolicited updates to a set of containers.
rpc UpdateContainers(UpdateContainersRequest) returns (UpdateContainersResponse);
}
message RegisterPluginRequest {
// Name of the plugin to register.
string plugin_name = 1;
// Plugin invocation index. Plugins are called in ascending index order.
string plugin_idx = 2;
// NRI (module) version used by plugin, if known.
string NRI_version = 3;
}
message UpdateContainersRequest {
// List of containers to update.
repeated ContainerUpdate update = 1;
// List of containers to evict.
repeated ContainerEviction evict = 2;
}
message UpdateContainersResponse {
// Containers that the runtime failed to update.
repeated ContainerUpdate failed = 1;
}
//
// Plugin is the API NRI uses to interact with plugins. It is used to
// - configure a plugin and subscribe it for lifecycle events
// - synchronize the state of a plugin with that of the runtime
// - hook a plugin into the lifecycle events of its interest
//
// During configuration the plugin tells the runtime which lifecycle events
// it wishes to get hooked into. Once configured, the plugin is synchronized
// with the runtime by receiving the list of pods and containers known to
// the runtime. The plugin can request changes to any of the containers in
// response. After initial synchronization the plugin starts receiving the
// events it subscribed for as they occur in the runtime. For container
// creation, update, and stop events, the plugin can request changes, both
// to the container that triggered the event or any other existing container
// in the runtime.
//
// For a subset of the container lifecycle events, NRI defines an additional
// Post-variant of the event. These variants are defined for CreateContainer,
// StartContainer, and UpdateContainer. For creation and update, these events
// can be used by plugins to discover the full extent of changes applied to
// the container, including any changes made by other active plugins.
//
// go:plugin type=plugin version=1
service Plugin {
// Configure the plugin and get its event subscription.
rpc Configure(ConfigureRequest) returns (ConfigureResponse);
// Synchronize the plugin with the state of the runtime.
rpc Synchronize(SynchronizeRequest) returns (SynchronizeResponse);
// Shutdown a plugin (let it know the runtime is going down).
rpc Shutdown(Empty) returns (Empty);
// RunPodSandbox relays the corresponding request to the plugin.
rpc RunPodSandbox(RunPodSandboxRequest) returns (RunPodSandboxResponse);
// UpdatePodSandbox relays the corresponding request to the plugin.
rpc UpdatePodSandbox(UpdatePodSandboxRequest) returns (UpdatePodSandboxResponse);
// PostUpdatePodSandbox relays the corresponding request to the plugin.
rpc PostUpdatePodSandbox(PostUpdatePodSandboxRequest) returns (PostUpdatePodSandboxResponse);
// StopPodSandbox relays the corresponding request to the plugin.
rpc StopPodSandbox(StopPodSandboxRequest) returns (StopPodSandboxResponse);
// RemovePodSandbox relays the corresponding request to the plugin.
rpc RemovePodSandbox(RemovePodSandboxRequest) returns (RemovePodSandboxResponse);
// CreateContainer relays the corresponding request to the plugin. In
// response, the plugin can adjust the container being created, and
// update other containers in the runtime. Container adjustment can
// alter labels, annotations, mounts, devices, environment variables,
// OCI hooks, and assigned container resources. Updates can alter
// assigned container resources.
rpc CreateContainer(CreateContainerRequest) returns (CreateContainerResponse);
// PostCreateContainer relays the corresponding container request to the plugin.
rpc PostCreateContainer(PostCreateContainerRequest) returns (PostCreateContainerResponse);
// StartContainer relays the corresponding container request to the plugin.
rpc StartContainer(StartContainerRequest) returns (StartContainerResponse);
// PostStartContainer relays the corresponding container request to the plugin.
rpc PostStartContainer(PostStartContainerRequest) returns (PostStartContainerResponse);
// UpdateContainer relays the corresponding request to the plugin.
// The plugin can alter how the container is updated and request updates
// to additional containers in the runtime.
rpc UpdateContainer(UpdateContainerRequest) returns (UpdateContainerResponse);
// PostUpdateContainer relays the corresponding container request to the plugin.
rpc PostUpdateContainer(PostUpdateContainerRequest) returns (PostUpdateContainerResponse);
// StopContainer relays the corresponding request to the plugin. The plugin
// can update any of the remaining containers in the runtime in response.
rpc StopContainer(StopContainerRequest) returns (StopContainerResponse);
// RemoveContainer relays the corresponding container request to the plugin.
rpc RemoveContainer(RemoveContainerRequest) returns (RemoveContainerResponse);
// StateChange relays any remaining pod or container lifecycle/state change
// events the plugin has subscribed for. These can be used to trigger any
// plugin-specific processing which needs to occur in connection with any of
// these events.
rpc StateChange(StateChangeEvent) returns (Empty);
// ValidateContainerAdjustment relays a container adjustment validation request
// to the plugin. Container creation will fail the plugin rejects the adjustments.
rpc ValidateContainerAdjustment(ValidateContainerAdjustmentRequest) returns (ValidateContainerAdjustmentResponse);
}
// go:plugin type=host
service HostFunctions {
// Log displays a log message
rpc Log(LogRequest) returns (Empty) {}
}
message LogRequest {
string msg = 1;
enum Level {
LEVEL_UNSPECIFIED = 0;
LEVEL_DEBUG = 1;
LEVEL_INFO = 2;
LEVEL_WARN = 3;
LEVEL_ERROR = 4;
}
Level level = 2;
}
message ConfigureRequest {
// Any plugin-specific data, if present among the NRI configuration.
string config = 1;
// Name of the runtime NRI is running in.
string runtime_name = 2;
// Version of the runtime NRI is running in.
string runtime_version = 3;
// Configured registration timeout in milliseconds.
int64 registration_timeout = 4;
// Configured request processing timeout in milliseconds.
int64 request_timeout = 5;
// Version of NRI used by the runtime.
string NRI_version = 6;
}
message ConfigureResponse {
// Events to subscribe the plugin for. Each bit set corresponds to an
// enumerated Event.
int32 events = 2;
}
message SynchronizeRequest {
// Pods known to the runtime.
repeated PodSandbox pods = 1;
// Containers known to the runtime.
repeated Container containers = 2;
// Whether there are more pods and containers to follow.
bool more = 3;
}
message SynchronizeResponse {
// Updates to containers requested by the plugin.
repeated ContainerUpdate update = 1;
// Whether the client is able to handle more advertised pods and containers.
bool more = 2;
}
message RunPodSandboxRequest {
// Pod being created.
PodSandbox pod = 1;
}
message RunPodSandboxResponse{}
message UpdatePodSandboxRequest {
// Pod being updated.
PodSandbox pod = 1;
// Overhead associated with this pod.
LinuxResources overhead_linux_resources = 2;
// Sum of container resources for this pod.
LinuxResources linux_resources = 3;
}
message UpdatePodSandboxResponse {}
message PostUpdatePodSandboxRequest {
// Updated pod.
PodSandbox pod = 1;
}
message PostUpdatePodSandboxResponse {}
message StopPodSandboxRequest {
// Pod being stopped.
PodSandbox pod = 1;
}
message StopPodSandboxResponse{}
message RemovePodSandboxRequest {
// Pod being removed.
PodSandbox pod = 1;
}
message RemovePodSandboxResponse{}
message CreateContainerRequest {
// Pod of container being created.
PodSandbox pod = 1;
// Container being created.
Container container = 2;
}
message CreateContainerResponse {
// Requested adjustments to container being created.
ContainerAdjustment adjust = 1;
// Requested updates to other existing containers.
repeated ContainerUpdate update = 2;
// Requested eviction of existing containers.
repeated ContainerEviction evict = 3;
}
message PostCreateContainerRequest {
// Pod of created container.
PodSandbox pod = 1;
// Created container.
Container container = 2;
}
message PostCreateContainerResponse{}
message StartContainerRequest {
// Pod of container being started.
PodSandbox pod = 1;
// Container being started.
Container container = 2;
}
message StartContainerResponse {}
message PostStartContainerRequest {
// Pod of started container.
PodSandbox pod = 1;
// Started container.
Container container = 2;
}
message PostStartContainerResponse {}
message UpdateContainerRequest {
// Pod of container being updated.
PodSandbox pod = 1;
// Container being updated.
Container container = 2;
// Resources to update.
LinuxResources linux_resources = 3;
}
message UpdateContainerResponse {
// Requested updates to containers.
repeated ContainerUpdate update = 1;
// Requested eviction of containers.
repeated ContainerEviction evict = 2;
}
message PostUpdateContainerRequest {
// Pod of updated container.
PodSandbox pod = 1;
// Updated container.
Container container = 2;
}
message PostUpdateContainerResponse {}
message StopContainerRequest {
// Pod of container being stopped.
PodSandbox pod = 1;
// Container being stopped.
Container container = 2;
}
message StopContainerResponse {
// Requested updates to containers.
repeated ContainerUpdate update = 1;
}
message RemoveContainerRequest {
// Pod of removed container.
PodSandbox pod = 1;
// Removed container.
Container container = 2;
}
message RemoveContainerResponse {}
message StateChangeEvent {
// Event type of notification.
Event event = 1;
// Pod this notification is sent for. If this event is related to a container,
// pod is set to the pod of the container.
PodSandbox pod = 2;
// Container this notification is sent for. If the event is related to a pod,
// container is nil.
Container container = 3;
}
message ValidateContainerAdjustmentRequest {
// Pod of container being adjusted.
PodSandbox pod = 1;
// Container being adjusted in its pristine state.
Container container = 2;
// Pending container adjustments.
ContainerAdjustment adjust = 3;
// Pending updates to other containers.
repeated ContainerUpdate update = 4;
// Plugins that made the adjustments and updates.
OwningPlugins owners = 5;
// Plugins consulted for adjustments and updates.
repeated PluginInstance plugins = 6;
}
message PluginInstance {
string name = 1;
string index = 2;
}
message ValidateContainerAdjustmentResponse {
bool reject = 1;
string reason = 2;
}
// Empty response for those *Requests that are semantically events.
message Empty {}
// Events that plugins can subscribe to in ConfigureResponse.
enum Event {
UNKNOWN = 0;
RUN_POD_SANDBOX = 1;
STOP_POD_SANDBOX = 2;
REMOVE_POD_SANDBOX = 3;
CREATE_CONTAINER = 4;
POST_CREATE_CONTAINER = 5;
START_CONTAINER = 6;
POST_START_CONTAINER = 7;
UPDATE_CONTAINER = 8;
POST_UPDATE_CONTAINER = 9;
STOP_CONTAINER = 10;
REMOVE_CONTAINER = 11;
UPDATE_POD_SANDBOX = 12;
POST_UPDATE_POD_SANDBOX = 13;
VALIDATE_CONTAINER_ADJUSTMENT = 14;
LAST = 15;
}
// Pod metadata that is considered relevant for a plugin.
message PodSandbox {
string id = 1;
string name = 2;
string uid = 3;
string namespace = 4;
map<string, string> labels = 5;
map<string, string> annotations = 6;
string runtime_handler = 7;
LinuxPodSandbox linux = 8;
uint32 pid = 9; // for NRI v1 emulation
repeated string ips = 10;
}
// PodSandbox linux-specific metadata
message LinuxPodSandbox {
LinuxResources pod_overhead = 1;
LinuxResources pod_resources = 2;
string cgroup_parent = 3;
string cgroups_path = 4; // for NRI v1 emulation
repeated LinuxNamespace namespaces = 5; // for NRI v1 emulation
LinuxResources resources = 6; // for NRI v1 emulation
}
// Container metadata that is considered relevant for a plugin.
message Container {
string id = 1;
string pod_sandbox_id = 2;
string name = 3;
ContainerState state = 4;
map<string, string> labels = 5;
map<string, string> annotations = 6;
repeated string args = 7;
repeated string env = 8;
repeated Mount mounts = 9;
Hooks hooks = 10;
LinuxContainer linux = 11;
uint32 pid = 12; // for NRI v1 emulation
repeated POSIXRlimit rlimits = 13;
int64 created_at = 14;
int64 started_at = 15;
int64 finished_at = 16;
int32 exit_code = 17;
string status_reason = 18;
string status_message = 19;
repeated CDIDevice CDI_devices = 20;
User user = 21;
}
// Possible container states.
enum ContainerState {
CONTAINER_UNKNOWN = 0;
CONTAINER_CREATED = 1;
CONTAINER_PAUSED = 2; // is this useful/necessary ?
CONTAINER_RUNNING = 3;
CONTAINER_STOPPED = 4;
}
// A container mount.
message Mount {
string destination = 1;
string type = 2;
string source = 3;
repeated string options = 4;
}
// Container OCI hooks.
message Hooks {
repeated Hook prestart = 1;
repeated Hook create_runtime = 2;
repeated Hook create_container = 3;
repeated Hook start_container = 4;
repeated Hook poststart = 5;
repeated Hook poststop = 6;
}
// One OCI hook.
message Hook {
string path = 1;
repeated string args = 2;
repeated string env = 3;
OptionalInt timeout = 4;
}
// Container (linux) metadata.
message LinuxContainer {
repeated LinuxNamespace namespaces = 1;
repeated LinuxDevice devices = 2;
LinuxResources resources = 3;
OptionalInt oom_score_adj = 4;
string cgroups_path = 5;
LinuxIOPriority io_priority = 6;
SecurityProfile seccomp_profile = 7;
LinuxSeccomp seccomp_policy = 8;
map<string, string> sysctl = 9;
map<string, LinuxNetDevice> net_devices = 10;
LinuxScheduler scheduler = 11;
LinuxRdt rdt = 12;
}
// A linux namespace.
message LinuxNamespace {
string type = 1;
string path = 2;
}
// A container (linux) device.
message LinuxDevice {
string path = 1;
string type = 2;
int64 major = 3;
int64 minor = 4;
OptionalFileMode file_mode = 5;
OptionalUInt32 uid = 6;
OptionalUInt32 gid = 7;
}
// A linux device cgroup controller rule.
message LinuxDeviceCgroup {
bool allow = 1;
string type = 2;
OptionalInt64 major = 3;
OptionalInt64 minor = 4;
string access = 5;
}
// A CDI device reference.
message CDIDevice {
string name = 1;
}
// User and group IDs for the container.
message User {
uint32 uid = 1;
uint32 gid = 2;
repeated uint32 additional_gids = 3;
}
// Container (linux) resources.
message LinuxResources {
LinuxMemory memory = 1;
LinuxCPU cpu = 2;
repeated HugepageLimit hugepage_limits = 3;
OptionalString blockio_class = 4;
OptionalString rdt_class = 5;
map<string, string> unified = 6;
repeated LinuxDeviceCgroup devices = 7; // for NRI v1 emulation
LinuxPids pids = 8;
}
// Memory-related parts of (linux) resources.
message LinuxMemory {
OptionalInt64 limit = 1;
OptionalInt64 reservation = 2;
OptionalInt64 swap = 3;
OptionalInt64 kernel = 4;
OptionalInt64 kernel_tcp = 5;
OptionalUInt64 swappiness = 6;
OptionalBool disable_oom_killer = 7;
OptionalBool use_hierarchy = 8;
}
// CPU-related parts of (linux) resources.
message LinuxCPU {
OptionalUInt64 shares = 1;
OptionalInt64 quota = 2;
OptionalUInt64 period = 3;
OptionalInt64 realtime_runtime = 4;
OptionalUInt64 realtime_period = 5;
string cpus = 6;
string mems = 7;
}
// Container huge page limit.
message HugepageLimit {
string page_size = 1;
uint64 limit = 2;
}
// SecurityProfile for container.
message SecurityProfile {
enum ProfileType {
RUNTIME_DEFAULT = 0;
UNCONFINED = 1;
LOCALHOST = 2;
}
ProfileType profile_type = 1;
string localhost_ref = 2;
}
// Container rlimits
message POSIXRlimit {
string type = 1;
uint64 hard = 2;
uint64 soft = 3;
}
// Pids-related parts of (linux) resources.
message LinuxPids {
int64 limit = 1;
}
message LinuxIOPriority {
// Scheduling class of the IO priority.
IOPrioClass class = 1;
// The value of the IO priority.
int32 priority = 2;
}
enum IOPrioClass {
IOPRIO_CLASS_NONE = 0;
IOPRIO_CLASS_RT = 1;
IOPRIO_CLASS_BE = 2;
IOPRIO_CLASS_IDLE = 3;
}
// A linux network device.
message LinuxNetDevice {
string name = 1;
}
// Linux process scheduling attributes.
message LinuxScheduler {
LinuxSchedulerPolicy policy = 1;
int32 nice = 2;
int32 priority = 3;
repeated LinuxSchedulerFlag flags = 4;
uint64 runtime = 5;
uint64 deadline = 6;
uint64 period = 7;
}
// Linux scheduling policies.
enum LinuxSchedulerPolicy {
SCHED_NONE = 0;
SCHED_OTHER = 1;
SCHED_FIFO = 2;
SCHED_RR = 3;
SCHED_BATCH = 4;
SCHED_ISO = 5;
SCHED_IDLE = 6;
SCHED_DEADLINE = 7;
}
enum LinuxSchedulerFlag {
SCHED_FLAG_RESET_ON_FORK = 0;
SCHED_FLAG_RECLAIM = 1;
SCHED_FLAG_DL_OVERRUN = 2;
SCHED_FLAG_KEEP_POLICY = 3;
SCHED_FLAG_KEEP_PARAMS = 4;
SCHED_FLAG_UTIL_CLAMP_MIN = 5;
SCHED_FLAG_UTIL_CLAMP_MAX = 6;
}
// Requested adjustments to a container being created.
message ContainerAdjustment {
map<string, string> annotations = 2;
repeated Mount mounts = 3;
repeated KeyValue env = 4;
Hooks hooks = 5;
LinuxContainerAdjustment linux = 6;
repeated POSIXRlimit rlimits = 7;
repeated CDIDevice CDI_devices = 8;
repeated string args = 9;
}
// Adjustments to (linux) resources.
message LinuxContainerAdjustment {
repeated LinuxDevice devices = 1;
LinuxResources resources = 2;
string cgroups_path = 3;
OptionalInt oom_score_adj = 4;
LinuxIOPriority io_priority = 5;
LinuxSeccomp seccomp_policy = 6;
repeated LinuxNamespace namespaces = 7;
map<string, string> sysctl = 8;
map<string,LinuxNetDevice> net_devices = 9;
LinuxScheduler scheduler = 10;
LinuxRdt rdt = 11;
LinuxMemoryPolicy memory_policy = 12;
}
message LinuxSeccomp {
string default_action = 1;
OptionalUInt32 default_errno = 2;
repeated string architectures = 3;
repeated string flags = 4;
string listener_path = 5;
string listener_metadata = 6;
repeated LinuxSyscall syscalls = 7;
}
message LinuxSyscall {
repeated string names = 1;
string action = 2;
OptionalUInt32 errno_ret = 3;
repeated LinuxSeccompArg args = 4;
}
message LinuxSeccompArg {
uint32 index = 1;
uint64 value = 2;
uint64 value_two = 3;
string op = 4;
}
// Memory policy of a container being created.
message LinuxMemoryPolicy {
MpolMode mode = 1;
string nodes = 2;
repeated MpolFlag flags = 3;
}
enum MpolMode {
MPOL_DEFAULT = 0;
MPOL_PREFERRED = 1;
MPOL_BIND = 2;
MPOL_INTERLEAVE = 3;
MPOL_LOCAL = 4;
MPOL_PREFERRED_MANY = 5;
MPOL_WEIGHTED_INTERLEAVE = 6;
}
enum MpolFlag {
MPOL_F_STATIC_NODES = 0;
MPOL_F_RELATIVE_NODES = 1;
MPOL_F_NUMA_BALANCING = 2;
}
// Requested update to an already created container.
message ContainerUpdate {
string container_id = 1;
LinuxContainerUpdate linux = 2;
bool ignore_failure = 3;
}
// Updates to (linux) resources.
message LinuxContainerUpdate {
LinuxResources resources = 1;
}
// Request to evict (IOW unsolicitedly stop) a container.
message ContainerEviction {
// Container to evict.
string container_id = 1;
// Human-readable reason for eviction.
string reason = 2;
}
message LinuxRdt {
OptionalString clos_id = 1;
OptionalRepeatedString schemata = 2;
OptionalBool enable_monitoring = 3;
// NRI specific field to mark the RDT config for removal.
bool remove = 4;
}
// KeyValue represents an environment variable.
message KeyValue {
string key = 1;
string value = 2;
}
// An optional string value.
message OptionalString {
string value = 1;
}
// An optional collection of strings.
message OptionalRepeatedString {
repeated string value = 1;
}
// An optional signed integer value.
message OptionalInt {
int64 value = 1;
}
// An optional 32-bit signed integer value.
message OptionalInt32 {
int32 value = 1;
}
// An optional 32-bit unsigned integer value.
message OptionalUInt32 {
uint32 value = 1;
}
// An optional 64-bit signed integer value.
message OptionalInt64 {
int64 value = 1;
}
// An optional 64-bit unsigned integer value.
message OptionalUInt64 {
uint64 value = 1;
}
// An optional boolean value.
message OptionalBool {
bool value = 1;
}
// An optional value of file permissions.
message OptionalFileMode {
uint32 value = 1;
}
// CompoundFieldOwners tracks 'plugin ownership' of compound fields
// which can be adjusted entry by entry, typically maps or slices.
// It is used to track ownership for annotations, mounts, devices,
// environment variables, hugepage limits, etc. The key identifies
// the owned entry (annotation key, mount destination, device path,
// environment variable name, etc.). The value is the owning plugin.
message CompoundFieldOwners {
map<string, string> owners = 1;
}
// FieldOwners tracks field 'plugin ownership' for a single container.
// Keys represent adjustable fields of a container. For simple fields,
// the value is the plugin that last modified the field. For compound
// fields, the value is a CompoundFieldOwners which provides tracking
// 'plugin ownership' per field for compound data, typically maps and
// slices. Field enum values are used to index both maps, using Key()
// to get the int32 for the Field.
message FieldOwners {
map<int32, string> simple = 1;
map<int32, CompoundFieldOwners> compound = 2;
}
// OwningPlugins tracks field 'plugin ownership' for multiple containers.
// The string keys are container IDs. The values are FieldOwners which
// track 'plugin ownership' per adjustable field for the container.
message OwningPlugins {
map<string, FieldOwners> owners = 1;
}
// Field enumerates all fields that can be adjusted by plugins.
enum Field {
None = 0;
Annotations = 1;
Mounts = 2;
OciHooks = 3;
Devices = 4;
CdiDevices = 5;
Env = 6;
Args = 7;
MemLimit = 8;
MemReservation = 9;
MemSwapLimit = 10;
MemKernelLimit = 11;
MemTCPLimit = 12;
MemSwappiness = 13;
MemDisableOomKiller = 14;
MemUseHierarchy = 15;
CPUShares = 16;
CPUQuota = 17;
CPUPeriod = 18;
CPURealtimeRuntime = 19;
CPURealtimePeriod = 20;
CPUSetCPUs = 21;
CPUSetMems = 22;
PidsLimit = 23;
HugepageLimits = 24;
BlockioClass = 25;
RdtClass = 26;
CgroupsUnified = 27;
CgroupsPath = 28;
OomScoreAdj = 29;
Rlimits = 30;
IoPriority = 31;
SeccompPolicy = 32;
Namespace = 33;
Sysctl = 34;
LinuxNetDevices = 35;
// protoc scoping rules: calling this LinuxScheduler would conflict with message.
LinuxSched = 36;
RdtClosID = 37;
RdtSchemata = 38;
RdtEnableMonitoring = 39;
MemoryPolicy = 40;
}