diff --git a/flyteidl/gen/pb-cpp/flyteidl/admin/agent.pb.cc b/flyteidl/gen/pb-cpp/flyteidl/admin/agent.pb.cc index 84cb28a2fc..490636e25c 100644 --- a/flyteidl/gen/pb-cpp/flyteidl/admin/agent.pb.cc +++ b/flyteidl/gen/pb-cpp/flyteidl/admin/agent.pb.cc @@ -20,7 +20,7 @@ extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fadmin_2fagent_2eproto ::google::proto extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fadmin_2fagent_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TaskExecutionMetadata_AnnotationsEntry_DoNotUse_flyteidl_2fadmin_2fagent_2eproto; extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fadmin_2fagent_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TaskExecutionMetadata_EnvironmentVariablesEntry_DoNotUse_flyteidl_2fadmin_2fagent_2eproto; extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fadmin_2fagent_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TaskExecutionMetadata_LabelsEntry_DoNotUse_flyteidl_2fadmin_2fagent_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fadmin_2fagent_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Resource_flyteidl_2fadmin_2fagent_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fadmin_2fagent_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_Resource_flyteidl_2fadmin_2fagent_2eproto; extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fadmin_2fagent_2eproto ::google::protobuf::internal::SCCInfo<4> scc_info_TaskExecutionMetadata_flyteidl_2fadmin_2fagent_2eproto; extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fcore_2fexecution_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TaskLog_flyteidl_2fcore_2fexecution_2eproto; extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fcore_2fidentifier_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_TaskExecutionIdentifier_flyteidl_2fcore_2fidentifier_2eproto; @@ -51,6 +51,8 @@ class CreateTaskRequestDefaultTypeInternal { class CreateTaskResponseDefaultTypeInternal { public: ::google::protobuf::internal::ExplicitlyConstructed _instance; + ::google::protobuf::internal::ArenaStringPtr resource_meta_; + const ::flyteidl::admin::Resource* resource_; } _CreateTaskResponse_default_instance_; class GetTaskRequestDefaultTypeInternal { public: @@ -179,8 +181,9 @@ static void InitDefaultsCreateTaskResponse_flyteidl_2fadmin_2fagent_2eproto() { ::flyteidl::admin::CreateTaskResponse::InitAsDefaultInstance(); } -::google::protobuf::internal::SCCInfo<0> scc_info_CreateTaskResponse_flyteidl_2fadmin_2fagent_2eproto = - {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsCreateTaskResponse_flyteidl_2fadmin_2fagent_2eproto}, {}}; +::google::protobuf::internal::SCCInfo<1> scc_info_CreateTaskResponse_flyteidl_2fadmin_2fagent_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsCreateTaskResponse_flyteidl_2fadmin_2fagent_2eproto}, { + &scc_info_Resource_flyteidl_2fadmin_2fagent_2eproto.base,}}; static void InitDefaultsGetTaskRequest_flyteidl_2fadmin_2fagent_2eproto() { GOOGLE_PROTOBUF_VERIFY_VERSION; @@ -223,9 +226,10 @@ static void InitDefaultsResource_flyteidl_2fadmin_2fagent_2eproto() { ::flyteidl::admin::Resource::InitAsDefaultInstance(); } -::google::protobuf::internal::SCCInfo<1> scc_info_Resource_flyteidl_2fadmin_2fagent_2eproto = - {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsResource_flyteidl_2fadmin_2fagent_2eproto}, { - &scc_info_Literal_flyteidl_2fcore_2fliterals_2eproto.base,}}; +::google::protobuf::internal::SCCInfo<2> scc_info_Resource_flyteidl_2fadmin_2fagent_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsResource_flyteidl_2fadmin_2fagent_2eproto}, { + &scc_info_Literal_flyteidl_2fcore_2fliterals_2eproto.base, + &scc_info_TaskLog_flyteidl_2fcore_2fexecution_2eproto.base,}}; static void InitDefaultsDeleteTaskRequest_flyteidl_2fadmin_2fagent_2eproto() { GOOGLE_PROTOBUF_VERIFY_VERSION; @@ -401,9 +405,11 @@ const ::google::protobuf::uint32 TableStruct_flyteidl_2fadmin_2fagent_2eproto::o ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::flyteidl::admin::CreateTaskResponse, _internal_metadata_), ~0u, // no _extensions_ - ~0u, // no _oneof_case_ + PROTOBUF_FIELD_OFFSET(::flyteidl::admin::CreateTaskResponse, _oneof_case_[0]), ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::flyteidl::admin::CreateTaskResponse, resource_meta_), + offsetof(::flyteidl::admin::CreateTaskResponseDefaultTypeInternal, resource_meta_), + offsetof(::flyteidl::admin::CreateTaskResponseDefaultTypeInternal, resource_), + PROTOBUF_FIELD_OFFSET(::flyteidl::admin::CreateTaskResponse, res_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::flyteidl::admin::GetTaskRequest, _internal_metadata_), ~0u, // no _extensions_ @@ -426,6 +432,7 @@ const ::google::protobuf::uint32 TableStruct_flyteidl_2fadmin_2fagent_2eproto::o PROTOBUF_FIELD_OFFSET(::flyteidl::admin::Resource, state_), PROTOBUF_FIELD_OFFSET(::flyteidl::admin::Resource, outputs_), PROTOBUF_FIELD_OFFSET(::flyteidl::admin::Resource, message_), + PROTOBUF_FIELD_OFFSET(::flyteidl::admin::Resource, log_links_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::flyteidl::admin::DeleteTaskRequest, _internal_metadata_), ~0u, // no _extensions_ @@ -476,16 +483,16 @@ static const ::google::protobuf::internal::MigrationSchema schemas[] PROTOBUF_SE { 27, -1, sizeof(::flyteidl::admin::TaskExecutionMetadata)}, { 38, -1, sizeof(::flyteidl::admin::CreateTaskRequest)}, { 47, -1, sizeof(::flyteidl::admin::CreateTaskResponse)}, - { 53, -1, sizeof(::flyteidl::admin::GetTaskRequest)}, - { 60, -1, sizeof(::flyteidl::admin::GetTaskResponse)}, - { 67, -1, sizeof(::flyteidl::admin::Resource)}, - { 75, -1, sizeof(::flyteidl::admin::DeleteTaskRequest)}, - { 82, -1, sizeof(::flyteidl::admin::DeleteTaskResponse)}, - { 87, -1, sizeof(::flyteidl::admin::Agent)}, - { 94, -1, sizeof(::flyteidl::admin::GetAgentRequest)}, - { 100, -1, sizeof(::flyteidl::admin::GetAgentResponse)}, - { 106, -1, sizeof(::flyteidl::admin::ListAgentsRequest)}, - { 111, -1, sizeof(::flyteidl::admin::ListAgentsResponse)}, + { 55, -1, sizeof(::flyteidl::admin::GetTaskRequest)}, + { 62, -1, sizeof(::flyteidl::admin::GetTaskResponse)}, + { 69, -1, sizeof(::flyteidl::admin::Resource)}, + { 78, -1, sizeof(::flyteidl::admin::DeleteTaskRequest)}, + { 85, -1, sizeof(::flyteidl::admin::DeleteTaskResponse)}, + { 90, -1, sizeof(::flyteidl::admin::Agent)}, + { 97, -1, sizeof(::flyteidl::admin::GetAgentRequest)}, + { 103, -1, sizeof(::flyteidl::admin::GetAgentResponse)}, + { 109, -1, sizeof(::flyteidl::admin::ListAgentsRequest)}, + { 114, -1, sizeof(::flyteidl::admin::ListAgentsResponse)}, }; static ::google::protobuf::Message const * const file_default_instances[] = { @@ -537,32 +544,35 @@ const char descriptor_table_protodef_flyteidl_2fadmin_2fagent_2eproto[] = "p\022-\n\010template\030\002 \001(\0132\033.flyteidl.core.Task" "Template\022\025\n\routput_prefix\030\003 \001(\t\022F\n\027task_" "execution_metadata\030\004 \001(\0132%.flyteidl.admi" - "n.TaskExecutionMetadata\"+\n\022CreateTaskRes" - "ponse\022\025\n\rresource_meta\030\001 \001(\014\":\n\016GetTaskR" - "equest\022\021\n\ttask_type\030\001 \001(\t\022\025\n\rresource_me" - "ta\030\002 \001(\014\"h\n\017GetTaskResponse\022*\n\010resource\030" - "\001 \001(\0132\030.flyteidl.admin.Resource\022)\n\tlog_l" - "inks\030\002 \003(\0132\026.flyteidl.core.TaskLog\"m\n\010Re" - "source\022$\n\005state\030\001 \001(\0162\025.flyteidl.admin.S" - "tate\022*\n\007outputs\030\002 \001(\0132\031.flyteidl.core.Li" - "teralMap\022\017\n\007message\030\003 \001(\t\"=\n\021DeleteTaskR" - "equest\022\021\n\ttask_type\030\001 \001(\t\022\025\n\rresource_me" - "ta\030\002 \001(\014\"\024\n\022DeleteTaskResponse\"3\n\005Agent\022" - "\014\n\004name\030\001 \001(\t\022\034\n\024supported_task_types\030\002 " - "\003(\t\"\037\n\017GetAgentRequest\022\014\n\004name\030\001 \001(\t\"8\n\020" - "GetAgentResponse\022$\n\005agent\030\001 \001(\0132\025.flytei" - "dl.admin.Agent\"\023\n\021ListAgentsRequest\";\n\022L" - "istAgentsResponse\022%\n\006agents\030\001 \003(\0132\025.flyt" - "eidl.admin.Agent*^\n\005State\022\025\n\021RETRYABLE_F" - "AILURE\020\000\022\025\n\021PERMANENT_FAILURE\020\001\022\013\n\007PENDI" - "NG\020\002\022\013\n\007RUNNING\020\003\022\r\n\tSUCCEEDED\020\004B=Z;gith" - "ub.com/flyteorg/flyte/flyteidl/gen/pb-go" - "/flyteidl/adminb\006proto3" + "n.TaskExecutionMetadata\"b\n\022CreateTaskRes" + "ponse\022\027\n\rresource_meta\030\001 \001(\014H\000\022,\n\010resour" + "ce\030\002 \001(\0132\030.flyteidl.admin.ResourceH\000B\005\n\003" + "res\":\n\016GetTaskRequest\022\021\n\ttask_type\030\001 \001(\t" + "\022\025\n\rresource_meta\030\002 \001(\014\"h\n\017GetTaskRespon" + "se\022*\n\010resource\030\001 \001(\0132\030.flyteidl.admin.Re" + "source\022)\n\tlog_links\030\002 \003(\0132\026.flyteidl.cor" + "e.TaskLog\"\230\001\n\010Resource\022$\n\005state\030\001 \001(\0162\025." + "flyteidl.admin.State\022*\n\007outputs\030\002 \001(\0132\031." + "flyteidl.core.LiteralMap\022\017\n\007message\030\003 \001(" + "\t\022)\n\tlog_links\030\004 \003(\0132\026.flyteidl.core.Tas" + "kLog\"=\n\021DeleteTaskRequest\022\021\n\ttask_type\030\001" + " \001(\t\022\025\n\rresource_meta\030\002 \001(\014\"\024\n\022DeleteTas" + "kResponse\"3\n\005Agent\022\014\n\004name\030\001 \001(\t\022\034\n\024supp" + "orted_task_types\030\002 \003(\t\"\037\n\017GetAgentReques" + "t\022\014\n\004name\030\001 \001(\t\"8\n\020GetAgentResponse\022$\n\005a" + "gent\030\001 \001(\0132\025.flyteidl.admin.Agent\"\023\n\021Lis" + "tAgentsRequest\";\n\022ListAgentsResponse\022%\n\006" + "agents\030\001 \003(\0132\025.flyteidl.admin.Agent*^\n\005S" + "tate\022\025\n\021RETRYABLE_FAILURE\020\000\022\025\n\021PERMANENT" + "_FAILURE\020\001\022\013\n\007PENDING\020\002\022\013\n\007RUNNING\020\003\022\r\n\t" + "SUCCEEDED\020\004B=Z;github.com/flyteorg/flyte" + "/flyteidl/gen/pb-go/flyteidl/adminb\006prot" + "o3" ; ::google::protobuf::internal::DescriptorTable descriptor_table_flyteidl_2fadmin_2fagent_2eproto = { false, InitDefaults_flyteidl_2fadmin_2fagent_2eproto, descriptor_table_protodef_flyteidl_2fadmin_2fagent_2eproto, - "flyteidl/admin/agent.proto", &assign_descriptors_table_flyteidl_2fadmin_2fagent_2eproto, 1743, + "flyteidl/admin/agent.proto", &assign_descriptors_table_flyteidl_2fadmin_2fagent_2eproto, 1842, }; void AddDescriptors_flyteidl_2fadmin_2fagent_2eproto() { @@ -2164,13 +2174,37 @@ ::google::protobuf::Metadata CreateTaskRequest::GetMetadata() const { // =================================================================== void CreateTaskResponse::InitAsDefaultInstance() { + ::flyteidl::admin::_CreateTaskResponse_default_instance_.resource_meta_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::flyteidl::admin::_CreateTaskResponse_default_instance_.resource_ = const_cast< ::flyteidl::admin::Resource*>( + ::flyteidl::admin::Resource::internal_default_instance()); } class CreateTaskResponse::HasBitSetters { public: + static const ::flyteidl::admin::Resource& resource(const CreateTaskResponse* msg); }; +const ::flyteidl::admin::Resource& +CreateTaskResponse::HasBitSetters::resource(const CreateTaskResponse* msg) { + return *msg->res_.resource_; +} +void CreateTaskResponse::set_allocated_resource(::flyteidl::admin::Resource* resource) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_res(); + if (resource) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + resource = ::google::protobuf::internal::GetOwnedMessage( + message_arena, resource, submessage_arena); + } + set_has_resource(); + res_.resource_ = resource; + } + // @@protoc_insertion_point(field_set_allocated:flyteidl.admin.CreateTaskResponse.resource) +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int CreateTaskResponse::kResourceMetaFieldNumber; +const int CreateTaskResponse::kResourceFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 CreateTaskResponse::CreateTaskResponse() @@ -2182,9 +2216,19 @@ CreateTaskResponse::CreateTaskResponse(const CreateTaskResponse& from) : ::google::protobuf::Message(), _internal_metadata_(nullptr) { _internal_metadata_.MergeFrom(from._internal_metadata_); - resource_meta_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.resource_meta().size() > 0) { - resource_meta_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.resource_meta_); + clear_has_res(); + switch (from.res_case()) { + case kResourceMeta: { + set_resource_meta(from.resource_meta()); + break; + } + case kResource: { + mutable_resource()->::flyteidl::admin::Resource::MergeFrom(from.resource()); + break; + } + case RES_NOT_SET: { + break; + } } // @@protoc_insertion_point(copy_constructor:flyteidl.admin.CreateTaskResponse) } @@ -2192,7 +2236,7 @@ CreateTaskResponse::CreateTaskResponse(const CreateTaskResponse& from) void CreateTaskResponse::SharedCtor() { ::google::protobuf::internal::InitSCC( &scc_info_CreateTaskResponse_flyteidl_2fadmin_2fagent_2eproto.base); - resource_meta_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_res(); } CreateTaskResponse::~CreateTaskResponse() { @@ -2201,7 +2245,9 @@ CreateTaskResponse::~CreateTaskResponse() { } void CreateTaskResponse::SharedDtor() { - resource_meta_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (has_res()) { + clear_res(); + } } void CreateTaskResponse::SetCachedSize(int size) const { @@ -2213,13 +2259,32 @@ const CreateTaskResponse& CreateTaskResponse::default_instance() { } +void CreateTaskResponse::clear_res() { +// @@protoc_insertion_point(one_of_clear_start:flyteidl.admin.CreateTaskResponse) + switch (res_case()) { + case kResourceMeta: { + res_.resource_meta_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + break; + } + case kResource: { + delete res_.resource_; + break; + } + case RES_NOT_SET: { + break; + } + } + _oneof_case_[0] = RES_NOT_SET; +} + + void CreateTaskResponse::Clear() { // @@protoc_insertion_point(message_clear_start:flyteidl.admin.CreateTaskResponse) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - resource_meta_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_res(); _internal_metadata_.Clear(); } @@ -2251,6 +2316,19 @@ const char* CreateTaskResponse::_InternalParse(const char* begin, const char* en ptr += size; break; } + // .flyteidl.admin.Resource resource = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) != 18) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::flyteidl::admin::Resource::_InternalParse; + object = msg->mutable_resource(); + if (size > end - ptr) goto len_delim_till_end; + ptr += size; + GOOGLE_PROTOBUF_PARSER_ASSERT(ctx->ParseExactRange( + {parser_till_end, object}, ptr - size, ptr)); + break; + } default: { handle_unusual: if ((tag & 7) == 4 || tag == 0) { @@ -2296,6 +2374,17 @@ bool CreateTaskResponse::MergePartialFromCodedStream( break; } + // .flyteidl.admin.Resource resource = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_resource())); + } else { + goto handle_unusual; + } + break; + } + default: { handle_unusual: if (tag == 0) { @@ -2324,11 +2413,17 @@ void CreateTaskResponse::SerializeWithCachedSizes( (void) cached_has_bits; // bytes resource_meta = 1; - if (this->resource_meta().size() > 0) { + if (has_resource_meta()) { ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 1, this->resource_meta(), output); } + // .flyteidl.admin.Resource resource = 2; + if (has_resource()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, HasBitSetters::resource(this), output); + } + if (_internal_metadata_.have_unknown_fields()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); @@ -2343,12 +2438,19 @@ ::google::protobuf::uint8* CreateTaskResponse::InternalSerializeWithCachedSizesT (void) cached_has_bits; // bytes resource_meta = 1; - if (this->resource_meta().size() > 0) { + if (has_resource_meta()) { target = ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 1, this->resource_meta(), target); } + // .flyteidl.admin.Resource resource = 2; + if (has_resource()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, HasBitSetters::resource(this), target); + } + if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); @@ -2370,13 +2472,25 @@ size_t CreateTaskResponse::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // bytes resource_meta = 1; - if (this->resource_meta().size() > 0) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::BytesSize( - this->resource_meta()); + switch (res_case()) { + // bytes resource_meta = 1; + case kResourceMeta: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->resource_meta()); + break; + } + // .flyteidl.admin.Resource resource = 2; + case kResource: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *res_.resource_); + break; + } + case RES_NOT_SET: { + break; + } } - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; @@ -2404,9 +2518,18 @@ void CreateTaskResponse::MergeFrom(const CreateTaskResponse& from) { ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; - if (from.resource_meta().size() > 0) { - - resource_meta_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.resource_meta_); + switch (from.res_case()) { + case kResourceMeta: { + set_resource_meta(from.resource_meta()); + break; + } + case kResource: { + mutable_resource()->::flyteidl::admin::Resource::MergeFrom(from.resource()); + break; + } + case RES_NOT_SET: { + break; + } } } @@ -2435,8 +2558,8 @@ void CreateTaskResponse::Swap(CreateTaskResponse* other) { void CreateTaskResponse::InternalSwap(CreateTaskResponse* other) { using std::swap; _internal_metadata_.Swap(&other->_internal_metadata_); - resource_meta_.Swap(&other->resource_meta_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); + swap(res_, other->res_); + swap(_oneof_case_[0], other->_oneof_case_[0]); } ::google::protobuf::Metadata CreateTaskResponse::GetMetadata() const { @@ -3173,10 +3296,14 @@ void Resource::clear_outputs() { } outputs_ = nullptr; } +void Resource::clear_log_links() { + log_links_.Clear(); +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Resource::kStateFieldNumber; const int Resource::kOutputsFieldNumber; const int Resource::kMessageFieldNumber; +const int Resource::kLogLinksFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Resource::Resource() @@ -3186,7 +3313,8 @@ Resource::Resource() } Resource::Resource(const Resource& from) : ::google::protobuf::Message(), - _internal_metadata_(nullptr) { + _internal_metadata_(nullptr), + log_links_(from.log_links_) { _internal_metadata_.MergeFrom(from._internal_metadata_); message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.message().size() > 0) { @@ -3235,6 +3363,7 @@ void Resource::Clear() { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + log_links_.Clear(); message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (GetArenaNoVirtual() == nullptr && outputs_ != nullptr) { delete outputs_; @@ -3294,6 +3423,22 @@ const char* Resource::_InternalParse(const char* begin, const char* end, void* o ptr += size; break; } + // repeated .flyteidl.core.TaskLog log_links = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) != 34) goto handle_unusual; + do { + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::flyteidl::core::TaskLog::_InternalParse; + object = msg->add_log_links(); + if (size > end - ptr) goto len_delim_till_end; + ptr += size; + GOOGLE_PROTOBUF_PARSER_ASSERT(ctx->ParseExactRange( + {parser_till_end, object}, ptr - size, ptr)); + if (ptr >= end) break; + } while ((::google::protobuf::io::UnalignedLoad<::google::protobuf::uint64>(ptr) & 255) == 34 && (ptr += 1)); + break; + } default: { handle_unusual: if ((tag & 7) == 4 || tag == 0) { @@ -3368,6 +3513,17 @@ bool Resource::MergePartialFromCodedStream( break; } + // repeated .flyteidl.core.TaskLog log_links = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == (34 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_log_links())); + } else { + goto handle_unusual; + } + break; + } + default: { handle_unusual: if (tag == 0) { @@ -3417,6 +3573,15 @@ void Resource::SerializeWithCachedSizes( 3, this->message(), output); } + // repeated .flyteidl.core.TaskLog log_links = 4; + for (unsigned int i = 0, + n = static_cast(this->log_links_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, + this->log_links(static_cast(i)), + output); + } + if (_internal_metadata_.have_unknown_fields()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); @@ -3454,6 +3619,14 @@ ::google::protobuf::uint8* Resource::InternalSerializeWithCachedSizesToArray( 3, this->message(), target); } + // repeated .flyteidl.core.TaskLog log_links = 4; + for (unsigned int i = 0, + n = static_cast(this->log_links_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->log_links(static_cast(i)), target); + } + if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); @@ -3475,6 +3648,17 @@ size_t Resource::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + // repeated .flyteidl.core.TaskLog log_links = 4; + { + unsigned int count = static_cast(this->log_links_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->log_links(static_cast(i))); + } + } + // string message = 3; if (this->message().size() > 0) { total_size += 1 + @@ -3522,6 +3706,7 @@ void Resource::MergeFrom(const Resource& from) { ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; + log_links_.MergeFrom(from.log_links_); if (from.message().size() > 0) { message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.message_); @@ -3559,6 +3744,7 @@ void Resource::Swap(Resource* other) { void Resource::InternalSwap(Resource* other) { using std::swap; _internal_metadata_.Swap(&other->_internal_metadata_); + CastToBase(&log_links_)->InternalSwap(CastToBase(&other->log_links_)); message_.Swap(&other->message_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); swap(outputs_, other->outputs_); diff --git a/flyteidl/gen/pb-cpp/flyteidl/admin/agent.pb.h b/flyteidl/gen/pb-cpp/flyteidl/admin/agent.pb.h index 7360e91d06..86aeccc4b2 100644 --- a/flyteidl/gen/pb-cpp/flyteidl/admin/agent.pb.h +++ b/flyteidl/gen/pb-cpp/flyteidl/admin/agent.pb.h @@ -603,6 +603,12 @@ class CreateTaskResponse final : } static const CreateTaskResponse& default_instance(); + enum ResCase { + kResourceMeta = 1, + kResource = 2, + RES_NOT_SET = 0, + }; + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const CreateTaskResponse* internal_default_instance() { return reinterpret_cast( @@ -667,6 +673,9 @@ class CreateTaskResponse final : // accessors ------------------------------------------------------- // bytes resource_meta = 1; + private: + bool has_resource_meta() const; + public: void clear_resource_meta(); static const int kResourceMetaFieldNumber = 1; const ::std::string& resource_meta() const; @@ -680,13 +689,35 @@ class CreateTaskResponse final : ::std::string* release_resource_meta(); void set_allocated_resource_meta(::std::string* resource_meta); + // .flyteidl.admin.Resource resource = 2; + bool has_resource() const; + void clear_resource(); + static const int kResourceFieldNumber = 2; + const ::flyteidl::admin::Resource& resource() const; + ::flyteidl::admin::Resource* release_resource(); + ::flyteidl::admin::Resource* mutable_resource(); + void set_allocated_resource(::flyteidl::admin::Resource* resource); + + void clear_res(); + ResCase res_case() const; // @@protoc_insertion_point(class_scope:flyteidl.admin.CreateTaskResponse) private: class HasBitSetters; + void set_has_resource_meta(); + void set_has_resource(); + + inline bool has_res() const; + inline void clear_has_res(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; - ::google::protobuf::internal::ArenaStringPtr resource_meta_; + union ResUnion { + ResUnion() {} + ::google::protobuf::internal::ArenaStringPtr resource_meta_; + ::flyteidl::admin::Resource* resource_; + } res_; mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + friend struct ::TableStruct_flyteidl_2fadmin_2fagent_2eproto; }; // ------------------------------------------------------------------- @@ -1049,6 +1080,18 @@ class Resource final : // accessors ------------------------------------------------------- + // repeated .flyteidl.core.TaskLog log_links = 4; + int log_links_size() const; + void clear_log_links(); + static const int kLogLinksFieldNumber = 4; + ::flyteidl::core::TaskLog* mutable_log_links(int index); + ::google::protobuf::RepeatedPtrField< ::flyteidl::core::TaskLog >* + mutable_log_links(); + const ::flyteidl::core::TaskLog& log_links(int index) const; + ::flyteidl::core::TaskLog* add_log_links(); + const ::google::protobuf::RepeatedPtrField< ::flyteidl::core::TaskLog >& + log_links() const; + // string message = 3; void clear_message(); static const int kMessageFieldNumber = 3; @@ -1083,6 +1126,7 @@ class Resource final : class HasBitSetters; ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::flyteidl::core::TaskLog > log_links_; ::google::protobuf::internal::ArenaStringPtr message_; ::flyteidl::core::LiteralMap* outputs_; int state_; @@ -2355,58 +2399,147 @@ inline void CreateTaskRequest::set_allocated_task_execution_metadata(::flyteidl: // CreateTaskResponse // bytes resource_meta = 1; +inline bool CreateTaskResponse::has_resource_meta() const { + return res_case() == kResourceMeta; +} +inline void CreateTaskResponse::set_has_resource_meta() { + _oneof_case_[0] = kResourceMeta; +} inline void CreateTaskResponse::clear_resource_meta() { - resource_meta_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (has_resource_meta()) { + res_.resource_meta_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_res(); + } } inline const ::std::string& CreateTaskResponse::resource_meta() const { // @@protoc_insertion_point(field_get:flyteidl.admin.CreateTaskResponse.resource_meta) - return resource_meta_.GetNoArena(); + if (has_resource_meta()) { + return res_.resource_meta_.GetNoArena(); + } + return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); } inline void CreateTaskResponse::set_resource_meta(const ::std::string& value) { - - resource_meta_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:flyteidl.admin.CreateTaskResponse.resource_meta) + if (!has_resource_meta()) { + clear_res(); + set_has_resource_meta(); + res_.resource_meta_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + res_.resource_meta_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:flyteidl.admin.CreateTaskResponse.resource_meta) } #if LANG_CXX11 inline void CreateTaskResponse::set_resource_meta(::std::string&& value) { - - resource_meta_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set:flyteidl.admin.CreateTaskResponse.resource_meta) + if (!has_resource_meta()) { + clear_res(); + set_has_resource_meta(); + res_.resource_meta_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + res_.resource_meta_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); // @@protoc_insertion_point(field_set_rvalue:flyteidl.admin.CreateTaskResponse.resource_meta) } #endif inline void CreateTaskResponse::set_resource_meta(const char* value) { GOOGLE_DCHECK(value != nullptr); - - resource_meta_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + if (!has_resource_meta()) { + clear_res(); + set_has_resource_meta(); + res_.resource_meta_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + res_.resource_meta_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); // @@protoc_insertion_point(field_set_char:flyteidl.admin.CreateTaskResponse.resource_meta) } inline void CreateTaskResponse::set_resource_meta(const void* value, size_t size) { - - resource_meta_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + if (!has_resource_meta()) { + clear_res(); + set_has_resource_meta(); + res_.resource_meta_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + res_.resource_meta_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size)); // @@protoc_insertion_point(field_set_pointer:flyteidl.admin.CreateTaskResponse.resource_meta) } inline ::std::string* CreateTaskResponse::mutable_resource_meta() { - + if (!has_resource_meta()) { + clear_res(); + set_has_resource_meta(); + res_.resource_meta_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } // @@protoc_insertion_point(field_mutable:flyteidl.admin.CreateTaskResponse.resource_meta) - return resource_meta_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return res_.resource_meta_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline ::std::string* CreateTaskResponse::release_resource_meta() { // @@protoc_insertion_point(field_release:flyteidl.admin.CreateTaskResponse.resource_meta) - - return resource_meta_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (has_resource_meta()) { + clear_has_res(); + return res_.resource_meta_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } else { + return nullptr; + } } inline void CreateTaskResponse::set_allocated_resource_meta(::std::string* resource_meta) { + if (has_res()) { + clear_res(); + } if (resource_meta != nullptr) { - - } else { - + set_has_resource_meta(); + res_.resource_meta_.UnsafeSetDefault(resource_meta); } - resource_meta_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), resource_meta); // @@protoc_insertion_point(field_set_allocated:flyteidl.admin.CreateTaskResponse.resource_meta) } +// .flyteidl.admin.Resource resource = 2; +inline bool CreateTaskResponse::has_resource() const { + return res_case() == kResource; +} +inline void CreateTaskResponse::set_has_resource() { + _oneof_case_[0] = kResource; +} +inline void CreateTaskResponse::clear_resource() { + if (has_resource()) { + delete res_.resource_; + clear_has_res(); + } +} +inline ::flyteidl::admin::Resource* CreateTaskResponse::release_resource() { + // @@protoc_insertion_point(field_release:flyteidl.admin.CreateTaskResponse.resource) + if (has_resource()) { + clear_has_res(); + ::flyteidl::admin::Resource* temp = res_.resource_; + res_.resource_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::flyteidl::admin::Resource& CreateTaskResponse::resource() const { + // @@protoc_insertion_point(field_get:flyteidl.admin.CreateTaskResponse.resource) + return has_resource() + ? *res_.resource_ + : *reinterpret_cast< ::flyteidl::admin::Resource*>(&::flyteidl::admin::_Resource_default_instance_); +} +inline ::flyteidl::admin::Resource* CreateTaskResponse::mutable_resource() { + if (!has_resource()) { + clear_res(); + set_has_resource(); + res_.resource_ = CreateMaybeMessage< ::flyteidl::admin::Resource >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:flyteidl.admin.CreateTaskResponse.resource) + return res_.resource_; +} + +inline bool CreateTaskResponse::has_res() const { + return res_case() != RES_NOT_SET; +} +inline void CreateTaskResponse::clear_has_res() { + _oneof_case_[0] = RES_NOT_SET; +} +inline CreateTaskResponse::ResCase CreateTaskResponse::res_case() const { + return CreateTaskResponse::ResCase(_oneof_case_[0]); +} // ------------------------------------------------------------------- // GetTaskRequest @@ -2715,6 +2848,33 @@ inline void Resource::set_allocated_message(::std::string* message) { // @@protoc_insertion_point(field_set_allocated:flyteidl.admin.Resource.message) } +// repeated .flyteidl.core.TaskLog log_links = 4; +inline int Resource::log_links_size() const { + return log_links_.size(); +} +inline ::flyteidl::core::TaskLog* Resource::mutable_log_links(int index) { + // @@protoc_insertion_point(field_mutable:flyteidl.admin.Resource.log_links) + return log_links_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::flyteidl::core::TaskLog >* +Resource::mutable_log_links() { + // @@protoc_insertion_point(field_mutable_list:flyteidl.admin.Resource.log_links) + return &log_links_; +} +inline const ::flyteidl::core::TaskLog& Resource::log_links(int index) const { + // @@protoc_insertion_point(field_get:flyteidl.admin.Resource.log_links) + return log_links_.Get(index); +} +inline ::flyteidl::core::TaskLog* Resource::add_log_links() { + // @@protoc_insertion_point(field_add:flyteidl.admin.Resource.log_links) + return log_links_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::flyteidl::core::TaskLog >& +Resource::log_links() const { + // @@protoc_insertion_point(field_list:flyteidl.admin.Resource.log_links) + return log_links_; +} + // ------------------------------------------------------------------- // DeleteTaskRequest diff --git a/flyteidl/gen/pb-go/flyteidl/admin/agent.pb.go b/flyteidl/gen/pb-go/flyteidl/admin/agent.pb.go index aeb5a70ed1..2e255f5c88 100644 --- a/flyteidl/gen/pb-go/flyteidl/admin/agent.pb.go +++ b/flyteidl/gen/pb-go/flyteidl/admin/agent.pb.go @@ -215,10 +215,15 @@ func (m *CreateTaskRequest) GetTaskExecutionMetadata() *TaskExecutionMetadata { // Represents a create response structure. type CreateTaskResponse struct { // Metadata is created by the agent. It could be a string (jobId) or a dict (more complex metadata). - ResourceMeta []byte `protobuf:"bytes,1,opt,name=resource_meta,json=resourceMeta,proto3" json:"resource_meta,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // Resource is for synchronous task execution. + // + // Types that are valid to be assigned to Res: + // *CreateTaskResponse_ResourceMeta + // *CreateTaskResponse_Resource + Res isCreateTaskResponse_Res `protobuf_oneof:"res"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *CreateTaskResponse) Reset() { *m = CreateTaskResponse{} } @@ -246,13 +251,51 @@ func (m *CreateTaskResponse) XXX_DiscardUnknown() { var xxx_messageInfo_CreateTaskResponse proto.InternalMessageInfo -func (m *CreateTaskResponse) GetResourceMeta() []byte { +type isCreateTaskResponse_Res interface { + isCreateTaskResponse_Res() +} + +type CreateTaskResponse_ResourceMeta struct { + ResourceMeta []byte `protobuf:"bytes,1,opt,name=resource_meta,json=resourceMeta,proto3,oneof"` +} + +type CreateTaskResponse_Resource struct { + Resource *Resource `protobuf:"bytes,2,opt,name=resource,proto3,oneof"` +} + +func (*CreateTaskResponse_ResourceMeta) isCreateTaskResponse_Res() {} + +func (*CreateTaskResponse_Resource) isCreateTaskResponse_Res() {} + +func (m *CreateTaskResponse) GetRes() isCreateTaskResponse_Res { if m != nil { - return m.ResourceMeta + return m.Res } return nil } +func (m *CreateTaskResponse) GetResourceMeta() []byte { + if x, ok := m.GetRes().(*CreateTaskResponse_ResourceMeta); ok { + return x.ResourceMeta + } + return nil +} + +func (m *CreateTaskResponse) GetResource() *Resource { + if x, ok := m.GetRes().(*CreateTaskResponse_Resource); ok { + return x.Resource + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*CreateTaskResponse) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*CreateTaskResponse_ResourceMeta)(nil), + (*CreateTaskResponse_Resource)(nil), + } +} + // A message used to fetch a job resource from flyte agent server. type GetTaskRequest struct { // A predefined yet extensible Task type identifier. @@ -360,10 +403,12 @@ type Resource struct { // +optional Outputs *core.LiteralMap `protobuf:"bytes,2,opt,name=outputs,proto3" json:"outputs,omitempty"` // A descriptive message for the current state. e.g. waiting for cluster. - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` + // log information for the task execution. + LogLinks []*core.TaskLog `protobuf:"bytes,4,rep,name=log_links,json=logLinks,proto3" json:"log_links,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Resource) Reset() { *m = Resource{} } @@ -412,6 +457,13 @@ func (m *Resource) GetMessage() string { return "" } +func (m *Resource) GetLogLinks() []*core.TaskLog { + if m != nil { + return m.LogLinks + } + return nil +} + // A message used to delete a task. type DeleteTaskRequest struct { // A predefined yet extensible Task type identifier. @@ -720,60 +772,62 @@ func init() { func init() { proto.RegisterFile("flyteidl/admin/agent.proto", fileDescriptor_c434e52bb0028071) } var fileDescriptor_c434e52bb0028071 = []byte{ - // 869 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xf1, 0x6f, 0xdb, 0x44, - 0x14, 0x26, 0x49, 0xd3, 0x26, 0x2f, 0x5d, 0x97, 0xdc, 0x1a, 0x70, 0xb3, 0x81, 0x2a, 0xa3, 0xa1, - 0x8a, 0x69, 0x0e, 0x6b, 0x11, 0x74, 0x20, 0x98, 0xb2, 0xd6, 0x54, 0x95, 0xd2, 0xa8, 0xba, 0xa6, - 0x08, 0x90, 0xc0, 0xba, 0x38, 0xaf, 0xc6, 0x8a, 0x63, 0x1b, 0xdf, 0xb9, 0x5a, 0x24, 0x7e, 0x43, - 0xe2, 0x6f, 0xe0, 0xcf, 0x45, 0xbe, 0x3b, 0xbb, 0x49, 0xf0, 0x50, 0xa7, 0xfd, 0x66, 0xbf, 0xef, - 0xbb, 0xef, 0x7d, 0x7e, 0xdf, 0x5d, 0x2e, 0xd0, 0xbb, 0x09, 0x16, 0x02, 0xfd, 0x69, 0xd0, 0x67, - 0xd3, 0xb9, 0x1f, 0xf6, 0x99, 0x87, 0xa1, 0xb0, 0xe2, 0x24, 0x12, 0x11, 0xd9, 0xc9, 0x31, 0x4b, - 0x62, 0xbd, 0x27, 0x05, 0xd7, 0x8d, 0x12, 0xec, 0x07, 0xbe, 0xc0, 0x84, 0x05, 0x5c, 0xb1, 0x7b, - 0x7b, 0xab, 0xa8, 0x60, 0x7c, 0x96, 0x43, 0x1f, 0xaf, 0x42, 0x7e, 0x28, 0x30, 0xb9, 0x61, 0x2e, - 0x6a, 0xf8, 0x93, 0x35, 0x78, 0x8a, 0xa1, 0xf0, 0x6f, 0x7c, 0x4c, 0xca, 0x97, 0xe3, 0x1b, 0x74, - 0x53, 0xe1, 0x47, 0xa1, 0x82, 0xcd, 0x7f, 0xea, 0xd0, 0x1d, 0x33, 0x3e, 0xb3, 0xf3, 0xfa, 0x05, - 0x0a, 0x36, 0x65, 0x82, 0x11, 0x0a, 0x9d, 0xcc, 0x86, 0x53, 0xac, 0x70, 0xfc, 0xa9, 0x51, 0xd9, - 0xaf, 0x1c, 0xb4, 0x0e, 0x3f, 0xb3, 0x8a, 0x8f, 0xcb, 0x44, 0xad, 0x15, 0x81, 0xf3, 0xc2, 0x01, - 0x7d, 0x28, 0x56, 0x01, 0xf2, 0x04, 0x9a, 0x21, 0x9b, 0x23, 0x8f, 0x99, 0x8b, 0x46, 0x75, 0xbf, - 0x72, 0xd0, 0xa4, 0x77, 0x05, 0x72, 0x0e, 0x9b, 0x01, 0x9b, 0x60, 0xc0, 0x8d, 0xda, 0x7e, 0xed, - 0xa0, 0x75, 0xf8, 0xc2, 0x5a, 0x9d, 0xa1, 0x55, 0x6a, 0xd4, 0x1a, 0xca, 0x35, 0x76, 0x28, 0x92, - 0x05, 0xd5, 0x02, 0xe4, 0x27, 0x68, 0xb1, 0x30, 0x8c, 0x04, 0xcb, 0x98, 0xdc, 0xd8, 0x90, 0x7a, - 0x5f, 0xdd, 0x4f, 0x6f, 0x70, 0xb7, 0x50, 0x89, 0x2e, 0x4b, 0x11, 0x0b, 0x1e, 0xcd, 0x8e, 0xb9, - 0xc3, 0x31, 0xb9, 0xf5, 0x5d, 0x74, 0x98, 0xeb, 0x46, 0x69, 0x28, 0x8c, 0xba, 0xfc, 0x98, 0xce, - 0xec, 0x98, 0x5f, 0x29, 0x64, 0xa0, 0x00, 0x22, 0xa0, 0x8b, 0xe1, 0xad, 0x9f, 0x44, 0xe1, 0x1c, - 0x43, 0xe1, 0xdc, 0xb2, 0xc4, 0x67, 0x93, 0x00, 0xb9, 0xb1, 0x29, 0x3d, 0xbd, 0xba, 0x9f, 0x27, - 0xfb, 0x4e, 0xe2, 0xc7, 0x5c, 0x41, 0x99, 0xdb, 0xc5, 0x12, 0xa8, 0xf7, 0x12, 0x5a, 0x4b, 0x63, - 0x21, 0x6d, 0xa8, 0xcd, 0x70, 0x21, 0xd3, 0x6b, 0xd2, 0xec, 0x91, 0xec, 0x42, 0xfd, 0x96, 0x05, - 0x69, 0x9e, 0x82, 0x7a, 0xf9, 0xa6, 0x7a, 0x5c, 0xe9, 0x7d, 0x0f, 0xed, 0xf5, 0x09, 0xbc, 0xd3, - 0xfa, 0x33, 0xd8, 0x7b, 0xab, 0xdb, 0x77, 0x11, 0x32, 0xff, 0xaa, 0x42, 0xe7, 0x24, 0x41, 0x26, - 0x30, 0x9b, 0x09, 0xc5, 0x3f, 0x52, 0xe4, 0x82, 0xbc, 0x80, 0x4d, 0x3f, 0x8c, 0x53, 0xc1, 0xf5, - 0x5e, 0xdc, 0x5b, 0xdb, 0x8b, 0x43, 0x75, 0xb0, 0x2e, 0x58, 0x4c, 0x35, 0x91, 0x7c, 0x0d, 0x0d, - 0x81, 0xf3, 0x38, 0x60, 0x42, 0x75, 0x69, 0x1d, 0x3e, 0x2e, 0xd9, 0xc0, 0x63, 0x4d, 0xa1, 0x05, - 0x99, 0x7c, 0x0a, 0x0f, 0xa2, 0x54, 0xc4, 0xa9, 0x70, 0xe2, 0x04, 0x6f, 0xfc, 0x37, 0x46, 0x4d, - 0x7a, 0xdc, 0x56, 0xc5, 0x4b, 0x59, 0x23, 0xbf, 0xc2, 0x47, 0x6b, 0xe7, 0x64, 0xae, 0x53, 0x33, - 0x36, 0x64, 0xb3, 0xa7, 0xf7, 0x8a, 0x98, 0x76, 0x45, 0x59, 0xd9, 0x7c, 0x09, 0x64, 0x79, 0x08, - 0x3c, 0x8e, 0x42, 0x2e, 0x9d, 0x25, 0xc8, 0xa3, 0x34, 0x71, 0x51, 0xb6, 0x93, 0xc3, 0xd8, 0xa6, - 0xdb, 0x79, 0x31, 0x5b, 0x6e, 0x52, 0xd8, 0x39, 0x43, 0xb1, 0x3c, 0xbc, 0xc7, 0xd0, 0x94, 0x5e, - 0xc5, 0x22, 0x46, 0x1d, 0x42, 0x23, 0x2b, 0x8c, 0x17, 0x71, 0x89, 0x66, 0xb5, 0x44, 0xf3, 0x4f, - 0x78, 0x58, 0x68, 0x6a, 0x2f, 0x5f, 0x42, 0x23, 0xa7, 0xe8, 0x4c, 0x8c, 0xf5, 0x2f, 0xa6, 0x1a, - 0xa7, 0x05, 0x93, 0x1c, 0x41, 0x33, 0x88, 0x3c, 0x27, 0xf0, 0xc3, 0x19, 0x37, 0xaa, 0xf2, 0x2c, - 0x7c, 0x58, 0x92, 0xca, 0x30, 0xf2, 0x68, 0x23, 0x88, 0xbc, 0x61, 0xc6, 0x33, 0xff, 0xae, 0x40, - 0x23, 0xd7, 0x22, 0xcf, 0xa0, 0xce, 0x45, 0x96, 0x69, 0xd6, 0x74, 0xe7, 0xb0, 0xbb, 0xde, 0xf4, - 0x2a, 0x03, 0xa9, 0xe2, 0x90, 0x23, 0xd8, 0x52, 0xa9, 0x71, 0xbd, 0x05, 0xfe, 0x67, 0xdf, 0xe4, - 0x4c, 0x62, 0xc0, 0xd6, 0x1c, 0x39, 0x67, 0x1e, 0xea, 0xe4, 0xf3, 0x57, 0xf3, 0x1a, 0x3a, 0xa7, - 0x18, 0xe0, 0xea, 0xd6, 0x7c, 0xff, 0xe9, 0xee, 0x02, 0x59, 0x96, 0x55, 0x03, 0x36, 0x2f, 0xa0, - 0x3e, 0xc8, 0x6e, 0x16, 0x42, 0x60, 0x23, 0xfb, 0xb5, 0xd4, 0xda, 0xf2, 0x99, 0x7c, 0x01, 0xbb, - 0x3c, 0x8d, 0xe3, 0x28, 0x11, 0x38, 0x75, 0x8a, 0xf6, 0x6a, 0xa4, 0x4d, 0x4a, 0x0a, 0x6c, 0xac, - 0x8d, 0x70, 0xf3, 0xa9, 0x8c, 0x50, 0x2a, 0xe6, 0xce, 0x4b, 0x84, 0xcd, 0x57, 0xd0, 0xbe, 0xa3, - 0xe9, 0xa8, 0x9f, 0x41, 0x5d, 0xde, 0x71, 0x3a, 0xe7, 0xff, 0x8c, 0x5c, 0xb1, 0x15, 0xc7, 0x7c, - 0x04, 0x9d, 0xa1, 0xcf, 0x95, 0x02, 0xd7, 0x9d, 0xcc, 0x13, 0x20, 0xcb, 0x45, 0xad, 0xfb, 0x1c, - 0x36, 0xe5, 0x9a, 0xec, 0x50, 0xd7, 0xde, 0x2e, 0xac, 0x49, 0x9f, 0xff, 0x06, 0x75, 0x19, 0x2e, - 0xe9, 0x42, 0x87, 0xda, 0x63, 0xfa, 0xf3, 0xe0, 0xf5, 0xd0, 0x76, 0x7e, 0x18, 0x9c, 0x0f, 0xaf, - 0xa9, 0xdd, 0xfe, 0x20, 0x2b, 0x5f, 0xda, 0xf4, 0x62, 0x30, 0xb2, 0x47, 0xe3, 0xa2, 0x5c, 0x21, - 0x2d, 0xd8, 0xba, 0xb4, 0x47, 0xa7, 0xe7, 0xa3, 0xb3, 0x76, 0x35, 0x7b, 0xa1, 0xd7, 0xa3, 0x51, - 0xf6, 0x52, 0x23, 0x0f, 0xa0, 0x79, 0x75, 0x7d, 0x72, 0x62, 0xdb, 0xa7, 0xf6, 0x69, 0x7b, 0xe3, - 0xf5, 0x77, 0xbf, 0x7c, 0xeb, 0xf9, 0xe2, 0xf7, 0x74, 0x62, 0xb9, 0xd1, 0xbc, 0x2f, 0xad, 0x44, - 0x89, 0xa7, 0x1e, 0xfa, 0xc5, 0x7d, 0xea, 0x61, 0xd8, 0x8f, 0x27, 0xcf, 0xbd, 0xa8, 0xbf, 0xfa, - 0x37, 0x60, 0xb2, 0x29, 0xaf, 0xd6, 0xa3, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x81, 0xa7, 0x12, - 0x0e, 0x1f, 0x08, 0x00, 0x00, + // 901 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x7f, 0x6f, 0xe3, 0x44, + 0x10, 0x6d, 0x7e, 0x36, 0x99, 0xb4, 0xbd, 0x64, 0xaf, 0x01, 0x37, 0x77, 0xa0, 0xca, 0xa8, 0xa8, + 0xe2, 0x74, 0x09, 0xd7, 0xa2, 0xa3, 0x80, 0xe0, 0x94, 0xb6, 0xa6, 0x57, 0x29, 0x8d, 0xaa, 0x6d, + 0x8a, 0x00, 0x09, 0xa2, 0x4d, 0x32, 0x35, 0x56, 0x1c, 0xdb, 0x78, 0xd7, 0xd5, 0x05, 0xf1, 0x1f, + 0x5f, 0x82, 0xef, 0xc2, 0x97, 0x43, 0xde, 0x5d, 0x3b, 0x71, 0xc8, 0x9d, 0x7a, 0xe2, 0x3f, 0xef, + 0xbc, 0xb7, 0x6f, 0xde, 0xce, 0xcc, 0x66, 0x03, 0xad, 0x3b, 0x77, 0x2e, 0xd0, 0x99, 0xb8, 0x1d, + 0x36, 0x99, 0x39, 0x5e, 0x87, 0xd9, 0xe8, 0x89, 0x76, 0x10, 0xfa, 0xc2, 0x27, 0x3b, 0x09, 0xd6, + 0x96, 0x58, 0xeb, 0x69, 0xca, 0x1d, 0xfb, 0x21, 0x76, 0x5c, 0x47, 0x60, 0xc8, 0x5c, 0xae, 0xd8, + 0xad, 0xbd, 0x2c, 0x2a, 0x18, 0x9f, 0x26, 0xd0, 0x47, 0x59, 0xc8, 0xf1, 0x04, 0x86, 0x77, 0x6c, + 0x8c, 0x1a, 0xfe, 0x78, 0x05, 0x9e, 0xa0, 0x27, 0x9c, 0x3b, 0x07, 0xc3, 0xf5, 0xdb, 0xf1, 0x0d, + 0x8e, 0x23, 0xe1, 0xf8, 0x9e, 0x82, 0xcd, 0xbf, 0x4b, 0xd0, 0x1c, 0x30, 0x3e, 0xb5, 0x92, 0xf8, + 0x15, 0x0a, 0x36, 0x61, 0x82, 0x11, 0x0a, 0x8d, 0xd8, 0xc6, 0x30, 0xdd, 0x31, 0x74, 0x26, 0x46, + 0x6e, 0x3f, 0x77, 0x58, 0x3b, 0xfa, 0xb4, 0x9d, 0x1e, 0x2e, 0x16, 0x6d, 0x67, 0x04, 0x2e, 0x53, + 0x07, 0xf4, 0x91, 0xc8, 0x02, 0xe4, 0x29, 0x54, 0x3d, 0x36, 0x43, 0x1e, 0xb0, 0x31, 0x1a, 0xf9, + 0xfd, 0xdc, 0x61, 0x95, 0x2e, 0x02, 0xe4, 0x12, 0xca, 0x2e, 0x1b, 0xa1, 0xcb, 0x8d, 0xc2, 0x7e, + 0xe1, 0xb0, 0x76, 0xf4, 0xa2, 0x9d, 0xad, 0x61, 0x7b, 0xad, 0xd1, 0x76, 0x4f, 0xee, 0xb1, 0x3c, + 0x11, 0xce, 0xa9, 0x16, 0x20, 0x3f, 0x42, 0x8d, 0x79, 0x9e, 0x2f, 0x58, 0xcc, 0xe4, 0x46, 0x51, + 0xea, 0xbd, 0x7c, 0x98, 0x5e, 0x77, 0xb1, 0x51, 0x89, 0x2e, 0x4b, 0x91, 0x36, 0x3c, 0x9e, 0x9e, + 0xf0, 0x21, 0xc7, 0xf0, 0xde, 0x19, 0xe3, 0x90, 0x8d, 0xc7, 0x7e, 0xe4, 0x09, 0xa3, 0x24, 0x0f, + 0xd3, 0x98, 0x9e, 0xf0, 0x1b, 0x85, 0x74, 0x15, 0x40, 0x04, 0x34, 0xd1, 0xbb, 0x77, 0x42, 0xdf, + 0x9b, 0xa1, 0x27, 0x86, 0xf7, 0x2c, 0x74, 0xd8, 0xc8, 0x45, 0x6e, 0x94, 0xa5, 0xa7, 0x57, 0x0f, + 0xf3, 0x64, 0x2d, 0x24, 0x7e, 0x48, 0x14, 0x94, 0xb9, 0x5d, 0x5c, 0x03, 0xb5, 0xbe, 0x82, 0xda, + 0x52, 0x59, 0x48, 0x1d, 0x0a, 0x53, 0x9c, 0xcb, 0xee, 0x55, 0x69, 0xfc, 0x49, 0x76, 0xa1, 0x74, + 0xcf, 0xdc, 0x28, 0xe9, 0x82, 0x5a, 0x7c, 0x9d, 0x3f, 0xc9, 0xb5, 0xbe, 0x83, 0xfa, 0x6a, 0x05, + 0xde, 0x6b, 0xff, 0x05, 0xec, 0xbd, 0xd5, 0xed, 0xfb, 0x08, 0x99, 0x7f, 0xe5, 0xa1, 0x71, 0x16, + 0x22, 0x13, 0x18, 0xd7, 0x84, 0xe2, 0xef, 0x11, 0x72, 0x41, 0x5e, 0x40, 0xd9, 0xf1, 0x82, 0x48, + 0x70, 0x3d, 0x8b, 0x7b, 0x2b, 0xb3, 0xd8, 0x53, 0x17, 0xeb, 0x8a, 0x05, 0x54, 0x13, 0xc9, 0x97, + 0x50, 0x11, 0x38, 0x0b, 0x5c, 0x26, 0x54, 0x96, 0xda, 0xd1, 0x93, 0x35, 0x03, 0x3c, 0xd0, 0x14, + 0x9a, 0x92, 0xc9, 0x27, 0xb0, 0xed, 0x47, 0x22, 0x88, 0xc4, 0x30, 0x08, 0xf1, 0xce, 0x79, 0x63, + 0x14, 0xa4, 0xc7, 0x2d, 0x15, 0xbc, 0x96, 0x31, 0xf2, 0x0b, 0x7c, 0xb8, 0x72, 0x4f, 0x66, 0xba, + 0x6b, 0x46, 0x51, 0x26, 0x3b, 0x78, 0x50, 0x8b, 0x69, 0x53, 0xac, 0x0b, 0x9b, 0x7f, 0x00, 0x59, + 0x2e, 0x02, 0x0f, 0x7c, 0x8f, 0x23, 0x39, 0x80, 0xed, 0x10, 0xb9, 0x1f, 0x85, 0x63, 0x94, 0xe9, + 0x64, 0x31, 0xb6, 0x5e, 0x6f, 0xd0, 0xad, 0x24, 0x1c, 0x0b, 0x90, 0x97, 0x50, 0x49, 0xd6, 0xfa, + 0xe4, 0xc6, 0xaa, 0x19, 0xaa, 0xf1, 0xd7, 0x1b, 0x34, 0xe5, 0x9e, 0x96, 0xa0, 0x10, 0x22, 0x37, + 0x29, 0xec, 0x5c, 0xa0, 0x58, 0xae, 0xfe, 0x13, 0xa8, 0xca, 0xc3, 0x8a, 0x79, 0x80, 0xba, 0x8b, + 0x95, 0x38, 0x30, 0x98, 0x07, 0xb2, 0x5c, 0x59, 0x53, 0x71, 0xca, 0xad, 0xac, 0x25, 0xf3, 0x4f, + 0x78, 0x94, 0x6a, 0xea, 0xc3, 0x7c, 0xb1, 0xe4, 0x32, 0xf7, 0x6e, 0x97, 0x0b, 0x8f, 0xe4, 0x18, + 0xaa, 0xae, 0x6f, 0x0f, 0x5d, 0xc7, 0x9b, 0x72, 0x23, 0x2f, 0x2f, 0xd3, 0x07, 0x6b, 0xda, 0xda, + 0xf3, 0x6d, 0x5a, 0x71, 0x7d, 0xbb, 0x17, 0xf3, 0xcc, 0x7f, 0x72, 0x50, 0x49, 0xb4, 0xc8, 0x33, + 0x28, 0x71, 0x11, 0x0f, 0x45, 0x9c, 0x74, 0xe7, 0xa8, 0xb9, 0x9a, 0xf4, 0x26, 0x06, 0xa9, 0xe2, + 0x90, 0x63, 0xd8, 0x54, 0x6d, 0xe7, 0xba, 0x92, 0xef, 0x18, 0xbc, 0x84, 0x49, 0x0c, 0xd8, 0x9c, + 0x21, 0xe7, 0xcc, 0x46, 0x3d, 0x3a, 0xc9, 0x32, 0xeb, 0xbe, 0xf8, 0x40, 0xf7, 0xb7, 0xd0, 0x38, + 0x47, 0x17, 0xb3, 0x17, 0xe2, 0xff, 0xb7, 0x64, 0x17, 0xc8, 0xb2, 0xac, 0xea, 0x8a, 0x79, 0x05, + 0xa5, 0x6e, 0xfc, 0x9e, 0x11, 0x02, 0xc5, 0xf8, 0x37, 0x5a, 0x6b, 0xcb, 0x6f, 0xf2, 0x39, 0xec, + 0xf2, 0x28, 0x08, 0xfc, 0x50, 0xe0, 0x64, 0x98, 0xa6, 0x57, 0x7d, 0xa8, 0x52, 0x92, 0x62, 0x03, + 0x6d, 0x84, 0x9b, 0x07, 0xb2, 0xef, 0x52, 0x31, 0x71, 0xbe, 0x46, 0xd8, 0x7c, 0x05, 0xf5, 0x05, + 0x4d, 0xcf, 0xc7, 0x33, 0x28, 0xc9, 0x97, 0x55, 0x0f, 0xc7, 0x7f, 0xfa, 0xa4, 0xd8, 0x8a, 0x63, + 0x3e, 0x86, 0x46, 0xcf, 0xe1, 0x4a, 0x81, 0xeb, 0x4c, 0xe6, 0x19, 0x90, 0xe5, 0xa0, 0xd6, 0x7d, + 0x0e, 0x65, 0xb9, 0x27, 0xfe, 0x29, 0x29, 0xbc, 0x5d, 0x58, 0x93, 0x3e, 0xfb, 0x15, 0x4a, 0x72, + 0x22, 0x48, 0x13, 0x1a, 0xd4, 0x1a, 0xd0, 0x9f, 0xba, 0xa7, 0x3d, 0x6b, 0xf8, 0x7d, 0xf7, 0xb2, + 0x77, 0x4b, 0xad, 0xfa, 0x46, 0x1c, 0xbe, 0xb6, 0xe8, 0x55, 0xb7, 0x6f, 0xf5, 0x07, 0x69, 0x38, + 0x47, 0x6a, 0xb0, 0x79, 0x6d, 0xf5, 0xcf, 0x2f, 0xfb, 0x17, 0xf5, 0x7c, 0xbc, 0xa0, 0xb7, 0xfd, + 0x7e, 0xbc, 0x28, 0x90, 0x6d, 0xa8, 0xde, 0xdc, 0x9e, 0x9d, 0x59, 0xd6, 0xb9, 0x75, 0x5e, 0x2f, + 0x9e, 0x7e, 0xfb, 0xf3, 0x37, 0xb6, 0x23, 0x7e, 0x8b, 0x46, 0xed, 0xb1, 0x3f, 0xeb, 0x48, 0x2b, + 0x7e, 0x68, 0xab, 0x8f, 0x4e, 0xfa, 0x8a, 0xdb, 0xe8, 0x75, 0x82, 0xd1, 0x73, 0xdb, 0xef, 0x64, + 0xff, 0x7c, 0x8c, 0xca, 0xf2, 0x41, 0x3f, 0xfe, 0x37, 0x00, 0x00, 0xff, 0xff, 0x3c, 0x11, 0x18, + 0x7d, 0x95, 0x08, 0x00, 0x00, } diff --git a/flyteidl/gen/pb-go/flyteidl/admin/agent.pb.validate.go b/flyteidl/gen/pb-go/flyteidl/admin/agent.pb.validate.go index c4767d006c..8bdff082f3 100644 --- a/flyteidl/gen/pb-go/flyteidl/admin/agent.pb.validate.go +++ b/flyteidl/gen/pb-go/flyteidl/admin/agent.pb.validate.go @@ -230,7 +230,24 @@ func (m *CreateTaskResponse) Validate() error { return nil } - // no validation rules for ResourceMeta + switch m.Res.(type) { + + case *CreateTaskResponse_ResourceMeta: + // no validation rules for ResourceMeta + + case *CreateTaskResponse_Resource: + + if v, ok := interface{}(m.GetResource()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateTaskResponseValidationError{ + field: "Resource", + reason: "embedded message failed validation", + cause: err, + } + } + } + + } return nil } @@ -471,6 +488,21 @@ func (m *Resource) Validate() error { // no validation rules for Message + for idx, item := range m.GetLogLinks() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResourceValidationError{ + field: fmt.Sprintf("LogLinks[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + return nil } diff --git a/flyteidl/gen/pb-go/flyteidl/service/agent.swagger.json b/flyteidl/gen/pb-go/flyteidl/service/agent.swagger.json index b9cb5d6b5b..623a3ecd94 100644 --- a/flyteidl/gen/pb-go/flyteidl/service/agent.swagger.json +++ b/flyteidl/gen/pb-go/flyteidl/service/agent.swagger.json @@ -238,8 +238,10 @@ "properties": { "resource_meta": { "type": "string", - "format": "byte", - "description": "Metadata is created by the agent. It could be a string (jobId) or a dict (more complex metadata)." + "format": "byte" + }, + "resource": { + "$ref": "#/definitions/adminResource" } }, "description": "Represents a create response structure." @@ -299,6 +301,13 @@ "message": { "type": "string", "description": "A descriptive message for the current state. e.g. waiting for cluster." + }, + "log_links": { + "type": "array", + "items": { + "$ref": "#/definitions/coreTaskLog" + }, + "description": "log information for the task execution." } } }, diff --git a/flyteidl/gen/pb-java/flyteidl/admin/AgentOuterClass.java b/flyteidl/gen/pb-java/flyteidl/admin/AgentOuterClass.java index a6fa424d2a..f71d1743ff 100644 --- a/flyteidl/gen/pb-java/flyteidl/admin/AgentOuterClass.java +++ b/flyteidl/gen/pb-java/flyteidl/admin/AgentOuterClass.java @@ -3615,13 +3615,24 @@ public interface CreateTaskResponseOrBuilder extends com.google.protobuf.MessageOrBuilder { /** - *
-     * Metadata is created by the agent. It could be a string (jobId) or a dict (more complex metadata).
-     * 
- * * bytes resource_meta = 1; */ com.google.protobuf.ByteString getResourceMeta(); + + /** + * .flyteidl.admin.Resource resource = 2; + */ + boolean hasResource(); + /** + * .flyteidl.admin.Resource resource = 2; + */ + flyteidl.admin.AgentOuterClass.Resource getResource(); + /** + * .flyteidl.admin.Resource resource = 2; + */ + flyteidl.admin.AgentOuterClass.ResourceOrBuilder getResourceOrBuilder(); + + public flyteidl.admin.AgentOuterClass.CreateTaskResponse.ResCase getResCase(); } /** *
@@ -3640,7 +3651,6 @@ private CreateTaskResponse(com.google.protobuf.GeneratedMessageV3.Builder bui
       super(builder);
     }
     private CreateTaskResponse() {
-      resourceMeta_ = com.google.protobuf.ByteString.EMPTY;
     }
 
     @java.lang.Override
@@ -3668,8 +3678,22 @@ private CreateTaskResponse(
               done = true;
               break;
             case 10: {
-
-              resourceMeta_ = input.readBytes();
+              resCase_ = 1;
+              res_ = input.readBytes();
+              break;
+            }
+            case 18: {
+              flyteidl.admin.AgentOuterClass.Resource.Builder subBuilder = null;
+              if (resCase_ == 2) {
+                subBuilder = ((flyteidl.admin.AgentOuterClass.Resource) res_).toBuilder();
+              }
+              res_ =
+                  input.readMessage(flyteidl.admin.AgentOuterClass.Resource.parser(), extensionRegistry);
+              if (subBuilder != null) {
+                subBuilder.mergeFrom((flyteidl.admin.AgentOuterClass.Resource) res_);
+                res_ = subBuilder.buildPartial();
+              }
+              resCase_ = 2;
               break;
             }
             default: {
@@ -3704,17 +3728,79 @@ private CreateTaskResponse(
               flyteidl.admin.AgentOuterClass.CreateTaskResponse.class, flyteidl.admin.AgentOuterClass.CreateTaskResponse.Builder.class);
     }
 
+    private int resCase_ = 0;
+    private java.lang.Object res_;
+    public enum ResCase
+        implements com.google.protobuf.Internal.EnumLite {
+      RESOURCE_META(1),
+      RESOURCE(2),
+      RES_NOT_SET(0);
+      private final int value;
+      private ResCase(int value) {
+        this.value = value;
+      }
+      /**
+       * @deprecated Use {@link #forNumber(int)} instead.
+       */
+      @java.lang.Deprecated
+      public static ResCase valueOf(int value) {
+        return forNumber(value);
+      }
+
+      public static ResCase forNumber(int value) {
+        switch (value) {
+          case 1: return RESOURCE_META;
+          case 2: return RESOURCE;
+          case 0: return RES_NOT_SET;
+          default: return null;
+        }
+      }
+      public int getNumber() {
+        return this.value;
+      }
+    };
+
+    public ResCase
+    getResCase() {
+      return ResCase.forNumber(
+          resCase_);
+    }
+
     public static final int RESOURCE_META_FIELD_NUMBER = 1;
