Skip to content

Commit 88e182c

Browse files
committed
Add implementation of network configuration proxy
* Ncproxy (abbreviation of network configuration proxy) is a proxy used to facilitate external configuration of a pods network through a set of TTRPC and GRPC services. Ncproxy relies on other TTRPC/GRPC services to get the information it needs to perform its actions. The full set of services are as follows: ------------------------------------------------------------------------------------------------------ NetworkConfigProxy (TTRPC) - This service is exposed by Ncproxy and is used by the shim. NodeNetworkService (GRPC) - This service is exposed by any application implementing the interface to the service (/cmd/ncproxy/sdn_nodenetsvc/nodenetsvc.proto). NetworkConfigProxy (GRPC) - This service is exposed by Ncproxy and is used by a service implementing the NodeNetworkService GRPC interface. ComputeAgent (TTRPC) - This service is exposed by the shim and is called by ncproxy. --------------------------------------------------------------------------------------------------------- This is an optional feature that can be enabled by setting the annotation "io.microsoft.network.ncproxy" and providing an address to a TTRPC service that implements the NetworkConfigProxy TTRPC service defined in /internal/ncproxyttrpc. Signed-off-by: Daniel Canter <[email protected]>
1 parent 486694f commit 88e182c

38 files changed

Lines changed: 10680 additions & 430 deletions

Protobuild.toml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,10 @@ plugins = ["grpc", "fieldpath"]
3535
prefixes = ["github.com/Microsoft/hcsshim/internal/shimdiag"]
3636
plugins = ["ttrpc"]
3737

38-
# Lock down runhcs config
39-
40-
[[descriptors]]
41-
prefix = "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options"
42-
target = "cmd/containerd-shim-runhcs-v1/options/next.pb.txt"
43-
ignore_files = [
44-
"google/protobuf/descriptor.proto",
45-
"gogoproto/gogo.proto"
46-
]
38+
[[overrides]]
39+
prefixes = ["github.com/Microsoft/hcsshim/internal/computeagent"]
40+
plugins = ["ttrpc"]
4741

48-
[[descriptors]]
49-
prefix = "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats"
50-
target = "cmd/containerd-shim-runhcs-v1/stats/next.pb.txt"
51-
ignore_files = [
52-
"google/protobuf/descriptor.proto",
53-
"gogoproto/gogo.proto"
54-
]
42+
[[overrides]]
43+
prefixes = ["github.com/Microsoft/hcsshim/internal/ncproxyttrpc"]
44+
plugins = ["ttrpc"]

