package hcsv2
import "github.com/Microsoft/hcsshim/internal/guest/runtime/hcsv2"
Index ¶
- Constants
- type Container
- func (c *Container) Delete(ctx context.Context) error
- func (c *Container) ExecProcess(ctx context.Context, process *oci.Process, conSettings stdio.ConnectionSettings) (int, error)
- func (c *Container) GetAllProcessPids(ctx context.Context) ([]int, error)
- func (c *Container) GetProcess(pid uint32) (Process, error)
- func (c *Container) GetStats(ctx context.Context) (*v1.Metrics, error)
- func (c *Container) Kill(ctx context.Context, signal syscall.Signal) error
- func (c *Container) Start(ctx context.Context, conSettings stdio.ConnectionSettings) (int, error)
- func (c *Container) Update(ctx context.Context, resources interface{}) error
- func (c *Container) Wait() prot.NotificationType
- type Host
- func NewHost(rtime runtime.Runtime, vsock transport.Transport) *Host
- func (h *Host) CreateContainer(ctx context.Context, id string, settings *prot.VMHostedContainerSettingsV2) (_ *Container, err error)
- func (h *Host) GetContainer(id string) (*Container, error)
- func (h *Host) GetExternalProcess(pid int) (Process, error)
- func (h *Host) ModifySettings(ctx context.Context, containerID string, settings *prot.ModifySettingRequest) error
- func (h *Host) RemoveContainer(id string)
- func (h *Host) RunExternalProcess(ctx context.Context, params prot.ProcessParameters, conSettings stdio.ConnectionSettings) (_ int, err error)
- func (h *Host) SetSecurityPolicy(base64Policy string) error
- func (h *Host) Shutdown()
- type Process
Constants ¶
const UVMContainerID = "00000000-0000-0000-0000-000000000000"
UVMContainerID is the ContainerID that will be sent on any prot.MessageBase for V2 where the specific message is targeted at the UVM itself.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func (*Container) Delete ¶
func (*Container) ExecProcess ¶
func (c *Container) ExecProcess(ctx context.Context, process *oci.Process, conSettings stdio.ConnectionSettings) (int, error)
func (*Container) GetAllProcessPids ¶
GetAllProcessPids returns all process pids in the container namespace.
func (*Container) GetProcess ¶
GetProcess returns the Process with the matching 'pid'. If the 'pid' does not exit returns error.
func (*Container) GetStats ¶
GetStats returns the cgroup metrics for the container.
func (*Container) Kill ¶
Kill sends 'signal' to the container process.
func (*Container) Start ¶
func (*Container) Update ¶
func (*Container) Wait ¶
func (c *Container) Wait() prot.NotificationType
Wait waits for the container's init process to exit.
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
Host is the structure tracking all UVM host state including all containers and processes.
func NewHost ¶
func (*Host) CreateContainer ¶
func (h *Host) CreateContainer(ctx context.Context, id string, settings *prot.VMHostedContainerSettingsV2) (_ *Container, err error)
func (*Host) GetContainer ¶
func (*Host) GetExternalProcess ¶
func (*Host) ModifySettings ¶
func (h *Host) ModifySettings(ctx context.Context, containerID string, settings *prot.ModifySettingRequest) error
func (*Host) RemoveContainer ¶
func (*Host) RunExternalProcess ¶
func (h *Host) RunExternalProcess(ctx context.Context, params prot.ProcessParameters, conSettings stdio.ConnectionSettings) (_ int, err error)
RunExternalProcess runs a process in the utility VM.
func (*Host) SetSecurityPolicy ¶
SetSecurityPolicy takes a base64 encoded security policy and sets up our internal data structures we use to store said policy. The security policy is transmitted as json in an annotation, so we first have to remove the base64 encoding that allows the JSON based policy to be passed as a string. From there, we decode the JSON and setup our security policy state
func (*Host) Shutdown ¶
func (h *Host) Shutdown()
Shutdown terminates this UVM. This is a destructive call and will destroy all state that has not been cleaned before calling this function.
type Process ¶
type Process interface { // Kill sends `signal` to the process. // // If the process has already exited returns `gcserr.HrErrNotFound` by contract. Kill(ctx context.Context, signal syscall.Signal) error // Pid returns the process id of the process. Pid() int // ResizeConsole resizes the tty to `height`x`width` for the process. ResizeConsole(ctx context.Context, height, width uint16) error // Wait returns a channel that can be used to wait for the process to exit // and gather the exit code. The second channel must be signaled from the // caller when the caller has completed its use of this call to Wait. Wait() (<-chan int, chan<- bool) }
Source Files ¶
container.go network.go nvidia_utils.go process.go sandbox_container.go spec.go standalone_container.go uvm.go workload_container.go
- Version
- v0.9.3
- Published
- May 20, 2022
- Platform
- linux/amd64
- Imports
- 41 packages
- Last checked
- 2 minutes ago –
Tools for package owners.