-    private com.google.protobuf.ByteString resourceMeta_;
     /**
-     * 
-     * Metadata is created by the agent. It could be a string (jobId) or a dict (more complex metadata).
-     * 
- * * bytes resource_meta = 1; */ public com.google.protobuf.ByteString getResourceMeta() { - return resourceMeta_; + if (resCase_ == 1) { + return (com.google.protobuf.ByteString) res_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int RESOURCE_FIELD_NUMBER = 2; + /** + * .flyteidl.admin.Resource resource = 2; + */ + public boolean hasResource() { + return resCase_ == 2; + } + /** + * .flyteidl.admin.Resource resource = 2; + */ + public flyteidl.admin.AgentOuterClass.Resource getResource() { + if (resCase_ == 2) { + return (flyteidl.admin.AgentOuterClass.Resource) res_; + } + return flyteidl.admin.AgentOuterClass.Resource.getDefaultInstance(); + } + /** + * .flyteidl.admin.Resource resource = 2; + */ + public flyteidl.admin.AgentOuterClass.ResourceOrBuilder getResourceOrBuilder() { + if (resCase_ == 2) { + return (flyteidl.admin.AgentOuterClass.Resource) res_; + } + return flyteidl.admin.AgentOuterClass.Resource.getDefaultInstance(); } private byte memoizedIsInitialized = -1; @@ -3731,8 +3817,12 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!resourceMeta_.isEmpty()) { - output.writeBytes(1, resourceMeta_); + if (resCase_ == 1) { + output.writeBytes( + 1, (com.google.protobuf.ByteString) res_); + } + if (resCase_ == 2) { + output.writeMessage(2, (flyteidl.admin.AgentOuterClass.Resource) res_); } unknownFields.writeTo(output); } @@ -3743,9 +3833,14 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!resourceMeta_.isEmpty()) { + if (resCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize( + 1, (com.google.protobuf.ByteString) res_); + } + if (resCase_ == 2) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, resourceMeta_); + .computeMessageSize(2, (flyteidl.admin.AgentOuterClass.Resource) res_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -3762,8 +3857,19 @@ public boolean equals(final java.lang.Object obj) { } flyteidl.admin.AgentOuterClass.CreateTaskResponse other = (flyteidl.admin.AgentOuterClass.CreateTaskResponse) obj; - if (!getResourceMeta() - .equals(other.getResourceMeta())) return false; + if (!getResCase().equals(other.getResCase())) return false; + switch (resCase_) { + case 1: + if (!getResourceMeta() + .equals(other.getResourceMeta())) return false; + break; + case 2: + if (!getResource() + .equals(other.getResource())) return false; + break; + case 0: + default: + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -3775,8 +3881,18 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + RESOURCE_META_FIELD_NUMBER; - hash = (53 * hash) + getResourceMeta().hashCode(); + switch (resCase_) { + case 1: + hash = (37 * hash) + RESOURCE_META_FIELD_NUMBER; + hash = (53 * hash) + getResourceMeta().hashCode(); + break; + case 2: + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + break; + case 0: + default: + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -3914,8 +4030,8 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - resourceMeta_ = com.google.protobuf.ByteString.EMPTY; - + resCase_ = 0; + res_ = null; return this; } @@ -3942,7 +4058,17 @@ public flyteidl.admin.AgentOuterClass.CreateTaskResponse build() { @java.lang.Override public flyteidl.admin.AgentOuterClass.CreateTaskResponse buildPartial() { flyteidl.admin.AgentOuterClass.CreateTaskResponse result = new flyteidl.admin.AgentOuterClass.CreateTaskResponse(this); - result.resourceMeta_ = resourceMeta_; + if (resCase_ == 1) { + result.res_ = res_; + } + if (resCase_ == 2) { + if (resourceBuilder_ == null) { + result.res_ = res_; + } else { + result.res_ = resourceBuilder_.build(); + } + } + result.resCase_ = resCase_; onBuilt(); return result; } @@ -3991,8 +4117,18 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(flyteidl.admin.AgentOuterClass.CreateTaskResponse other) { if (other == flyteidl.admin.AgentOuterClass.CreateTaskResponse.getDefaultInstance()) return this; - if (other.getResourceMeta() != com.google.protobuf.ByteString.EMPTY) { - setResourceMeta(other.getResourceMeta()); + switch (other.getResCase()) { + case RESOURCE_META: { + setResourceMeta(other.getResourceMeta()); + break; + } + case RESOURCE: { + mergeResource(other.getResource()); + break; + } + case RES_NOT_SET: { + break; + } } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -4022,47 +4158,190 @@ public Builder mergeFrom( } return this; } + private int resCase_ = 0; + private java.lang.Object res_; + public ResCase + getResCase() { + return ResCase.forNumber( + resCase_); + } + + public Builder clearRes() { + resCase_ = 0; + res_ = null; + onChanged(); + return this; + } + - private com.google.protobuf.ByteString resourceMeta_ = com.google.protobuf.ByteString.EMPTY; /** - *
-       * Metadata is created by the agent. It could be a string (jobId) or a dict (more complex metadata).
-       * 
- * * bytes resource_meta = 1; */ public com.google.protobuf.ByteString getResourceMeta() { - return resourceMeta_; + if (resCase_ == 1) { + return (com.google.protobuf.ByteString) res_; + } + return com.google.protobuf.ByteString.EMPTY; } /** - *
-       * Metadata is created by the agent. It could be a string (jobId) or a dict (more complex metadata).
-       * 
- * * bytes resource_meta = 1; */ public Builder setResourceMeta(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - - resourceMeta_ = value; + resCase_ = 1; + res_ = value; onChanged(); return this; } /** - *
-       * Metadata is created by the agent. It could be a string (jobId) or a dict (more complex metadata).
-       * 
- * * bytes resource_meta = 1; */ public Builder clearResourceMeta() { - - resourceMeta_ = getDefaultInstance().getResourceMeta(); - onChanged(); + if (resCase_ == 1) { + resCase_ = 0; + res_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.admin.AgentOuterClass.Resource, flyteidl.admin.AgentOuterClass.Resource.Builder, flyteidl.admin.AgentOuterClass.ResourceOrBuilder> resourceBuilder_; + /** + * .flyteidl.admin.Resource resource = 2; + */ + public boolean hasResource() { + return resCase_ == 2; + } + /** + * .flyteidl.admin.Resource resource = 2; + */ + public flyteidl.admin.AgentOuterClass.Resource getResource() { + if (resourceBuilder_ == null) { + if (resCase_ == 2) { + return (flyteidl.admin.AgentOuterClass.Resource) res_; + } + return flyteidl.admin.AgentOuterClass.Resource.getDefaultInstance(); + } else { + if (resCase_ == 2) { + return resourceBuilder_.getMessage(); + } + return flyteidl.admin.AgentOuterClass.Resource.getDefaultInstance(); + } + } + /** + * .flyteidl.admin.Resource resource = 2; + */ + public Builder setResource(flyteidl.admin.AgentOuterClass.Resource value) { + if (resourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + res_ = value; + onChanged(); + } else { + resourceBuilder_.setMessage(value); + } + resCase_ = 2; + return this; + } + /** + * .flyteidl.admin.Resource resource = 2; + */ + public Builder setResource( + flyteidl.admin.AgentOuterClass.Resource.Builder builderForValue) { + if (resourceBuilder_ == null) { + res_ = builderForValue.build(); + onChanged(); + } else { + resourceBuilder_.setMessage(builderForValue.build()); + } + resCase_ = 2; + return this; + } + /** + * .flyteidl.admin.Resource resource = 2; + */ + public Builder mergeResource(flyteidl.admin.AgentOuterClass.Resource value) { + if (resourceBuilder_ == null) { + if (resCase_ == 2 && + res_ != flyteidl.admin.AgentOuterClass.Resource.getDefaultInstance()) { + res_ = flyteidl.admin.AgentOuterClass.Resource.newBuilder((flyteidl.admin.AgentOuterClass.Resource) res_) + .mergeFrom(value).buildPartial(); + } else { + res_ = value; + } + onChanged(); + } else { + if (resCase_ == 2) { + resourceBuilder_.mergeFrom(value); + } + resourceBuilder_.setMessage(value); + } + resCase_ = 2; + return this; + } + /** + * .flyteidl.admin.Resource resource = 2; + */ + public Builder clearResource() { + if (resourceBuilder_ == null) { + if (resCase_ == 2) { + resCase_ = 0; + res_ = null; + onChanged(); + } + } else { + if (resCase_ == 2) { + resCase_ = 0; + res_ = null; + } + resourceBuilder_.clear(); + } return this; } + /** + * .flyteidl.admin.Resource resource = 2; + */ + public flyteidl.admin.AgentOuterClass.Resource.Builder getResourceBuilder() { + return getResourceFieldBuilder().getBuilder(); + } + /** + * .flyteidl.admin.Resource resource = 2; + */ + public flyteidl.admin.AgentOuterClass.ResourceOrBuilder getResourceOrBuilder() { + if ((resCase_ == 2) && (resourceBuilder_ != null)) { + return resourceBuilder_.getMessageOrBuilder(); + } else { + if (resCase_ == 2) { + return (flyteidl.admin.AgentOuterClass.Resource) res_; + } + return flyteidl.admin.AgentOuterClass.Resource.getDefaultInstance(); + } + } + /** + * .flyteidl.admin.Resource resource = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.admin.AgentOuterClass.Resource, flyteidl.admin.AgentOuterClass.Resource.Builder, flyteidl.admin.AgentOuterClass.ResourceOrBuilder> + getResourceFieldBuilder() { + if (resourceBuilder_ == null) { + if (!(resCase_ == 2)) { + res_ = flyteidl.admin.AgentOuterClass.Resource.getDefaultInstance(); + } + resourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + flyteidl.admin.AgentOuterClass.Resource, flyteidl.admin.AgentOuterClass.Resource.Builder, flyteidl.admin.AgentOuterClass.ResourceOrBuilder>( + (flyteidl.admin.AgentOuterClass.Resource) res_, + getParentForChildren(), + isClean()); + res_ = null; + } + resCase_ = 2; + onChanged();; + return resourceBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -5962,6 +6241,50 @@ public interface ResourceOrBuilder extends */ com.google.protobuf.ByteString getMessageBytes(); + + /** + *
+     * log information for the task execution.
+     * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + java.util.List + getLogLinksList(); + /** + *
+     * log information for the task execution.
+     * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + flyteidl.core.Execution.TaskLog getLogLinks(int index); + /** + *
+     * log information for the task execution.
+     * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + int getLogLinksCount(); + /** + *
+     * log information for the task execution.
+     * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + java.util.List + getLogLinksOrBuilderList(); + /** + *
+     * log information for the task execution.
+     * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + flyteidl.core.Execution.TaskLogOrBuilder getLogLinksOrBuilder( + int index); } /** * Protobuf type {@code flyteidl.admin.Resource} @@ -5978,6 +6301,7 @@ private Resource(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Resource() { state_ = 0; message_ = ""; + logLinks_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -6029,6 +6353,15 @@ private Resource( message_ = s; break; } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + logLinks_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + logLinks_.add( + input.readMessage(flyteidl.core.Execution.TaskLog.parser(), extensionRegistry)); + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -6044,6 +6377,9 @@ private Resource( throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000008) != 0)) { + logLinks_ = java.util.Collections.unmodifiableList(logLinks_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -6061,6 +6397,7 @@ private Resource( flyteidl.admin.AgentOuterClass.Resource.class, flyteidl.admin.AgentOuterClass.Resource.Builder.class); } + private int bitField0_; public static final int STATE_FIELD_NUMBER = 1; private int state_; /** @@ -6167,15 +6504,70 @@ public java.lang.String getMessage() { } } - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; + public static final int LOG_LINKS_FIELD_NUMBER = 4; + private java.util.List logLinks_; + /** + *
+     * log information for the task execution.
+     * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public java.util.List getLogLinksList() { + return logLinks_; + } + /** + *
+     * log information for the task execution.
+     * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public java.util.List + getLogLinksOrBuilderList() { + return logLinks_; + } + /** + *
+     * log information for the task execution.
+     * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public int getLogLinksCount() { + return logLinks_.size(); + } + /** + *
+     * log information for the task execution.
+     * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public flyteidl.core.Execution.TaskLog getLogLinks(int index) { + return logLinks_.get(index); + } + /** + *
+     * log information for the task execution.
+     * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public flyteidl.core.Execution.TaskLogOrBuilder getLogLinksOrBuilder( + int index) { + return logLinks_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; } @java.lang.Override @@ -6190,6 +6582,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (!getMessageBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, message_); } + for (int i = 0; i < logLinks_.size(); i++) { + output.writeMessage(4, logLinks_.get(i)); + } unknownFields.writeTo(output); } @@ -6210,6 +6605,10 @@ public int getSerializedSize() { if (!getMessageBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, message_); } + for (int i = 0; i < logLinks_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, logLinks_.get(i)); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -6233,6 +6632,8 @@ public boolean equals(final java.lang.Object obj) { } if (!getMessage() .equals(other.getMessage())) return false; + if (!getLogLinksList() + .equals(other.getLogLinksList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -6252,6 +6653,10 @@ public int hashCode() { } hash = (37 * hash) + MESSAGE_FIELD_NUMBER; hash = (53 * hash) + getMessage().hashCode(); + if (getLogLinksCount() > 0) { + hash = (37 * hash) + LOG_LINKS_FIELD_NUMBER; + hash = (53 * hash) + getLogLinksList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -6380,6 +6785,7 @@ private Builder( private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { + getLogLinksFieldBuilder(); } } @java.lang.Override @@ -6395,6 +6801,12 @@ public Builder clear() { } message_ = ""; + if (logLinksBuilder_ == null) { + logLinks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + logLinksBuilder_.clear(); + } return this; } @@ -6421,6 +6833,8 @@ public flyteidl.admin.AgentOuterClass.Resource build() { @java.lang.Override public flyteidl.admin.AgentOuterClass.Resource buildPartial() { flyteidl.admin.AgentOuterClass.Resource result = new flyteidl.admin.AgentOuterClass.Resource(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; result.state_ = state_; if (outputsBuilder_ == null) { result.outputs_ = outputs_; @@ -6428,6 +6842,16 @@ public flyteidl.admin.AgentOuterClass.Resource buildPartial() { result.outputs_ = outputsBuilder_.build(); } result.message_ = message_; + if (logLinksBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + logLinks_ = java.util.Collections.unmodifiableList(logLinks_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.logLinks_ = logLinks_; + } else { + result.logLinks_ = logLinksBuilder_.build(); + } + result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -6486,6 +6910,32 @@ public Builder mergeFrom(flyteidl.admin.AgentOuterClass.Resource other) { message_ = other.message_; onChanged(); } + if (logLinksBuilder_ == null) { + if (!other.logLinks_.isEmpty()) { + if (logLinks_.isEmpty()) { + logLinks_ = other.logLinks_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureLogLinksIsMutable(); + logLinks_.addAll(other.logLinks_); + } + onChanged(); + } + } else { + if (!other.logLinks_.isEmpty()) { + if (logLinksBuilder_.isEmpty()) { + logLinksBuilder_.dispose(); + logLinksBuilder_ = null; + logLinks_ = other.logLinks_; + bitField0_ = (bitField0_ & ~0x00000008); + logLinksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLogLinksFieldBuilder() : null; + } else { + logLinksBuilder_.addAllMessages(other.logLinks_); + } + } + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -6514,6 +6964,7 @@ public Builder mergeFrom( } return this; } + private int bitField0_; private int state_ = 0; /** @@ -6839,6 +7290,318 @@ public Builder setMessageBytes( onChanged(); return this; } + + private java.util.List logLinks_ = + java.util.Collections.emptyList(); + private void ensureLogLinksIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + logLinks_ = new java.util.ArrayList(logLinks_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + flyteidl.core.Execution.TaskLog, flyteidl.core.Execution.TaskLog.Builder, flyteidl.core.Execution.TaskLogOrBuilder> logLinksBuilder_; + + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public java.util.List getLogLinksList() { + if (logLinksBuilder_ == null) { + return java.util.Collections.unmodifiableList(logLinks_); + } else { + return logLinksBuilder_.getMessageList(); + } + } + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public int getLogLinksCount() { + if (logLinksBuilder_ == null) { + return logLinks_.size(); + } else { + return logLinksBuilder_.getCount(); + } + } + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public flyteidl.core.Execution.TaskLog getLogLinks(int index) { + if (logLinksBuilder_ == null) { + return logLinks_.get(index); + } else { + return logLinksBuilder_.getMessage(index); + } + } + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public Builder setLogLinks( + int index, flyteidl.core.Execution.TaskLog value) { + if (logLinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogLinksIsMutable(); + logLinks_.set(index, value); + onChanged(); + } else { + logLinksBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public Builder setLogLinks( + int index, flyteidl.core.Execution.TaskLog.Builder builderForValue) { + if (logLinksBuilder_ == null) { + ensureLogLinksIsMutable(); + logLinks_.set(index, builderForValue.build()); + onChanged(); + } else { + logLinksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public Builder addLogLinks(flyteidl.core.Execution.TaskLog value) { + if (logLinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogLinksIsMutable(); + logLinks_.add(value); + onChanged(); + } else { + logLinksBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public Builder addLogLinks( + int index, flyteidl.core.Execution.TaskLog value) { + if (logLinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogLinksIsMutable(); + logLinks_.add(index, value); + onChanged(); + } else { + logLinksBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public Builder addLogLinks( + flyteidl.core.Execution.TaskLog.Builder builderForValue) { + if (logLinksBuilder_ == null) { + ensureLogLinksIsMutable(); + logLinks_.add(builderForValue.build()); + onChanged(); + } else { + logLinksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public Builder addLogLinks( + int index, flyteidl.core.Execution.TaskLog.Builder builderForValue) { + if (logLinksBuilder_ == null) { + ensureLogLinksIsMutable(); + logLinks_.add(index, builderForValue.build()); + onChanged(); + } else { + logLinksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public Builder addAllLogLinks( + java.lang.Iterable values) { + if (logLinksBuilder_ == null) { + ensureLogLinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, logLinks_); + onChanged(); + } else { + logLinksBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public Builder clearLogLinks() { + if (logLinksBuilder_ == null) { + logLinks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + logLinksBuilder_.clear(); + } + return this; + } + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public Builder removeLogLinks(int index) { + if (logLinksBuilder_ == null) { + ensureLogLinksIsMutable(); + logLinks_.remove(index); + onChanged(); + } else { + logLinksBuilder_.remove(index); + } + return this; + } + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public flyteidl.core.Execution.TaskLog.Builder getLogLinksBuilder( + int index) { + return getLogLinksFieldBuilder().getBuilder(index); + } + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public flyteidl.core.Execution.TaskLogOrBuilder getLogLinksOrBuilder( + int index) { + if (logLinksBuilder_ == null) { + return logLinks_.get(index); } else { + return logLinksBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public java.util.List + getLogLinksOrBuilderList() { + if (logLinksBuilder_ != null) { + return logLinksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(logLinks_); + } + } + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public flyteidl.core.Execution.TaskLog.Builder addLogLinksBuilder() { + return getLogLinksFieldBuilder().addBuilder( + flyteidl.core.Execution.TaskLog.getDefaultInstance()); + } + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public flyteidl.core.Execution.TaskLog.Builder addLogLinksBuilder( + int index) { + return getLogLinksFieldBuilder().addBuilder( + index, flyteidl.core.Execution.TaskLog.getDefaultInstance()); + } + /** + *
+       * log information for the task execution.
+       * 
+ * + * repeated .flyteidl.core.TaskLog log_links = 4; + */ + public java.util.List + getLogLinksBuilderList() { + return getLogLinksFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + flyteidl.core.Execution.TaskLog, flyteidl.core.Execution.TaskLog.Builder, flyteidl.core.Execution.TaskLogOrBuilder> + getLogLinksFieldBuilder() { + if (logLinksBuilder_ == null) { + logLinksBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + flyteidl.core.Execution.TaskLog, flyteidl.core.Execution.TaskLog.Builder, flyteidl.core.Execution.TaskLogOrBuilder>( + logLinks_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + logLinks_ = null; + } + return logLinksBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -11372,27 +12135,30 @@ public flyteidl.admin.AgentOuterClass.ListAgentsResponse getDefaultInstanceForTy "p\022-\n\010template\030\002 \001(\0132\033.flyteidl.core.Task" + "Template\022\025\n\routput_prefix\030\003 \001(\t\022F\n\027task_" + "execution_metadata\030\004 \001(\0132%.flyteidl.admi" + - "n.TaskExecutionMetadata\"+\n\022CreateTaskRes" + - "ponse\022\025\n\rresource_meta\030\001 \001(\014\":\n\016GetTaskR" + - "equest\022\021\n\ttask_type\030\001 \001(\t\022\025\n\rresource_me" + - "ta\030\002 \001(\014\"h\n\017GetTaskResponse\022*\n\010resource\030" + - "\001 \001(\0132\030.flyteidl.admin.Resource\022)\n\tlog_l" + - "inks\030\002 \003(\0132\026.flyteidl.core.TaskLog\"m\n\010Re" + - "source\022$\n\005state\030\001 \001(\0162\025.flyteidl.admin.S" + - "tate\022*\n\007outputs\030\002 \001(\0132\031.flyteidl.core.Li" + - "teralMap\022\017\n\007message\030\003 \001(\t\"=\n\021DeleteTaskR" + - "equest\022\021\n\ttask_type\030\001 \001(\t\022\025\n\rresource_me" + - "ta\030\002 \001(\014\"\024\n\022DeleteTaskResponse\"3\n\005Agent\022" + - "\014\n\004name\030\001 \001(\t\022\034\n\024supported_task_types\030\002 " + - "\003(\t\"\037\n\017GetAgentRequest\022\014\n\004name\030\001 \001(\t\"8\n\020" + - "GetAgentResponse\022$\n\005agent\030\001 \001(\0132\025.flytei" + - "dl.admin.Agent\"\023\n\021ListAgentsRequest\";\n\022L" + - "istAgentsResponse\022%\n\006agents\030\001 \003(\0132\025.flyt" + - "eidl.admin.Agent*^\n\005State\022\025\n\021RETRYABLE_F" + - "AILURE\020\000\022\025\n\021PERMANENT_FAILURE\020\001\022\013\n\007PENDI" + - "NG\020\002\022\013\n\007RUNNING\020\003\022\r\n\tSUCCEEDED\020\004B=Z;gith" + - "ub.com/flyteorg/flyte/flyteidl/gen/pb-go" + - "/flyteidl/adminb\006proto3" + "n.TaskExecutionMetadata\"b\n\022CreateTaskRes" + + "ponse\022\027\n\rresource_meta\030\001 \001(\014H\000\022,\n\010resour" + + "ce\030\002 \001(\0132\030.flyteidl.admin.ResourceH\000B\005\n\003" + + "res\":\n\016GetTaskRequest\022\021\n\ttask_type\030\001 \001(\t" + + "\022\025\n\rresource_meta\030\002 \001(\014\"h\n\017GetTaskRespon" + + "se\022*\n\010resource\030\001 \001(\0132\030.flyteidl.admin.Re" + + "source\022)\n\tlog_links\030\002 \003(\0132\026.flyteidl.cor" + + "e.TaskLog\"\230\001\n\010Resource\022$\n\005state\030\001 \001(\0162\025." + + "flyteidl.admin.State\022*\n\007outputs\030\002 \001(\0132\031." + + "flyteidl.core.LiteralMap\022\017\n\007message\030\003 \001(" + + "\t\022)\n\tlog_links\030\004 \003(\0132\026.flyteidl.core.Tas" + + "kLog\"=\n\021DeleteTaskRequest\022\021\n\ttask_type\030\001" + + " \001(\t\022\025\n\rresource_meta\030\002 \001(\014\"\024\n\022DeleteTas" + + "kResponse\"3\n\005Agent\022\014\n\004name\030\001 \001(\t\022\034\n\024supp" + + "orted_task_types\030\002 \003(\t\"\037\n\017GetAgentReques" + + "t\022\014\n\004name\030\001 \001(\t\"8\n\020GetAgentResponse\022$\n\005a" + + "gent\030\001 \001(\0132\025.flyteidl.admin.Agent\"\023\n\021Lis" + + "tAgentsRequest\";\n\022ListAgentsResponse\022%\n\006" + + "agents\030\001 \003(\0132\025.flyteidl.admin.Agent*^\n\005S" + + "tate\022\025\n\021RETRYABLE_FAILURE\020\000\022\025\n\021PERMANENT" + + "_FAILURE\020\001\022\013\n\007PENDING\020\002\022\013\n\007RUNNING\020\003\022\r\n\t" + + "SUCCEEDED\020\004B=Z;github.com/flyteorg/flyte" + + "/flyteidl/gen/pb-go/flyteidl/adminb\006prot" + + "o3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -11446,7 +12212,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( internal_static_flyteidl_admin_CreateTaskResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_flyteidl_admin_CreateTaskResponse_descriptor, - new java.lang.String[] { "ResourceMeta", }); + new java.lang.String[] { "ResourceMeta", "Resource", "Res", }); internal_static_flyteidl_admin_GetTaskRequest_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_flyteidl_admin_GetTaskRequest_fieldAccessorTable = new @@ -11464,7 +12230,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( internal_static_flyteidl_admin_Resource_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_flyteidl_admin_Resource_descriptor, - new java.lang.String[] { "State", "Outputs", "Message", }); + new java.lang.String[] { "State", "Outputs", "Message", "LogLinks", }); internal_static_flyteidl_admin_DeleteTaskRequest_descriptor = getDescriptor().getMessageTypes().get(6); internal_static_flyteidl_admin_DeleteTaskRequest_fieldAccessorTable = new diff --git a/flyteidl/gen/pb-js/flyteidl.d.ts b/flyteidl/gen/pb-js/flyteidl.d.ts index 2e0ff4e76c..9570d8dc7b 100644 --- a/flyteidl/gen/pb-js/flyteidl.d.ts +++ b/flyteidl/gen/pb-js/flyteidl.d.ts @@ -8028,6 +8028,9 @@ export namespace flyteidl { /** CreateTaskResponse resourceMeta */ resourceMeta?: (Uint8Array|null); + + /** CreateTaskResponse resource */ + resource?: (flyteidl.admin.IResource|null); } /** Represents a CreateTaskResponse. */ @@ -8042,6 +8045,12 @@ export namespace flyteidl { /** CreateTaskResponse resourceMeta. */ public resourceMeta: Uint8Array; + /** CreateTaskResponse resource. */ + public resource?: (flyteidl.admin.IResource|null); + + /** CreateTaskResponse res. */ + public res?: ("resourceMeta"|"resource"); + /** * Creates a new CreateTaskResponse instance using the specified properties. * @param [properties] Properties to set @@ -8202,6 +8211,9 @@ export namespace flyteidl { /** Resource message */ message?: (string|null); + + /** Resource logLinks */ + logLinks?: (flyteidl.core.ITaskLog[]|null); } /** Represents a Resource. */ @@ -8222,6 +8234,9 @@ export namespace flyteidl { /** Resource message. */ public message: string; + /** Resource logLinks. */ + public logLinks: flyteidl.core.ITaskLog[]; + /** * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set diff --git a/flyteidl/gen/pb-js/flyteidl.js b/flyteidl/gen/pb-js/flyteidl.js index 95f887c3ba..ff88e85cd1 100644 --- a/flyteidl/gen/pb-js/flyteidl.js +++ b/flyteidl/gen/pb-js/flyteidl.js @@ -19663,6 +19663,7 @@ * @memberof flyteidl.admin * @interface ICreateTaskResponse * @property {Uint8Array|null} [resourceMeta] CreateTaskResponse resourceMeta + * @property {flyteidl.admin.IResource|null} [resource] CreateTaskResponse resource */ /** @@ -19688,6 +19689,28 @@ */ CreateTaskResponse.prototype.resourceMeta = $util.newBuffer([]); + /** + * CreateTaskResponse resource. + * @member {flyteidl.admin.IResource|null|undefined} resource + * @memberof flyteidl.admin.CreateTaskResponse + * @instance + */ + CreateTaskResponse.prototype.resource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CreateTaskResponse res. + * @member {"resourceMeta"|"resource"|undefined} res + * @memberof flyteidl.admin.CreateTaskResponse + * @instance + */ + Object.defineProperty(CreateTaskResponse.prototype, "res", { + get: $util.oneOfGetter($oneOfFields = ["resourceMeta", "resource"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new CreateTaskResponse instance using the specified properties. * @function create @@ -19714,6 +19737,8 @@ writer = $Writer.create(); if (message.resourceMeta != null && message.hasOwnProperty("resourceMeta")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.resourceMeta); + if (message.resource != null && message.hasOwnProperty("resource")) + $root.flyteidl.admin.Resource.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -19738,6 +19763,9 @@ case 1: message.resourceMeta = reader.bytes(); break; + case 2: + message.resource = $root.flyteidl.admin.Resource.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -19757,9 +19785,22 @@ CreateTaskResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.resourceMeta != null && message.hasOwnProperty("resourceMeta")) + var properties = {}; + if (message.resourceMeta != null && message.hasOwnProperty("resourceMeta")) { + properties.res = 1; if (!(message.resourceMeta && typeof message.resourceMeta.length === "number" || $util.isString(message.resourceMeta))) return "resourceMeta: buffer expected"; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + if (properties.res === 1) + return "res: multiple values"; + properties.res = 1; + { + var error = $root.flyteidl.admin.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + } return null; }; @@ -20041,6 +20082,7 @@ * @property {flyteidl.admin.State|null} [state] Resource state * @property {flyteidl.core.ILiteralMap|null} [outputs] Resource outputs * @property {string|null} [message] Resource message + * @property {Array.|null} [logLinks] Resource logLinks */ /** @@ -20052,6 +20094,7 @@ * @param {flyteidl.admin.IResource=} [properties] Properties to set */ function Resource(properties) { + this.logLinks = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20082,6 +20125,14 @@ */ Resource.prototype.message = ""; + /** + * Resource logLinks. + * @member {Array.} logLinks + * @memberof flyteidl.admin.Resource + * @instance + */ + Resource.prototype.logLinks = $util.emptyArray; + /** * Creates a new Resource instance using the specified properties. * @function create @@ -20112,6 +20163,9 @@ $root.flyteidl.core.LiteralMap.encode(message.outputs, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.message != null && message.hasOwnProperty("message")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.message); + if (message.logLinks != null && message.logLinks.length) + for (var i = 0; i < message.logLinks.length; ++i) + $root.flyteidl.core.TaskLog.encode(message.logLinks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -20142,6 +20196,11 @@ case 3: message.message = reader.string(); break; + case 4: + if (!(message.logLinks && message.logLinks.length)) + message.logLinks = []; + message.logLinks.push($root.flyteidl.core.TaskLog.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -20180,6 +20239,15 @@ if (message.message != null && message.hasOwnProperty("message")) if (!$util.isString(message.message)) return "message: string expected"; + if (message.logLinks != null && message.hasOwnProperty("logLinks")) { + if (!Array.isArray(message.logLinks)) + return "logLinks: array expected"; + for (var i = 0; i < message.logLinks.length; ++i) { + var error = $root.flyteidl.core.TaskLog.verify(message.logLinks[i]); + if (error) + return "logLinks." + error; + } + } return null; }; diff --git a/flyteidl/gen/pb_python/flyteidl/admin/agent_pb2.py b/flyteidl/gen/pb_python/flyteidl/admin/agent_pb2.py index baceaf16c6..5d515cb0c4 100644 --- a/flyteidl/gen/pb_python/flyteidl/admin/agent_pb2.py +++ b/flyteidl/gen/pb_python/flyteidl/admin/agent_pb2.py @@ -18,7 +18,7 @@ from flyteidl.core import execution_pb2 as flyteidl_dot_core_dot_execution__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1a\x66lyteidl/admin/agent.proto\x12\x0e\x66lyteidl.admin\x1a\x1c\x66lyteidl/core/literals.proto\x1a\x19\x66lyteidl/core/tasks.proto\x1a\x1d\x66lyteidl/core/interface.proto\x1a\x1e\x66lyteidl/core/identifier.proto\x1a\x1d\x66lyteidl/core/execution.proto\"\x98\x05\n\x15TaskExecutionMetadata\x12R\n\x11task_execution_id\x18\x01 \x01(\x0b\x32&.flyteidl.core.TaskExecutionIdentifierR\x0ftaskExecutionId\x12\x1c\n\tnamespace\x18\x02 \x01(\tR\tnamespace\x12I\n\x06labels\x18\x03 \x03(\x0b\x32\x31.flyteidl.admin.TaskExecutionMetadata.LabelsEntryR\x06labels\x12X\n\x0b\x61nnotations\x18\x04 \x03(\x0b\x32\x36.flyteidl.admin.TaskExecutionMetadata.AnnotationsEntryR\x0b\x61nnotations\x12.\n\x13k8s_service_account\x18\x05 \x01(\tR\x11k8sServiceAccount\x12t\n\x15\x65nvironment_variables\x18\x06 \x03(\x0b\x32?.flyteidl.admin.TaskExecutionMetadata.EnvironmentVariablesEntryR\x14\x65nvironmentVariables\x1a\x39\n\x0bLabelsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\x1a>\n\x10\x41nnotationsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\x1aG\n\x19\x45nvironmentVariablesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\x83\x02\n\x11\x43reateTaskRequest\x12\x31\n\x06inputs\x18\x01 \x01(\x0b\x32\x19.flyteidl.core.LiteralMapR\x06inputs\x12\x37\n\x08template\x18\x02 \x01(\x0b\x32\x1b.flyteidl.core.TaskTemplateR\x08template\x12#\n\routput_prefix\x18\x03 \x01(\tR\x0coutputPrefix\x12]\n\x17task_execution_metadata\x18\x04 \x01(\x0b\x32%.flyteidl.admin.TaskExecutionMetadataR\x15taskExecutionMetadata\"9\n\x12\x43reateTaskResponse\x12#\n\rresource_meta\x18\x01 \x01(\x0cR\x0cresourceMeta\"R\n\x0eGetTaskRequest\x12\x1b\n\ttask_type\x18\x01 \x01(\tR\x08taskType\x12#\n\rresource_meta\x18\x02 \x01(\x0cR\x0cresourceMeta\"|\n\x0fGetTaskResponse\x12\x34\n\x08resource\x18\x01 \x01(\x0b\x32\x18.flyteidl.admin.ResourceR\x08resource\x12\x33\n\tlog_links\x18\x02 \x03(\x0b\x32\x16.flyteidl.core.TaskLogR\x08logLinks\"\x86\x01\n\x08Resource\x12+\n\x05state\x18\x01 \x01(\x0e\x32\x15.flyteidl.admin.StateR\x05state\x12\x33\n\x07outputs\x18\x02 \x01(\x0b\x32\x19.flyteidl.core.LiteralMapR\x07outputs\x12\x18\n\x07message\x18\x03 \x01(\tR\x07message\"U\n\x11\x44\x65leteTaskRequest\x12\x1b\n\ttask_type\x18\x01 \x01(\tR\x08taskType\x12#\n\rresource_meta\x18\x02 \x01(\x0cR\x0cresourceMeta\"\x14\n\x12\x44\x65leteTaskResponse\"M\n\x05\x41gent\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x30\n\x14supported_task_types\x18\x02 \x03(\tR\x12supportedTaskTypes\"%\n\x0fGetAgentRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\"?\n\x10GetAgentResponse\x12+\n\x05\x61gent\x18\x01 \x01(\x0b\x32\x15.flyteidl.admin.AgentR\x05\x61gent\"\x13\n\x11ListAgentsRequest\"C\n\x12ListAgentsResponse\x12-\n\x06\x61gents\x18\x01 \x03(\x0b\x32\x15.flyteidl.admin.AgentR\x06\x61gents*^\n\x05State\x12\x15\n\x11RETRYABLE_FAILURE\x10\x00\x12\x15\n\x11PERMANENT_FAILURE\x10\x01\x12\x0b\n\x07PENDING\x10\x02\x12\x0b\n\x07RUNNING\x10\x03\x12\r\n\tSUCCEEDED\x10\x04\x42\xb6\x01\n\x12\x63om.flyteidl.adminB\nAgentProtoP\x01Z;github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin\xa2\x02\x03\x46\x41X\xaa\x02\x0e\x46lyteidl.Admin\xca\x02\x0e\x46lyteidl\\Admin\xe2\x02\x1a\x46lyteidl\\Admin\\GPBMetadata\xea\x02\x0f\x46lyteidl::Adminb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1a\x66lyteidl/admin/agent.proto\x12\x0e\x66lyteidl.admin\x1a\x1c\x66lyteidl/core/literals.proto\x1a\x19\x66lyteidl/core/tasks.proto\x1a\x1d\x66lyteidl/core/interface.proto\x1a\x1e\x66lyteidl/core/identifier.proto\x1a\x1d\x66lyteidl/core/execution.proto\"\x98\x05\n\x15TaskExecutionMetadata\x12R\n\x11task_execution_id\x18\x01 \x01(\x0b\x32&.flyteidl.core.TaskExecutionIdentifierR\x0ftaskExecutionId\x12\x1c\n\tnamespace\x18\x02 \x01(\tR\tnamespace\x12I\n\x06labels\x18\x03 \x03(\x0b\x32\x31.flyteidl.admin.TaskExecutionMetadata.LabelsEntryR\x06labels\x12X\n\x0b\x61nnotations\x18\x04 \x03(\x0b\x32\x36.flyteidl.admin.TaskExecutionMetadata.AnnotationsEntryR\x0b\x61nnotations\x12.\n\x13k8s_service_account\x18\x05 \x01(\tR\x11k8sServiceAccount\x12t\n\x15\x65nvironment_variables\x18\x06 \x03(\x0b\x32?.flyteidl.admin.TaskExecutionMetadata.EnvironmentVariablesEntryR\x14\x65nvironmentVariables\x1a\x39\n\x0bLabelsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\x1a>\n\x10\x41nnotationsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\x1aG\n\x19\x45nvironmentVariablesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\x83\x02\n\x11\x43reateTaskRequest\x12\x31\n\x06inputs\x18\x01 \x01(\x0b\x32\x19.flyteidl.core.LiteralMapR\x06inputs\x12\x37\n\x08template\x18\x02 \x01(\x0b\x32\x1b.flyteidl.core.TaskTemplateR\x08template\x12#\n\routput_prefix\x18\x03 \x01(\tR\x0coutputPrefix\x12]\n\x17task_execution_metadata\x18\x04 \x01(\x0b\x32%.flyteidl.admin.TaskExecutionMetadataR\x15taskExecutionMetadata\"z\n\x12\x43reateTaskResponse\x12%\n\rresource_meta\x18\x01 \x01(\x0cH\x00R\x0cresourceMeta\x12\x36\n\x08resource\x18\x02 \x01(\x0b\x32\x18.flyteidl.admin.ResourceH\x00R\x08resourceB\x05\n\x03res\"R\n\x0eGetTaskRequest\x12\x1b\n\ttask_type\x18\x01 \x01(\tR\x08taskType\x12#\n\rresource_meta\x18\x02 \x01(\x0cR\x0cresourceMeta\"|\n\x0fGetTaskResponse\x12\x34\n\x08resource\x18\x01 \x01(\x0b\x32\x18.flyteidl.admin.ResourceR\x08resource\x12\x33\n\tlog_links\x18\x02 \x03(\x0b\x32\x16.flyteidl.core.TaskLogR\x08logLinks\"\xbb\x01\n\x08Resource\x12+\n\x05state\x18\x01 \x01(\x0e\x32\x15.flyteidl.admin.StateR\x05state\x12\x33\n\x07outputs\x18\x02 \x01(\x0b\x32\x19.flyteidl.core.LiteralMapR\x07outputs\x12\x18\n\x07message\x18\x03 \x01(\tR\x07message\x12\x33\n\tlog_links\x18\x04 \x03(\x0b\x32\x16.flyteidl.core.TaskLogR\x08logLinks\"U\n\x11\x44\x65leteTaskRequest\x12\x1b\n\ttask_type\x18\x01 \x01(\tR\x08taskType\x12#\n\rresource_meta\x18\x02 \x01(\x0cR\x0cresourceMeta\"\x14\n\x12\x44\x65leteTaskResponse\"M\n\x05\x41gent\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x30\n\x14supported_task_types\x18\x02 \x03(\tR\x12supportedTaskTypes\"%\n\x0fGetAgentRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\"?\n\x10GetAgentResponse\x12+\n\x05\x61gent\x18\x01 \x01(\x0b\x32\x15.flyteidl.admin.AgentR\x05\x61gent\"\x13\n\x11ListAgentsRequest\"C\n\x12ListAgentsResponse\x12-\n\x06\x61gents\x18\x01 \x03(\x0b\x32\x15.flyteidl.admin.AgentR\x06\x61gents*^\n\x05State\x12\x15\n\x11RETRYABLE_FAILURE\x10\x00\x12\x15\n\x11PERMANENT_FAILURE\x10\x01\x12\x0b\n\x07PENDING\x10\x02\x12\x0b\n\x07RUNNING\x10\x03\x12\r\n\tSUCCEEDED\x10\x04\x42\xb6\x01\n\x12\x63om.flyteidl.adminB\nAgentProtoP\x01Z;github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin\xa2\x02\x03\x46\x41X\xaa\x02\x0e\x46lyteidl.Admin\xca\x02\x0e\x46lyteidl\\Admin\xe2\x02\x1a\x46lyteidl\\Admin\\GPBMetadata\xea\x02\x0f\x46lyteidl::Adminb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -33,8 +33,8 @@ _TASKEXECUTIONMETADATA_ANNOTATIONSENTRY._serialized_options = b'8\001' _TASKEXECUTIONMETADATA_ENVIRONMENTVARIABLESENTRY._options = None _TASKEXECUTIONMETADATA_ENVIRONMENTVARIABLESENTRY._serialized_options = b'8\001' - _globals['_STATE']._serialized_start=1914 - _globals['_STATE']._serialized_end=2008 + _globals['_STATE']._serialized_start=2032 + _globals['_STATE']._serialized_end=2126 _globals['_TASKEXECUTIONMETADATA']._serialized_start=198 _globals['_TASKEXECUTIONMETADATA']._serialized_end=862 _globals['_TASKEXECUTIONMETADATA_LABELSENTRY']._serialized_start=668 @@ -46,25 +46,25 @@ _globals['_CREATETASKREQUEST']._serialized_start=865 _globals['_CREATETASKREQUEST']._serialized_end=1124 _globals['_CREATETASKRESPONSE']._serialized_start=1126 - _globals['_CREATETASKRESPONSE']._serialized_end=1183 - _globals['_GETTASKREQUEST']._serialized_start=1185 - _globals['_GETTASKREQUEST']._serialized_end=1267 - _globals['_GETTASKRESPONSE']._serialized_start=1269 - _globals['_GETTASKRESPONSE']._serialized_end=1393 - _globals['_RESOURCE']._serialized_start=1396 - _globals['_RESOURCE']._serialized_end=1530 - _globals['_DELETETASKREQUEST']._serialized_start=1532 - _globals['_DELETETASKREQUEST']._serialized_end=1617 - _globals['_DELETETASKRESPONSE']._serialized_start=1619 - _globals['_DELETETASKRESPONSE']._serialized_end=1639 - _globals['_AGENT']._serialized_start=1641 - _globals['_AGENT']._serialized_end=1718 - _globals['_GETAGENTREQUEST']._serialized_start=1720 - _globals['_GETAGENTREQUEST']._serialized_end=1757 - _globals['_GETAGENTRESPONSE']._serialized_start=1759 - _globals['_GETAGENTRESPONSE']._serialized_end=1822 - _globals['_LISTAGENTSREQUEST']._serialized_start=1824 - _globals['_LISTAGENTSREQUEST']._serialized_end=1843 - _globals['_LISTAGENTSRESPONSE']._serialized_start=1845 - _globals['_LISTAGENTSRESPONSE']._serialized_end=1912 + _globals['_CREATETASKRESPONSE']._serialized_end=1248 + _globals['_GETTASKREQUEST']._serialized_start=1250 + _globals['_GETTASKREQUEST']._serialized_end=1332 + _globals['_GETTASKRESPONSE']._serialized_start=1334 + _globals['_GETTASKRESPONSE']._serialized_end=1458 + _globals['_RESOURCE']._serialized_start=1461 + _globals['_RESOURCE']._serialized_end=1648 + _globals['_DELETETASKREQUEST']._serialized_start=1650 + _globals['_DELETETASKREQUEST']._serialized_end=1735 + _globals['_DELETETASKRESPONSE']._serialized_start=1737 + _globals['_DELETETASKRESPONSE']._serialized_end=1757 + _globals['_AGENT']._serialized_start=1759 + _globals['_AGENT']._serialized_end=1836 + _globals['_GETAGENTREQUEST']._serialized_start=1838 + _globals['_GETAGENTREQUEST']._serialized_end=1875 + _globals['_GETAGENTRESPONSE']._serialized_start=1877 + _globals['_GETAGENTRESPONSE']._serialized_end=1940 + _globals['_LISTAGENTSREQUEST']._serialized_start=1942 + _globals['_LISTAGENTSREQUEST']._serialized_end=1961 + _globals['_LISTAGENTSRESPONSE']._serialized_start=1963 + _globals['_LISTAGENTSRESPONSE']._serialized_end=2030 # @@protoc_insertion_point(module_scope) diff --git a/flyteidl/gen/pb_python/flyteidl/admin/agent_pb2.pyi b/flyteidl/gen/pb_python/flyteidl/admin/agent_pb2.pyi index d184c997b7..3b80e41b58 100644 --- a/flyteidl/gen/pb_python/flyteidl/admin/agent_pb2.pyi +++ b/flyteidl/gen/pb_python/flyteidl/admin/agent_pb2.pyi @@ -74,10 +74,12 @@ class CreateTaskRequest(_message.Message): def __init__(self, inputs: _Optional[_Union[_literals_pb2.LiteralMap, _Mapping]] = ..., template: _Optional[_Union[_tasks_pb2.TaskTemplate, _Mapping]] = ..., output_prefix: _Optional[str] = ..., task_execution_metadata: _Optional[_Union[TaskExecutionMetadata, _Mapping]] = ...) -> None: ... class CreateTaskResponse(_message.Message): - __slots__ = ["resource_meta"] + __slots__ = ["resource_meta", "resource"] RESOURCE_META_FIELD_NUMBER: _ClassVar[int] + RESOURCE_FIELD_NUMBER: _ClassVar[int] resource_meta: bytes - def __init__(self, resource_meta: _Optional[bytes] = ...) -> None: ... + resource: Resource + def __init__(self, resource_meta: _Optional[bytes] = ..., resource: _Optional[_Union[Resource, _Mapping]] = ...) -> None: ... class GetTaskRequest(_message.Message): __slots__ = ["task_type", "resource_meta"] @@ -96,14 +98,16 @@ class GetTaskResponse(_message.Message): def __init__(self, resource: _Optional[_Union[Resource, _Mapping]] = ..., log_links: _Optional[_Iterable[_Union[_execution_pb2.TaskLog, _Mapping]]] = ...) -> None: ... class Resource(_message.Message): - __slots__ = ["state", "outputs", "message"] + __slots__ = ["state", "outputs", "message", "log_links"] STATE_FIELD_NUMBER: _ClassVar[int] OUTPUTS_FIELD_NUMBER: _ClassVar[int] MESSAGE_FIELD_NUMBER: _ClassVar[int] + LOG_LINKS_FIELD_NUMBER: _ClassVar[int] state: State outputs: _literals_pb2.LiteralMap message: str - def __init__(self, state: _Optional[_Union[State, str]] = ..., outputs: _Optional[_Union[_literals_pb2.LiteralMap, _Mapping]] = ..., message: _Optional[str] = ...) -> None: ... + log_links: _containers.RepeatedCompositeFieldContainer[_execution_pb2.TaskLog] + def __init__(self, state: _Optional[_Union[State, str]] = ..., outputs: _Optional[_Union[_literals_pb2.LiteralMap, _Mapping]] = ..., message: _Optional[str] = ..., log_links: _Optional[_Iterable[_Union[_execution_pb2.TaskLog, _Mapping]]] = ...) -> None: ... class DeleteTaskRequest(_message.Message): __slots__ = ["task_type", "resource_meta"] diff --git a/flyteidl/gen/pb_rust/flyteidl.admin.rs b/flyteidl/gen/pb_rust/flyteidl.admin.rs index 3758f6d90e..692a1ee5e7 100644 --- a/flyteidl/gen/pb_rust/flyteidl.admin.rs +++ b/flyteidl/gen/pb_rust/flyteidl.admin.rs @@ -46,8 +46,22 @@ pub struct CreateTaskRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct CreateTaskResponse { /// Metadata is created by the agent. It could be a string (jobId) or a dict (more complex metadata). - #[prost(bytes="vec", tag="1")] - pub resource_meta: ::prost::alloc::vec::Vec, + /// Resource is for synchronous task execution. + #[prost(oneof="create_task_response::Res", tags="1, 2")] + pub res: ::core::option::Option, +} +/// Nested message and enum types in `CreateTaskResponse`. +pub mod create_task_response { + /// Metadata is created by the agent. It could be a string (jobId) or a dict (more complex metadata). + /// Resource is for synchronous task execution. + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Res { + #[prost(bytes, tag="1")] + ResourceMeta(::prost::alloc::vec::Vec), + #[prost(message, tag="2")] + Resource(super::Resource), + } } /// A message used to fetch a job resource from flyte agent server. #[allow(clippy::derive_partial_eq_without_eq)] @@ -84,6 +98,9 @@ pub struct Resource { /// A descriptive message for the current state. e.g. waiting for cluster. #[prost(string, tag="3")] pub message: ::prost::alloc::string::String, + /// log information for the task execution. + #[prost(message, repeated, tag="4")] + pub log_links: ::prost::alloc::vec::Vec, } /// A message used to delete a task. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/flyteidl/protos/flyteidl/admin/agent.proto b/flyteidl/protos/flyteidl/admin/agent.proto index 98ab21cd07..778fcc99d0 100644 --- a/flyteidl/protos/flyteidl/admin/agent.proto +++ b/flyteidl/protos/flyteidl/admin/agent.proto @@ -51,7 +51,11 @@ message CreateTaskRequest { // Represents a create response structure. message CreateTaskResponse { // Metadata is created by the agent. It could be a string (jobId) or a dict (more complex metadata). - bytes resource_meta = 1; + // Resource is for synchronous task execution. + oneof res { + bytes resource_meta = 1; + Resource resource = 2; + } } // A message used to fetch a job resource from flyte agent server. @@ -79,6 +83,8 @@ message Resource { core.LiteralMap outputs = 2; // A descriptive message for the current state. e.g. waiting for cluster. string message = 3; + // log information for the task execution. + repeated core.TaskLog log_links = 4; } // A message used to delete a task. diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go index d51209a77c..a23f985fc6 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go @@ -73,6 +73,7 @@ func (c CorePlugin) Handle(ctx context.Context, tCtx core.TaskExecutionContext) var nextState *State var phaseInfo core.PhaseInfo + switch incomingState.Phase { case PhaseNotStarted: if len(c.p.GetConfig().ResourceQuotas) > 0 { @@ -123,6 +124,7 @@ func (c CorePlugin) Finalize(ctx context.Context, tCtx core.TaskExecutionContext logger.Infof(ctx, "Attempting to finalize resource [%v].", tCtx.TaskExecutionMetadata().GetTaskExecutionID().GetGeneratedName()) + return c.tokenAllocator.releaseToken(ctx, c.p, tCtx, c.metrics) } diff --git a/flyteplugins/go/tasks/pluginmachinery/webapi/mocks/plugin.go b/flyteplugins/go/tasks/pluginmachinery/webapi/mocks/plugin.go new file mode 100644 index 0000000000..1e255ca1fa --- /dev/null +++ b/flyteplugins/go/tasks/pluginmachinery/webapi/mocks/plugin.go @@ -0,0 +1,45 @@ +// Code generated by mockery v1.0.1. DO NOT EDIT. + +package mocks + +import ( + webapi "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" + mock "github.com/stretchr/testify/mock" +) + +// Plugin is an autogenerated mock type for the Plugin type +type Plugin struct { + mock.Mock +} + +type Plugin_GetConfig struct { + *mock.Call +} + +func (_m Plugin_GetConfig) Return(_a0 webapi.PluginConfig) *Plugin_GetConfig { + return &Plugin_GetConfig{Call: _m.Call.Return(_a0)} +} + +func (_m *Plugin) OnGetConfig() *Plugin_GetConfig { + c_call := _m.On("GetConfig") + return &Plugin_GetConfig{Call: c_call} +} + +func (_m *Plugin) OnGetConfigMatch(matchers ...interface{}) *Plugin_GetConfig { + c_call := _m.On("GetConfig", matchers...) + return &Plugin_GetConfig{Call: c_call} +} + +// GetConfig provides a mock function with given fields: +func (_m *Plugin) GetConfig() webapi.PluginConfig { + ret := _m.Called() + + var r0 webapi.PluginConfig + if rf, ok := ret.Get(0).(func() webapi.PluginConfig); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(webapi.PluginConfig) + } + + return r0 +} diff --git a/flyteplugins/go/tasks/pluginmachinery/webapi/mocks/sync_plugin.go b/flyteplugins/go/tasks/pluginmachinery/webapi/mocks/sync_plugin.go deleted file mode 100644 index cfe5d38090..0000000000 --- a/flyteplugins/go/tasks/pluginmachinery/webapi/mocks/sync_plugin.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by mockery v1.0.1. DO NOT EDIT. - -package mocks - -import ( - context "context" - - core "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - mock "github.com/stretchr/testify/mock" - - webapi "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" -) - -// SyncPlugin is an autogenerated mock type for the SyncPlugin type -type SyncPlugin struct { - mock.Mock -} - -type SyncPlugin_Do struct { - *mock.Call -} - -func (_m SyncPlugin_Do) Return(phase core.PhaseInfo, err error) *SyncPlugin_Do { - return &SyncPlugin_Do{Call: _m.Call.Return(phase, err)} -} - -func (_m *SyncPlugin) OnDo(ctx context.Context, tCtx webapi.TaskExecutionContext) *SyncPlugin_Do { - c_call := _m.On("Do", ctx, tCtx) - return &SyncPlugin_Do{Call: c_call} -} - -func (_m *SyncPlugin) OnDoMatch(matchers ...interface{}) *SyncPlugin_Do { - c_call := _m.On("Do", matchers...) - return &SyncPlugin_Do{Call: c_call} -} - -// Do provides a mock function with given fields: ctx, tCtx -func (_m *SyncPlugin) Do(ctx context.Context, tCtx webapi.TaskExecutionContext) (core.PhaseInfo, error) { - ret := _m.Called(ctx, tCtx) - - var r0 core.PhaseInfo - if rf, ok := ret.Get(0).(func(context.Context, webapi.TaskExecutionContext) core.PhaseInfo); ok { - r0 = rf(ctx, tCtx) - } else { - r0 = ret.Get(0).(core.PhaseInfo) - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, webapi.TaskExecutionContext) error); ok { - r1 = rf(ctx, tCtx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -type SyncPlugin_GetConfig struct { - *mock.Call -} - -func (_m SyncPlugin_GetConfig) Return(_a0 webapi.PluginConfig) *SyncPlugin_GetConfig { - return &SyncPlugin_GetConfig{Call: _m.Call.Return(_a0)} -} - -func (_m *SyncPlugin) OnGetConfig() *SyncPlugin_GetConfig { - c_call := _m.On("GetConfig") - return &SyncPlugin_GetConfig{Call: c_call} -} - -func (_m *SyncPlugin) OnGetConfigMatch(matchers ...interface{}) *SyncPlugin_GetConfig { - c_call := _m.On("GetConfig", matchers...) - return &SyncPlugin_GetConfig{Call: c_call} -} - -// GetConfig provides a mock function with given fields: -func (_m *SyncPlugin) GetConfig() webapi.PluginConfig { - ret := _m.Called() - - var r0 webapi.PluginConfig - if rf, ok := ret.Get(0).(func() webapi.PluginConfig); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(webapi.PluginConfig) - } - - return r0 -} diff --git a/flyteplugins/go/tasks/plugins/webapi/agent/integration_test.go b/flyteplugins/go/tasks/plugins/webapi/agent/integration_test.go index 15375a8580..827af0d907 100644 --- a/flyteplugins/go/tasks/plugins/webapi/agent/integration_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/agent/integration_test.go @@ -37,18 +37,24 @@ type MockPlugin struct { Plugin } -type MockClient struct { +type MockAsyncTask struct { } -func (m *MockClient) CreateTask(_ context.Context, createTaskRequest *admin.CreateTaskRequest, _ ...grpc.CallOption) (*admin.CreateTaskResponse, error) { +type MockSyncTask struct { +} + +func (m *MockAsyncTask) CreateTask(_ context.Context, createTaskRequest *admin.CreateTaskRequest, _ ...grpc.CallOption) (*admin.CreateTaskResponse, error) { expectedArgs := []string{"pyflyte-fast-execute", "--output-prefix", "fake://bucket/prefix/nhv"} if slices.Equal(createTaskRequest.Template.GetContainer().Args, expectedArgs) { return nil, fmt.Errorf("args not as expected") } - return &admin.CreateTaskResponse{ResourceMeta: []byte{1, 2, 3, 4}}, nil + return &admin.CreateTaskResponse{ + Res: &admin.CreateTaskResponse_ResourceMeta{ + ResourceMeta: []byte{1, 2, 3, 4}, + }}, nil } -func (m *MockClient) GetTask(_ context.Context, req *admin.GetTaskRequest, _ ...grpc.CallOption) (*admin.GetTaskResponse, error) { +func (m *MockAsyncTask) GetTask(_ context.Context, req *admin.GetTaskRequest, _ ...grpc.CallOption) (*admin.GetTaskResponse, error) { if req.GetTaskType() == "bigquery_query_job_task" { return &admin.GetTaskResponse{Resource: &admin.Resource{State: admin.State_SUCCEEDED, Outputs: &flyteIdlCore.LiteralMap{ Literals: map[string]*flyteIdlCore.Literal{ @@ -59,15 +65,50 @@ func (m *MockClient) GetTask(_ context.Context, req *admin.GetTaskRequest, _ ... return &admin.GetTaskResponse{Resource: &admin.Resource{State: admin.State_SUCCEEDED}}, nil } -func (m *MockClient) DeleteTask(_ context.Context, _ *admin.DeleteTaskRequest, _ ...grpc.CallOption) (*admin.DeleteTaskResponse, error) { +func (m *MockAsyncTask) DeleteTask(_ context.Context, _ *admin.DeleteTaskRequest, _ ...grpc.CallOption) (*admin.DeleteTaskResponse, error) { return &admin.DeleteTaskResponse{}, nil } -func mockGetClientFunc(_ context.Context, _ *Agent, _ map[*Agent]*grpc.ClientConn) (service.AsyncAgentServiceClient, error) { - return &MockClient{}, nil +func (m *MockSyncTask) CreateTask(_ context.Context, createTaskRequest *admin.CreateTaskRequest, _ ...grpc.CallOption) (*admin.CreateTaskResponse, error) { + return &admin.CreateTaskResponse{ + Res: &admin.CreateTaskResponse_Resource{ + Resource: &admin.Resource{ + State: admin.State_SUCCEEDED, + Outputs: &flyteIdlCore.LiteralMap{ + Literals: map[string]*flyteIdlCore.Literal{}, + }, + Message: "Sync task finished", + LogLinks: []*flyteIdlCore.TaskLog{{Uri: "http://localhost:3000/log", Name: "Log Link"}}, + }, + }, + }, nil + +} + +func (m *MockSyncTask) GetTask(_ context.Context, req *admin.GetTaskRequest, _ ...grpc.CallOption) (*admin.GetTaskResponse, error) { + if req.GetTaskType() == "fake_task" { + return &admin.GetTaskResponse{Resource: &admin.Resource{State: admin.State_SUCCEEDED, Outputs: &flyteIdlCore.LiteralMap{ + Literals: map[string]*flyteIdlCore.Literal{ + "arr": coreutils.MustMakeLiteral([]interface{}{[]interface{}{"a", "b"}, []interface{}{1, 2}}), + }, + }}}, nil + } + return &admin.GetTaskResponse{Resource: &admin.Resource{State: admin.State_SUCCEEDED}}, nil +} + +func (m *MockSyncTask) DeleteTask(_ context.Context, _ *admin.DeleteTaskRequest, _ ...grpc.CallOption) (*admin.DeleteTaskResponse, error) { + return &admin.DeleteTaskResponse{}, nil } -func mockGetBadClientFunc(_ context.Context, _ *Agent, _ map[*Agent]*grpc.ClientConn) (service.AsyncAgentServiceClient, error) { +func mockAsyncTaskClientFunc(_ context.Context, _ *Agent, _ map[*Agent]*grpc.ClientConn) (service.AsyncAgentServiceClient, error) { + return &MockAsyncTask{}, nil +} + +func mockSyncTaskClientFunc(_ context.Context, _ *Agent, _ map[*Agent]*grpc.ClientConn) (service.AsyncAgentServiceClient, error) { + return &MockSyncTask{}, nil +} + +func mockGetBadAsyncClientFunc(_ context.Context, _ *Agent, _ map[*Agent]*grpc.ClientConn) (service.AsyncAgentServiceClient, error) { return nil, fmt.Errorf("error") } @@ -130,7 +171,7 @@ func TestEndToEnd(t *testing.T) { Plugin{ metricScope: iCtx.MetricsScope(), cfg: GetConfig(), - getClient: mockGetBadClientFunc, + getClient: mockGetBadAsyncClientFunc, }, }, nil } @@ -234,6 +275,11 @@ func getTaskContext(t *testing.T) *pluginCoreMocks.TaskExecutionContext { }) tMeta := &pluginCoreMocks.TaskExecutionMetadata{} tMeta.OnGetTaskExecutionID().Return(tID) + tMeta.OnGetNamespace().Return("test-namespace") + tMeta.OnGetLabels().Return(map[string]string{"foo": "bar"}) + tMeta.OnGetAnnotations().Return(map[string]string{"foo": "bar"}) + tMeta.OnGetK8sServiceAccount().Return("k8s-account") + tMeta.OnGetEnvironmentVariables().Return(map[string]string{"foo": "bar"}) resourceManager := &pluginCoreMocks.ResourceManager{} resourceManager.OnAllocateResourceMatch(mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(pluginCore.AllocationStatusGranted, nil) resourceManager.OnReleaseResourceMatch(mock.Anything, mock.Anything, mock.Anything).Return(nil) @@ -259,13 +305,29 @@ func getTaskContext(t *testing.T) *pluginCoreMocks.TaskExecutionContext { func newMockAgentPlugin() webapi.PluginEntry { return webapi.PluginEntry{ ID: "agent-service", - SupportedTaskTypes: []core.TaskType{"bigquery_query_job_task", "spark_job"}, + SupportedTaskTypes: []core.TaskType{"bigquery_query_job_task", "spark_job", "api_task"}, + PluginLoader: func(ctx context.Context, iCtx webapi.PluginSetupContext) (webapi.AsyncPlugin, error) { + return &MockPlugin{ + Plugin{ + metricScope: iCtx.MetricsScope(), + cfg: GetConfig(), + getClient: mockAsyncTaskClientFunc, + }, + }, nil + }, + } +} + +func newMockSyncAgentPlugin() webapi.PluginEntry { + return webapi.PluginEntry{ + ID: "agent-service", + SupportedTaskTypes: []core.TaskType{"bigquery_query_job_task", "spark_job", "api_task"}, PluginLoader: func(ctx context.Context, iCtx webapi.PluginSetupContext) (webapi.AsyncPlugin, error) { return &MockPlugin{ Plugin{ metricScope: iCtx.MetricsScope(), cfg: GetConfig(), - getClient: mockGetClientFunc, + getClient: mockSyncTaskClientFunc, }, }, nil }, diff --git a/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go b/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go index 6230dc14f8..73a98782bc 100644 --- a/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go +++ b/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go @@ -115,12 +115,26 @@ func (p Plugin) Create(ctx context.Context, taskCtx webapi.TaskExecutionContextR taskTemplate.GetContainer().Args = argTemplate } + // If the agent returned a resource, we assume this is a synchronous task. + // The state should be a terminal state, for example, SUCCEEDED, PERMANENT_FAILURE, or RETRYABLE_FAILURE. + if res.GetResource() != nil { + logger.Infof(ctx, "Agent is executing a synchronous task.") + return nil, + ResourceWrapper{ + State: res.GetResource().State, + Outputs: res.GetResource().Outputs, + Message: res.GetResource().Message, + LogLinks: res.GetResource().LogLinks, + }, nil + } + + logger.Infof(ctx, "Agent is executing an asynchronous task.") return ResourceMetaWrapper{ OutputPrefix: outputPrefix, AgentResourceMeta: res.GetResourceMeta(), Token: "", TaskType: taskTemplate.Type, - }, ResourceWrapper{State: admin.State_RUNNING}, nil + }, nil, nil } func (p Plugin) Get(ctx context.Context, taskCtx webapi.GetContext) (latest webapi.Resource, err error) { @@ -209,7 +223,7 @@ func writeOutput(ctx context.Context, taskCtx webapi.StatusContext, resource Res var opReader io.OutputReader if resource.Outputs != nil { - logger.Debugf(ctx, "Agent returned an output") + logger.Debugf(ctx, "Agent returned an output.") opReader = ioutils.NewInMemoryOutputReader(resource.Outputs, nil, nil) } else { logger.Debugf(ctx, "Agent didn't return any output, assuming file based outputs.") diff --git a/flyteplugins/go/tasks/plugins/webapi/agent/plugin_test.go b/flyteplugins/go/tasks/plugins/webapi/agent/plugin_test.go index 779fb597c1..b9fd7e1b35 100644 --- a/flyteplugins/go/tasks/plugins/webapi/agent/plugin_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/agent/plugin_test.go @@ -11,17 +11,52 @@ import ( "golang.org/x/exp/maps" "google.golang.org/grpc" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - flyteidlcore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" webapiPlugin "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi/mocks" agentMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/webapi/agent/mocks" + "github.com/flyteorg/flyte/flyteplugins/tests" "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/storage" ) +func TestSyncTask(t *testing.T) { + tCtx := getTaskContext(t) + taskReader := new(pluginCoreMocks.TaskReader) + + template := flyteIdlCore.TaskTemplate{ + Type: "api_task", + } + + taskReader.On("Read", mock.Anything).Return(&template, nil) + + tCtx.OnTaskReader().Return(taskReader) + + agentPlugin := newMockSyncAgentPlugin() + pluginEntry := pluginmachinery.CreateRemotePlugin(agentPlugin) + plugin, err := pluginEntry.LoadPlugin(context.TODO(), newFakeSetupContext("create_task_sync_test")) + assert.NoError(t, err) + + inputs, err := coreutils.MakeLiteralMap(map[string]interface{}{"x": 1}) + assert.NoError(t, err) + basePrefix := storage.DataReference("fake://bucket/prefix/") + inputReader := &ioMocks.InputReader{} + inputReader.OnGetInputPrefixPath().Return(basePrefix) + inputReader.OnGetInputPath().Return(basePrefix + "/inputs.pb") + inputReader.OnGetMatch(mock.Anything).Return(inputs, nil) + tCtx.OnInputReader().Return(inputReader) + + phase := tests.RunPluginEndToEndTest(t, plugin, &template, inputs, nil, nil, nil) + assert.Equal(t, true, phase.Phase().IsSuccess()) +} + func TestPlugin(t *testing.T) { fakeSetupContext := pluginCoreMocks.SetupContext{} fakeSetupContext.OnMetricsScope().Return(promutils.NewScope("test")) @@ -120,7 +155,7 @@ func TestPlugin(t *testing.T) { State: admin.State_PENDING, Outputs: nil, Message: "Waiting for cluster", - LogLinks: []*flyteidlcore.TaskLog{{Uri: "http://localhost:3000/log", Name: "Log Link"}}, + LogLinks: []*flyteIdlCore.TaskLog{{Uri: "http://localhost:3000/log", Name: "Log Link"}}, }) phase, err := plugin.Status(context.Background(), taskContext) @@ -135,7 +170,7 @@ func TestPlugin(t *testing.T) { State: admin.State_RUNNING, Outputs: nil, Message: "Job is running", - LogLinks: []*flyteidlcore.TaskLog{{Uri: "http://localhost:3000/log", Name: "Log Link"}}, + LogLinks: []*flyteIdlCore.TaskLog{{Uri: "http://localhost:3000/log", Name: "Log Link"}}, }) phase, err := plugin.Status(context.Background(), taskContext) @@ -149,7 +184,7 @@ func TestPlugin(t *testing.T) { State: admin.State_PERMANENT_FAILURE, Outputs: nil, Message: "", - LogLinks: []*flyteidlcore.TaskLog{{Uri: "http://localhost:3000/log", Name: "Log Link"}}, + LogLinks: []*flyteIdlCore.TaskLog{{Uri: "http://localhost:3000/log", Name: "Log Link"}}, }) phase, err := plugin.Status(context.Background(), taskContext) @@ -163,7 +198,7 @@ func TestPlugin(t *testing.T) { State: admin.State_RETRYABLE_FAILURE, Outputs: nil, Message: "", - LogLinks: []*flyteidlcore.TaskLog{{Uri: "http://localhost:3000/log", Name: "Log Link"}}, + LogLinks: []*flyteIdlCore.TaskLog{{Uri: "http://localhost:3000/log", Name: "Log Link"}}, }) phase, err := plugin.Status(context.Background(), taskContext) @@ -177,7 +212,7 @@ func TestPlugin(t *testing.T) { State: 5, Outputs: nil, Message: "", - LogLinks: []*flyteidlcore.TaskLog{{Uri: "http://localhost:3000/log", Name: "Log Link"}}, + LogLinks: []*flyteIdlCore.TaskLog{{Uri: "http://localhost:3000/log", Name: "Log Link"}}, }) phase, err := plugin.Status(context.Background(), taskContext)