fn: runner status and docker load images (#1116)

* fn: runner status and docker load images

Introducing a function run for pure runner Status
calls. Previously, Status gRPC calls returned active
inflight request counts with the purpose of a simple
health checker. However this is not sufficient since
it does not show if agent or docker is healthy. With
this change, if pure runner is configured with a status
image, that image is executed through docker. The
call uses zero memory/cpu/tmpsize settings to ensure
resource tracker does not block it.

However, operators might not always have a docker
repository accessible/available for status image. Or
operators might not want the status to go over the
network. To allow such cases, and in general possibly
caching docker images, added a new environment variable
FN_DOCKER_LOAD_FILE. If this is set, fn-agent during
startup will load these images that were previously
saved with 'docker save' into docker.
This commit is contained in:
Tolga Ceylan
2018-07-12 13:58:38 -07:00
committed by GitHub
parent 62461d93a7
commit 5dc5740a54
26 changed files with 745 additions and 57 deletions

View File

@@ -575,7 +575,15 @@ func _RunnerMsg_OneofSizer(msg proto.Message) (n int) {
}
type RunnerStatus struct {
Active int32 `protobuf:"varint,2,opt,name=active" json:"active,omitempty"`
Active int32 `protobuf:"varint,2,opt,name=active" json:"active,omitempty"`
Failed bool `protobuf:"varint,3,opt,name=failed" json:"failed,omitempty"`
Id string `protobuf:"bytes,4,opt,name=id" json:"id,omitempty"`
Details string `protobuf:"bytes,5,opt,name=details" json:"details,omitempty"`
ErrorCode int32 `protobuf:"varint,6,opt,name=errorCode" json:"errorCode,omitempty"`
ErrorStr string `protobuf:"bytes,7,opt,name=errorStr" json:"errorStr,omitempty"`
CreatedAt string `protobuf:"bytes,8,opt,name=createdAt" json:"createdAt,omitempty"`
StartedAt string `protobuf:"bytes,9,opt,name=startedAt" json:"startedAt,omitempty"`
CompletedAt string `protobuf:"bytes,10,opt,name=completedAt" json:"completedAt,omitempty"`
}
func (m *RunnerStatus) Reset() { *m = RunnerStatus{} }
@@ -590,6 +598,62 @@ func (m *RunnerStatus) GetActive() int32 {
return 0
}
func (m *RunnerStatus) GetFailed() bool {
if m != nil {
return m.Failed
}
return false
}
func (m *RunnerStatus) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func (m *RunnerStatus) GetDetails() string {
if m != nil {
return m.Details
}
return ""
}
func (m *RunnerStatus) GetErrorCode() int32 {
if m != nil {
return m.ErrorCode
}
return 0
}
func (m *RunnerStatus) GetErrorStr() string {
if m != nil {
return m.ErrorStr
}
return ""
}
func (m *RunnerStatus) GetCreatedAt() string {
if m != nil {
return m.CreatedAt
}
return ""
}
func (m *RunnerStatus) GetStartedAt() string {
if m != nil {
return m.StartedAt
}
return ""
}
func (m *RunnerStatus) GetCompletedAt() string {
if m != nil {
return m.CompletedAt
}
return ""
}
func init() {
proto.RegisterType((*TryCall)(nil), "TryCall")
proto.RegisterType((*DataFrame)(nil), "DataFrame")
@@ -745,44 +809,46 @@ var _RunnerProtocol_serviceDesc = grpc.ServiceDesc{
func init() { proto.RegisterFile("runner.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 611 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xfd, 0x8a, 0xd3, 0x40,
0x10, 0xc0, 0x9b, 0x7e, 0x77, 0x92, 0xfb, 0x60, 0x11, 0x09, 0xf5, 0xc0, 0x12, 0x3f, 0x28, 0x08,
0x39, 0xad, 0x0a, 0x87, 0xa0, 0xa0, 0x67, 0x8f, 0x28, 0x1c, 0xc8, 0x56, 0xfc, 0xb7, 0xec, 0x25,
0x73, 0x6d, 0x74, 0x9b, 0x2d, 0xbb, 0xd3, 0xc3, 0x3e, 0x8a, 0x2f, 0xe5, 0x03, 0xf8, 0x34, 0xb2,
0x9b, 0x34, 0x57, 0xee, 0x1f, 0xfd, 0x6f, 0x67, 0x7e, 0xf3, 0xb5, 0x33, 0xb3, 0x0b, 0x81, 0xde,
0x14, 0x05, 0xea, 0x78, 0xad, 0x15, 0xa9, 0xe1, 0x83, 0x85, 0x52, 0x0b, 0x89, 0xa7, 0x4e, 0xba,
0xda, 0x5c, 0x9f, 0xe2, 0x6a, 0x4d, 0xdb, 0x12, 0x46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0c, 0xb8, 0x7b, 0x31,
0x36, 0xea, 0x6b, 0x08, 0xb4, 0xeb, 0xfd, 0xdc, 0x15, 0x56, 0x85, 0x3f, 0x8e, 0xef, 0x0c, 0x25,
0x69, 0x70, 0x5f, 0xef, 0xcd, 0xe8, 0x9f, 0xe9, 0xd8, 0x33, 0xe8, 0x5f, 0x57, 0x33, 0x71, 0x2d,
0xb5, 0x93, 0xdc, 0x1f, 0x54, 0xd2, 0xe0, 0xb5, 0x41, 0x5d, 0xdb, 0x53, 0x08, 0xca, 0xd2, 0x66,
0x6e, 0x91, 0xd8, 0x7d, 0xe8, 0x8a, 0x94, 0xf2, 0x9b, 0x72, 0x19, 0x3b, 0xbc, 0x92, 0x26, 0x0b,
0x38, 0x2c, 0xed, 0xbe, 0xd8, 0x67, 0x9d, 0x2a, 0xc9, 0x1e, 0x43, 0x77, 0x5a, 0x2c, 0xc4, 0x02,
0x19, 0xc4, 0x75, 0xcf, 0x86, 0x10, 0xd7, 0x37, 0x1d, 0x7b, 0xcf, 0x3d, 0x76, 0x0a, 0xdd, 0x5d,
0xe4, 0xb8, 0xfc, 0x27, 0xe2, 0xdd, 0x3f, 0x11, 0x4f, 0xed, 0x3f, 0x31, 0x3c, 0x88, 0xf7, 0x0b,
0xb8, 0xea, 0x3a, 0xfc, 0xf2, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6e, 0x67, 0x4d, 0xd3, 0x64,
0x04, 0x00, 0x00,
// 655 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xed, 0x8a, 0xd3, 0x40,
0x14, 0x6d, 0xd2, 0x36, 0x4d, 0x6f, 0xb2, 0x1f, 0x0c, 0x22, 0xa1, 0x2e, 0x58, 0xa2, 0x42, 0x41,
0xc8, 0x6a, 0x55, 0x58, 0x04, 0x05, 0x5d, 0xbb, 0x44, 0x61, 0x41, 0xa6, 0xe2, 0xdf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0x99, 0xe0, 0xe8, 0x31, 0x78, 0x93, 0x62, 0x41, 0x16, 0x0c, 0x41, 0x52, 0xaf,
0xc3, 0x00, 0x92, 0xda, 0xc4, 0x91, 0xf3, 0xcc, 0x41, 0xa7, 0xe0, 0xed, 0x34, 0x4b, 0xca, 0x27,
0x30, 0xd9, 0x3d, 0x81, 0xc9, 0xc4, 0x3c, 0x81, 0x83, 0x83, 0xa4, 0x29, 0xed, 0x95, 0x67, 0xe9,
0x17, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xaa, 0xe9, 0xb8, 0x88, 0x3f, 0x05, 0x00, 0x00,
}

View File

@@ -64,6 +64,14 @@ message RunnerMsg {
message RunnerStatus {
int32 active = 2; // Number of currently inflight responses
bool failed = 3; // if status was successful or not
string id = 4; // call id if status image was used
string details = 5; // details for logging/debug
int32 errorCode = 6; // error code if not successful
string errorStr = 7; // error description if not successful
string createdAt = 8; // call latency details: initialization time
string startedAt = 9; // call latency details: start time in container
string completedAt = 10; // call latency details: end time
}
service RunnerProtocol {