mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
fn: Call extensions/overriding and more customization friendly docker driver (#1065)
In pure-runner and LB agent, service providers might want to set specific driver options. For example, to add cpu-shares to functions, LB can add the information as extensions to the Call and pass this via gRPC to runners. Runners then pick these extensions from gRPC call and pass it to driver. Using a custom driver implementation, pure-runners can process these extensions to modify docker.CreateContainerOptions. To achieve this, LB agents can now be configured using a call overrider. Pure-runners can be configured using a custom docker driver. RunnerCall and Call interfaces both expose call extensions. An example to demonstrate this is implemented in test/fn-system-tests/system_test.go which registers a call overrider for LB agent as well as a simple custom docker driver. In this example, LB agent adds a key-value to extensions and runners add this key-value as an environment variable to the container.
This commit is contained in:
@@ -6,6 +6,7 @@ import "google/protobuf/empty.proto";
|
||||
message TryCall {
|
||||
string models_call_json = 1;
|
||||
string slot_hash_id = 2;
|
||||
map<string,string> extensions = 3;
|
||||
}
|
||||
|
||||
// Data sent C2S and S2C - as soon as the runner sees the first of these it
|
||||
|
||||
Reference in New Issue
Block a user