appveyor.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ build_script:
1919
- go build ./cmd/tar2ext4
2020
- go build ./cmd/wclayer
2121
- go build ./cmd/device-util
22-
- go build ./internal/tools/grantvmgroupaccess
22+
- go build ./cmd/ncproxy
23+
- go build ./internal/tools/grantvmgroupaccess
2324
- go build ./internal/tools/uvmboot
2425
- go build ./internal/tools/zapdir
2526
- go test -gcflags=all=-d=checkptr -v ./... -tags admin
@@ -40,6 +41,7 @@ artifacts:
4041
- path: 'grantvmgroupaccess.exe'
4142
- path: 'uvmboot.exe'
4243
- path: 'zapdir.exe'
44+
- path: 'ncproxy.exe'
4345
- path: './test/containerd-shim-runhcs-v1.test.exe'
4446
- path: './test/cri-containerd.test.exe'
4547
- path: './test/functional.test.exe'
Lines changed: 0 additions & 221 deletions
Original file line numberDiff line numberDiff line change
@@ -1,221 +0,0 @@
1-
file {
2-
name: "google/protobuf/timestamp.proto"
3-
package: "google.protobuf"
4-
message_type {
5-
name: "Timestamp"
6-
field {
7-
name: "seconds"
8-
number: 1
9-
label: LABEL_OPTIONAL
10-
type: TYPE_INT64
11-
json_name: "seconds"
12-
}
13-
field {
14-
name: "nanos"
15-
number: 2
16-
label: LABEL_OPTIONAL
17-
type: TYPE_INT32
18-
json_name: "nanos"
19-
}
20-
}
21-
options {
22-
java_package: "com.google.protobuf"
23-
java_outer_classname: "TimestampProto"
24-
java_multiple_files: true
25-
go_package: "github.com/golang/protobuf/ptypes/timestamp"
26-
cc_enable_arenas: true
27-
objc_class_prefix: "GPB"
28-
csharp_namespace: "Google.Protobuf.WellKnownTypes"
29-
}
30-
syntax: "proto3"
31-
}
32-
file {
33-
name: "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto"
34-
package: "containerd.runhcs.v1"
35-
dependency: "gogoproto/gogo.proto"
36-
dependency: "google/protobuf/timestamp.proto"
37-
message_type {
38-
name: "Options"
39-
field {
40-
name: "debug"
41-
number: 1
42-
label: LABEL_OPTIONAL
43-
type: TYPE_BOOL
44-
json_name: "debug"
45-
}
46-
field {
47-
name: "debug_type"
48-
number: 2
49-
label: LABEL_OPTIONAL
50-
type: TYPE_ENUM
51-
type_name: ".containerd.runhcs.v1.Options.DebugType"
52-
json_name: "debugType"
53-
}
54-
field {
55-
name: "registry_root"
56-
number: 3
57-
label: LABEL_OPTIONAL
58-
type: TYPE_STRING
59-
json_name: "registryRoot"
60-
}
61-
field {
62-
name: "sandbox_image"
63-
number: 4
64-
label: LABEL_OPTIONAL
65-
type: TYPE_STRING
66-
json_name: "sandboxImage"
67-
}
68-
field {
69-
name: "sandbox_platform"
70-
number: 5
71-
label: LABEL_OPTIONAL
72-
type: TYPE_STRING
73-
json_name: "sandboxPlatform"
74-
}
75-
field {
76-
name: "sandbox_isolation"
77-
number: 6
78-
label: LABEL_OPTIONAL
79-
type: TYPE_ENUM
80-
type_name: ".containerd.runhcs.v1.Options.SandboxIsolation"
81-
json_name: "sandboxIsolation"
82-
}
83-
field {
84-
name: "boot_files_root_path"
85-
number: 7
86-
label: LABEL_OPTIONAL
87-
type: TYPE_STRING
88-
json_name: "bootFilesRootPath"
89-
}
90-
field {
91-
name: "vm_processor_count"
92-
number: 8
93-
label: LABEL_OPTIONAL
94-
type: TYPE_INT32
95-
json_name: "vmProcessorCount"
96-
}
97-
field {
98-
name: "vm_memory_size_in_mb"
99-
number: 9
100-
label: LABEL_OPTIONAL
101-
type: TYPE_INT32
102-
json_name: "vmMemorySizeInMb"
103-
}
104-
field {
105-
name: "GPUVHDPath"
106-
number: 10
107-
label: LABEL_OPTIONAL
108-
type: TYPE_STRING
109-
json_name: "GPUVHDPath"
110-
}
111-
field {
112-
name: "scale_cpu_limits_to_sandbox"
113-
number: 11
114-
label: LABEL_OPTIONAL
115-
type: TYPE_BOOL
116-
json_name: "scaleCpuLimitsToSandbox"
117-
}
118-
enum_type {
119-
name: "DebugType"
120-
value {
121-
name: "NPIPE"
122-
number: 0
123-
}
124-
value {
125-
name: "FILE"
126-
number: 1
127-
}
128-
value {
129-
name: "ETW"
130-
number: 2
131-
}
132-
}
133-
enum_type {
134-
name: "SandboxIsolation"
135-
value {
136-
name: "PROCESS"
137-
number: 0
138-
}
139-
value {
140-
name: "HYPERVISOR"
141-
number: 1
142-
}
143-
}
144-
}
145-
message_type {
146-
name: "ProcessDetails"
147-
field {
148-
name: "image_name"
149-
number: 1
150-
label: LABEL_OPTIONAL
151-
type: TYPE_STRING
152-
json_name: "imageName"
153-
}
154-
field {
155-
name: "created_at"
156-
number: 2
157-
label: LABEL_OPTIONAL
158-
type: TYPE_MESSAGE
159-
type_name: ".google.protobuf.Timestamp"
160-
options {
161-
65001: 0
162-
65010: 1
163-
}
164-
json_name: "createdAt"
165-
}
166-
field {
167-
name: "kernel_time_100_ns"
168-
number: 3
169-
label: LABEL_OPTIONAL
170-
type: TYPE_UINT64
171-
json_name: "kernelTime100Ns"
172-
}
173-
field {
174-
name: "memory_commit_bytes"
175-
number: 4
176-
label: LABEL_OPTIONAL
177-
type: TYPE_UINT64
178-
json_name: "memoryCommitBytes"
179-
}
180-
field {
181-
name: "memory_working_set_private_bytes"
182-
number: 5
183-
label: LABEL_OPTIONAL
184-
type: TYPE_UINT64
185-
json_name: "memoryWorkingSetPrivateBytes"
186-
}
187-
field {
188-
name: "memory_working_set_shared_bytes"
189-
number: 6
190-
label: LABEL_OPTIONAL
191-
type: TYPE_UINT64
192-
json_name: "memoryWorkingSetSharedBytes"
193-
}
194-
field {
195-
name: "process_id"
196-
number: 7
197-
label: LABEL_OPTIONAL
198-
type: TYPE_UINT32
199-
json_name: "processId"
200-
}
201-
field {
202-
name: "user_time_100_ns"
203-
number: 8
204-
label: LABEL_OPTIONAL
205-
type: TYPE_UINT64
206-
json_name: "userTime100Ns"
207-
}
208-
field {
209-
name: "exec_id"
210-
number: 9
211-
label: LABEL_OPTIONAL
212-
type: TYPE_STRING
213-
json_name: "execId"
214-
}
215-
}
216-
options {
217-
go_package: "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options;options"
218-
}
219-
weak_dependency: 0
220-
syntax: "proto3"
221-
}

0 commit comments

Comments
 (0)