Browse code

Merge pull request #26255 from Microsoft/jjh/xenon-test-infrastructure

Add isolation to info - enables Hyper-V containers CI bring-up

Vincent Demeester authored on 2016/09/28 01:46:51
Showing 8 changed files
... ...
@@ -268,6 +268,7 @@ type Info struct {
268 268
 	// running when the daemon is shutdown or upon daemon start if
269 269
 	// running containers are detected
270 270
 	LiveRestoreEnabled bool
271
+	Isolation          container.Isolation
271 272
 }
272 273
 
273 274
 // PluginsInfo is a temp struct holding Plugins name
... ...
@@ -145,6 +145,11 @@ func prettyPrintInfo(dockerCli *command.DockerCli, info types.Info) error {
145 145
 		fmt.Fprintf(dockerCli.Out(), "\n")
146 146
 	}
147 147
 
148
+	// Isolation only has meaning on a Windows daemon.
149
+	if info.OSType == "windows" {
150
+		fmt.Fprintf(dockerCli.Out(), "Default Isolation: %v\n", info.Isolation)
151
+	}
152
+
148 153
 	ioutils.FprintfIfNotEmpty(dockerCli.Out(), "Kernel Version: %s\n", info.KernelVersion)
149 154
 	ioutils.FprintfIfNotEmpty(dockerCli.Out(), "Operating System: %s\n", info.OperatingSystem)
150 155
 	ioutils.FprintfIfNotEmpty(dockerCli.Out(), "OSType: %s\n", info.OSType)
... ...
@@ -118,6 +118,7 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
118 118
 		NoProxy:            sockets.GetProxyEnv("no_proxy"),
119 119
 		SecurityOptions:    securityOptions,
120 120
 		LiveRestoreEnabled: daemon.configStore.LiveRestoreEnabled,
121
+		Isolation:          daemon.defaultIsolation,
121 122
 	}
122 123
 
123 124
 	// TODO Windows. Refactor this more once sysinfo is refactored into
... ...
@@ -116,6 +116,7 @@ This section lists each version from latest to oldest.  Each listing includes a
116 116
 
117 117
 [Docker Remote API v1.25](docker_remote_api_v1.25.md) documentation
118 118
 
119
+* `GET /info` now returns `Isolation`.
119 120
 * `POST /containers/create` now takes `AutoRemove` in HostConfig, to enable auto-removal of the container on daemon side when the container's process exits.
120 121
 * `GET /containers/json` and `GET /containers/(id or name)/json` now return `"removing"` as a value for the `State.Status` field if the container is being removed. Previously, "exited" was returned as status.
121 122
 * `GET /containers/json` now accepts `removing` as a valid value for the `status` filter.
... ...
@@ -2236,7 +2236,7 @@ Display system-wide information
2236 2236
 
2237 2237
     GET /info HTTP/1.1
2238 2238
 
2239
-**Example response**:
2239
+**Example response (Linux)**:
2240 2240
 
2241 2241
     HTTP/1.1 200 OK
2242 2242
     Content-Type: application/json
... ...
@@ -2314,6 +2314,109 @@ Display system-wide information
2314 2314
         "SystemTime": "2015-03-10T11:11:23.730591467-07:00"
2315 2315
     }
2316 2316
 
