diff --git a/hack/update-generated-agent-proto.sh b/hack/update-generated-agent-proto.sh new file mode 100755 index 0000000000..14e10fac5e --- /dev/null +++ b/hack/update-generated-agent-proto.sh @@ -0,0 +1,6 @@ +# +# Copyright 2017 HyperHQ Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# +protoc --proto_path=protocols/grpc --go_out=plugins=grpc:protocols/grpc protocols/grpc/hyperstart.proto protocols/grpc/oci.proto diff --git a/protocols/grpc/config.json b/protocols/grpc/config.json new file mode 100644 index 0000000000..b027e6346d --- /dev/null +++ b/protocols/grpc/config.json @@ -0,0 +1,586 @@ +{ + "ociVersion": "1.0.0", + "process": { + "user": { + "uid": 0, + "gid": 0 + }, + "args": [ + "sh" + ], + "env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "TERM=xterm" + ], + "cwd": "/", + "capabilities": { + "bounding": [ + "CAP_CHOWN", + "CAP_DAC_OVERRIDE", + "CAP_FSETID", + "CAP_FOWNER", + "CAP_MKNOD", + "CAP_NET_RAW", + "CAP_SETGID", + "CAP_SETUID", + "CAP_SETFCAP", + "CAP_SETPCAP", + "CAP_NET_BIND_SERVICE", + "CAP_SYS_CHROOT", + "CAP_KILL", + "CAP_AUDIT_WRITE" + ], + "effective": [ + "CAP_CHOWN", + "CAP_DAC_OVERRIDE", + "CAP_FSETID", + "CAP_FOWNER", + "CAP_MKNOD", + "CAP_NET_RAW", + "CAP_SETGID", + "CAP_SETUID", + "CAP_SETFCAP", + "CAP_SETPCAP", + "CAP_NET_BIND_SERVICE", + "CAP_SYS_CHROOT", + "CAP_KILL", + "CAP_AUDIT_WRITE" + ], + "inheritable": [ + "CAP_CHOWN", + "CAP_DAC_OVERRIDE", + "CAP_FSETID", + "CAP_FOWNER", + "CAP_MKNOD", + "CAP_NET_RAW", + "CAP_SETGID", + "CAP_SETUID", + "CAP_SETFCAP", + "CAP_SETPCAP", + "CAP_NET_BIND_SERVICE", + "CAP_SYS_CHROOT", + "CAP_KILL", + "CAP_AUDIT_WRITE" + ], + "permitted": [ + "CAP_CHOWN", + "CAP_DAC_OVERRIDE", + "CAP_FSETID", + "CAP_FOWNER", + "CAP_MKNOD", + "CAP_NET_RAW", + "CAP_SETGID", + "CAP_SETUID", + "CAP_SETFCAP", + "CAP_SETPCAP", + "CAP_NET_BIND_SERVICE", + "CAP_SYS_CHROOT", + "CAP_KILL", + "CAP_AUDIT_WRITE" + ], + "ambient": [ + "CAP_CHOWN", + "CAP_DAC_OVERRIDE", + "CAP_FSETID", + "CAP_FOWNER", + "CAP_MKNOD", + "CAP_NET_RAW", + "CAP_SETGID", + "CAP_SETUID", + "CAP_SETFCAP", + "CAP_SETPCAP", + "CAP_NET_BIND_SERVICE", + "CAP_SYS_CHROOT", + "CAP_KILL", + "CAP_AUDIT_WRITE" + ] + }, + "rlimits": [ + { + "type": "RLIMIT_NOFILE", + "hard": 1024, + "soft": 1024 + } + ] + }, + "root": { + "path": "rootfs" + }, + "hostname": "mrsdalloway", + "mounts": [ + { + "destination": "/proc", + "type": "proc", + "source": "proc" + }, + { + "destination": "/dev", + "type": "tmpfs", + "source": "tmpfs", + "options": [ + "nosuid", + "strictatime", + "mode=755", + "size=65536k" + ] + }, + { + "destination": "/dev/pts", + "type": "devpts", + "source": "devpts", + "options": [ + "nosuid", + "noexec", + "newinstance", + "ptmxmode=0666", + "mode=0620", + "gid=5" + ] + }, + { + "destination": "/dev/shm", + "type": "tmpfs", + "source": "shm", + "options": [ + "nosuid", + "noexec", + "nodev", + "mode=1777", + "size=65536k" + ] + }, + { + "destination": "/dev/mqueue", + "type": "mqueue", + "source": "mqueue", + "options": [ + "nosuid", + "noexec", + "nodev" + ] + }, + { + "destination": "/sys", + "type": "sysfs", + "source": "sysfs", + "options": [ + "nosuid", + "noexec", + "nodev", + "ro" + ] + } + ], + "linux": { + "resources": { + "devices": [ + { + "allow": false, + "access": "rwm" + } + ], + "blockIO": { + "weight": 32, + "leafWeight": 33, + "weightDevice": [ + { + "major": 10, + "minor": 11, + "weight": 64, + "leafWeight": 128 + } + ] + } + }, + "namespaces": [ + { + "type": "pid" + }, + { + "type": "network" + }, + { + "type": "ipc" + }, + { + "type": "uts" + }, + { + "type": "mount" + } + ], + "seccomp": { + "defaultAction": "SCMP_ACT_ERRNO", + "architectures": [ + "SCMP_ARCH_X86_64", + "SCMP_ARCH_X86", + "SCMP_ARCH_X32" + ], + "syscalls": [ + { + "names": [ + "accept", + "accept4", + "access", + "alarm", + "bind", + "brk", + "capget", + "capset", + "chdir", + "chmod", + "chown", + "chown32", + "clock_getres", + "clock_gettime", + "clock_nanosleep", + "close", + "connect", + "copy_file_range", + "creat", + "dup", + "dup2", + "dup3", + "epoll_create", + "epoll_create1", + "epoll_ctl", + "epoll_ctl_old", + "epoll_pwait", + "epoll_wait", + "epoll_wait_old", + "eventfd", + "eventfd2", + "execve", + "execveat", + "exit", + "exit_group", + "faccessat", + "fadvise64", + "fadvise64_64", + "fallocate", + "fanotify_mark", + "fchdir", + "fchmod", + "fchmodat", + "fchown", + "fchown32", + "fchownat", + "fcntl", + "fcntl64", + "fdatasync", + "fgetxattr", + "flistxattr", + "flock", + "fork", + "fremovexattr", + "fsetxattr", + "fstat", + "fstat64", + "fstatat64", + "fstatfs", + "fstatfs64", + "fsync", + "ftruncate", + "ftruncate64", + "futex", + "futimesat", + "getcpu", + "getcwd", + "getdents", + "getdents64", + "getegid", + "getegid32", + "geteuid", + "geteuid32", + "getgid", + "getgid32", + "getgroups", + "getgroups32", + "getitimer", + "getpeername", + "getpgid", + "getpgrp", + "getpid", + "getppid", + "getpriority", + "getrandom", + "getresgid", + "getresgid32", + "getresuid", + "getresuid32", + "getrlimit", + "get_robust_list", + "getrusage", + "getsid", + "getsockname", + "getsockopt", + "get_thread_area", + "gettid", + "gettimeofday", + "getuid", + "getuid32", + "getxattr", + "inotify_add_watch", + "inotify_init", + "inotify_init1", + "inotify_rm_watch", + "io_cancel", + "ioctl", + "io_destroy", + "io_getevents", + "ioprio_get", + "ioprio_set", + "io_setup", + "io_submit", + "ipc", + "kill", + "lchown", + "lchown32", + "lgetxattr", + "link", + "linkat", + "listen", + "listxattr", + "llistxattr", + "_llseek", + "lremovexattr", + "lseek", + "lsetxattr", + "lstat", + "lstat64", + "madvise", + "memfd_create", + "mincore", + "mkdir", + "mkdirat", + "mknod", + "mknodat", + "mlock", + "mlock2", + "mlockall", + "mmap", + "mmap2", + "mprotect", + "mq_getsetattr", + "mq_notify", + "mq_open", + "mq_timedreceive", + "mq_timedsend", + "mq_unlink", + "mremap", + "msgctl", + "msgget", + "msgrcv", + "msgsnd", + "msync", + "munlock", + "munlockall", + "munmap", + "nanosleep", + "newfstatat", + "_newselect", + "open", + "openat", + "pause", + "pipe", + "pipe2", + "poll", + "ppoll", + "prctl", + "pread64", + "preadv", + "prlimit64", + "pselect6", + "pwrite64", + "pwritev", + "read", + "readahead", + "readlink", + "readlinkat", + "readv", + "recv", + "recvfrom", + "recvmmsg", + "recvmsg", + "remap_file_pages", + "removexattr", + "rename", + "renameat", + "renameat2", + "restart_syscall", + "rmdir", + "rt_sigaction", + "rt_sigpending", + "rt_sigprocmask", + "rt_sigqueueinfo", + "rt_sigreturn", + "rt_sigsuspend", + "rt_sigtimedwait", + "rt_tgsigqueueinfo", + "sched_getaffinity", + "sched_getattr", + "sched_getparam", + "sched_get_priority_max", + "sched_get_priority_min", + "sched_getscheduler", + "sched_rr_get_interval", + "sched_setaffinity", + "sched_setattr", + "sched_setparam", + "sched_setscheduler", + "sched_yield", + "seccomp", + "select", + "semctl", + "semget", + "semop", + "semtimedop", + "send", + "sendfile", + "sendfile64", + "sendmmsg", + "sendmsg", + "sendto", + "setfsgid", + "setfsgid32", + "setfsuid", + "setfsuid32", + "setgid", + "setgid32", + "setgroups", + "setgroups32", + "setitimer", + "setpgid", + "setpriority", + "setregid", + "setregid32", + "setresgid", + "setresgid32", + "setresuid", + "setresuid32", + "setreuid", + "setreuid32", + "setrlimit", + "set_robust_list", + "setsid", + "setsockopt", + "set_thread_area", + "set_tid_address", + "setuid", + "setuid32", + "setxattr", + "shmat", + "shmctl", + "shmdt", + "shmget", + "shutdown", + "sigaltstack", + "signalfd", + "signalfd4", + "sigreturn", + "socket", + "socketcall", + "socketpair", + "splice", + "stat", + "stat64", + "statfs", + "statfs64", + "symlink", + "symlinkat", + "sync", + "sync_file_range", + "syncfs", + "sysinfo", + "syslog", + "tee", + "tgkill", + "time", + "timer_create", + "timer_delete", + "timerfd_create", + "timerfd_gettime", + "timerfd_settime", + "timer_getoverrun", + "timer_gettime", + "timer_settime", + "times", + "tkill", + "truncate", + "truncate64", + "ugetrlimit", + "umask", + "uname", + "unlink", + "unlinkat", + "utime", + "utimensat", + "utimes", + "vfork", + "vmsplice", + "wait4", + "waitid", + "waitpid", + "write", + "writev" + ], + "action": "SCMP_ACT_ALLOW" + }, + { + "names": [ + "personality" + ], + "action": "SCMP_ACT_ALLOW", + "args": [ + { + "index": 0, + "value": 0, + "op": "SCMP_CMP_EQ" + }, + { + "index": 0, + "value": 8, + "op": "SCMP_CMP_EQ" + }, + { + "index": 0, + "value": 4294967295, + "op": "SCMP_CMP_EQ" + } + ] + }, + { + "names": [ + "chroot" + ], + "action": "SCMP_ACT_ALLOW" + }, + { + "names": [ + "clone" + ], + "action": "SCMP_ACT_ALLOW", + "args": [ + { + "index": 0, + "value": 2080505856, + "op": "SCMP_CMP_MASKED_EQ" + } + ] + }, + { + "names": [ + "arch_prctl" + ], + "action": "SCMP_ACT_ALLOW" + }, + { + "names": [ + "modify_ldt" + ], + "action": "SCMP_ACT_ALLOW" + } + ] + } + } +} diff --git a/protocols/grpc/hyperstart.pb.go b/protocols/grpc/hyperstart.pb.go new file mode 100644 index 0000000000..d928310677 --- /dev/null +++ b/protocols/grpc/hyperstart.pb.go @@ -0,0 +1,1286 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: hyperstart.proto + +/* +Package grpc is a generated protocol buffer package. + +It is generated from these files: + hyperstart.proto + oci.proto + +It has these top-level messages: + CreateContainerRequest + StartContainerRequest + ExecProcessRequest + SignalProcessRequest + WaitProcessRequest + WaitProcessResponse + WriteStreamRequest + WriteStreamResponse + ReadStreamRequest + ReadStreamResponse + CloseStdinRequest + TtyWinResizeRequest + StartSandboxRequest + DestroySandboxRequest + IpAddress + UpdateInterfaceRequest + AddRouteRequest + OnlineCPUMemRequest + Storage + StringUser + Route + Spec + Process + Box + User + LinuxCapabilities + POSIXRlimit + Mount + Root + Hooks + Hook + Linux + Windows + Solaris + LinuxIDMapping + LinuxNamespace + LinuxDevice + LinuxResources + LinuxMemory + LinuxCPU + LinuxWeightDevice + LinuxThrottleDevice + LinuxBlockIO + LinuxPids + LinuxDeviceCgroup + LinuxNetwork + LinuxHugepageLimit + LinuxInterfacePriority + LinuxSeccomp + LinuxSeccompArg + LinuxSyscall + LinuxIntelRdt +*/ +package grpc + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_protobuf "github.com/golang/protobuf/ptypes/empty" + +import ( + context "golang.org/x/net/context" + grpc1 "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type CreateContainerRequest struct { + ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId" json:"container_id,omitempty"` + StringUser *StringUser `protobuf:"bytes,2,opt,name=string_user,json=stringUser" json:"string_user,omitempty"` + Storages []*Storage `protobuf:"bytes,3,rep,name=storages" json:"storages,omitempty"` + OCI *Spec `protobuf:"bytes,4,opt,name=OCI" json:"OCI,omitempty"` +} + +func (m *CreateContainerRequest) Reset() { *m = CreateContainerRequest{} } +func (m *CreateContainerRequest) String() string { return proto.CompactTextString(m) } +func (*CreateContainerRequest) ProtoMessage() {} +func (*CreateContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *CreateContainerRequest) GetContainerId() string { + if m != nil { + return m.ContainerId + } + return "" +} + +func (m *CreateContainerRequest) GetStringUser() *StringUser { + if m != nil { + return m.StringUser + } + return nil +} + +func (m *CreateContainerRequest) GetStorages() []*Storage { + if m != nil { + return m.Storages + } + return nil +} + +func (m *CreateContainerRequest) GetOCI() *Spec { + if m != nil { + return m.OCI + } + return nil +} + +type StartContainerRequest struct { + ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId" json:"container_id,omitempty"` +} + +func (m *StartContainerRequest) Reset() { *m = StartContainerRequest{} } +func (m *StartContainerRequest) String() string { return proto.CompactTextString(m) } +func (*StartContainerRequest) ProtoMessage() {} +func (*StartContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *StartContainerRequest) GetContainerId() string { + if m != nil { + return m.ContainerId + } + return "" +} + +type ExecProcessRequest struct { + ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId" json:"container_id,omitempty"` + StringUser *StringUser `protobuf:"bytes,2,opt,name=string_user,json=stringUser" json:"string_user,omitempty"` + Process *Process `protobuf:"bytes,3,opt,name=process" json:"process,omitempty"` +} + +func (m *ExecProcessRequest) Reset() { *m = ExecProcessRequest{} } +func (m *ExecProcessRequest) String() string { return proto.CompactTextString(m) } +func (*ExecProcessRequest) ProtoMessage() {} +func (*ExecProcessRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *ExecProcessRequest) GetContainerId() string { + if m != nil { + return m.ContainerId + } + return "" +} + +func (m *ExecProcessRequest) GetStringUser() *StringUser { + if m != nil { + return m.StringUser + } + return nil +} + +func (m *ExecProcessRequest) GetProcess() *Process { + if m != nil { + return m.Process + } + return nil +} + +type SignalProcessRequest struct { + ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId" json:"container_id,omitempty"` + ProcessId string `protobuf:"bytes,2,opt,name=process_id,json=processId" json:"process_id,omitempty"` + Signal uint32 `protobuf:"varint,3,opt,name=signal" json:"signal,omitempty"` +} + +func (m *SignalProcessRequest) Reset() { *m = SignalProcessRequest{} } +func (m *SignalProcessRequest) String() string { return proto.CompactTextString(m) } +func (*SignalProcessRequest) ProtoMessage() {} +func (*SignalProcessRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *SignalProcessRequest) GetContainerId() string { + if m != nil { + return m.ContainerId + } + return "" +} + +func (m *SignalProcessRequest) GetProcessId() string { + if m != nil { + return m.ProcessId + } + return "" +} + +func (m *SignalProcessRequest) GetSignal() uint32 { + if m != nil { + return m.Signal + } + return 0 +} + +type WaitProcessRequest struct { + ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId" json:"container_id,omitempty"` + ProcessId string `protobuf:"bytes,2,opt,name=process_id,json=processId" json:"process_id,omitempty"` +} + +func (m *WaitProcessRequest) Reset() { *m = WaitProcessRequest{} } +func (m *WaitProcessRequest) String() string { return proto.CompactTextString(m) } +func (*WaitProcessRequest) ProtoMessage() {} +func (*WaitProcessRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *WaitProcessRequest) GetContainerId() string { + if m != nil { + return m.ContainerId + } + return "" +} + +func (m *WaitProcessRequest) GetProcessId() string { + if m != nil { + return m.ProcessId + } + return "" +} + +type WaitProcessResponse struct { + Status int32 `protobuf:"varint,1,opt,name=status" json:"status,omitempty"` +} + +func (m *WaitProcessResponse) Reset() { *m = WaitProcessResponse{} } +func (m *WaitProcessResponse) String() string { return proto.CompactTextString(m) } +func (*WaitProcessResponse) ProtoMessage() {} +func (*WaitProcessResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *WaitProcessResponse) GetStatus() int32 { + if m != nil { + return m.Status + } + return 0 +} + +type WriteStreamRequest struct { + ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId" json:"container_id,omitempty"` + ProcessId string `protobuf:"bytes,2,opt,name=process_id,json=processId" json:"process_id,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *WriteStreamRequest) Reset() { *m = WriteStreamRequest{} } +func (m *WriteStreamRequest) String() string { return proto.CompactTextString(m) } +func (*WriteStreamRequest) ProtoMessage() {} +func (*WriteStreamRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *WriteStreamRequest) GetContainerId() string { + if m != nil { + return m.ContainerId + } + return "" +} + +func (m *WriteStreamRequest) GetProcessId() string { + if m != nil { + return m.ProcessId + } + return "" +} + +func (m *WriteStreamRequest) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +type WriteStreamResponse struct { + Len uint32 `protobuf:"varint,1,opt,name=len" json:"len,omitempty"` +} + +func (m *WriteStreamResponse) Reset() { *m = WriteStreamResponse{} } +func (m *WriteStreamResponse) String() string { return proto.CompactTextString(m) } +func (*WriteStreamResponse) ProtoMessage() {} +func (*WriteStreamResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *WriteStreamResponse) GetLen() uint32 { + if m != nil { + return m.Len + } + return 0 +} + +type ReadStreamRequest struct { + ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId" json:"container_id,omitempty"` + ProcessId string `protobuf:"bytes,2,opt,name=process_id,json=processId" json:"process_id,omitempty"` + Len uint32 `protobuf:"varint,3,opt,name=len" json:"len,omitempty"` +} + +func (m *ReadStreamRequest) Reset() { *m = ReadStreamRequest{} } +func (m *ReadStreamRequest) String() string { return proto.CompactTextString(m) } +func (*ReadStreamRequest) ProtoMessage() {} +func (*ReadStreamRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *ReadStreamRequest) GetContainerId() string { + if m != nil { + return m.ContainerId + } + return "" +} + +func (m *ReadStreamRequest) GetProcessId() string { + if m != nil { + return m.ProcessId + } + return "" +} + +func (m *ReadStreamRequest) GetLen() uint32 { + if m != nil { + return m.Len + } + return 0 +} + +type ReadStreamResponse struct { + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *ReadStreamResponse) Reset() { *m = ReadStreamResponse{} } +func (m *ReadStreamResponse) String() string { return proto.CompactTextString(m) } +func (*ReadStreamResponse) ProtoMessage() {} +func (*ReadStreamResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *ReadStreamResponse) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +type CloseStdinRequest struct { + ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId" json:"container_id,omitempty"` + ProcessId string `protobuf:"bytes,2,opt,name=process_id,json=processId" json:"process_id,omitempty"` +} + +func (m *CloseStdinRequest) Reset() { *m = CloseStdinRequest{} } +func (m *CloseStdinRequest) String() string { return proto.CompactTextString(m) } +func (*CloseStdinRequest) ProtoMessage() {} +func (*CloseStdinRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *CloseStdinRequest) GetContainerId() string { + if m != nil { + return m.ContainerId + } + return "" +} + +func (m *CloseStdinRequest) GetProcessId() string { + if m != nil { + return m.ProcessId + } + return "" +} + +type TtyWinResizeRequest struct { + ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId" json:"container_id,omitempty"` + ProcessId string `protobuf:"bytes,2,opt,name=process_id,json=processId" json:"process_id,omitempty"` + Row uint32 `protobuf:"varint,3,opt,name=row" json:"row,omitempty"` + Column uint32 `protobuf:"varint,4,opt,name=column" json:"column,omitempty"` +} + +func (m *TtyWinResizeRequest) Reset() { *m = TtyWinResizeRequest{} } +func (m *TtyWinResizeRequest) String() string { return proto.CompactTextString(m) } +func (*TtyWinResizeRequest) ProtoMessage() {} +func (*TtyWinResizeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *TtyWinResizeRequest) GetContainerId() string { + if m != nil { + return m.ContainerId + } + return "" +} + +func (m *TtyWinResizeRequest) GetProcessId() string { + if m != nil { + return m.ProcessId + } + return "" +} + +func (m *TtyWinResizeRequest) GetRow() uint32 { + if m != nil { + return m.Row + } + return 0 +} + +func (m *TtyWinResizeRequest) GetColumn() uint32 { + if m != nil { + return m.Column + } + return 0 +} + +type StartSandboxRequest struct { + Hostname string `protobuf:"bytes,1,opt,name=hostname" json:"hostname,omitempty"` + Dns []string `protobuf:"bytes,2,rep,name=dns" json:"dns,omitempty"` + Storages []*Storage `protobuf:"bytes,3,rep,name=storages" json:"storages,omitempty"` +} + +func (m *StartSandboxRequest) Reset() { *m = StartSandboxRequest{} } +func (m *StartSandboxRequest) String() string { return proto.CompactTextString(m) } +func (*StartSandboxRequest) ProtoMessage() {} +func (*StartSandboxRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *StartSandboxRequest) GetHostname() string { + if m != nil { + return m.Hostname + } + return "" +} + +func (m *StartSandboxRequest) GetDns() []string { + if m != nil { + return m.Dns + } + return nil +} + +func (m *StartSandboxRequest) GetStorages() []*Storage { + if m != nil { + return m.Storages + } + return nil +} + +type DestroySandboxRequest struct { +} + +func (m *DestroySandboxRequest) Reset() { *m = DestroySandboxRequest{} } +func (m *DestroySandboxRequest) String() string { return proto.CompactTextString(m) } +func (*DestroySandboxRequest) ProtoMessage() {} +func (*DestroySandboxRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +type IpAddress struct { + Address string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + Mask string `protobuf:"bytes,2,opt,name=mask" json:"mask,omitempty"` +} + +func (m *IpAddress) Reset() { *m = IpAddress{} } +func (m *IpAddress) String() string { return proto.CompactTextString(m) } +func (*IpAddress) ProtoMessage() {} +func (*IpAddress) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *IpAddress) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *IpAddress) GetMask() string { + if m != nil { + return m.Mask + } + return "" +} + +type UpdateInterfaceRequest struct { + Type uint64 `protobuf:"varint,1,opt,name=type" json:"type,omitempty"` + Device string `protobuf:"bytes,2,opt,name=device" json:"device,omitempty"` + NewName string `protobuf:"bytes,3,opt,name=newName" json:"newName,omitempty"` + IpAddresses []*IpAddress `protobuf:"bytes,4,rep,name=ipAddresses" json:"ipAddresses,omitempty"` + Mtu uint64 `protobuf:"varint,5,opt,name=mtu" json:"mtu,omitempty"` +} + +func (m *UpdateInterfaceRequest) Reset() { *m = UpdateInterfaceRequest{} } +func (m *UpdateInterfaceRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateInterfaceRequest) ProtoMessage() {} +func (*UpdateInterfaceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *UpdateInterfaceRequest) GetType() uint64 { + if m != nil { + return m.Type + } + return 0 +} + +func (m *UpdateInterfaceRequest) GetDevice() string { + if m != nil { + return m.Device + } + return "" +} + +func (m *UpdateInterfaceRequest) GetNewName() string { + if m != nil { + return m.NewName + } + return "" +} + +func (m *UpdateInterfaceRequest) GetIpAddresses() []*IpAddress { + if m != nil { + return m.IpAddresses + } + return nil +} + +func (m *UpdateInterfaceRequest) GetMtu() uint64 { + if m != nil { + return m.Mtu + } + return 0 +} + +type AddRouteRequest struct { + Routes []*Route `protobuf:"bytes,1,rep,name=routes" json:"routes,omitempty"` +} + +func (m *AddRouteRequest) Reset() { *m = AddRouteRequest{} } +func (m *AddRouteRequest) String() string { return proto.CompactTextString(m) } +func (*AddRouteRequest) ProtoMessage() {} +func (*AddRouteRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *AddRouteRequest) GetRoutes() []*Route { + if m != nil { + return m.Routes + } + return nil +} + +type OnlineCPUMemRequest struct { +} + +func (m *OnlineCPUMemRequest) Reset() { *m = OnlineCPUMemRequest{} } +func (m *OnlineCPUMemRequest) String() string { return proto.CompactTextString(m) } +func (*OnlineCPUMemRequest) ProtoMessage() {} +func (*OnlineCPUMemRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +type Storage struct { + Format string `protobuf:"bytes,1,opt,name=format" json:"format,omitempty"` + Source string `protobuf:"bytes,2,opt,name=source" json:"source,omitempty"` + Fstype string `protobuf:"bytes,3,opt,name=fstype" json:"fstype,omitempty"` + Options []string `protobuf:"bytes,4,rep,name=options" json:"options,omitempty"` + MountPoint string `protobuf:"bytes,5,opt,name=mount_point,json=mountPoint" json:"mount_point,omitempty"` +} + +func (m *Storage) Reset() { *m = Storage{} } +func (m *Storage) String() string { return proto.CompactTextString(m) } +func (*Storage) ProtoMessage() {} +func (*Storage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *Storage) GetFormat() string { + if m != nil { + return m.Format + } + return "" +} + +func (m *Storage) GetSource() string { + if m != nil { + return m.Source + } + return "" +} + +func (m *Storage) GetFstype() string { + if m != nil { + return m.Fstype + } + return "" +} + +func (m *Storage) GetOptions() []string { + if m != nil { + return m.Options + } + return nil +} + +func (m *Storage) GetMountPoint() string { + if m != nil { + return m.MountPoint + } + return "" +} + +type StringUser struct { + Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` + Gid string `protobuf:"bytes,2,opt,name=gid" json:"gid,omitempty"` + AdditionalGids []string `protobuf:"bytes,3,rep,name=additionalGids" json:"additionalGids,omitempty"` +} + +func (m *StringUser) Reset() { *m = StringUser{} } +func (m *StringUser) String() string { return proto.CompactTextString(m) } +func (*StringUser) ProtoMessage() {} +func (*StringUser) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *StringUser) GetUid() string { + if m != nil { + return m.Uid + } + return "" +} + +func (m *StringUser) GetGid() string { + if m != nil { + return m.Gid + } + return "" +} + +func (m *StringUser) GetAdditionalGids() []string { + if m != nil { + return m.AdditionalGids + } + return nil +} + +type Route struct { + Dest string `protobuf:"bytes,1,opt,name=dest" json:"dest,omitempty"` + Gateway string `protobuf:"bytes,2,opt,name=gateway" json:"gateway,omitempty"` + Device string `protobuf:"bytes,3,opt,name=device" json:"device,omitempty"` +} + +func (m *Route) Reset() { *m = Route{} } +func (m *Route) String() string { return proto.CompactTextString(m) } +func (*Route) ProtoMessage() {} +func (*Route) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +func (m *Route) GetDest() string { + if m != nil { + return m.Dest + } + return "" +} + +func (m *Route) GetGateway() string { + if m != nil { + return m.Gateway + } + return "" +} + +func (m *Route) GetDevice() string { + if m != nil { + return m.Device + } + return "" +} + +func init() { + proto.RegisterType((*CreateContainerRequest)(nil), "grpc.CreateContainerRequest") + proto.RegisterType((*StartContainerRequest)(nil), "grpc.StartContainerRequest") + proto.RegisterType((*ExecProcessRequest)(nil), "grpc.ExecProcessRequest") + proto.RegisterType((*SignalProcessRequest)(nil), "grpc.SignalProcessRequest") + proto.RegisterType((*WaitProcessRequest)(nil), "grpc.WaitProcessRequest") + proto.RegisterType((*WaitProcessResponse)(nil), "grpc.WaitProcessResponse") + proto.RegisterType((*WriteStreamRequest)(nil), "grpc.WriteStreamRequest") + proto.RegisterType((*WriteStreamResponse)(nil), "grpc.WriteStreamResponse") + proto.RegisterType((*ReadStreamRequest)(nil), "grpc.ReadStreamRequest") + proto.RegisterType((*ReadStreamResponse)(nil), "grpc.ReadStreamResponse") + proto.RegisterType((*CloseStdinRequest)(nil), "grpc.CloseStdinRequest") + proto.RegisterType((*TtyWinResizeRequest)(nil), "grpc.TtyWinResizeRequest") + proto.RegisterType((*StartSandboxRequest)(nil), "grpc.StartSandboxRequest") + proto.RegisterType((*DestroySandboxRequest)(nil), "grpc.DestroySandboxRequest") + proto.RegisterType((*IpAddress)(nil), "grpc.IpAddress") + proto.RegisterType((*UpdateInterfaceRequest)(nil), "grpc.UpdateInterfaceRequest") + proto.RegisterType((*AddRouteRequest)(nil), "grpc.AddRouteRequest") + proto.RegisterType((*OnlineCPUMemRequest)(nil), "grpc.OnlineCPUMemRequest") + proto.RegisterType((*Storage)(nil), "grpc.Storage") + proto.RegisterType((*StringUser)(nil), "grpc.StringUser") + proto.RegisterType((*Route)(nil), "grpc.Route") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc1.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc1.SupportPackageIsVersion4 + +// Client API for HyperstartService service + +type HyperstartServiceClient interface { + // execution + CreateContainer(ctx context.Context, in *CreateContainerRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) + StartContainer(ctx context.Context, in *StartContainerRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) + ExecProcess(ctx context.Context, in *ExecProcessRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) + SignalProcess(ctx context.Context, in *SignalProcessRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) + WaitProcess(ctx context.Context, in *WaitProcessRequest, opts ...grpc1.CallOption) (*WaitProcessResponse, error) + // stdio + WriteStdin(ctx context.Context, in *WriteStreamRequest, opts ...grpc1.CallOption) (*WriteStreamResponse, error) + ReadStdout(ctx context.Context, in *ReadStreamRequest, opts ...grpc1.CallOption) (*ReadStreamResponse, error) + ReadStderr(ctx context.Context, in *ReadStreamRequest, opts ...grpc1.CallOption) (*ReadStreamResponse, error) + CloseStdin(ctx context.Context, in *CloseStdinRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) + TtyWinResize(ctx context.Context, in *TtyWinResizeRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) + // misc (TODO: some rpcs can be replaced by hyperstart-exec) + StartSandbox(ctx context.Context, in *StartSandboxRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) + DestroySandbox(ctx context.Context, in *DestroySandboxRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) + UpdateInterface(ctx context.Context, in *UpdateInterfaceRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) + AddRoute(ctx context.Context, in *AddRouteRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) + OnlineCPUMem(ctx context.Context, in *OnlineCPUMemRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) +} + +type hyperstartServiceClient struct { + cc *grpc1.ClientConn +} + +func NewHyperstartServiceClient(cc *grpc1.ClientConn) HyperstartServiceClient { + return &hyperstartServiceClient{cc} +} + +func (c *hyperstartServiceClient) CreateContainer(ctx context.Context, in *CreateContainerRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + err := grpc1.Invoke(ctx, "/grpc.HyperstartService/CreateContainer", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperstartServiceClient) StartContainer(ctx context.Context, in *StartContainerRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + err := grpc1.Invoke(ctx, "/grpc.HyperstartService/StartContainer", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperstartServiceClient) ExecProcess(ctx context.Context, in *ExecProcessRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + err := grpc1.Invoke(ctx, "/grpc.HyperstartService/ExecProcess", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperstartServiceClient) SignalProcess(ctx context.Context, in *SignalProcessRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + err := grpc1.Invoke(ctx, "/grpc.HyperstartService/SignalProcess", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperstartServiceClient) WaitProcess(ctx context.Context, in *WaitProcessRequest, opts ...grpc1.CallOption) (*WaitProcessResponse, error) { + out := new(WaitProcessResponse) + err := grpc1.Invoke(ctx, "/grpc.HyperstartService/WaitProcess", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperstartServiceClient) WriteStdin(ctx context.Context, in *WriteStreamRequest, opts ...grpc1.CallOption) (*WriteStreamResponse, error) { + out := new(WriteStreamResponse) + err := grpc1.Invoke(ctx, "/grpc.HyperstartService/WriteStdin", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperstartServiceClient) ReadStdout(ctx context.Context, in *ReadStreamRequest, opts ...grpc1.CallOption) (*ReadStreamResponse, error) { + out := new(ReadStreamResponse) + err := grpc1.Invoke(ctx, "/grpc.HyperstartService/ReadStdout", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperstartServiceClient) ReadStderr(ctx context.Context, in *ReadStreamRequest, opts ...grpc1.CallOption) (*ReadStreamResponse, error) { + out := new(ReadStreamResponse) + err := grpc1.Invoke(ctx, "/grpc.HyperstartService/ReadStderr", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperstartServiceClient) CloseStdin(ctx context.Context, in *CloseStdinRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + err := grpc1.Invoke(ctx, "/grpc.HyperstartService/CloseStdin", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperstartServiceClient) TtyWinResize(ctx context.Context, in *TtyWinResizeRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + err := grpc1.Invoke(ctx, "/grpc.HyperstartService/TtyWinResize", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperstartServiceClient) StartSandbox(ctx context.Context, in *StartSandboxRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + err := grpc1.Invoke(ctx, "/grpc.HyperstartService/StartSandbox", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperstartServiceClient) DestroySandbox(ctx context.Context, in *DestroySandboxRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + err := grpc1.Invoke(ctx, "/grpc.HyperstartService/DestroySandbox", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperstartServiceClient) UpdateInterface(ctx context.Context, in *UpdateInterfaceRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + err := grpc1.Invoke(ctx, "/grpc.HyperstartService/UpdateInterface", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperstartServiceClient) AddRoute(ctx context.Context, in *AddRouteRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + err := grpc1.Invoke(ctx, "/grpc.HyperstartService/AddRoute", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperstartServiceClient) OnlineCPUMem(ctx context.Context, in *OnlineCPUMemRequest, opts ...grpc1.CallOption) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + err := grpc1.Invoke(ctx, "/grpc.HyperstartService/OnlineCPUMem", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for HyperstartService service + +type HyperstartServiceServer interface { + // execution + CreateContainer(context.Context, *CreateContainerRequest) (*google_protobuf.Empty, error) + StartContainer(context.Context, *StartContainerRequest) (*google_protobuf.Empty, error) + ExecProcess(context.Context, *ExecProcessRequest) (*google_protobuf.Empty, error) + SignalProcess(context.Context, *SignalProcessRequest) (*google_protobuf.Empty, error) + WaitProcess(context.Context, *WaitProcessRequest) (*WaitProcessResponse, error) + // stdio + WriteStdin(context.Context, *WriteStreamRequest) (*WriteStreamResponse, error) + ReadStdout(context.Context, *ReadStreamRequest) (*ReadStreamResponse, error) + ReadStderr(context.Context, *ReadStreamRequest) (*ReadStreamResponse, error) + CloseStdin(context.Context, *CloseStdinRequest) (*google_protobuf.Empty, error) + TtyWinResize(context.Context, *TtyWinResizeRequest) (*google_protobuf.Empty, error) + // misc (TODO: some rpcs can be replaced by hyperstart-exec) + StartSandbox(context.Context, *StartSandboxRequest) (*google_protobuf.Empty, error) + DestroySandbox(context.Context, *DestroySandboxRequest) (*google_protobuf.Empty, error) + UpdateInterface(context.Context, *UpdateInterfaceRequest) (*google_protobuf.Empty, error) + AddRoute(context.Context, *AddRouteRequest) (*google_protobuf.Empty, error) + OnlineCPUMem(context.Context, *OnlineCPUMemRequest) (*google_protobuf.Empty, error) +} + +func RegisterHyperstartServiceServer(s *grpc1.Server, srv HyperstartServiceServer) { + s.RegisterService(&_HyperstartService_serviceDesc, srv) +} + +func _HyperstartService_CreateContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc1.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateContainerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperstartServiceServer).CreateContainer(ctx, in) + } + info := &grpc1.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.HyperstartService/CreateContainer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperstartServiceServer).CreateContainer(ctx, req.(*CreateContainerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperstartService_StartContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc1.UnaryServerInterceptor) (interface{}, error) { + in := new(StartContainerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperstartServiceServer).StartContainer(ctx, in) + } + info := &grpc1.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.HyperstartService/StartContainer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperstartServiceServer).StartContainer(ctx, req.(*StartContainerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperstartService_ExecProcess_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc1.UnaryServerInterceptor) (interface{}, error) { + in := new(ExecProcessRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperstartServiceServer).ExecProcess(ctx, in) + } + info := &grpc1.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.HyperstartService/ExecProcess", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperstartServiceServer).ExecProcess(ctx, req.(*ExecProcessRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperstartService_SignalProcess_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc1.UnaryServerInterceptor) (interface{}, error) { + in := new(SignalProcessRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperstartServiceServer).SignalProcess(ctx, in) + } + info := &grpc1.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.HyperstartService/SignalProcess", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperstartServiceServer).SignalProcess(ctx, req.(*SignalProcessRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperstartService_WaitProcess_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc1.UnaryServerInterceptor) (interface{}, error) { + in := new(WaitProcessRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperstartServiceServer).WaitProcess(ctx, in) + } + info := &grpc1.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.HyperstartService/WaitProcess", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperstartServiceServer).WaitProcess(ctx, req.(*WaitProcessRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperstartService_WriteStdin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc1.UnaryServerInterceptor) (interface{}, error) { + in := new(WriteStreamRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperstartServiceServer).WriteStdin(ctx, in) + } + info := &grpc1.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.HyperstartService/WriteStdin", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperstartServiceServer).WriteStdin(ctx, req.(*WriteStreamRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperstartService_ReadStdout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc1.UnaryServerInterceptor) (interface{}, error) { + in := new(ReadStreamRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperstartServiceServer).ReadStdout(ctx, in) + } + info := &grpc1.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.HyperstartService/ReadStdout", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperstartServiceServer).ReadStdout(ctx, req.(*ReadStreamRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperstartService_ReadStderr_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc1.UnaryServerInterceptor) (interface{}, error) { + in := new(ReadStreamRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperstartServiceServer).ReadStderr(ctx, in) + } + info := &grpc1.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.HyperstartService/ReadStderr", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperstartServiceServer).ReadStderr(ctx, req.(*ReadStreamRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperstartService_CloseStdin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc1.UnaryServerInterceptor) (interface{}, error) { + in := new(CloseStdinRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperstartServiceServer).CloseStdin(ctx, in) + } + info := &grpc1.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.HyperstartService/CloseStdin", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperstartServiceServer).CloseStdin(ctx, req.(*CloseStdinRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperstartService_TtyWinResize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc1.UnaryServerInterceptor) (interface{}, error) { + in := new(TtyWinResizeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperstartServiceServer).TtyWinResize(ctx, in) + } + info := &grpc1.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.HyperstartService/TtyWinResize", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperstartServiceServer).TtyWinResize(ctx, req.(*TtyWinResizeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperstartService_StartSandbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc1.UnaryServerInterceptor) (interface{}, error) { + in := new(StartSandboxRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperstartServiceServer).StartSandbox(ctx, in) + } + info := &grpc1.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.HyperstartService/StartSandbox", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperstartServiceServer).StartSandbox(ctx, req.(*StartSandboxRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperstartService_DestroySandbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc1.UnaryServerInterceptor) (interface{}, error) { + in := new(DestroySandboxRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperstartServiceServer).DestroySandbox(ctx, in) + } + info := &grpc1.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.HyperstartService/DestroySandbox", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperstartServiceServer).DestroySandbox(ctx, req.(*DestroySandboxRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperstartService_UpdateInterface_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc1.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateInterfaceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperstartServiceServer).UpdateInterface(ctx, in) + } + info := &grpc1.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.HyperstartService/UpdateInterface", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperstartServiceServer).UpdateInterface(ctx, req.(*UpdateInterfaceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperstartService_AddRoute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc1.UnaryServerInterceptor) (interface{}, error) { + in := new(AddRouteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperstartServiceServer).AddRoute(ctx, in) + } + info := &grpc1.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.HyperstartService/AddRoute", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperstartServiceServer).AddRoute(ctx, req.(*AddRouteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperstartService_OnlineCPUMem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc1.UnaryServerInterceptor) (interface{}, error) { + in := new(OnlineCPUMemRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperstartServiceServer).OnlineCPUMem(ctx, in) + } + info := &grpc1.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.HyperstartService/OnlineCPUMem", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperstartServiceServer).OnlineCPUMem(ctx, req.(*OnlineCPUMemRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _HyperstartService_serviceDesc = grpc1.ServiceDesc{ + ServiceName: "grpc.HyperstartService", + HandlerType: (*HyperstartServiceServer)(nil), + Methods: []grpc1.MethodDesc{ + { + MethodName: "CreateContainer", + Handler: _HyperstartService_CreateContainer_Handler, + }, + { + MethodName: "StartContainer", + Handler: _HyperstartService_StartContainer_Handler, + }, + { + MethodName: "ExecProcess", + Handler: _HyperstartService_ExecProcess_Handler, + }, + { + MethodName: "SignalProcess", + Handler: _HyperstartService_SignalProcess_Handler, + }, + { + MethodName: "WaitProcess", + Handler: _HyperstartService_WaitProcess_Handler, + }, + { + MethodName: "WriteStdin", + Handler: _HyperstartService_WriteStdin_Handler, + }, + { + MethodName: "ReadStdout", + Handler: _HyperstartService_ReadStdout_Handler, + }, + { + MethodName: "ReadStderr", + Handler: _HyperstartService_ReadStderr_Handler, + }, + { + MethodName: "CloseStdin", + Handler: _HyperstartService_CloseStdin_Handler, + }, + { + MethodName: "TtyWinResize", + Handler: _HyperstartService_TtyWinResize_Handler, + }, + { + MethodName: "StartSandbox", + Handler: _HyperstartService_StartSandbox_Handler, + }, + { + MethodName: "DestroySandbox", + Handler: _HyperstartService_DestroySandbox_Handler, + }, + { + MethodName: "UpdateInterface", + Handler: _HyperstartService_UpdateInterface_Handler, + }, + { + MethodName: "AddRoute", + Handler: _HyperstartService_AddRoute_Handler, + }, + { + MethodName: "OnlineCPUMem", + Handler: _HyperstartService_OnlineCPUMem_Handler, + }, + }, + Streams: []grpc1.StreamDesc{}, + Metadata: "hyperstart.proto", +} + +func init() { proto.RegisterFile("hyperstart.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 978 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x5f, 0x6f, 0x23, 0x35, + 0x10, 0x57, 0x6e, 0xd3, 0x3f, 0x99, 0x34, 0xd7, 0xd6, 0xa1, 0xbd, 0x25, 0x77, 0x88, 0xb2, 0x48, + 0x5c, 0x78, 0x20, 0x27, 0x8a, 0x84, 0x74, 0x48, 0xe8, 0x54, 0x42, 0x55, 0xf2, 0x70, 0x5c, 0xb5, + 0xa1, 0x94, 0xb7, 0xca, 0x8d, 0xa7, 0xb9, 0x85, 0xc4, 0x5e, 0x6c, 0x2f, 0xbd, 0xf0, 0xc6, 0x03, + 0x6f, 0xbc, 0xf1, 0x11, 0xf8, 0x10, 0x7c, 0x3d, 0x64, 0xaf, 0xbd, 0xdd, 0x24, 0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3, 0xa4, 0x93, 0x24, 0xcc, 0x31, 0x96, 0xa5, 0x73, 0x25, 0x40, 0x1f, + 0x5a, 0x73, 0x9a, 0x46, 0x3a, 0xae, 0x8d, 0x0a, 0xa1, 0x5b, 0x09, 0xf2, 0x0d, 0x34, 0x4b, 0x72, + 0xe2, 0xbb, 0x58, 0x56, 0xae, 0xce, 0xfb, 0x15, 0x27, 0x6e, 0x9f, 0x9e, 0x00, 0xb8, 0xbd, 0xcf, + 0x12, 0x5e, 0x40, 0x2c, 0xa9, 0x4e, 0x01, 0x51, 0xa1, 0x11, 0x2f, 0x00, 0xf2, 0x45, 0xcd, 0x44, + 0xa6, 0xc9, 0x23, 0xf7, 0x49, 0x16, 0x35, 0xa2, 0x13, 0x2e, 0x1f, 0x2c, 0x01, 0xa0, 0x94, 0xef, + 0x02, 0xf0, 0x35, 0xc0, 0x9d, 0x00, 0x78, 0x80, 0x25, 0x49, 0x58, 0x39, 0xc7, 0x13, 0xd8, 0x29, + 0xef, 0x79, 0xe2, 0xb8, 0x56, 0xec, 0xfe, 0xfb, 0x20, 0xca, 0x7b, 0xda, 0x43, 0x54, 0xec, 0xee, + 0xfb, 0x9e, 0xe6, 0xfc, 0xea, 0xf5, 0x4f, 0xb3, 0x72, 0x21, 0xaf, 0x84, 0x39, 0x83, 0xdd, 0x85, + 0x65, 0xeb, 0xbf, 0x4a, 0xf5, 0x0e, 0x5e, 0x09, 0xf4, 0x1c, 0xb6, 0xfd, 0x42, 0x24, 0x07, 0x39, + 0xc2, 0xc2, 0x82, 0xbc, 0x6f, 0x1a, 0xe5, 0x9d, 0xe8, 0xa7, 0x51, 0xb1, 0x27, 0x57, 0x41, 0x5c, + 0x6f, 0x5a, 0xff, 0x8b, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x2d, 0xcb, 0xe0, 0x8d, 0xc9, 0x0b, + 0x00, 0x00, +} diff --git a/protocols/grpc/hyperstart.proto b/protocols/grpc/hyperstart.proto new file mode 100644 index 0000000000..e14c2242a3 --- /dev/null +++ b/protocols/grpc/hyperstart.proto @@ -0,0 +1,149 @@ +// +// Copyright 2017 HyperHQ Inc. +// +// SPDX-License-Identifier: Apache-2.0 +// + +syntax = "proto3"; + +package grpc; + +import "oci.proto"; +import "google/protobuf/empty.proto"; + +// unstable +service HyperstartService { + // execution + rpc CreateContainer(CreateContainerRequest) returns (google.protobuf.Empty); + rpc StartContainer(StartContainerRequest) returns (google.protobuf.Empty); + rpc ExecProcess(ExecProcessRequest) returns (google.protobuf.Empty); + rpc SignalProcess(SignalProcessRequest) returns (google.protobuf.Empty); + rpc WaitProcess(WaitProcessRequest) returns (WaitProcessResponse); // wait & reap like waitpid(2) + + // stdio + rpc WriteStdin(WriteStreamRequest) returns (WriteStreamResponse); + rpc ReadStdout(ReadStreamRequest) returns (ReadStreamResponse); + rpc ReadStderr(ReadStreamRequest) returns (ReadStreamResponse); + rpc CloseStdin(CloseStdinRequest) returns (google.protobuf.Empty); + rpc TtyWinResize(TtyWinResizeRequest) returns (google.protobuf.Empty); + + // misc (TODO: some rpcs can be replaced by hyperstart-exec) + rpc StartSandbox(StartSandboxRequest) returns (google.protobuf.Empty); + rpc DestroySandbox(DestroySandboxRequest) returns (google.protobuf.Empty); + rpc UpdateInterface(UpdateInterfaceRequest) returns (google.protobuf.Empty); + rpc AddRoute(AddRouteRequest) returns (google.protobuf.Empty); + rpc OnlineCPUMem(OnlineCPUMemRequest) returns (google.protobuf.Empty); +} + +message CreateContainerRequest { + string container_id = 1; + StringUser string_user = 2; + repeated Storage storages =3; + Spec OCI = 4; +} + +message StartContainerRequest { + string container_id = 1; +} + +message ExecProcessRequest { + string container_id = 1; + StringUser string_user =2; + Process process = 3; +} + +message SignalProcessRequest { + string container_id = 1; + string process_id = 2; + uint32 signal = 3; +} + +message WaitProcessRequest { + string container_id = 1; + string process_id = 2; +} + +message WaitProcessResponse { + int32 status = 1; +} + +message WriteStreamRequest { + string container_id = 1; + string process_id = 2; + bytes data = 3; +} + +message WriteStreamResponse { + uint32 len = 1; +} + +message ReadStreamRequest { + string container_id = 1; + string process_id = 2; + uint32 len = 3; +} + +message ReadStreamResponse { + bytes data = 1; +} + +message CloseStdinRequest { + string container_id = 1; + string process_id = 2; +} + +message TtyWinResizeRequest { + string container_id = 1; + string process_id = 2; + uint32 row = 3; + uint32 column = 4; +} + +message StartSandboxRequest { + string hostname = 1; + repeated string dns = 2; + repeated Storage storages = 3; +} + +message DestroySandboxRequest { +} + +message IpAddress { + string address = 1; + string mask = 2; +} + +message UpdateInterfaceRequest { + uint64 type =1; + string device = 2; + string newName = 3; + repeated IpAddress ipAddresses = 4; + uint64 mtu = 5; +} + +message AddRouteRequest { + repeated Route routes = 1; +} + +message OnlineCPUMemRequest { +} + +message Storage { + string format = 1; // empty for 9p dir passing (or "dir" by default). it supports block device in "raw", and will support "qcow2" and other formats. + string source = 2; // "/dev/sdb", "/dev/disk/by-scsi/xxxx", "none",... + string fstype = 3; // "xfs", "ext4" etc. for block dev, or "9p" for shared fs, or "tmpfs" for shared /dev/shm for all containers ... + repeated string options = 4; // options for the storage device, required by some special devices, such as ceph rbd. + string mount_point = 5; // mount_point is only visible by VM, not by containers. This mount point can be used on oci.Mount.Source as "/Stroage/mount/point/{rootfs|_data}". +} + +message StringUser { + string uid = 1; + string gid = 2; + repeated string additionalGids = 3; +} + +message Route { + string dest = 1; + string gateway = 2; + string device = 3; +} diff --git a/protocols/grpc/oci.pb.go b/protocols/grpc/oci.pb.go new file mode 100644 index 0000000000..70c0008436 --- /dev/null +++ b/protocols/grpc/oci.pb.go @@ -0,0 +1,1622 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: oci.proto + +package grpc + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type Spec struct { + // Version of the Open Container Initiative Runtime Specification with which the bundle complies. + Version string `protobuf:"bytes,1,opt,name=Version" json:"Version,omitempty"` + // Process configures the container process. + Process *Process `protobuf:"bytes,2,opt,name=Process" json:"Process,omitempty"` + // Root configures the container's root filesystem. + Root *Root `protobuf:"bytes,3,opt,name=Root" json:"Root,omitempty"` + // Hostname configures the container's hostname. + Hostname string `protobuf:"bytes,4,opt,name=Hostname" json:"Hostname,omitempty"` + // Mounts configures additional mounts (on top of Root). + Mounts []*Mount `protobuf:"bytes,5,rep,name=Mounts" json:"Mounts,omitempty"` + // Hooks configures callbacks for container lifecycle events. + Hooks *Hooks `protobuf:"bytes,6,opt,name=Hooks" json:"Hooks,omitempty"` + // Annotations contains arbitrary metadata for the container. + Annotations map[string]string `protobuf:"bytes,7,rep,name=Annotations" json:"Annotations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Linux is platform-specific configuration for Linux based containers. + Linux *Linux `protobuf:"bytes,8,opt,name=Linux" json:"Linux,omitempty"` + // Solaris is platform-specific configuration for Solaris based containers. + Solaris *Solaris `protobuf:"bytes,9,opt,name=Solaris" json:"Solaris,omitempty"` + // Windows is platform-specific configuration for Windows based containers. + Windows *Windows `protobuf:"bytes,10,opt,name=Windows" json:"Windows,omitempty"` +} + +func (m *Spec) Reset() { *m = Spec{} } +func (m *Spec) String() string { return proto.CompactTextString(m) } +func (*Spec) ProtoMessage() {} +func (*Spec) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *Spec) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *Spec) GetProcess() *Process { + if m != nil { + return m.Process + } + return nil +} + +func (m *Spec) GetRoot() *Root { + if m != nil { + return m.Root + } + return nil +} + +func (m *Spec) GetHostname() string { + if m != nil { + return m.Hostname + } + return "" +} + +func (m *Spec) GetMounts() []*Mount { + if m != nil { + return m.Mounts + } + return nil +} + +func (m *Spec) GetHooks() *Hooks { + if m != nil { + return m.Hooks + } + return nil +} + +func (m *Spec) GetAnnotations() map[string]string { + if m != nil { + return m.Annotations + } + return nil +} + +func (m *Spec) GetLinux() *Linux { + if m != nil { + return m.Linux + } + return nil +} + +func (m *Spec) GetSolaris() *Solaris { + if m != nil { + return m.Solaris + } + return nil +} + +func (m *Spec) GetWindows() *Windows { + if m != nil { + return m.Windows + } + return nil +} + +type Process struct { + // Terminal creates an interactive terminal for the container. + Terminal bool `protobuf:"varint,1,opt,name=Terminal" json:"Terminal,omitempty"` + // ConsoleSize specifies the size of the console. + ConsoleSize *Box `protobuf:"bytes,2,opt,name=ConsoleSize" json:"ConsoleSize,omitempty"` + // OCIUser specifies user information for the process. + User *User `protobuf:"bytes,3,opt,name=User" json:"User,omitempty"` + // Args specifies the binary and arguments for the application to execute. + Args []string `protobuf:"bytes,4,rep,name=Args" json:"Args,omitempty"` + // Env populates the process environment for the process. + Env []string `protobuf:"bytes,5,rep,name=Env" json:"Env,omitempty"` + // Cwd is the current working directory for the process and must be + // relative to the container's root. + Cwd string `protobuf:"bytes,6,opt,name=Cwd" json:"Cwd,omitempty"` + // Capabilities are Linux capabilities that are kept for the process. + Capabilities *LinuxCapabilities `protobuf:"bytes,7,opt,name=Capabilities" json:"Capabilities,omitempty"` + // Rlimits specifies rlimit options to apply to the process. + Rlimits []*POSIXRlimit `protobuf:"bytes,8,rep,name=Rlimits" json:"Rlimits,omitempty"` + // NoNewPrivileges controls whether additional privileges could be gained by processes in the container. + NoNewPrivileges bool `protobuf:"varint,9,opt,name=NoNewPrivileges" json:"NoNewPrivileges,omitempty"` + // ApparmorProfile specifies the apparmor profile for the container. + ApparmorProfile string `protobuf:"bytes,10,opt,name=ApparmorProfile" json:"ApparmorProfile,omitempty"` + // Specify an oom_score_adj for the container. + OOMScoreAdj uint32 `protobuf:"varint,11,opt,name=OOMScoreAdj" json:"OOMScoreAdj,omitempty"` + // SelinuxLabel specifies the selinux context that the container process is run as. + SelinuxLabel string `protobuf:"bytes,12,opt,name=SelinuxLabel" json:"SelinuxLabel,omitempty"` +} + +func (m *Process) Reset() { *m = Process{} } +func (m *Process) String() string { return proto.CompactTextString(m) } +func (*Process) ProtoMessage() {} +func (*Process) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *Process) GetTerminal() bool { + if m != nil { + return m.Terminal + } + return false +} + +func (m *Process) GetConsoleSize() *Box { + if m != nil { + return m.ConsoleSize + } + return nil +} + +func (m *Process) GetUser() *User { + if m != nil { + return m.User + } + return nil +} + +func (m *Process) GetArgs() []string { + if m != nil { + return m.Args + } + return nil +} + +func (m *Process) GetEnv() []string { + if m != nil { + return m.Env + } + return nil +} + +func (m *Process) GetCwd() string { + if m != nil { + return m.Cwd + } + return "" +} + +func (m *Process) GetCapabilities() *LinuxCapabilities { + if m != nil { + return m.Capabilities + } + return nil +} + +func (m *Process) GetRlimits() []*POSIXRlimit { + if m != nil { + return m.Rlimits + } + return nil +} + +func (m *Process) GetNoNewPrivileges() bool { + if m != nil { + return m.NoNewPrivileges + } + return false +} + +func (m *Process) GetApparmorProfile() string { + if m != nil { + return m.ApparmorProfile + } + return "" +} + +func (m *Process) GetOOMScoreAdj() uint32 { + if m != nil { + return m.OOMScoreAdj + } + return 0 +} + +func (m *Process) GetSelinuxLabel() string { + if m != nil { + return m.SelinuxLabel + } + return "" +} + +type Box struct { + // Height is the vertical dimension of a box. + Height uint32 `protobuf:"varint,1,opt,name=Height" json:"Height,omitempty"` + // Width is the horizontal dimension of a box. + Width uint32 `protobuf:"varint,2,opt,name=Width" json:"Width,omitempty"` +} + +func (m *Box) Reset() { *m = Box{} } +func (m *Box) String() string { return proto.CompactTextString(m) } +func (*Box) ProtoMessage() {} +func (*Box) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *Box) GetHeight() uint32 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *Box) GetWidth() uint32 { + if m != nil { + return m.Width + } + return 0 +} + +type User struct { + // UID is the user id. + UID uint32 `protobuf:"varint,1,opt,name=UID" json:"UID,omitempty"` + // GID is the group id. + GID uint32 `protobuf:"varint,2,opt,name=GID" json:"GID,omitempty"` + // AdditionalGids are additional group ids set for the container's process. + AdditionalGids []uint32 `protobuf:"varint,3,rep,packed,name=AdditionalGids" json:"AdditionalGids,omitempty"` + // Username is the user name. + Username string `protobuf:"bytes,4,opt,name=Username" json:"Username,omitempty"` +} + +func (m *User) Reset() { *m = User{} } +func (m *User) String() string { return proto.CompactTextString(m) } +func (*User) ProtoMessage() {} +func (*User) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *User) GetUID() uint32 { + if m != nil { + return m.UID + } + return 0 +} + +func (m *User) GetGID() uint32 { + if m != nil { + return m.GID + } + return 0 +} + +func (m *User) GetAdditionalGids() []uint32 { + if m != nil { + return m.AdditionalGids + } + return nil +} + +func (m *User) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +type LinuxCapabilities struct { + // Bounding is the set of capabilities checked by the kernel. + Bounding []string `protobuf:"bytes,1,rep,name=Bounding" json:"Bounding,omitempty"` + // Effective is the set of capabilities checked by the kernel. + Effective []string `protobuf:"bytes,2,rep,name=Effective" json:"Effective,omitempty"` + // Inheritable is the capabilities preserved across execve. + Inheritable []string `protobuf:"bytes,3,rep,name=Inheritable" json:"Inheritable,omitempty"` + // Permitted is the limiting superset for effective capabilities. + Permitted []string `protobuf:"bytes,4,rep,name=Permitted" json:"Permitted,omitempty"` + // Ambient is the ambient set of capabilities that are kept. + Ambient []string `protobuf:"bytes,5,rep,name=Ambient" json:"Ambient,omitempty"` +} + +func (m *LinuxCapabilities) Reset() { *m = LinuxCapabilities{} } +func (m *LinuxCapabilities) String() string { return proto.CompactTextString(m) } +func (*LinuxCapabilities) ProtoMessage() {} +func (*LinuxCapabilities) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *LinuxCapabilities) GetBounding() []string { + if m != nil { + return m.Bounding + } + return nil +} + +func (m *LinuxCapabilities) GetEffective() []string { + if m != nil { + return m.Effective + } + return nil +} + +func (m *LinuxCapabilities) GetInheritable() []string { + if m != nil { + return m.Inheritable + } + return nil +} + +func (m *LinuxCapabilities) GetPermitted() []string { + if m != nil { + return m.Permitted + } + return nil +} + +func (m *LinuxCapabilities) GetAmbient() []string { + if m != nil { + return m.Ambient + } + return nil +} + +type POSIXRlimit struct { + // Type of the rlimit to set + Type string `protobuf:"bytes,1,opt,name=Type" json:"Type,omitempty"` + // Hard is the hard limit for the specified type + Hard uint64 `protobuf:"varint,2,opt,name=Hard" json:"Hard,omitempty"` + // Soft is the soft limit for the specified type + Soft uint64 `protobuf:"varint,3,opt,name=Soft" json:"Soft,omitempty"` +} + +func (m *POSIXRlimit) Reset() { *m = POSIXRlimit{} } +func (m *POSIXRlimit) String() string { return proto.CompactTextString(m) } +func (*POSIXRlimit) ProtoMessage() {} +func (*POSIXRlimit) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *POSIXRlimit) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *POSIXRlimit) GetHard() uint64 { + if m != nil { + return m.Hard + } + return 0 +} + +func (m *POSIXRlimit) GetSoft() uint64 { + if m != nil { + return m.Soft + } + return 0 +} + +type Mount struct { + // destination is the path inside the container expect when it starts with "tmp:/" + Destination string `protobuf:"bytes,1,opt,name=destination" json:"destination,omitempty"` + // source is the path inside the container expect when it starts with "vm:/dev/" or "tmp:/" + // the path which starts with "vm:/dev/" refers the guest vm's "/dev", + // especially, "vm:/dev/hostfs/" refers to the shared filesystem. + // "tmp:/" is a temporary directory which is used for temporary mounts. + Source string `protobuf:"bytes,2,opt,name=source" json:"source,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type" json:"type,omitempty"` + Options []string `protobuf:"bytes,4,rep,name=options" json:"options,omitempty"` +} + +func (m *Mount) Reset() { *m = Mount{} } +func (m *Mount) String() string { return proto.CompactTextString(m) } +func (*Mount) ProtoMessage() {} +func (*Mount) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +func (m *Mount) GetDestination() string { + if m != nil { + return m.Destination + } + return "" +} + +func (m *Mount) GetSource() string { + if m != nil { + return m.Source + } + return "" +} + +func (m *Mount) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *Mount) GetOptions() []string { + if m != nil { + return m.Options + } + return nil +} + +type Root struct { + // Path is the absolute path to the container's root filesystem. + Path string `protobuf:"bytes,1,opt,name=Path" json:"Path,omitempty"` + // Readonly makes the root filesystem for the container readonly before the process is executed. + Readonly bool `protobuf:"varint,2,opt,name=Readonly" json:"Readonly,omitempty"` +} + +func (m *Root) Reset() { *m = Root{} } +func (m *Root) String() string { return proto.CompactTextString(m) } +func (*Root) ProtoMessage() {} +func (*Root) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } + +func (m *Root) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *Root) GetReadonly() bool { + if m != nil { + return m.Readonly + } + return false +} + +type Hooks struct { + // Prestart is a list of hooks to be run before the container process is executed. + Prestart []*Hook `protobuf:"bytes,1,rep,name=Prestart" json:"Prestart,omitempty"` + // Poststart is a list of hooks to be run after the container process is started. + Poststart []*Hook `protobuf:"bytes,2,rep,name=Poststart" json:"Poststart,omitempty"` + // Poststop is a list of hooks to be run after the container process exits. + Poststop []*Hook `protobuf:"bytes,3,rep,name=Poststop" json:"Poststop,omitempty"` +} + +func (m *Hooks) Reset() { *m = Hooks{} } +func (m *Hooks) String() string { return proto.CompactTextString(m) } +func (*Hooks) ProtoMessage() {} +func (*Hooks) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } + +func (m *Hooks) GetPrestart() []*Hook { + if m != nil { + return m.Prestart + } + return nil +} + +func (m *Hooks) GetPoststart() []*Hook { + if m != nil { + return m.Poststart + } + return nil +} + +func (m *Hooks) GetPoststop() []*Hook { + if m != nil { + return m.Poststop + } + return nil +} + +type Hook struct { + Path string `protobuf:"bytes,1,opt,name=Path" json:"Path,omitempty"` + Args []string `protobuf:"bytes,2,rep,name=Args" json:"Args,omitempty"` + Env []string `protobuf:"bytes,3,rep,name=Env" json:"Env,omitempty"` + Timeout int64 `protobuf:"varint,4,opt,name=Timeout" json:"Timeout,omitempty"` +} + +func (m *Hook) Reset() { *m = Hook{} } +func (m *Hook) String() string { return proto.CompactTextString(m) } +func (*Hook) ProtoMessage() {} +func (*Hook) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + +func (m *Hook) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *Hook) GetArgs() []string { + if m != nil { + return m.Args + } + return nil +} + +func (m *Hook) GetEnv() []string { + if m != nil { + return m.Env + } + return nil +} + +func (m *Hook) GetTimeout() int64 { + if m != nil { + return m.Timeout + } + return 0 +} + +type Linux struct { + // UIDMapping specifies user mappings for supporting user namespaces. + UIDMappings []*LinuxIDMapping `protobuf:"bytes,1,rep,name=UIDMappings" json:"UIDMappings,omitempty"` + // GIDMapping specifies group mappings for supporting user namespaces. + GIDMappings []*LinuxIDMapping `protobuf:"bytes,2,rep,name=GIDMappings" json:"GIDMappings,omitempty"` + // Sysctl are a set of key value pairs that are set for the container on start + Sysctl map[string]string `protobuf:"bytes,3,rep,name=Sysctl" json:"Sysctl,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Resources contain cgroup information for handling resource constraints + // for the container + Resources *LinuxResources `protobuf:"bytes,4,opt,name=Resources" json:"Resources,omitempty"` + // CgroupsPath specifies the path to cgroups that are created and/or joined by the container. + // The path is expected to be relative to the cgroups mountpoint. + // If resources are specified, the cgroups at CgroupsPath will be updated based on resources. + CgroupsPath string `protobuf:"bytes,5,opt,name=CgroupsPath" json:"CgroupsPath,omitempty"` + // Namespaces contains the namespaces that are created and/or joined by the container + Namespaces []*LinuxNamespace `protobuf:"bytes,6,rep,name=Namespaces" json:"Namespaces,omitempty"` + // Devices are a list of device nodes that are created for the container + Devices []*LinuxDevice `protobuf:"bytes,7,rep,name=Devices" json:"Devices,omitempty"` + // Seccomp specifies the seccomp security settings for the container. + Seccomp *LinuxSeccomp `protobuf:"bytes,8,opt,name=Seccomp" json:"Seccomp,omitempty"` + // RootfsPropagation is the rootfs mount propagation mode for the container. + RootfsPropagation string `protobuf:"bytes,9,opt,name=RootfsPropagation" json:"RootfsPropagation,omitempty"` + // MaskedPaths masks over the provided paths inside the container. + MaskedPaths []string `protobuf:"bytes,10,rep,name=MaskedPaths" json:"MaskedPaths,omitempty"` + // ReadonlyPaths sets the provided paths as RO inside the container. + ReadonlyPaths []string `protobuf:"bytes,11,rep,name=ReadonlyPaths" json:"ReadonlyPaths,omitempty"` + // MountLabel specifies the selinux context for the mounts in the container. + MountLabel string `protobuf:"bytes,12,opt,name=MountLabel" json:"MountLabel,omitempty"` + // IntelRdt contains Intel Resource Director Technology (RDT) information + // for handling resource constraints (e.g., L3 cache) for the container + IntelRdt *LinuxIntelRdt `protobuf:"bytes,13,opt,name=IntelRdt" json:"IntelRdt,omitempty"` +} + +func (m *Linux) Reset() { *m = Linux{} } +func (m *Linux) String() string { return proto.CompactTextString(m) } +func (*Linux) ProtoMessage() {} +func (*Linux) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} } + +func (m *Linux) GetUIDMappings() []*LinuxIDMapping { + if m != nil { + return m.UIDMappings + } + return nil +} + +func (m *Linux) GetGIDMappings() []*LinuxIDMapping { + if m != nil { + return m.GIDMappings + } + return nil +} + +func (m *Linux) GetSysctl() map[string]string { + if m != nil { + return m.Sysctl + } + return nil +} + +func (m *Linux) GetResources() *LinuxResources { + if m != nil { + return m.Resources + } + return nil +} + +func (m *Linux) GetCgroupsPath() string { + if m != nil { + return m.CgroupsPath + } + return "" +} + +func (m *Linux) GetNamespaces() []*LinuxNamespace { + if m != nil { + return m.Namespaces + } + return nil +} + +func (m *Linux) GetDevices() []*LinuxDevice { + if m != nil { + return m.Devices + } + return nil +} + +func (m *Linux) GetSeccomp() *LinuxSeccomp { + if m != nil { + return m.Seccomp + } + return nil +} + +func (m *Linux) GetRootfsPropagation() string { + if m != nil { + return m.RootfsPropagation + } + return "" +} + +func (m *Linux) GetMaskedPaths() []string { + if m != nil { + return m.MaskedPaths + } + return nil +} + +func (m *Linux) GetReadonlyPaths() []string { + if m != nil { + return m.ReadonlyPaths + } + return nil +} + +func (m *Linux) GetMountLabel() string { + if m != nil { + return m.MountLabel + } + return "" +} + +func (m *Linux) GetIntelRdt() *LinuxIntelRdt { + if m != nil { + return m.IntelRdt + } + return nil +} + +type Windows struct { + // Dummy string, never used. + Dummy string `protobuf:"bytes,1,opt,name=dummy" json:"dummy,omitempty"` +} + +func (m *Windows) Reset() { *m = Windows{} } +func (m *Windows) String() string { return proto.CompactTextString(m) } +func (*Windows) ProtoMessage() {} +func (*Windows) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{11} } + +func (m *Windows) GetDummy() string { + if m != nil { + return m.Dummy + } + return "" +} + +type Solaris struct { + // Dummy string, never used. + Dummy string `protobuf:"bytes,1,opt,name=dummy" json:"dummy,omitempty"` +} + +func (m *Solaris) Reset() { *m = Solaris{} } +func (m *Solaris) String() string { return proto.CompactTextString(m) } +func (*Solaris) ProtoMessage() {} +func (*Solaris) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{12} } + +func (m *Solaris) GetDummy() string { + if m != nil { + return m.Dummy + } + return "" +} + +type LinuxIDMapping struct { + // HostID is the starting UID/GID on the host to be mapped to 'ContainerID' + HostID uint32 `protobuf:"varint,1,opt,name=HostID" json:"HostID,omitempty"` + // ContainerID is the starting UID/GID in the container + ContainerID uint32 `protobuf:"varint,2,opt,name=ContainerID" json:"ContainerID,omitempty"` + // Size is the number of IDs to be mapped + Size uint32 `protobuf:"varint,3,opt,name=Size" json:"Size,omitempty"` +} + +func (m *LinuxIDMapping) Reset() { *m = LinuxIDMapping{} } +func (m *LinuxIDMapping) String() string { return proto.CompactTextString(m) } +func (*LinuxIDMapping) ProtoMessage() {} +func (*LinuxIDMapping) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{13} } + +func (m *LinuxIDMapping) GetHostID() uint32 { + if m != nil { + return m.HostID + } + return 0 +} + +func (m *LinuxIDMapping) GetContainerID() uint32 { + if m != nil { + return m.ContainerID + } + return 0 +} + +func (m *LinuxIDMapping) GetSize() uint32 { + if m != nil { + return m.Size + } + return 0 +} + +type LinuxNamespace struct { + // Type is the type of namespace + Type string `protobuf:"bytes,1,opt,name=Type" json:"Type,omitempty"` + // Path is a path to an existing namespace persisted on disk that can be joined + // and is of the same type + Path string `protobuf:"bytes,2,opt,name=Path" json:"Path,omitempty"` +} + +func (m *LinuxNamespace) Reset() { *m = LinuxNamespace{} } +func (m *LinuxNamespace) String() string { return proto.CompactTextString(m) } +func (*LinuxNamespace) ProtoMessage() {} +func (*LinuxNamespace) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{14} } + +func (m *LinuxNamespace) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *LinuxNamespace) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +type LinuxDevice struct { + // Path to the device. + Path string `protobuf:"bytes,1,opt,name=Path" json:"Path,omitempty"` + // Device type, block, char, etc. + Type string `protobuf:"bytes,2,opt,name=Type" json:"Type,omitempty"` + // Major is the device's major number. + Major int64 `protobuf:"varint,3,opt,name=Major" json:"Major,omitempty"` + // Minor is the device's minor number. + Minor int64 `protobuf:"varint,4,opt,name=Minor" json:"Minor,omitempty"` + // FileMode permission bits for the device. + FileMode uint32 `protobuf:"varint,5,opt,name=FileMode" json:"FileMode,omitempty"` + // UID of the device. + UID uint32 `protobuf:"varint,6,opt,name=UID" json:"UID,omitempty"` + // Gid of the device. + GID uint32 `protobuf:"varint,7,opt,name=GID" json:"GID,omitempty"` +} + +func (m *LinuxDevice) Reset() { *m = LinuxDevice{} } +func (m *LinuxDevice) String() string { return proto.CompactTextString(m) } +func (*LinuxDevice) ProtoMessage() {} +func (*LinuxDevice) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{15} } + +func (m *LinuxDevice) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *LinuxDevice) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *LinuxDevice) GetMajor() int64 { + if m != nil { + return m.Major + } + return 0 +} + +func (m *LinuxDevice) GetMinor() int64 { + if m != nil { + return m.Minor + } + return 0 +} + +func (m *LinuxDevice) GetFileMode() uint32 { + if m != nil { + return m.FileMode + } + return 0 +} + +func (m *LinuxDevice) GetUID() uint32 { + if m != nil { + return m.UID + } + return 0 +} + +func (m *LinuxDevice) GetGID() uint32 { + if m != nil { + return m.GID + } + return 0 +} + +type LinuxResources struct { + // Devices configures the device whitelist. + Devices []*LinuxDeviceCgroup `protobuf:"bytes,1,rep,name=Devices" json:"Devices,omitempty"` + // Memory restriction configuration + Memory *LinuxMemory `protobuf:"bytes,2,opt,name=Memory" json:"Memory,omitempty"` + // CPU resource restriction configuration + CPU *LinuxCPU `protobuf:"bytes,3,opt,name=CPU" json:"CPU,omitempty"` + // Task resource restriction configuration. + Pids *LinuxPids `protobuf:"bytes,4,opt,name=Pids" json:"Pids,omitempty"` + // BlockIO restriction configuration + BlockIO *LinuxBlockIO `protobuf:"bytes,5,opt,name=BlockIO" json:"BlockIO,omitempty"` + // Hugetlb limit (in bytes) + HugepageLimits []*LinuxHugepageLimit `protobuf:"bytes,6,rep,name=HugepageLimits" json:"HugepageLimits,omitempty"` + // Network restriction configuration + Network *LinuxNetwork `protobuf:"bytes,7,opt,name=Network" json:"Network,omitempty"` +} + +func (m *LinuxResources) Reset() { *m = LinuxResources{} } +func (m *LinuxResources) String() string { return proto.CompactTextString(m) } +func (*LinuxResources) ProtoMessage() {} +func (*LinuxResources) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{16} } + +func (m *LinuxResources) GetDevices() []*LinuxDeviceCgroup { + if m != nil { + return m.Devices + } + return nil +} + +func (m *LinuxResources) GetMemory() *LinuxMemory { + if m != nil { + return m.Memory + } + return nil +} + +func (m *LinuxResources) GetCPU() *LinuxCPU { + if m != nil { + return m.CPU + } + return nil +} + +func (m *LinuxResources) GetPids() *LinuxPids { + if m != nil { + return m.Pids + } + return nil +} + +func (m *LinuxResources) GetBlockIO() *LinuxBlockIO { + if m != nil { + return m.BlockIO + } + return nil +} + +func (m *LinuxResources) GetHugepageLimits() []*LinuxHugepageLimit { + if m != nil { + return m.HugepageLimits + } + return nil +} + +func (m *LinuxResources) GetNetwork() *LinuxNetwork { + if m != nil { + return m.Network + } + return nil +} + +type LinuxMemory struct { + // Memory limit (in bytes). + Limit int64 `protobuf:"varint,1,opt,name=Limit" json:"Limit,omitempty"` + // Memory reservation or soft_limit (in bytes). + Reservation int64 `protobuf:"varint,2,opt,name=Reservation" json:"Reservation,omitempty"` + // Total memory limit (memory + swap). + Swap int64 `protobuf:"varint,3,opt,name=Swap" json:"Swap,omitempty"` + // Kernel memory limit (in bytes). + Kernel int64 `protobuf:"varint,4,opt,name=Kernel" json:"Kernel,omitempty"` + // Kernel memory limit for tcp (in bytes) + KernelTCP int64 `protobuf:"varint,5,opt,name=KernelTCP" json:"KernelTCP,omitempty"` + // How aggressive the kernel will swap memory pages. + Swappiness uint64 `protobuf:"varint,6,opt,name=Swappiness" json:"Swappiness,omitempty"` + // DisableOOMKiller disables the OOM killer for out of memory conditions + DisableOOMKiller bool `protobuf:"varint,7,opt,name=DisableOOMKiller" json:"DisableOOMKiller,omitempty"` +} + +func (m *LinuxMemory) Reset() { *m = LinuxMemory{} } +func (m *LinuxMemory) String() string { return proto.CompactTextString(m) } +func (*LinuxMemory) ProtoMessage() {} +func (*LinuxMemory) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{17} } + +func (m *LinuxMemory) GetLimit() int64 { + if m != nil { + return m.Limit + } + return 0 +} + +func (m *LinuxMemory) GetReservation() int64 { + if m != nil { + return m.Reservation + } + return 0 +} + +func (m *LinuxMemory) GetSwap() int64 { + if m != nil { + return m.Swap + } + return 0 +} + +func (m *LinuxMemory) GetKernel() int64 { + if m != nil { + return m.Kernel + } + return 0 +} + +func (m *LinuxMemory) GetKernelTCP() int64 { + if m != nil { + return m.KernelTCP + } + return 0 +} + +func (m *LinuxMemory) GetSwappiness() uint64 { + if m != nil { + return m.Swappiness + } + return 0 +} + +func (m *LinuxMemory) GetDisableOOMKiller() bool { + if m != nil { + return m.DisableOOMKiller + } + return false +} + +type LinuxCPU struct { + // CPU shares (relative weight (ratio) vs. other cgroups with cpu shares). + Shares uint64 `protobuf:"varint,1,opt,name=Shares" json:"Shares,omitempty"` + // CPU hardcap limit (in usecs). Allowed cpu time in a given period. + Quota int64 `protobuf:"varint,2,opt,name=Quota" json:"Quota,omitempty"` + // CPU period to be used for hardcapping (in usecs). + Period uint64 `protobuf:"varint,3,opt,name=Period" json:"Period,omitempty"` + // How much time realtime scheduling may use (in usecs). + RealtimeRuntime int64 `protobuf:"varint,4,opt,name=RealtimeRuntime" json:"RealtimeRuntime,omitempty"` + // CPU period to be used for realtime scheduling (in usecs). + RealtimePeriod uint64 `protobuf:"varint,5,opt,name=RealtimePeriod" json:"RealtimePeriod,omitempty"` + // CPUs to use within the cpuset. Default is to use any CPU available. + Cpus string `protobuf:"bytes,6,opt,name=Cpus" json:"Cpus,omitempty"` + // List of memory nodes in the cpuset. Default is to use any available memory node. + Mems string `protobuf:"bytes,7,opt,name=Mems" json:"Mems,omitempty"` +} + +func (m *LinuxCPU) Reset() { *m = LinuxCPU{} } +func (m *LinuxCPU) String() string { return proto.CompactTextString(m) } +func (*LinuxCPU) ProtoMessage() {} +func (*LinuxCPU) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{18} } + +func (m *LinuxCPU) GetShares() uint64 { + if m != nil { + return m.Shares + } + return 0 +} + +func (m *LinuxCPU) GetQuota() int64 { + if m != nil { + return m.Quota + } + return 0 +} + +func (m *LinuxCPU) GetPeriod() uint64 { + if m != nil { + return m.Period + } + return 0 +} + +func (m *LinuxCPU) GetRealtimeRuntime() int64 { + if m != nil { + return m.RealtimeRuntime + } + return 0 +} + +func (m *LinuxCPU) GetRealtimePeriod() uint64 { + if m != nil { + return m.RealtimePeriod + } + return 0 +} + +func (m *LinuxCPU) GetCpus() string { + if m != nil { + return m.Cpus + } + return "" +} + +func (m *LinuxCPU) GetMems() string { + if m != nil { + return m.Mems + } + return "" +} + +type LinuxWeightDevice struct { + // Major is the device's major number. + Major int64 `protobuf:"varint,1,opt,name=Major" json:"Major,omitempty"` + // Minor is the device's minor number. + Minor int64 `protobuf:"varint,2,opt,name=Minor" json:"Minor,omitempty"` + // Weight is the bandwidth rate for the device. + Weight uint32 `protobuf:"varint,3,opt,name=Weight" json:"Weight,omitempty"` + // LeafWeight is the bandwidth rate for the device while competing with the cgroup's child cgroups, CFQ scheduler only + LeafWeight uint32 `protobuf:"varint,4,opt,name=LeafWeight" json:"LeafWeight,omitempty"` +} + +func (m *LinuxWeightDevice) Reset() { *m = LinuxWeightDevice{} } +func (m *LinuxWeightDevice) String() string { return proto.CompactTextString(m) } +func (*LinuxWeightDevice) ProtoMessage() {} +func (*LinuxWeightDevice) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{19} } + +func (m *LinuxWeightDevice) GetMajor() int64 { + if m != nil { + return m.Major + } + return 0 +} + +func (m *LinuxWeightDevice) GetMinor() int64 { + if m != nil { + return m.Minor + } + return 0 +} + +func (m *LinuxWeightDevice) GetWeight() uint32 { + if m != nil { + return m.Weight + } + return 0 +} + +func (m *LinuxWeightDevice) GetLeafWeight() uint32 { + if m != nil { + return m.LeafWeight + } + return 0 +} + +type LinuxThrottleDevice struct { + // Major is the device's major number. + Major int64 `protobuf:"varint,1,opt,name=Major" json:"Major,omitempty"` + // Minor is the device's minor number. + Minor int64 `protobuf:"varint,2,opt,name=Minor" json:"Minor,omitempty"` + // Rate is the IO rate limit per cgroup per device + Rate uint64 `protobuf:"varint,3,opt,name=Rate" json:"Rate,omitempty"` +} + +func (m *LinuxThrottleDevice) Reset() { *m = LinuxThrottleDevice{} } +func (m *LinuxThrottleDevice) String() string { return proto.CompactTextString(m) } +func (*LinuxThrottleDevice) ProtoMessage() {} +func (*LinuxThrottleDevice) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{20} } + +func (m *LinuxThrottleDevice) GetMajor() int64 { + if m != nil { + return m.Major + } + return 0 +} + +func (m *LinuxThrottleDevice) GetMinor() int64 { + if m != nil { + return m.Minor + } + return 0 +} + +func (m *LinuxThrottleDevice) GetRate() uint64 { + if m != nil { + return m.Rate + } + return 0 +} + +type LinuxBlockIO struct { + // Specifies per cgroup weight + Weight uint32 `protobuf:"varint,1,opt,name=Weight" json:"Weight,omitempty"` + // Specifies tasks' weight in the given cgroup while competing with the cgroup's child cgroups, CFQ scheduler only + LeafWeight uint32 `protobuf:"varint,2,opt,name=LeafWeight" json:"LeafWeight,omitempty"` + // Weight per cgroup per device, can override BlkioWeight + WeightDevice []*LinuxWeightDevice `protobuf:"bytes,3,rep,name=WeightDevice" json:"WeightDevice,omitempty"` + // IO read rate limit per cgroup per device, bytes per second + ThrottleReadBpsDevice []*LinuxThrottleDevice `protobuf:"bytes,4,rep,name=ThrottleReadBpsDevice" json:"ThrottleReadBpsDevice,omitempty"` + // IO write rate limit per cgroup per device, bytes per second + ThrottleWriteBpsDevice []*LinuxThrottleDevice `protobuf:"bytes,5,rep,name=ThrottleWriteBpsDevice" json:"ThrottleWriteBpsDevice,omitempty"` + // IO read rate limit per cgroup per device, IO per second + ThrottleReadIOPSDevice []*LinuxThrottleDevice `protobuf:"bytes,6,rep,name=ThrottleReadIOPSDevice" json:"ThrottleReadIOPSDevice,omitempty"` + // IO write rate limit per cgroup per device, IO per second + ThrottleWriteIOPSDevice []*LinuxThrottleDevice `protobuf:"bytes,7,rep,name=ThrottleWriteIOPSDevice" json:"ThrottleWriteIOPSDevice,omitempty"` +} + +func (m *LinuxBlockIO) Reset() { *m = LinuxBlockIO{} } +func (m *LinuxBlockIO) String() string { return proto.CompactTextString(m) } +func (*LinuxBlockIO) ProtoMessage() {} +func (*LinuxBlockIO) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{21} } + +func (m *LinuxBlockIO) GetWeight() uint32 { + if m != nil { + return m.Weight + } + return 0 +} + +func (m *LinuxBlockIO) GetLeafWeight() uint32 { + if m != nil { + return m.LeafWeight + } + return 0 +} + +func (m *LinuxBlockIO) GetWeightDevice() []*LinuxWeightDevice { + if m != nil { + return m.WeightDevice + } + return nil +} + +func (m *LinuxBlockIO) GetThrottleReadBpsDevice() []*LinuxThrottleDevice { + if m != nil { + return m.ThrottleReadBpsDevice + } + return nil +} + +func (m *LinuxBlockIO) GetThrottleWriteBpsDevice() []*LinuxThrottleDevice { + if m != nil { + return m.ThrottleWriteBpsDevice + } + return nil +} + +func (m *LinuxBlockIO) GetThrottleReadIOPSDevice() []*LinuxThrottleDevice { + if m != nil { + return m.ThrottleReadIOPSDevice + } + return nil +} + +func (m *LinuxBlockIO) GetThrottleWriteIOPSDevice() []*LinuxThrottleDevice { + if m != nil { + return m.ThrottleWriteIOPSDevice + } + return nil +} + +type LinuxPids struct { + // Maximum number of PIDs. Default is "no limit". + Limit int64 `protobuf:"varint,1,opt,name=Limit" json:"Limit,omitempty"` +} + +func (m *LinuxPids) Reset() { *m = LinuxPids{} } +func (m *LinuxPids) String() string { return proto.CompactTextString(m) } +func (*LinuxPids) ProtoMessage() {} +func (*LinuxPids) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{22} } + +func (m *LinuxPids) GetLimit() int64 { + if m != nil { + return m.Limit + } + return 0 +} + +type LinuxDeviceCgroup struct { + // Allow or deny + Allow bool `protobuf:"varint,1,opt,name=Allow" json:"Allow,omitempty"` + // Device type, block, char, etc. + Type string `protobuf:"bytes,2,opt,name=Type" json:"Type,omitempty"` + // Major is the device's major number. + Major int64 `protobuf:"varint,3,opt,name=Major" json:"Major,omitempty"` + // Minor is the device's minor number. + Minor int64 `protobuf:"varint,4,opt,name=Minor" json:"Minor,omitempty"` + // Cgroup access permissions format, rwm. + Access string `protobuf:"bytes,5,opt,name=Access" json:"Access,omitempty"` +} + +func (m *LinuxDeviceCgroup) Reset() { *m = LinuxDeviceCgroup{} } +func (m *LinuxDeviceCgroup) String() string { return proto.CompactTextString(m) } +func (*LinuxDeviceCgroup) ProtoMessage() {} +func (*LinuxDeviceCgroup) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{23} } + +func (m *LinuxDeviceCgroup) GetAllow() bool { + if m != nil { + return m.Allow + } + return false +} + +func (m *LinuxDeviceCgroup) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *LinuxDeviceCgroup) GetMajor() int64 { + if m != nil { + return m.Major + } + return 0 +} + +func (m *LinuxDeviceCgroup) GetMinor() int64 { + if m != nil { + return m.Minor + } + return 0 +} + +func (m *LinuxDeviceCgroup) GetAccess() string { + if m != nil { + return m.Access + } + return "" +} + +type LinuxNetwork struct { + // Set class identifier for container's network packets + ClassID uint32 `protobuf:"varint,1,opt,name=ClassID" json:"ClassID,omitempty"` + // Set priority of network traffic for container + Priorities []*LinuxInterfacePriority `protobuf:"bytes,2,rep,name=Priorities" json:"Priorities,omitempty"` +} + +func (m *LinuxNetwork) Reset() { *m = LinuxNetwork{} } +func (m *LinuxNetwork) String() string { return proto.CompactTextString(m) } +func (*LinuxNetwork) ProtoMessage() {} +func (*LinuxNetwork) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{24} } + +func (m *LinuxNetwork) GetClassID() uint32 { + if m != nil { + return m.ClassID + } + return 0 +} + +func (m *LinuxNetwork) GetPriorities() []*LinuxInterfacePriority { + if m != nil { + return m.Priorities + } + return nil +} + +type LinuxHugepageLimit struct { + // Pagesize is the hugepage size + Pagesize string `protobuf:"bytes,1,opt,name=Pagesize" json:"Pagesize,omitempty"` + // Limit is the limit of "hugepagesize" hugetlb usage + Limit uint64 `protobuf:"varint,2,opt,name=Limit" json:"Limit,omitempty"` +} + +func (m *LinuxHugepageLimit) Reset() { *m = LinuxHugepageLimit{} } +func (m *LinuxHugepageLimit) String() string { return proto.CompactTextString(m) } +func (*LinuxHugepageLimit) ProtoMessage() {} +func (*LinuxHugepageLimit) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{25} } + +func (m *LinuxHugepageLimit) GetPagesize() string { + if m != nil { + return m.Pagesize + } + return "" +} + +func (m *LinuxHugepageLimit) GetLimit() uint64 { + if m != nil { + return m.Limit + } + return 0 +} + +type LinuxInterfacePriority struct { + // Name is the name of the network interface + Name string `protobuf:"bytes,1,opt,name=Name" json:"Name,omitempty"` + // Priority for the interface + Priority uint32 `protobuf:"varint,2,opt,name=Priority" json:"Priority,omitempty"` +} + +func (m *LinuxInterfacePriority) Reset() { *m = LinuxInterfacePriority{} } +func (m *LinuxInterfacePriority) String() string { return proto.CompactTextString(m) } +func (*LinuxInterfacePriority) ProtoMessage() {} +func (*LinuxInterfacePriority) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{26} } + +func (m *LinuxInterfacePriority) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *LinuxInterfacePriority) GetPriority() uint32 { + if m != nil { + return m.Priority + } + return 0 +} + +type LinuxSeccomp struct { + DefaultAction string `protobuf:"bytes,1,opt,name=DefaultAction" json:"DefaultAction,omitempty"` + Architectures []string `protobuf:"bytes,2,rep,name=Architectures" json:"Architectures,omitempty"` + Syscalls []*LinuxSyscall `protobuf:"bytes,3,rep,name=Syscalls" json:"Syscalls,omitempty"` +} + +func (m *LinuxSeccomp) Reset() { *m = LinuxSeccomp{} } +func (m *LinuxSeccomp) String() string { return proto.CompactTextString(m) } +func (*LinuxSeccomp) ProtoMessage() {} +func (*LinuxSeccomp) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{27} } + +func (m *LinuxSeccomp) GetDefaultAction() string { + if m != nil { + return m.DefaultAction + } + return "" +} + +func (m *LinuxSeccomp) GetArchitectures() []string { + if m != nil { + return m.Architectures + } + return nil +} + +func (m *LinuxSeccomp) GetSyscalls() []*LinuxSyscall { + if m != nil { + return m.Syscalls + } + return nil +} + +type LinuxSeccompArg struct { + Index uint64 `protobuf:"varint,1,opt,name=Index" json:"Index,omitempty"` + Value uint64 `protobuf:"varint,2,opt,name=Value" json:"Value,omitempty"` + ValueTwo uint64 `protobuf:"varint,3,opt,name=ValueTwo" json:"ValueTwo,omitempty"` + Op string `protobuf:"bytes,4,opt,name=Op" json:"Op,omitempty"` +} + +func (m *LinuxSeccompArg) Reset() { *m = LinuxSeccompArg{} } +func (m *LinuxSeccompArg) String() string { return proto.CompactTextString(m) } +func (*LinuxSeccompArg) ProtoMessage() {} +func (*LinuxSeccompArg) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{28} } + +func (m *LinuxSeccompArg) GetIndex() uint64 { + if m != nil { + return m.Index + } + return 0 +} + +func (m *LinuxSeccompArg) GetValue() uint64 { + if m != nil { + return m.Value + } + return 0 +} + +func (m *LinuxSeccompArg) GetValueTwo() uint64 { + if m != nil { + return m.ValueTwo + } + return 0 +} + +func (m *LinuxSeccompArg) GetOp() string { + if m != nil { + return m.Op + } + return "" +} + +type LinuxSyscall struct { + Names []string `protobuf:"bytes,1,rep,name=Names" json:"Names,omitempty"` + Action string `protobuf:"bytes,2,opt,name=Action" json:"Action,omitempty"` + Args []*LinuxSeccompArg `protobuf:"bytes,3,rep,name=Args" json:"Args,omitempty"` +} + +func (m *LinuxSyscall) Reset() { *m = LinuxSyscall{} } +func (m *LinuxSyscall) String() string { return proto.CompactTextString(m) } +func (*LinuxSyscall) ProtoMessage() {} +func (*LinuxSyscall) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{29} } + +func (m *LinuxSyscall) GetNames() []string { + if m != nil { + return m.Names + } + return nil +} + +func (m *LinuxSyscall) GetAction() string { + if m != nil { + return m.Action + } + return "" +} + +func (m *LinuxSyscall) GetArgs() []*LinuxSeccompArg { + if m != nil { + return m.Args + } + return nil +} + +type LinuxIntelRdt struct { + // The schema for L3 cache id and capacity bitmask (CBM) + // Format: "L3:=;=;..." + L3CacheSchema string `protobuf:"bytes,1,opt,name=L3CacheSchema" json:"L3CacheSchema,omitempty"` +} + +func (m *LinuxIntelRdt) Reset() { *m = LinuxIntelRdt{} } +func (m *LinuxIntelRdt) String() string { return proto.CompactTextString(m) } +func (*LinuxIntelRdt) ProtoMessage() {} +func (*LinuxIntelRdt) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{30} } + +func (m *LinuxIntelRdt) GetL3CacheSchema() string { + if m != nil { + return m.L3CacheSchema + } + return "" +} + +func init() { + proto.RegisterType((*Spec)(nil), "grpc.Spec") + proto.RegisterType((*Process)(nil), "grpc.Process") + proto.RegisterType((*Box)(nil), "grpc.Box") + proto.RegisterType((*User)(nil), "grpc.User") + proto.RegisterType((*LinuxCapabilities)(nil), "grpc.LinuxCapabilities") + proto.RegisterType((*POSIXRlimit)(nil), "grpc.POSIXRlimit") + proto.RegisterType((*Mount)(nil), "grpc.Mount") + proto.RegisterType((*Root)(nil), "grpc.Root") + proto.RegisterType((*Hooks)(nil), "grpc.Hooks") + proto.RegisterType((*Hook)(nil), "grpc.Hook") + proto.RegisterType((*Linux)(nil), "grpc.Linux") + proto.RegisterType((*Windows)(nil), "grpc.Windows") + proto.RegisterType((*Solaris)(nil), "grpc.Solaris") + proto.RegisterType((*LinuxIDMapping)(nil), "grpc.LinuxIDMapping") + proto.RegisterType((*LinuxNamespace)(nil), "grpc.LinuxNamespace") + proto.RegisterType((*LinuxDevice)(nil), "grpc.LinuxDevice") + proto.RegisterType((*LinuxResources)(nil), "grpc.LinuxResources") + proto.RegisterType((*LinuxMemory)(nil), "grpc.LinuxMemory") + proto.RegisterType((*LinuxCPU)(nil), "grpc.LinuxCPU") + proto.RegisterType((*LinuxWeightDevice)(nil), "grpc.LinuxWeightDevice") + proto.RegisterType((*LinuxThrottleDevice)(nil), "grpc.LinuxThrottleDevice") + proto.RegisterType((*LinuxBlockIO)(nil), "grpc.LinuxBlockIO") + proto.RegisterType((*LinuxPids)(nil), "grpc.LinuxPids") + proto.RegisterType((*LinuxDeviceCgroup)(nil), "grpc.LinuxDeviceCgroup") + proto.RegisterType((*LinuxNetwork)(nil), "grpc.LinuxNetwork") + proto.RegisterType((*LinuxHugepageLimit)(nil), "grpc.LinuxHugepageLimit") + proto.RegisterType((*LinuxInterfacePriority)(nil), "grpc.LinuxInterfacePriority") + proto.RegisterType((*LinuxSeccomp)(nil), "grpc.LinuxSeccomp") + proto.RegisterType((*LinuxSeccompArg)(nil), "grpc.LinuxSeccompArg") + proto.RegisterType((*LinuxSyscall)(nil), "grpc.LinuxSyscall") + proto.RegisterType((*LinuxIntelRdt)(nil), "grpc.LinuxIntelRdt") +} + +func init() { proto.RegisterFile("oci.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 1926 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0x4f, 0x73, 0x1b, 0xb7, + 0x15, 0x1f, 0x72, 0x29, 0x8a, 0x04, 0x4d, 0xdb, 0x42, 0x1c, 0x65, 0xeb, 0x66, 0x52, 0x65, 0x93, + 0x49, 0x95, 0x26, 0xa3, 0x4c, 0xed, 0x36, 0x93, 0xfe, 0x9d, 0x52, 0x94, 0x63, 0x71, 0x22, 0x9a, + 0x0c, 0x28, 0xc5, 0x9d, 0x1e, 0x3a, 0x03, 0xed, 0x82, 0x24, 0xa2, 0xe5, 0x62, 0x07, 0x0b, 0x4a, + 0x56, 0x6f, 0xbd, 0xf6, 0xd6, 0x8f, 0xd0, 0x53, 0x6f, 0xfd, 0x0e, 0xbd, 0xf6, 0xd2, 0x43, 0x8f, + 0xfd, 0x32, 0x9d, 0xf7, 0x80, 0x5d, 0x82, 0xa4, 0x9c, 0xb4, 0xcd, 0x89, 0x78, 0xbf, 0xf7, 0xf0, + 0x80, 0x87, 0xf7, 0x77, 0x49, 0xda, 0x2a, 0x96, 0x47, 0xb9, 0x56, 0x46, 0xd1, 0xc6, 0x4c, 0xe7, + 0x71, 0xf4, 0xf7, 0x80, 0x34, 0x26, 0xb9, 0x88, 0x69, 0x48, 0x76, 0xbf, 0x12, 0xba, 0x90, 0x2a, + 0x0b, 0x6b, 0x07, 0xb5, 0xc3, 0x36, 0x2b,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 0x9e, 0x4b, + 0x23, 0x62, 0xb3, 0xd4, 0xa2, 0x9c, 0xeb, 0xd7, 0x41, 0x7a, 0x44, 0x5a, 0x30, 0x5b, 0xf1, 0x34, + 0x2d, 0x5c, 0x0a, 0xae, 0x4d, 0x94, 0x96, 0xc5, 0x2a, 0x99, 0x48, 0x92, 0x07, 0xfe, 0x5d, 0x7a, + 0x7a, 0x06, 0xf6, 0x0f, 0xb2, 0x44, 0xbc, 0x72, 0x15, 0xda, 0x12, 0x80, 0x7e, 0x55, 0xcd, 0x64, + 0x0d, 0x66, 0x09, 0xb0, 0x13, 0x17, 0xe7, 0x37, 0xca, 0x95, 0x95, 0x8a, 0xa6, 0xf7, 0x49, 0x7d, + 0x94, 0xbb, 0x6f, 0xda, 0xfa, 0x28, 0x8f, 0x66, 0xa5, 0xd9, 0xf6, 0x6c, 0xd0, 0x88, 0x43, 0x92, + 0xfb, 0x88, 0xb5, 0x84, 0x8d, 0x97, 0xaa, 0xc1, 0x61, 0xbc, 0xa0, 0xf9, 0x1f, 0xba, 0xaf, 0x19, + 0x6b, 0xd4, 0x9b, 0xdb, 0x63, 0x72, 0x4f, 0xcf, 0xec, 0x47, 0x4e, 0xf4, 0x53, 0xd2, 0x5d, 0x1b, + 0x3d, 0xe1, 0xe9, 0xce, 0x9e, 0xf6, 0x79, 0x3c, 0x17, 0x93, 0x78, 0x2e, 0x16, 0xbc, 0x7c, 0xe0, + 0x35, 0xf0, 0xb2, 0x89, 0x7f, 0xca, 0x3d, 0xfd, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf3, 0xf4, + 0x32, 0x69, 0xa1, 0x13, 0x00, 0x00, +} diff --git a/protocols/grpc/oci.proto b/protocols/grpc/oci.proto new file mode 100644 index 0000000000..97232b6376 --- /dev/null +++ b/protocols/grpc/oci.proto @@ -0,0 +1,454 @@ +// +// Copyright (c) 2017 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 +// + +syntax = "proto3"; + +package grpc; + +message Spec { + // Version of the Open Container Initiative Runtime Specification with which the bundle complies. + string Version = 1; + + // Process configures the container process. + Process Process = 2; + + // Root configures the container's root filesystem. + Root Root = 3; + + // Hostname configures the container's hostname. + string Hostname = 4; + + // Mounts configures additional mounts (on top of Root). + repeated Mount Mounts = 5; + + // Hooks configures callbacks for container lifecycle events. + Hooks Hooks = 6; + + // Annotations contains arbitrary metadata for the container. + map Annotations = 7; + + // Linux is platform-specific configuration for Linux based containers. + Linux Linux = 8; + + // Solaris is platform-specific configuration for Solaris based containers. + Solaris Solaris = 9; + // Windows is platform-specific configuration for Windows based containers. + Windows Windows = 10; +} + +message Process { + // Terminal creates an interactive terminal for the container. + bool Terminal = 1; + + // ConsoleSize specifies the size of the console. + Box ConsoleSize = 2; + + // OCIUser specifies user information for the process. + User User = 3; + + // Args specifies the binary and arguments for the application to execute. + repeated string Args = 4; + + // Env populates the process environment for the process. + repeated string Env = 5; + + // Cwd is the current working directory for the process and must be + // relative to the container's root. + string Cwd = 6; + + // Capabilities are Linux capabilities that are kept for the process. + LinuxCapabilities Capabilities = 7; + + // Rlimits specifies rlimit options to apply to the process. + repeated POSIXRlimit Rlimits = 8; + + // NoNewPrivileges controls whether additional privileges could be gained by processes in the container. + bool NoNewPrivileges = 9; + + // ApparmorProfile specifies the apparmor profile for the container. + string ApparmorProfile = 10; + + // Specify an oom_score_adj for the container. + uint32 OOMScoreAdj = 11; + + // SelinuxLabel specifies the selinux context that the container process is run as. + string SelinuxLabel = 12; +} + +message Box { + // Height is the vertical dimension of a box. + uint32 Height = 1; + + // Width is the horizontal dimension of a box. + uint32 Width = 2; +} + +message User { + // UID is the user id. + uint32 UID = 1; + + // GID is the group id. + uint32 GID = 2; + + // AdditionalGids are additional group ids set for the container's process. + repeated uint32 AdditionalGids = 3; + + // Username is the user name. + string Username = 4; +} + +message LinuxCapabilities { + // Bounding is the set of capabilities checked by the kernel. + repeated string Bounding = 1; + + // Effective is the set of capabilities checked by the kernel. + repeated string Effective = 2; + + // Inheritable is the capabilities preserved across execve. + repeated string Inheritable = 3; + + // Permitted is the limiting superset for effective capabilities. + repeated string Permitted = 4; + + // Ambient is the ambient set of capabilities that are kept. + repeated string Ambient = 5; +} + +message POSIXRlimit { + // Type of the rlimit to set + string Type = 1; + + // Hard is the hard limit for the specified type + uint64 Hard = 2; + + // Soft is the soft limit for the specified type + uint64 Soft = 3; +} + +message Mount { + // destination is the path inside the container expect when it starts with "tmp:/" + string destination = 1; + + // source is the path inside the container expect when it starts with "vm:/dev/" or "tmp:/" + // the path which starts with "vm:/dev/" refers the guest vm's "/dev", + // especially, "vm:/dev/hostfs/" refers to the shared filesystem. + // "tmp:/" is a temporary directory which is used for temporary mounts. + string source = 2; + string type = 3; + repeated string options = 4; +} + +message Root { + // Path is the absolute path to the container's root filesystem. + string Path = 1; + + // Readonly makes the root filesystem for the container readonly before the process is executed. + bool Readonly = 2; +} + +message Hooks { + // Prestart is a list of hooks to be run before the container process is executed. + repeated Hook Prestart = 1; + + // Poststart is a list of hooks to be run after the container process is started. + repeated Hook Poststart = 2; + + // Poststop is a list of hooks to be run after the container process exits. + repeated Hook Poststop = 3; +} + +message Hook { + string Path = 1; + repeated string Args = 2; + repeated string Env = 3; + int64 Timeout = 4; +} + +message Linux { + // UIDMapping specifies user mappings for supporting user namespaces. + repeated LinuxIDMapping UIDMappings = 1; + + // GIDMapping specifies group mappings for supporting user namespaces. + repeated LinuxIDMapping GIDMappings = 2; + + // Sysctl are a set of key value pairs that are set for the container on start + map Sysctl = 3; + + // Resources contain cgroup information for handling resource constraints + // for the container + LinuxResources Resources = 4; + + // CgroupsPath specifies the path to cgroups that are created and/or joined by the container. + // The path is expected to be relative to the cgroups mountpoint. + // If resources are specified, the cgroups at CgroupsPath will be updated based on resources. + string CgroupsPath = 5; + + // Namespaces contains the namespaces that are created and/or joined by the container + repeated LinuxNamespace Namespaces = 6; + + // Devices are a list of device nodes that are created for the container + repeated LinuxDevice Devices = 7; + + // Seccomp specifies the seccomp security settings for the container. + LinuxSeccomp Seccomp = 8; + + // RootfsPropagation is the rootfs mount propagation mode for the container. + string RootfsPropagation = 9; + + // MaskedPaths masks over the provided paths inside the container. + repeated string MaskedPaths = 10; + + // ReadonlyPaths sets the provided paths as RO inside the container. + repeated string ReadonlyPaths = 11; + + // MountLabel specifies the selinux context for the mounts in the container. + string MountLabel = 12; + + // IntelRdt contains Intel Resource Director Technology (RDT) information + // for handling resource constraints (e.g., L3 cache) for the container + LinuxIntelRdt IntelRdt = 13; +} + +message Windows { + // Dummy string, never used. + string dummy = 1; +} + +message Solaris { + // Dummy string, never used. + string dummy = 1; +} + +message LinuxIDMapping { + // HostID is the starting UID/GID on the host to be mapped to 'ContainerID' + uint32 HostID = 1; + + // ContainerID is the starting UID/GID in the container + uint32 ContainerID = 2; + + // Size is the number of IDs to be mapped + uint32 Size = 3; +} + +message LinuxNamespace { + // Type is the type of namespace + string Type = 1; + + // Path is a path to an existing namespace persisted on disk that can be joined + // and is of the same type + string Path = 2; +} + +message LinuxDevice { + // Path to the device. + string Path = 1; + + // Device type, block, char, etc. + string Type = 2; + + // Major is the device's major number. + int64 Major = 3; + + // Minor is the device's minor number. + int64 Minor = 4; + + // FileMode permission bits for the device. + uint32 FileMode = 5; + + // UID of the device. + uint32 UID = 6; + + // Gid of the device. + uint32 GID = 7; +} + +message LinuxResources { + // Devices configures the device whitelist. + repeated LinuxDeviceCgroup Devices = 1; + + // Memory restriction configuration + LinuxMemory Memory = 2; + + // CPU resource restriction configuration + LinuxCPU CPU = 3; + + // Task resource restriction configuration. + LinuxPids Pids = 4; + + // BlockIO restriction configuration + LinuxBlockIO BlockIO = 5; + + // Hugetlb limit (in bytes) + repeated LinuxHugepageLimit HugepageLimits = 6; + + // Network restriction configuration + LinuxNetwork Network = 7; +} + +message LinuxMemory { + // Memory limit (in bytes). + int64 Limit = 1; + + // Memory reservation or soft_limit (in bytes). + int64 Reservation = 2; + + // Total memory limit (memory + swap). + int64 Swap = 3; + + // Kernel memory limit (in bytes). + int64 Kernel = 4; + + // Kernel memory limit for tcp (in bytes) + int64 KernelTCP = 5; + + // How aggressive the kernel will swap memory pages. + uint64 Swappiness = 6; + + // DisableOOMKiller disables the OOM killer for out of memory conditions + bool DisableOOMKiller = 7; +} + +message LinuxCPU { + // CPU shares (relative weight (ratio) vs. other cgroups with cpu shares). + uint64 Shares = 1; + + // CPU hardcap limit (in usecs). Allowed cpu time in a given period. + int64 Quota = 2; + + // CPU period to be used for hardcapping (in usecs). + uint64 Period = 3; + + // How much time realtime scheduling may use (in usecs). + int64 RealtimeRuntime = 4; + + // CPU period to be used for realtime scheduling (in usecs). + uint64 RealtimePeriod = 5; + + // CPUs to use within the cpuset. Default is to use any CPU available. + string Cpus = 6; + + // List of memory nodes in the cpuset. Default is to use any available memory node. + string Mems = 7; +} + +message LinuxWeightDevice { + // Major is the device's major number. + int64 Major = 1; + + // Minor is the device's minor number. + int64 Minor = 2; + + // Weight is the bandwidth rate for the device. + uint32 Weight = 3; + + // LeafWeight is the bandwidth rate for the device while competing with the cgroup's child cgroups, CFQ scheduler only + uint32 LeafWeight = 4; +} + +message LinuxThrottleDevice { + // Major is the device's major number. + int64 Major = 1; + + // Minor is the device's minor number. + int64 Minor = 2; + + // Rate is the IO rate limit per cgroup per device + uint64 Rate = 3; +} + +message LinuxBlockIO { + // Specifies per cgroup weight + uint32 Weight = 1; + + // Specifies tasks' weight in the given cgroup while competing with the cgroup's child cgroups, CFQ scheduler only + uint32 LeafWeight = 2; + + // Weight per cgroup per device, can override BlkioWeight + repeated LinuxWeightDevice WeightDevice = 3; + + // IO read rate limit per cgroup per device, bytes per second + repeated LinuxThrottleDevice ThrottleReadBpsDevice = 4; + + // IO write rate limit per cgroup per device, bytes per second + repeated LinuxThrottleDevice ThrottleWriteBpsDevice = 5; + + // IO read rate limit per cgroup per device, IO per second + repeated LinuxThrottleDevice ThrottleReadIOPSDevice = 6; + + // IO write rate limit per cgroup per device, IO per second + repeated LinuxThrottleDevice ThrottleWriteIOPSDevice = 7; +} + +message LinuxPids { + // Maximum number of PIDs. Default is "no limit". + int64 Limit = 1; +} + +message LinuxDeviceCgroup { + // Allow or deny + bool Allow = 1; + + // Device type, block, char, etc. + string Type = 2; + + // Major is the device's major number. + int64 Major = 3; + + // Minor is the device's minor number. + int64 Minor = 4; + + // Cgroup access permissions format, rwm. + string Access = 5; +} + +message LinuxNetwork { + // Set class identifier for container's network packets + uint32 ClassID = 1; + + // Set priority of network traffic for container + repeated LinuxInterfacePriority Priorities = 2; +} + +message LinuxHugepageLimit { + // Pagesize is the hugepage size + string Pagesize = 1; + + // Limit is the limit of "hugepagesize" hugetlb usage + uint64 Limit = 2; +} + +message LinuxInterfacePriority { + // Name is the name of the network interface + string Name = 1; + + // Priority for the interface + uint32 Priority = 2; +} + +message LinuxSeccomp { + string DefaultAction = 1; + repeated string Architectures = 2; + repeated LinuxSyscall Syscalls = 3; +} + +message LinuxSeccompArg { + uint64 Index = 1; + uint64 Value = 2; + uint64 ValueTwo = 3; + string Op = 4; +} + +message LinuxSyscall { + repeated string Names = 1; + string Action = 2; + repeated LinuxSeccompArg Args = 3; +} + +message LinuxIntelRdt { + // The schema for L3 cache id and capacity bitmask (CBM) + // Format: "L3:=;=;..." + string L3CacheSchema = 1; +} diff --git a/protocols/grpc/utils.go b/protocols/grpc/utils.go new file mode 100644 index 0000000000..b3701dc6e5 --- /dev/null +++ b/protocols/grpc/utils.go @@ -0,0 +1,238 @@ +// +// Copyright (c) 2017 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 +// + +package grpc + +import ( + "fmt" + "reflect" + + "github.com/opencontainers/runtime-spec/specs-go" +) + +func copyValue(to, from reflect.Value) error { + toKind := to.Kind() + fromKind := from.Kind() + + if !from.IsValid() { + return nil + } + + if toKind == reflect.Ptr { + // If the destination is a pointer, we need to allocate a new one. + to.Set(reflect.New(to.Type().Elem())) + if fromKind == reflect.Ptr { + return copyValue(to.Elem(), from.Elem()) + } else { + return copyValue(to.Elem(), from) + } + } else { + // Here the destination is not a pointer. + // Let's check what's the origin. + if fromKind == reflect.Ptr { + return copyValue(to, from.Elem()) + } + + switch toKind { + case reflect.Struct: + return copyStructValue(to, from) + case reflect.Slice: + return copySliceValue(to, from) + case reflect.Map: + return copyMapValue(to, from) + default: + // We now are copying non pointers scalar. + // This is the leaf of the recursion. + if from.Type() != to.Type() { + if from.Type().ConvertibleTo(to.Type()) { + to.Set(from.Convert(to.Type())) + return nil + } else { + return fmt.Errorf("Can not convert %v to %v", from.Type(), to.Type()) + } + } else { + to.Set(from) + return nil + } + } + } +} + +func copyMapValue(to, from reflect.Value) error { + if to.Kind() != reflect.Map && from.Kind() != reflect.Map { + return fmt.Errorf("Can only copy maps into maps") + } + + to.Set(reflect.MakeMap(to.Type())) + + keys := from.MapKeys() + + for _, k := range keys { + newValue := reflect.New(to.Type().Elem()) + v := from.MapIndex(k) + + if err := copyValue(newValue.Elem(), v); err != nil { + return err + } + + to.SetMapIndex(k, newValue.Elem()) + } + + return nil +} + +func copySliceValue(to, from reflect.Value) error { + if to.Kind() != reflect.Slice && from.Kind() != reflect.Slice { + return fmt.Errorf("Can only copy slices into slices") + } + + sliceLen := from.Len() + to.Set(reflect.MakeSlice(to.Type(), sliceLen, sliceLen)) + + for j := 0; j < sliceLen; j++ { + if err := copyValue(to.Index(j), from.Index(j)); err != nil { + return err + } + } + + return nil +} + +func copyStructSkipField(to, from reflect.Value) bool { + var grpcSolaris Solaris + var ociSolaris specs.Solaris + var grpcWindows Windows + var ociWindows specs.Windows + + toType := to.Type() + grpcSolarisType := reflect.TypeOf(grpcSolaris) + ociSolarisType := reflect.TypeOf(ociSolaris) + grpcWindowsType := reflect.TypeOf(grpcWindows) + ociWindowsType := reflect.TypeOf(ociWindows) + + // We skip all Windows and Solaris types + if toType == grpcSolarisType || toType == grpcWindowsType || toType == ociSolarisType || toType == ociWindowsType { + return true + } + + return false +} + +func structFieldName(v reflect.Value, index int) (string, error) { + if v.Kind() != reflect.Struct { + return "", fmt.Errorf("Can only infer field name from structs") + } + + return v.Type().Field(index).Name, nil +} + +func isEmbeddedStruct(v reflect.Value, index int) bool { + if v.Kind() != reflect.Struct || index > v.Type().NumField()-1 { + return false + } + + return v.Type().Field(index).Anonymous +} + +func findStructField(v reflect.Value, name string) (reflect.Value, error) { + if v.Kind() != reflect.Struct { + return reflect.Value{}, fmt.Errorf("Can only infer field name from structs") + } + + for i := 0; i < v.NumField(); i++ { + if v.Type().Field(i).Name == name { + return v.Field(i), nil + } + } + + return reflect.Value{}, fmt.Errorf("Could not find field %s", name) +} + +func copyStructValue(to, from reflect.Value) error { + if to.Kind() != reflect.Struct && from.Kind() != reflect.Struct { + return fmt.Errorf("Can only copy structs into structs") + } + + if copyStructSkipField(to, from) { + return nil + } + + for i := 0; i < to.NumField(); i++ { + // If one of the field is embedded, we copy between the embedded field + // and the structure itself. The fields in the embedded field should + // be found in the parent structure. + if isEmbeddedStruct(to, i) { + if err := copyStructValue(to.Field(i), from); err != nil { + return err + } + continue + } + + if isEmbeddedStruct(from, i) { + if err := copyStructValue(to, from.Field(i)); err != nil { + return err + } + continue + } + + // Find the destination structure field name. + fieldName, err := structFieldName(to, i) + if err != nil { + return err + } + + // Try to find the same field name in the origin structure. + // This can fail as we support copying between structures + // that optionally have embedded fields. + v, err := findStructField(from, fieldName) + if err != nil { + continue + } + + if err := copyValue(to.Field(i), v); err != nil { + return err + } + } + + return nil +} + +func copyStruct(to interface{}, from interface{}) (err error) { + defer func() { + if r := recover(); r != nil { + err = r.(error) + } + }() + + toVal := reflect.ValueOf(to) + fromVal := reflect.ValueOf(from) + + if toVal.Kind() != reflect.Ptr || toVal.Elem().Kind() != reflect.Struct || + fromVal.Kind() != reflect.Ptr || fromVal.Elem().Kind() != reflect.Struct { + return fmt.Errorf("Arguments must be pointers to structures") + } + + toVal = toVal.Elem() + fromVal = fromVal.Elem() + + return copyStructValue(toVal, fromVal) +} + +func OCItoGRPC(ociSpec *specs.Spec) (*Spec, error) { + s := &Spec{} + + err := copyStruct(s, ociSpec) + + return s, err +} + +func GRPCtoOCI(grpcSpec *Spec) (*specs.Spec, error) { + s := &specs.Spec{} + + err := copyStruct(s, grpcSpec) + + return s, err +} diff --git a/protocols/grpc/utils_test.go b/protocols/grpc/utils_test.go new file mode 100644 index 0000000000..0b086130c6 --- /dev/null +++ b/protocols/grpc/utils_test.go @@ -0,0 +1,154 @@ +// +// Copyright (c) 2017 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 +// + +package grpc + +import ( + "encoding/json" + "io/ioutil" + "reflect" + "testing" + + "github.com/opencontainers/runtime-spec/specs-go" + "github.com/stretchr/testify/assert" +) + +const ociConfigFile = "config.json" + +func assertIsEqual(t *testing.T, ociSpec *specs.Spec, grpcSpec *Spec) { + assert := assert.New(t) + + // Version check + assert.Equal(grpcSpec.Version, ociSpec.Version) + + // Process checks: User + assert.Equal(grpcSpec.Process.User.UID, ociSpec.Process.User.UID) + assert.Equal(grpcSpec.Process.User.GID, ociSpec.Process.User.GID) + + // Process checks: Capabilities + assert.Equal(grpcSpec.Process.Capabilities.Bounding, ociSpec.Process.Capabilities.Bounding) + assert.Equal(grpcSpec.Process.Capabilities.Effective, ociSpec.Process.Capabilities.Effective) + assert.Equal(grpcSpec.Process.Capabilities.Inheritable, ociSpec.Process.Capabilities.Inheritable) + assert.Equal(grpcSpec.Process.Capabilities.Permitted, ociSpec.Process.Capabilities.Permitted) + assert.Equal(grpcSpec.Process.Capabilities.Ambient, ociSpec.Process.Capabilities.Ambient) + + // Annotations checks: Annotations + assert.Equal(len(grpcSpec.Annotations), len(ociSpec.Annotations)) + + for k := range grpcSpec.Annotations { + assert.Equal(grpcSpec.Annotations[k], ociSpec.Annotations[k]) + } + + // Linux checks: Devices + assert.Equal(len(grpcSpec.Linux.Resources.Devices), len(ociSpec.Linux.Resources.Devices)) + assert.Equal(len(grpcSpec.Linux.Resources.Devices), 1) + assert.Equal(grpcSpec.Linux.Resources.Devices[0].Access, "rwm") + + // Linux checks: Block IO, for checking embedded structures copy + assert.NotNil(ociSpec.Linux.Resources.BlockIO.LeafWeight) + assert.NotNil(ociSpec.Linux.Resources.BlockIO.Weight) + assert.EqualValues(grpcSpec.Linux.Resources.BlockIO.Weight, *ociSpec.Linux.Resources.BlockIO.Weight) + assert.EqualValues(grpcSpec.Linux.Resources.BlockIO.LeafWeight, *ociSpec.Linux.Resources.BlockIO.LeafWeight) + assert.NotEqual(len(grpcSpec.Linux.Resources.BlockIO.WeightDevice), 0) + assert.Equal(len(grpcSpec.Linux.Resources.BlockIO.WeightDevice), len(grpcSpec.Linux.Resources.BlockIO.WeightDevice)) + assert.EqualValues(grpcSpec.Linux.Resources.BlockIO.WeightDevice[0].Major, ociSpec.Linux.Resources.BlockIO.WeightDevice[0].Major) + assert.EqualValues(grpcSpec.Linux.Resources.BlockIO.WeightDevice[0].Minor, ociSpec.Linux.Resources.BlockIO.WeightDevice[0].Minor) + assert.NotNil(ociSpec.Linux.Resources.BlockIO.WeightDevice[0].LeafWeight) + assert.NotNil(ociSpec.Linux.Resources.BlockIO.WeightDevice[0].Weight) + assert.EqualValues(grpcSpec.Linux.Resources.BlockIO.WeightDevice[0].Weight, *ociSpec.Linux.Resources.BlockIO.WeightDevice[0].Weight) + assert.EqualValues(grpcSpec.Linux.Resources.BlockIO.WeightDevice[0].LeafWeight, *ociSpec.Linux.Resources.BlockIO.WeightDevice[0].LeafWeight) + + // Linux checks: Namespaces + assert.Equal(len(grpcSpec.Linux.Namespaces), len(ociSpec.Linux.Namespaces)) + assert.Equal(len(grpcSpec.Linux.Namespaces), 5) + + for i := range grpcSpec.Linux.Namespaces { + assert.Equal(grpcSpec.Linux.Namespaces[i].Type, (string)(ociSpec.Linux.Namespaces[i].Type)) + assert.Equal(grpcSpec.Linux.Namespaces[i].Path, (string)(ociSpec.Linux.Namespaces[i].Path)) + } +} + +func TestOCItoGRPC(t *testing.T) { + assert := assert.New(t) + var ociSpec specs.Spec + + configJsonBytes, err := ioutil.ReadFile(ociConfigFile) + assert.NoError(err, "Could not open OCI config file") + + err = json.Unmarshal(configJsonBytes, &ociSpec) + assert.NoError(err, "Could not unmarshall OCI config file") + + spec, err := OCItoGRPC(&ociSpec) + assert.NoError(err, "Could not convert OCI config file") + assertIsEqual(t, &ociSpec, spec) +} + +func TestGRPCtoOCI(t *testing.T) { + assert := assert.New(t) + + var ociSpec specs.Spec + + configJsonBytes, err := ioutil.ReadFile(ociConfigFile) + assert.NoError(err, "Could not open OCI config file") + + err = json.Unmarshal(configJsonBytes, &ociSpec) + assert.NoError(err, "Could not unmarshall OCI config file") + + grpcSpec, err := OCItoGRPC(&ociSpec) + assert.NoError(err, "Could not convert OCI config file") + + newOciSpec, err := GRPCtoOCI(grpcSpec) + assert.NoError(err, "Could not convert gRPC structure") + + assertIsEqual(t, newOciSpec, grpcSpec) +} + +func testCopyValue(t *testing.T, to, from interface{}) { + assert := assert.New(t) + + err := copyValue(reflect.ValueOf(to).Elem(), reflect.ValueOf(from)) + assert.NoError(err, "Could not copy to %v", reflect.ValueOf(from).Kind()) + assert.Equal(reflect.ValueOf(to).Elem().Interface(), reflect.ValueOf(from).Interface()) +} + +func TestCopyValueString(t *testing.T) { + from := "foobar" + to := new(string) + + testCopyValue(t, to, from) +} + +func TestCopyValueSlice(t *testing.T) { + from := []string{"foobar", "barfoo"} + to := new([]string) + + testCopyValue(t, to, from) +} + +func TestCopyValueStruc(t *testing.T) { + type dummyStruct struct { + S string + I int + } + + from := dummyStruct{ + S: "foobar", + I: 18, + } + to := new(dummyStruct) + + testCopyValue(t, to, from) +} + +func TestCopyValueMap(t *testing.T) { + from := map[string]string{ + "key1": "value1", + "key2": "value2", + } + to := new(map[string]string) + + testCopyValue(t, to, from) +}