From 21b1d4ada1c53870ae2da3f477beb5ca552aae10 Mon Sep 17 00:00:00 2001 From: Yosef Mihretie <40375360+yosefmih@users.noreply.github.com> Date: Mon, 25 Mar 2024 16:26:29 -0400 Subject: [PATCH] two more app event types (#216) * adds MaxResourceLimitExceedec and JobTimeOut app event types * adds MaxResourceLimitExceedec and JobTimeOut app event types --------- Co-authored-by: mihretiey@gmail.com --- .../go/porter/v1/agent_app_event_types.pb.go | 39 ++++++++++++------- .../porter/v1/agent_app_event_types_pb.d.ts | 14 +++++++ .../src/porter/v1/agent_app_event_types_pb.js | 2 + porter/v1/agent_app_event_types.proto | 6 +++ 4 files changed, 48 insertions(+), 13 deletions(-) diff --git a/generated/go/porter/v1/agent_app_event_types.pb.go b/generated/go/porter/v1/agent_app_event_types.pb.go index d217a9aa..7deb1a9b 100644 --- a/generated/go/porter/v1/agent_app_event_types.pb.go +++ b/generated/go/porter/v1/agent_app_event_types.pb.go @@ -28,6 +28,8 @@ const ( // APP_EVENT_TYPE_INSUFFICIENT_RESOURCES is generated when pods can't be scheduled becase of a resource shortage // This is either CPU or Memory, but agent cannot resolve AppEventType_APP_EVENT_TYPE_INSUFFICIENT_RESOURCES AppEventType = 1 + // APP_EVENT_TYPE_MAX_RESOURCE_LIMIT_EXCEEDED is generated when pods can't be scheduled because the node group has reached maximum capacity + AppEventType_APP_EVENT_TYPE_MAX_RESOURCE_LIMIT_EXCEEDED AppEventType = 3 // APP_EVENT_TYPE_INSUFFICIENT_CPU is generated when pods can't be scheduled because there is insufficient CPU AppEventType_APP_EVENT_TYPE_INSUFFICIENT_CPU AppEventType = 5 // APP_EVENT_TYPE_INSUFFICIENT_MEMORY is generated when pods can't be scheduled because there is insufficient memory @@ -44,6 +46,8 @@ const ( AppEventType_APP_EVENT_TYPE_NON_ZERO_EXIT_CODE AppEventType = 35 // APP_EVENT_TYPE_FAILING_HEALTH_CHECK is generated when a container is restarted due to a failing health check AppEventType_APP_EVENT_TYPE_FAILING_HEALTH_CHECK AppEventType = 40 + // APP_EVENT_TYPE_JOB_TIMEOUT is generated when a job container runs for more than the timeout period set for it + AppEventType_APP_EVENT_TYPE_JOB_TIMEOUT AppEventType = 45 ) // Enum value maps for AppEventType. @@ -51,6 +55,7 @@ var ( AppEventType_name = map[int32]string{ 0: "APP_EVENT_TYPE_UNSPECIFIED", 1: "APP_EVENT_TYPE_INSUFFICIENT_RESOURCES", + 3: "APP_EVENT_TYPE_MAX_RESOURCE_LIMIT_EXCEEDED", 5: "APP_EVENT_TYPE_INSUFFICIENT_CPU", 10: "APP_EVENT_TYPE_INSUFFICIENT_MEMORY", 15: "APP_EVENT_TYPE_STUCK_PENDING", @@ -59,18 +64,21 @@ var ( 30: "APP_EVENT_TYPE_OUT_OF_MEMORY", 35: "APP_EVENT_TYPE_NON_ZERO_EXIT_CODE", 40: "APP_EVENT_TYPE_FAILING_HEALTH_CHECK", + 45: "APP_EVENT_TYPE_JOB_TIMEOUT", } AppEventType_value = map[string]int32{ - "APP_EVENT_TYPE_UNSPECIFIED": 0, - "APP_EVENT_TYPE_INSUFFICIENT_RESOURCES": 1, - "APP_EVENT_TYPE_INSUFFICIENT_CPU": 5, - "APP_EVENT_TYPE_INSUFFICIENT_MEMORY": 10, - "APP_EVENT_TYPE_STUCK_PENDING": 15, - "APP_EVENT_TYPE_INVALID_IMAGE": 20, - "APP_EVENT_TYPE_INVALID_START_COMMAND": 25, - "APP_EVENT_TYPE_OUT_OF_MEMORY": 30, - "APP_EVENT_TYPE_NON_ZERO_EXIT_CODE": 35, - "APP_EVENT_TYPE_FAILING_HEALTH_CHECK": 40, + "APP_EVENT_TYPE_UNSPECIFIED": 0, + "APP_EVENT_TYPE_INSUFFICIENT_RESOURCES": 1, + "APP_EVENT_TYPE_MAX_RESOURCE_LIMIT_EXCEEDED": 3, + "APP_EVENT_TYPE_INSUFFICIENT_CPU": 5, + "APP_EVENT_TYPE_INSUFFICIENT_MEMORY": 10, + "APP_EVENT_TYPE_STUCK_PENDING": 15, + "APP_EVENT_TYPE_INVALID_IMAGE": 20, + "APP_EVENT_TYPE_INVALID_START_COMMAND": 25, + "APP_EVENT_TYPE_OUT_OF_MEMORY": 30, + "APP_EVENT_TYPE_NON_ZERO_EXIT_CODE": 35, + "APP_EVENT_TYPE_FAILING_HEALTH_CHECK": 40, + "APP_EVENT_TYPE_JOB_TIMEOUT": 45, } ) @@ -107,12 +115,15 @@ var file_porter_v1_agent_app_event_types_proto_rawDesc = []byte{ 0x0a, 0x25, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, - 0x76, 0x31, 0x2a, 0x86, 0x03, 0x0a, 0x0c, 0x41, 0x70, 0x70, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, + 0x76, 0x31, 0x2a, 0xd6, 0x03, 0x0a, 0x0c, 0x41, 0x70, 0x70, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x1a, 0x41, 0x50, 0x50, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x29, 0x0a, 0x25, 0x41, 0x50, 0x50, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x53, 0x55, 0x46, 0x46, 0x49, 0x43, 0x49, 0x45, - 0x4e, 0x54, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x53, 0x10, 0x01, 0x12, 0x23, + 0x4e, 0x54, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x53, 0x10, 0x01, 0x12, 0x2e, + 0x0a, 0x2a, 0x41, 0x50, 0x50, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x4d, 0x41, 0x58, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x4c, 0x49, + 0x4d, 0x49, 0x54, 0x5f, 0x45, 0x58, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x03, 0x12, 0x23, 0x0a, 0x1f, 0x41, 0x50, 0x50, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x53, 0x55, 0x46, 0x46, 0x49, 0x43, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x50, 0x55, 0x10, 0x05, 0x12, 0x26, 0x0a, 0x22, 0x41, 0x50, 0x50, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, @@ -131,7 +142,9 @@ var file_porter_v1_agent_app_event_types_proto_rawDesc = []byte{ 0x4e, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x5f, 0x45, 0x58, 0x49, 0x54, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x10, 0x23, 0x12, 0x27, 0x0a, 0x23, 0x41, 0x50, 0x50, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x49, 0x4e, 0x47, 0x5f, 0x48, 0x45, 0x41, - 0x4c, 0x54, 0x48, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x10, 0x28, 0x42, 0xb2, 0x01, 0x0a, 0x0d, + 0x4c, 0x54, 0x48, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x10, 0x28, 0x12, 0x1e, 0x0a, 0x1a, 0x41, + 0x50, 0x50, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x4f, + 0x42, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, 0x2d, 0x42, 0xb2, 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x17, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x70, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, diff --git a/generated/js/src/porter/v1/agent_app_event_types_pb.d.ts b/generated/js/src/porter/v1/agent_app_event_types_pb.d.ts index df9d175c..1d989d84 100644 --- a/generated/js/src/porter/v1/agent_app_event_types_pb.d.ts +++ b/generated/js/src/porter/v1/agent_app_event_types_pb.d.ts @@ -22,6 +22,13 @@ export declare enum AppEventType { */ INSUFFICIENT_RESOURCES = 1, + /** + * APP_EVENT_TYPE_MAX_RESOURCE_LIMIT_EXCEEDED is generated when pods can't be scheduled because the node group has reached maximum capacity + * + * @generated from enum value: APP_EVENT_TYPE_MAX_RESOURCE_LIMIT_EXCEEDED = 3; + */ + MAX_RESOURCE_LIMIT_EXCEEDED = 3, + /** * APP_EVENT_TYPE_INSUFFICIENT_CPU is generated when pods can't be scheduled because there is insufficient CPU * @@ -77,5 +84,12 @@ export declare enum AppEventType { * @generated from enum value: APP_EVENT_TYPE_FAILING_HEALTH_CHECK = 40; */ FAILING_HEALTH_CHECK = 40, + + /** + * APP_EVENT_TYPE_JOB_TIMEOUT is generated when a job container runs for more than the timeout period set for it + * + * @generated from enum value: APP_EVENT_TYPE_JOB_TIMEOUT = 45; + */ + JOB_TIMEOUT = 45, } diff --git a/generated/js/src/porter/v1/agent_app_event_types_pb.js b/generated/js/src/porter/v1/agent_app_event_types_pb.js index 99835a5d..07a873d6 100644 --- a/generated/js/src/porter/v1/agent_app_event_types_pb.js +++ b/generated/js/src/porter/v1/agent_app_event_types_pb.js @@ -13,6 +13,7 @@ export const AppEventType = /*@__PURE__*/ proto3.makeEnum( [ {no: 0, name: "APP_EVENT_TYPE_UNSPECIFIED", localName: "UNSPECIFIED"}, {no: 1, name: "APP_EVENT_TYPE_INSUFFICIENT_RESOURCES", localName: "INSUFFICIENT_RESOURCES"}, + {no: 3, name: "APP_EVENT_TYPE_MAX_RESOURCE_LIMIT_EXCEEDED", localName: "MAX_RESOURCE_LIMIT_EXCEEDED"}, {no: 5, name: "APP_EVENT_TYPE_INSUFFICIENT_CPU", localName: "INSUFFICIENT_CPU"}, {no: 10, name: "APP_EVENT_TYPE_INSUFFICIENT_MEMORY", localName: "INSUFFICIENT_MEMORY"}, {no: 15, name: "APP_EVENT_TYPE_STUCK_PENDING", localName: "STUCK_PENDING"}, @@ -21,6 +22,7 @@ export const AppEventType = /*@__PURE__*/ proto3.makeEnum( {no: 30, name: "APP_EVENT_TYPE_OUT_OF_MEMORY", localName: "OUT_OF_MEMORY"}, {no: 35, name: "APP_EVENT_TYPE_NON_ZERO_EXIT_CODE", localName: "NON_ZERO_EXIT_CODE"}, {no: 40, name: "APP_EVENT_TYPE_FAILING_HEALTH_CHECK", localName: "FAILING_HEALTH_CHECK"}, + {no: 45, name: "APP_EVENT_TYPE_JOB_TIMEOUT", localName: "JOB_TIMEOUT"}, ], ); diff --git a/porter/v1/agent_app_event_types.proto b/porter/v1/agent_app_event_types.proto index 9d9c57cc..f1c1d94a 100644 --- a/porter/v1/agent_app_event_types.proto +++ b/porter/v1/agent_app_event_types.proto @@ -10,6 +10,9 @@ enum AppEventType { // This is either CPU or Memory, but agent cannot resolve APP_EVENT_TYPE_INSUFFICIENT_RESOURCES = 1; + // APP_EVENT_TYPE_MAX_RESOURCE_LIMIT_EXCEEDED is generated when pods can't be scheduled because the node group has reached maximum capacity + APP_EVENT_TYPE_MAX_RESOURCE_LIMIT_EXCEEDED = 3; + // APP_EVENT_TYPE_INSUFFICIENT_CPU is generated when pods can't be scheduled because there is insufficient CPU APP_EVENT_TYPE_INSUFFICIENT_CPU = 5; @@ -33,4 +36,7 @@ enum AppEventType { // APP_EVENT_TYPE_FAILING_HEALTH_CHECK is generated when a container is restarted due to a failing health check APP_EVENT_TYPE_FAILING_HEALTH_CHECK = 40; + + // APP_EVENT_TYPE_JOB_TIMEOUT is generated when a job container runs for more than the timeout period set for it + APP_EVENT_TYPE_JOB_TIMEOUT = 45; }