2317
+
2318
+**Example response (Windows)**:
2319
+
2320
+    HTTP/1.1 200 OK
2321
+    Content-Type: application/json
2322
+
2323
+    {
2324
+        "ID": "NYMS:B5VK:UMSL:FVDZ:EWB5:FKVK:LPFL:FJMQ:H6FT:BZJ6:L2TD:XH62",
2325
+        "Containers": 1,
2326
+        "ContainersRunning": 0,
2327
+        "ContainersPaused": 0,
2328
+        "ContainersStopped": 1,
2329
+        "Images": 17,
2330
+        "Driver": "windowsfilter",
2331
+        "DriverStatus": [
2332
+            ["Windows", ""]
2333
+        ],
2334
+        "SystemStatus": null,
2335
+            "Plugins": {
2336
+                "Volume": ["local"],
2337
+                "Network": ["nat", "null", "overlay"],
2338
+                "Authorization": null
2339
+            },
2340
+        "MemoryLimit": false,
2341
+        "SwapLimit": false,
2342
+        "KernelMemory": false,
2343
+        "CpuCfsPeriod": false,
2344
+        "CpuCfsQuota": false,
2345
+        "CPUShares": false,
2346
+        "CPUSet": false,
2347
+        "IPv4Forwarding": true,
2348
+        "BridgeNfIptables": true,
2349
+        "BridgeNfIp6tables": true,
2350
+        "Debug": false,
2351
+        "NFd": -1,
2352
+        "OomKillDisable": false,
2353
+        "NGoroutines": 11,
2354
+        "SystemTime": "2016-09-23T11:59:58.9843533-07:00",
2355
+        "LoggingDriver": "json-file",
2356
+        "CgroupDriver": "",
2357
+        "NEventsListener": 0,
2358
+        "KernelVersion": "10.0 14393 (14393.206.amd64fre.rs1_release.160912-1937)",
2359
+        "OperatingSystem": "Windows Server 2016 Datacenter",
2360
+        "OSType": "windows",
2361
+        "Architecture": "x86_64",
2362
+        "IndexServerAddress": "https://index.docker.io/v1/",
2363
+        "RegistryConfig": {
2364
+                "InsecureRegistryCIDRs": ["127.0.0.0/8"],
2365
+                "IndexConfigs": {
2366
+                    "docker.io": {
2367
+                        "Name": "docker.io",
2368
+                        "Mirrors": null,
2369
+                        "Secure": true,
2370
+                        "Official": true
2371
+                    }
2372
+                },
2373
+                "Mirrors": null
2374
+        },
2375
+        "NCPU": 8,
2376
+        "MemTotal": 4293828608,
2377
+        "DockerRootDir": "C:\\control",
2378
+        "HttpProxy": "",
2379
+        "HttpsProxy": "",
2380
+        "NoProxy": "",
2381
+        "Name": "WIN-V0V70C0LU5P",
2382
+        "Labels": null,
2383
+        "ExperimentalBuild": false,
2384
+        "ServerVersion": "1.13.0-dev",
2385
+        "ClusterStore": "",
2386
+        "ClusterAdvertise": "",
2387
+        "SecurityOptions": null,
2388
+        "Runtimes": null,
2389
+        "DefaultRuntime": "",
2390
+        "Swarm": {
2391
+            "NodeID": "",
2392
+            "NodeAddr": "",
2393
+            "LocalNodeState": "inactive",
2394
+            "ControlAvailable": false,
2395
+            "Error": "",
2396
+            "RemoteManagers": null,
2397
+            "Nodes": 0,
2398
+            "Managers": 0,
2399
+            "Cluster": {
2400
+                "ID": "",
2401
+                "Version": {},
2402
+                "CreatedAt": "0001-01-01T00:00:00Z",
2403
+                "UpdatedAt": "0001-01-01T00:00:00Z",
2404
+                "Spec": {
2405
+                    "Orchestration": {},
2406
+                    "Raft": {
2407
+                        "ElectionTick": 0,
2408
+                        "HeartbeatTick": 0
2409
+                    },
2410
+                    "Dispatcher": {},
2411
+                    "CAConfig": {},
2412
+                    "TaskDefaults": {}
2413
+                }
2414
+            }
2415
+        },
2416
+        "LiveRestoreEnabled": false,
2417
+        "Isolation": "process"
2418
+    }
2419
+
2317 2420
 **Status codes**:
2318 2421
 
2319 2422
 -   **200** – no error
... ...
@@ -154,3 +154,36 @@ You can also specify the output format:
154 154
 
155 155
     $ docker info --format '{{json .}}'
156 156
 	{"ID":"I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S","Containers":14, ...}
157
+
158
+Here is a sample output for a daemon running on Windows Server 2016:
159
+
160
+    E:\docker>docker info
161
+    Containers: 1
162
+     Running: 0
163
+     Paused: 0
164
+     Stopped: 1
165
+    Images: 17
166
+    Server Version: 1.13.0-dev
167
+    Storage Driver: windowsfilter
168
+     Windows:
169
+    Logging Driver: json-file
170
+    Plugins:
171
+     Volume: local
172
+     Network: nat null overlay
173
+    Swarm: inactive
174
+    Default Isolation: process
175
+    Kernel Version: 10.0 14393 (14393.206.amd64fre.rs1_release.160912-1937)
176
+    Operating System: Windows Server 2016 Datacenter
177
+    OSType: windows
178
+    Architecture: x86_64
179
+    CPUs: 8
180
+    Total Memory: 3.999 GiB
181
+    Name: WIN-V0V70C0LU5P
182
+    ID: NYMS:B5VK:UMSL:FVDZ:EWB5:FKVK:LPFL:FJMQ:H6FT:BZJ6:L2TD:XH62
183
+    Docker Root Dir: C:\control
184
+    Debug Mode (client): false
185
+    Debug Mode (server): false
186
+    Registry: https://index.docker.io/v1/
187
+    Insecure Registries:
188
+     127.0.0.0/8
189
+    Live Restore Enabled: false
157 190
\ No newline at end of file
... ...
@@ -9,6 +9,7 @@ import (
9 9
 	"path/filepath"
10 10
 	"strconv"
11 11
 
12
+	"github.com/docker/docker/api/types/container"
12 13
 	"github.com/docker/docker/pkg/reexec"
13 14
 )
14 15
 
... ...
@@ -69,6 +70,9 @@ var (
69 69
 	// Environment variable WINDOWS_BASE_IMAGE can override this
70 70
 	WindowsBaseImage = "windowsservercore"
71 71
 
72
+	// isolation is the isolation mode of the daemon under test
73
+	isolation container.Isolation
74
+
72 75
 	// daemonPid is the pid of the main test daemon
73 76
 	daemonPid int
74 77
 )
... ...
@@ -84,6 +84,7 @@ func init() {
84 84
 		volumesConfigPath = strings.Replace(volumesConfigPath, `\`, `/`, -1)
85 85
 		containerStoragePath = strings.Replace(containerStoragePath, `\`, `/`, -1)
86 86
 	}
87
+	isolation = info.Isolation
87 88
 }
88 89
 
89 90
 func convertBasesize(basesizeBytes int64) (int64, error) {