|
...
|
...
|
@@ -1,6 +1,7 @@
|
|
1
|
1
|
package hcsshim
|
|
2
|
2
|
|
|
3
|
3
|
import (
|
|
|
4
|
+ "encoding/json"
|
|
4
|
5
|
"io"
|
|
5
|
6
|
"time"
|
|
6
|
7
|
)
|
|
...
|
...
|
@@ -8,16 +9,18 @@ import (
|
|
8
|
8
|
// ProcessConfig is used as both the input of Container.CreateProcess
|
|
9
|
9
|
// and to convert the parameters to JSON for passing onto the HCS
|
|
10
|
10
|
type ProcessConfig struct {
|
|
11
|
|
- ApplicationName string
|
|
12
|
|
- CommandLine string
|
|
13
|
|
- User string
|
|
14
|
|
- WorkingDirectory string
|
|
15
|
|
- Environment map[string]string
|
|
16
|
|
- EmulateConsole bool
|
|
17
|
|
- CreateStdInPipe bool
|
|
18
|
|
- CreateStdOutPipe bool
|
|
19
|
|
- CreateStdErrPipe bool
|
|
20
|
|
- ConsoleSize [2]uint
|
|
|
11
|
+ ApplicationName string `json:",omitempty"`
|
|
|
12
|
+ CommandLine string `json:",omitempty"`
|
|
|
13
|
+ User string `json:",omitempty"`
|
|
|
14
|
+ WorkingDirectory string `json:",omitempty"`
|
|
|
15
|
+ Environment map[string]string `json:",omitempty"`
|
|
|
16
|
+ EmulateConsole bool `json:",omitempty"`
|
|
|
17
|
+ CreateStdInPipe bool `json:",omitempty"`
|
|
|
18
|
+ CreateStdOutPipe bool `json:",omitempty"`
|
|
|
19
|
+ CreateStdErrPipe bool `json:",omitempty"`
|
|
|
20
|
+ ConsoleSize [2]uint `json:",omitempty"`
|
|
|
21
|
+ CreateInUtilityVm bool `json:",omitempty"` // Used by Linux Containers on Windows
|
|
|
22
|
+ OCISpecification *json.RawMessage `json:",omitempty"` // Used by Linux Containers on Windows
|
|
21
|
23
|
}
|
|
22
|
24
|
|
|
23
|
25
|
type Layer struct {
|
|
...
|
...
|
@@ -34,39 +37,50 @@ type MappedDir struct {
|
|
34
|
34
|
}
|
|
35
|
35
|
|
|
36
|
36
|
type HvRuntime struct {
|
|
37
|
|
- ImagePath string `json:",omitempty"`
|
|
38
|
|
- SkipTemplate bool `json:",omitempty"`
|
|
|
37
|
+ ImagePath string `json:",omitempty"`
|
|
|
38
|
+ SkipTemplate bool `json:",omitempty"`
|
|
|
39
|
+ LinuxInitrdPath string `json:",omitempty"` // Host path to an initrd image for starting a Linux utility VM
|
|
|
40
|
+ LinuxKernelPath string `json:",omitempty"` // Host path to kernel for starting a Linux utility VM
|
|
|
41
|
+}
|
|
|
42
|
+
|
|
|
43
|
+type MappedVirtualDisk struct {
|
|
|
44
|
+ HostPath string `json:",omitempty"` // Path to VHD on the host
|
|
|
45
|
+ ContainerPath string // Platform-specific mount point path in the container
|
|
|
46
|
+ CreateInUtilityVM bool `json:",omitempty"`
|
|
|
47
|
+ ReadOnly bool `json:",omitempty"`
|
|
|
48
|
+ Cache string `json:",omitempty"` // "" (Unspecified); "Disabled"; "Enabled"; "Private"; "PrivateAllowSharing"
|
|
39
|
49
|
}
|
|
40
|
50
|
|
|
41
|
51
|
// ContainerConfig is used as both the input of CreateContainer
|
|
42
|
52
|
// and to convert the parameters to JSON for passing onto the HCS
|
|
43
|
53
|
type ContainerConfig struct {
|
|
44
|
|
- SystemType string // HCS requires this to be hard-coded to "Container"
|
|
45
|
|
- Name string // Name of the container. We use the docker ID.
|
|
46
|
|
- Owner string // The management platform that created this container
|
|
47
|
|
- IsDummy bool // Used for development purposes.
|
|
48
|
|
- VolumePath string `json:",omitempty"` // Windows volume path for scratch space. Used by Windows Server Containers only. Format \\?\\Volume{GUID}
|
|
49
|
|
- IgnoreFlushesDuringBoot bool // Optimization hint for container startup in Windows
|
|
50
|
|
- LayerFolderPath string `json:",omitempty"` // Where the layer folders are located. Used by Windows Server Containers only. Format %root%\windowsfilter\containerID
|
|
51
|
|
- Layers []Layer // List of storage layers. Required for Windows Server and Hyper-V Containers. Format ID=GUID;Path=%root%\windowsfilter\layerID
|
|
52
|
|
- Credentials string `json:",omitempty"` // Credentials information
|
|
53
|
|
- ProcessorCount uint32 `json:",omitempty"` // Number of processors to assign to the container.
|
|
54
|
|
- ProcessorWeight uint64 `json:",omitempty"` // CPU Shares 0..10000 on Windows; where 0 will be omitted and HCS will default.
|
|
55
|
|
- ProcessorMaximum int64 `json:",omitempty"` // CPU maximum usage percent 1..100
|
|
56
|
|
- StorageIOPSMaximum uint64 `json:",omitempty"` // Maximum Storage IOPS
|
|
57
|
|
- StorageBandwidthMaximum uint64 `json:",omitempty"` // Maximum Storage Bandwidth in bytes per second
|
|
58
|
|
- StorageSandboxSize uint64 `json:",omitempty"` // Size in bytes that the container system drive should be expanded to if smaller
|
|
59
|
|
- MemoryMaximumInMB int64 `json:",omitempty"` // Maximum memory available to the container in Megabytes
|
|
60
|
|
- HostName string // Hostname
|
|
61
|
|
- MappedDirectories []MappedDir // List of mapped directories (volumes/mounts)
|
|
62
|
|
- SandboxPath string `json:",omitempty"` // Location of unmounted sandbox. Used by Hyper-V containers only. Format %root%\windowsfilter
|
|
63
|
|
- HvPartition bool // True if it a Hyper-V Container
|
|
64
|
|
- EndpointList []string // List of networking endpoints to be attached to container
|
|
65
|
|
- NetworkSharedContainerName string `json:",omitempty"` // Name (ID) of the container that we will share the network stack with.
|
|
66
|
|
- HvRuntime *HvRuntime `json:",omitempty"` // Hyper-V container settings. Used by Hyper-V containers only. Format ImagePath=%root%\BaseLayerID\UtilityVM
|
|
67
|
|
- Servicing bool // True if this container is for servicing
|
|
68
|
|
- AllowUnqualifiedDNSQuery bool // True to allow unqualified DNS name resolution
|
|
69
|
|
- DNSSearchList string `json:",omitempty"` // Comma seperated list of DNS suffixes to use for name resolution
|
|
|
54
|
+ SystemType string // HCS requires this to be hard-coded to "Container"
|
|
|
55
|
+ Name string // Name of the container. We use the docker ID.
|
|
|
56
|
+ Owner string `json:",omitempty"` // The management platform that created this container
|
|
|
57
|
+ VolumePath string `json:",omitempty"` // Windows volume path for scratch space. Used by Windows Server Containers only. Format \\?\\Volume{GUID}
|
|
|
58
|
+ IgnoreFlushesDuringBoot bool `json:",omitempty"` // Optimization hint for container startup in Windows
|
|
|
59
|
+ LayerFolderPath string `json:",omitempty"` // Where the layer folders are located. Used by Windows Server Containers only. Format %root%\windowsfilter\containerID
|
|
|
60
|
+ Layers []Layer // List of storage layers. Required for Windows Server and Hyper-V Containers. Format ID=GUID;Path=%root%\windowsfilter\layerID
|
|
|
61
|
+ Credentials string `json:",omitempty"` // Credentials information
|
|
|
62
|
+ ProcessorCount uint32 `json:",omitempty"` // Number of processors to assign to the container.
|
|
|
63
|
+ ProcessorWeight uint64 `json:",omitempty"` // CPU Shares 0..10000 on Windows; where 0 will be omitted and HCS will default.
|
|
|
64
|
+ ProcessorMaximum int64 `json:",omitempty"` // CPU maximum usage percent 1..100
|
|
|
65
|
+ StorageIOPSMaximum uint64 `json:",omitempty"` // Maximum Storage IOPS
|
|
|
66
|
+ StorageBandwidthMaximum uint64 `json:",omitempty"` // Maximum Storage Bandwidth in bytes per second
|
|
|
67
|
+ StorageSandboxSize uint64 `json:",omitempty"` // Size in bytes that the container system drive should be expanded to if smaller
|
|
|
68
|
+ MemoryMaximumInMB int64 `json:",omitempty"` // Maximum memory available to the container in Megabytes
|
|
|
69
|
+ HostName string `json:",omitempty"` // Hostname
|
|
|
70
|
+ MappedDirectories []MappedDir `json:",omitempty"` // List of mapped directories (volumes/mounts)
|
|
|
71
|
+ HvPartition bool // True if it a Hyper-V Container
|
|
|
72
|
+ NetworkSharedContainerName string `json:",omitempty"` // Name (ID) of the container that we will share the network stack with.
|
|
|
73
|
+ EndpointList []string `json:",omitempty"` // List of networking endpoints to be attached to container
|
|
|
74
|
+ HvRuntime *HvRuntime `json:",omitempty"` // Hyper-V container settings. Used by Hyper-V containers only. Format ImagePath=%root%\BaseLayerID\UtilityVM
|
|
|
75
|
+ Servicing bool `json:",omitempty"` // True if this container is for servicing
|
|
|
76
|
+ AllowUnqualifiedDNSQuery bool `json:",omitempty"` // True to allow unqualified DNS name resolution
|
|
|
77
|
+ DNSSearchList string `json:",omitempty"` // Comma seperated list of DNS suffixes to use for name resolution
|
|
|
78
|
+ ContainerType string `json:",omitempty"` // "Linux" for Linux containers on Windows. Omitted otherwise.
|
|
|
79
|
+ TerminateOnLastHandleClosed bool `json:",omitempty"` // Should HCS terminate the container once all handles have been closed
|
|
|
80
|
+ MappedVirtualDisks []MappedVirtualDisk `json:",omitempty"` // Array of virtual disks to mount at start
|
|
70
|
81
|
}
|
|
71
|
82
|
|
|
72
|
83
|
type ComputeSystemQuery struct {
|