From a7aa574bba41e5386b0a50e621fff5a5825bc765 Mon Sep 17 00:00:00 2001 From: Katrina Rogan Date: Fri, 26 Feb 2021 14:01:50 -0800 Subject: [PATCH] Update ArrayJob for Map task changes (#103) --- .../pb-cpp/flyteidl/plugins/array_job.pb.cc | 151 ++++++++-- .../pb-cpp/flyteidl/plugins/array_job.pb.h | 94 ++++++- .../pb-go/flyteidl/plugins/array_job.pb.go | 86 ++++-- .../flyteidl/plugins/array_job.pb.validate.go | 10 +- .../flyteidl/plugins/ArrayJobOuterClass.java | 266 +++++++++++++++--- .../flyteidl/plugins/array_job.proto.rst | 20 +- .../flyteidl/plugins/array_job_pb2.py | 20 +- flyteidl/package.json | 2 +- .../protos/flyteidl/plugins/array_job.proto | 16 +- flyteidl/setup.py | 2 +- 10 files changed, 561 insertions(+), 106 deletions(-) diff --git a/flyteidl/gen/pb-cpp/flyteidl/plugins/array_job.pb.cc b/flyteidl/gen/pb-cpp/flyteidl/plugins/array_job.pb.cc index f3f6e15b41..ccb0619ad2 100644 --- a/flyteidl/gen/pb-cpp/flyteidl/plugins/array_job.pb.cc +++ b/flyteidl/gen/pb-cpp/flyteidl/plugins/array_job.pb.cc @@ -21,6 +21,8 @@ namespace plugins { class ArrayJobDefaultTypeInternal { public: ::google::protobuf::internal::ExplicitlyConstructed _instance; + ::google::protobuf::int64 min_successes_; + float min_success_ratio_; } _ArrayJob_default_instance_; } // namespace plugins } // namespace flyteidl @@ -50,11 +52,13 @@ const ::google::protobuf::uint32 TableStruct_flyteidl_2fplugins_2farray_5fjob_2e ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::ArrayJob, _internal_metadata_), ~0u, // no _extensions_ - ~0u, // no _oneof_case_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::ArrayJob, _oneof_case_[0]), ~0u, // no _weak_field_map_ PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::ArrayJob, parallelism_), PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::ArrayJob, size_), - PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::ArrayJob, min_successes_), + offsetof(::flyteidl::plugins::ArrayJobDefaultTypeInternal, min_successes_), + offsetof(::flyteidl::plugins::ArrayJobDefaultTypeInternal, min_success_ratio_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::ArrayJob, success_criteria_), }; static const ::google::protobuf::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, sizeof(::flyteidl::plugins::ArrayJob)}, @@ -72,15 +76,16 @@ ::google::protobuf::internal::AssignDescriptorsTable assign_descriptors_table_fl const char descriptor_table_protodef_flyteidl_2fplugins_2farray_5fjob_2eproto[] = "\n flyteidl/plugins/array_job.proto\022\020flyt" - "eidl.plugins\"D\n\010ArrayJob\022\023\n\013parallelism\030" - "\001 \001(\003\022\014\n\004size\030\002 \001(\003\022\025\n\rmin_successes\030\003 \001" - "(\003B5Z3github.com/lyft/flyteidl/gen/pb-go" - "/flyteidl/pluginsb\006proto3" + "eidl.plugins\"w\n\010ArrayJob\022\023\n\013parallelism\030" + "\001 \001(\003\022\014\n\004size\030\002 \001(\003\022\027\n\rmin_successes\030\003 \001" + "(\003H\000\022\033\n\021min_success_ratio\030\004 \001(\002H\000B\022\n\020suc" + "cess_criteriaB5Z3github.com/lyft/flyteid" + "l/gen/pb-go/flyteidl/pluginsb\006proto3" ; ::google::protobuf::internal::DescriptorTable descriptor_table_flyteidl_2fplugins_2farray_5fjob_2eproto = { false, InitDefaults_flyteidl_2fplugins_2farray_5fjob_2eproto, descriptor_table_protodef_flyteidl_2fplugins_2farray_5fjob_2eproto, - "flyteidl/plugins/array_job.proto", &assign_descriptors_table_flyteidl_2fplugins_2farray_5fjob_2eproto, 185, + "flyteidl/plugins/array_job.proto", &assign_descriptors_table_flyteidl_2fplugins_2farray_5fjob_2eproto, 236, }; void AddDescriptors_flyteidl_2fplugins_2farray_5fjob_2eproto() { @@ -98,6 +103,8 @@ namespace plugins { // =================================================================== void ArrayJob::InitAsDefaultInstance() { + ::flyteidl::plugins::_ArrayJob_default_instance_.min_successes_ = PROTOBUF_LONGLONG(0); + ::flyteidl::plugins::_ArrayJob_default_instance_.min_success_ratio_ = 0; } class ArrayJob::HasBitSetters { public: @@ -107,6 +114,7 @@ class ArrayJob::HasBitSetters { const int ArrayJob::kParallelismFieldNumber; const int ArrayJob::kSizeFieldNumber; const int ArrayJob::kMinSuccessesFieldNumber; +const int ArrayJob::kMinSuccessRatioFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 ArrayJob::ArrayJob() @@ -119,15 +127,30 @@ ArrayJob::ArrayJob(const ArrayJob& from) _internal_metadata_(nullptr) { _internal_metadata_.MergeFrom(from._internal_metadata_); ::memcpy(¶llelism_, &from.parallelism_, - static_cast(reinterpret_cast(&min_successes_) - - reinterpret_cast(¶llelism_)) + sizeof(min_successes_)); + static_cast(reinterpret_cast(&size_) - + reinterpret_cast(¶llelism_)) + sizeof(size_)); + clear_has_success_criteria(); + switch (from.success_criteria_case()) { + case kMinSuccesses: { + set_min_successes(from.min_successes()); + break; + } + case kMinSuccessRatio: { + set_min_success_ratio(from.min_success_ratio()); + break; + } + case SUCCESS_CRITERIA_NOT_SET: { + break; + } + } // @@protoc_insertion_point(copy_constructor:flyteidl.plugins.ArrayJob) } void ArrayJob::SharedCtor() { ::memset(¶llelism_, 0, static_cast( - reinterpret_cast(&min_successes_) - - reinterpret_cast(¶llelism_)) + sizeof(min_successes_)); + reinterpret_cast(&size_) - + reinterpret_cast(¶llelism_)) + sizeof(size_)); + clear_has_success_criteria(); } ArrayJob::~ArrayJob() { @@ -136,6 +159,9 @@ ArrayJob::~ArrayJob() { } void ArrayJob::SharedDtor() { + if (has_success_criteria()) { + clear_success_criteria(); + } } void ArrayJob::SetCachedSize(int size) const { @@ -147,6 +173,25 @@ const ArrayJob& ArrayJob::default_instance() { } +void ArrayJob::clear_success_criteria() { +// @@protoc_insertion_point(one_of_clear_start:flyteidl.plugins.ArrayJob) + switch (success_criteria_case()) { + case kMinSuccesses: { + // No need to clear + break; + } + case kMinSuccessRatio: { + // No need to clear + break; + } + case SUCCESS_CRITERIA_NOT_SET: { + break; + } + } + _oneof_case_[0] = SUCCESS_CRITERIA_NOT_SET; +} + + void ArrayJob::Clear() { // @@protoc_insertion_point(message_clear_start:flyteidl.plugins.ArrayJob) ::google::protobuf::uint32 cached_has_bits = 0; @@ -154,8 +199,9 @@ void ArrayJob::Clear() { (void) cached_has_bits; ::memset(¶llelism_, 0, static_cast( - reinterpret_cast(&min_successes_) - - reinterpret_cast(¶llelism_)) + sizeof(min_successes_)); + reinterpret_cast(&size_) - + reinterpret_cast(¶llelism_)) + sizeof(size_)); + clear_success_criteria(); _internal_metadata_.Clear(); } @@ -193,6 +239,13 @@ const char* ArrayJob::_InternalParse(const char* begin, const char* end, void* o GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); break; } + // float min_success_ratio = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) != 37) goto handle_unusual; + msg->set_min_success_ratio(::google::protobuf::io::UnalignedLoad(ptr)); + ptr += sizeof(float); + break; + } default: { handle_unusual: if ((tag & 7) == 4 || tag == 0) { @@ -249,10 +302,25 @@ bool ArrayJob::MergePartialFromCodedStream( // int64 min_successes = 3; case 3: { if (static_cast< ::google::protobuf::uint8>(tag) == (24 & 0xFF)) { - + clear_success_criteria(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( - input, &min_successes_))); + input, &success_criteria_.min_successes_))); + set_has_min_successes(); + } else { + goto handle_unusual; + } + break; + } + + // float min_success_ratio = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == (37 & 0xFF)) { + clear_success_criteria(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &success_criteria_.min_success_ratio_))); + set_has_min_success_ratio(); } else { goto handle_unusual; } @@ -297,10 +365,15 @@ void ArrayJob::SerializeWithCachedSizes( } // int64 min_successes = 3; - if (this->min_successes() != 0) { + if (has_min_successes()) { ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->min_successes(), output); } + // float min_success_ratio = 4; + if (has_min_success_ratio()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->min_success_ratio(), output); + } + if (_internal_metadata_.have_unknown_fields()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); @@ -325,10 +398,15 @@ ::google::protobuf::uint8* ArrayJob::InternalSerializeWithCachedSizesToArray( } // int64 min_successes = 3; - if (this->min_successes() != 0) { + if (has_min_successes()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->min_successes(), target); } + // float min_success_ratio = 4; + if (has_min_success_ratio()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->min_success_ratio(), target); + } + if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); @@ -364,13 +442,23 @@ size_t ArrayJob::ByteSizeLong() const { this->size()); } - // int64 min_successes = 3; - if (this->min_successes() != 0) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::Int64Size( - this->min_successes()); + switch (success_criteria_case()) { + // int64 min_successes = 3; + case kMinSuccesses: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->min_successes()); + break; + } + // float min_success_ratio = 4; + case kMinSuccessRatio: { + total_size += 1 + 4; + break; + } + case SUCCESS_CRITERIA_NOT_SET: { + break; + } } - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; @@ -404,8 +492,18 @@ void ArrayJob::MergeFrom(const ArrayJob& from) { if (from.size() != 0) { set_size(from.size()); } - if (from.min_successes() != 0) { - set_min_successes(from.min_successes()); + switch (from.success_criteria_case()) { + case kMinSuccesses: { + set_min_successes(from.min_successes()); + break; + } + case kMinSuccessRatio: { + set_min_success_ratio(from.min_success_ratio()); + break; + } + case SUCCESS_CRITERIA_NOT_SET: { + break; + } } } @@ -436,7 +534,8 @@ void ArrayJob::InternalSwap(ArrayJob* other) { _internal_metadata_.Swap(&other->_internal_metadata_); swap(parallelism_, other->parallelism_); swap(size_, other->size_); - swap(min_successes_, other->min_successes_); + swap(success_criteria_, other->success_criteria_); + swap(_oneof_case_[0], other->_oneof_case_[0]); } ::google::protobuf::Metadata ArrayJob::GetMetadata() const { diff --git a/flyteidl/gen/pb-cpp/flyteidl/plugins/array_job.pb.h b/flyteidl/gen/pb-cpp/flyteidl/plugins/array_job.pb.h index 29bb583146..a0e835f77d 100644 --- a/flyteidl/gen/pb-cpp/flyteidl/plugins/array_job.pb.h +++ b/flyteidl/gen/pb-cpp/flyteidl/plugins/array_job.pb.h @@ -97,6 +97,12 @@ class ArrayJob final : } static const ArrayJob& default_instance(); + enum SuccessCriteriaCase { + kMinSuccesses = 3, + kMinSuccessRatio = 4, + SUCCESS_CRITERIA_NOT_SET = 0, + }; + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const ArrayJob* internal_default_instance() { return reinterpret_cast( @@ -173,20 +179,45 @@ class ArrayJob final : void set_size(::google::protobuf::int64 value); // int64 min_successes = 3; + private: + bool has_min_successes() const; + public: void clear_min_successes(); static const int kMinSuccessesFieldNumber = 3; ::google::protobuf::int64 min_successes() const; void set_min_successes(::google::protobuf::int64 value); + // float min_success_ratio = 4; + private: + bool has_min_success_ratio() const; + public: + void clear_min_success_ratio(); + static const int kMinSuccessRatioFieldNumber = 4; + float min_success_ratio() const; + void set_min_success_ratio(float value); + + void clear_success_criteria(); + SuccessCriteriaCase success_criteria_case() const; // @@protoc_insertion_point(class_scope:flyteidl.plugins.ArrayJob) private: class HasBitSetters; + void set_has_min_successes(); + void set_has_min_success_ratio(); + + inline bool has_success_criteria() const; + inline void clear_has_success_criteria(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; ::google::protobuf::int64 parallelism_; ::google::protobuf::int64 size_; - ::google::protobuf::int64 min_successes_; + union SuccessCriteriaUnion { + SuccessCriteriaUnion() {} + ::google::protobuf::int64 min_successes_; + float min_success_ratio_; + } success_criteria_; mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + friend struct ::TableStruct_flyteidl_2fplugins_2farray_5fjob_2eproto; }; // =================================================================== @@ -229,19 +260,72 @@ inline void ArrayJob::set_size(::google::protobuf::int64 value) { } // int64 min_successes = 3; +inline bool ArrayJob::has_min_successes() const { + return success_criteria_case() == kMinSuccesses; +} +inline void ArrayJob::set_has_min_successes() { + _oneof_case_[0] = kMinSuccesses; +} inline void ArrayJob::clear_min_successes() { - min_successes_ = PROTOBUF_LONGLONG(0); + if (has_min_successes()) { + success_criteria_.min_successes_ = PROTOBUF_LONGLONG(0); + clear_has_success_criteria(); + } } inline ::google::protobuf::int64 ArrayJob::min_successes() const { // @@protoc_insertion_point(field_get:flyteidl.plugins.ArrayJob.min_successes) - return min_successes_; + if (has_min_successes()) { + return success_criteria_.min_successes_; + } + return PROTOBUF_LONGLONG(0); } inline void ArrayJob::set_min_successes(::google::protobuf::int64 value) { - - min_successes_ = value; + if (!has_min_successes()) { + clear_success_criteria(); + set_has_min_successes(); + } + success_criteria_.min_successes_ = value; // @@protoc_insertion_point(field_set:flyteidl.plugins.ArrayJob.min_successes) } +// float min_success_ratio = 4; +inline bool ArrayJob::has_min_success_ratio() const { + return success_criteria_case() == kMinSuccessRatio; +} +inline void ArrayJob::set_has_min_success_ratio() { + _oneof_case_[0] = kMinSuccessRatio; +} +inline void ArrayJob::clear_min_success_ratio() { + if (has_min_success_ratio()) { + success_criteria_.min_success_ratio_ = 0; + clear_has_success_criteria(); + } +} +inline float ArrayJob::min_success_ratio() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.ArrayJob.min_success_ratio) + if (has_min_success_ratio()) { + return success_criteria_.min_success_ratio_; + } + return 0; +} +inline void ArrayJob::set_min_success_ratio(float value) { + if (!has_min_success_ratio()) { + clear_success_criteria(); + set_has_min_success_ratio(); + } + success_criteria_.min_success_ratio_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.ArrayJob.min_success_ratio) +} + +inline bool ArrayJob::has_success_criteria() const { + return success_criteria_case() != SUCCESS_CRITERIA_NOT_SET; +} +inline void ArrayJob::clear_has_success_criteria() { + _oneof_case_[0] = SUCCESS_CRITERIA_NOT_SET; +} +inline ArrayJob::SuccessCriteriaCase ArrayJob::success_criteria_case() const { + return ArrayJob::SuccessCriteriaCase(_oneof_case_[0]); +} #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ diff --git a/flyteidl/gen/pb-go/flyteidl/plugins/array_job.pb.go b/flyteidl/gen/pb-go/flyteidl/plugins/array_job.pb.go index afa327312c..27153d8b98 100644 --- a/flyteidl/gen/pb-go/flyteidl/plugins/array_job.pb.go +++ b/flyteidl/gen/pb-go/flyteidl/plugins/array_job.pb.go @@ -29,15 +29,15 @@ type ArrayJob struct { Parallelism int64 `protobuf:"varint,1,opt,name=parallelism,proto3" json:"parallelism,omitempty"` // Defines the number of instances to launch at most. This number should match the size of the input if the job // requires processing of all input data. This has to be a positive number. - // +required. + // In the case this is not defined, the back-end will determine the size at run-time by reading the inputs. Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` - // An absolute number of the minimum number of successful completions of subtasks. As soon as this criteria is met, - // the array job will be marked as successful and outputs will be computed. This has to be a non-negative number if - // assigned. Default value is size. - MinSuccesses int64 `protobuf:"varint,3,opt,name=min_successes,json=minSuccesses,proto3" json:"min_successes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // Types that are valid to be assigned to SuccessCriteria: + // *ArrayJob_MinSuccesses + // *ArrayJob_MinSuccessRatio + SuccessCriteria isArrayJob_SuccessCriteria `protobuf_oneof:"success_criteria"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ArrayJob) Reset() { *m = ArrayJob{} } @@ -79,13 +79,51 @@ func (m *ArrayJob) GetSize() int64 { return 0 } -func (m *ArrayJob) GetMinSuccesses() int64 { +type isArrayJob_SuccessCriteria interface { + isArrayJob_SuccessCriteria() +} + +type ArrayJob_MinSuccesses struct { + MinSuccesses int64 `protobuf:"varint,3,opt,name=min_successes,json=minSuccesses,proto3,oneof"` +} + +type ArrayJob_MinSuccessRatio struct { + MinSuccessRatio float32 `protobuf:"fixed32,4,opt,name=min_success_ratio,json=minSuccessRatio,proto3,oneof"` +} + +func (*ArrayJob_MinSuccesses) isArrayJob_SuccessCriteria() {} + +func (*ArrayJob_MinSuccessRatio) isArrayJob_SuccessCriteria() {} + +func (m *ArrayJob) GetSuccessCriteria() isArrayJob_SuccessCriteria { if m != nil { - return m.MinSuccesses + return m.SuccessCriteria + } + return nil +} + +func (m *ArrayJob) GetMinSuccesses() int64 { + if x, ok := m.GetSuccessCriteria().(*ArrayJob_MinSuccesses); ok { + return x.MinSuccesses + } + return 0 +} + +func (m *ArrayJob) GetMinSuccessRatio() float32 { + if x, ok := m.GetSuccessCriteria().(*ArrayJob_MinSuccessRatio); ok { + return x.MinSuccessRatio } return 0 } +// XXX_OneofWrappers is for the internal use of the proto package. +func (*ArrayJob) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*ArrayJob_MinSuccesses)(nil), + (*ArrayJob_MinSuccessRatio)(nil), + } +} + func init() { proto.RegisterType((*ArrayJob)(nil), "flyteidl.plugins.ArrayJob") } @@ -93,17 +131,19 @@ func init() { func init() { proto.RegisterFile("flyteidl/plugins/array_job.proto", fileDescriptor_794211c91ec6cd2b) } var fileDescriptor_794211c91ec6cd2b = []byte{ - // 180 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x8e, 0xbd, 0xca, 0xc2, 0x30, - 0x18, 0x46, 0xe9, 0xd7, 0x0f, 0x91, 0xa8, 0x20, 0x99, 0x3a, 0x16, 0x5d, 0x5c, 0x6c, 0x86, 0xe2, - 0x05, 0xe8, 0xe8, 0xa8, 0x9b, 0x4b, 0x49, 0x6a, 0x1a, 0x23, 0x6f, 0x7e, 0xc8, 0x9b, 0x0e, 0xf5, - 0xea, 0xc5, 0x60, 0x45, 0xdc, 0x1e, 0x9e, 0x73, 0x86, 0x43, 0xca, 0x0e, 0x86, 0x28, 0xf5, 0x15, - 0x98, 0x87, 0x5e, 0x69, 0x8b, 0x8c, 0x87, 0xc0, 0x87, 0xe6, 0xee, 0x44, 0xe5, 0x83, 0x8b, 0x8e, - 0x2e, 0x47, 0xa3, 0x7a, 0x1b, 0x2b, 0x49, 0xa6, 0xfb, 0x97, 0x74, 0x74, 0x82, 0x96, 0x64, 0xe6, - 0x79, 0xe0, 0x00, 0x12, 0x34, 0x9a, 0x22, 0x2b, 0xb3, 0x4d, 0x7e, 0xfa, 0xbe, 0x28, 0x25, 0xff, - 0xa8, 0x1f, 0xb2, 0xf8, 0x4b, 0x28, 0x6d, 0xba, 0x26, 0x0b, 0xa3, 0x6d, 0x83, 0x7d, 0xdb, 0x4a, - 0x44, 0x89, 0x45, 0x9e, 0xe0, 0xdc, 0x68, 0x7b, 0x1e, 0xbf, 0xc3, 0xee, 0x52, 0x2b, 0x1d, 0x6f, - 0xbd, 0xa8, 0x5a, 0x67, 0x18, 0x0c, 0x5d, 0x64, 0x9f, 0x58, 0x25, 0x2d, 0xf3, 0x62, 0xab, 0x1c, - 0xfb, 0xed, 0x17, 0x93, 0x94, 0x5d, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x75, 0xbd, 0x9d, 0x25, - 0xda, 0x00, 0x00, 0x00, + // 221 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0xd0, 0xbd, 0x4a, 0x04, 0x31, + 0x14, 0x05, 0xe0, 0xcd, 0xee, 0x22, 0x12, 0x15, 0xd7, 0x54, 0x29, 0x83, 0x20, 0x6c, 0xa1, 0x93, + 0x62, 0xf1, 0x01, 0xdc, 0x6a, 0xb1, 0x8c, 0x9d, 0xcd, 0x90, 0xc4, 0x4c, 0xbc, 0x92, 0x3f, 0x92, + 0x4c, 0x31, 0xbe, 0x91, 0x6f, 0x29, 0x33, 0x38, 0x3a, 0xd8, 0x5d, 0xce, 0xf9, 0x9a, 0x73, 0x31, + 0xeb, 0xdc, 0x50, 0x0d, 0xbc, 0x39, 0x9e, 0x5c, 0x6f, 0x21, 0x14, 0x2e, 0x73, 0x96, 0x43, 0xfb, + 0x11, 0x55, 0x93, 0x72, 0xac, 0x91, 0xec, 0x66, 0xd1, 0xfc, 0x88, 0xdb, 0x2f, 0x84, 0xcf, 0x9f, + 0x46, 0xf5, 0x1c, 0x15, 0x61, 0xf8, 0x22, 0xc9, 0x2c, 0x9d, 0x33, 0x0e, 0x8a, 0xa7, 0x88, 0xa1, + 0xfd, 0x46, 0x2c, 0x23, 0x42, 0xf0, 0xb6, 0xc0, 0xa7, 0xa1, 0xeb, 0xa9, 0x9a, 0x6e, 0x72, 0x87, + 0xaf, 0x3c, 0x84, 0xb6, 0xf4, 0x5a, 0x9b, 0x52, 0x4c, 0xa1, 0x9b, 0xb1, 0x3c, 0xad, 0xc4, 0xa5, + 0x87, 0xf0, 0x32, 0xa7, 0xe4, 0x1e, 0xdf, 0x2c, 0x58, 0x9b, 0x65, 0x85, 0x48, 0xb7, 0x0c, 0xed, + 0xd7, 0xa7, 0x95, 0xb8, 0xfe, 0xa3, 0x62, 0x2c, 0x8e, 0x04, 0xef, 0x66, 0xa9, 0x33, 0x54, 0x93, + 0x41, 0x1e, 0x1f, 0x5f, 0x0f, 0x16, 0xea, 0x7b, 0xaf, 0x1a, 0x1d, 0x3d, 0x77, 0x43, 0x57, 0xf9, + 0xef, 0x62, 0x6b, 0x02, 0x4f, 0xea, 0xc1, 0x46, 0xfe, 0xff, 0x09, 0xea, 0x6c, 0xda, 0x7e, 0xf8, + 0x0e, 0x00, 0x00, 0xff, 0xff, 0x63, 0x45, 0x75, 0xde, 0x1f, 0x01, 0x00, 0x00, } diff --git a/flyteidl/gen/pb-go/flyteidl/plugins/array_job.pb.validate.go b/flyteidl/gen/pb-go/flyteidl/plugins/array_job.pb.validate.go index b8da5468ef..322ffd7140 100644 --- a/flyteidl/gen/pb-go/flyteidl/plugins/array_job.pb.validate.go +++ b/flyteidl/gen/pb-go/flyteidl/plugins/array_job.pb.validate.go @@ -47,7 +47,15 @@ func (m *ArrayJob) Validate() error { // no validation rules for Size - // no validation rules for MinSuccesses + switch m.SuccessCriteria.(type) { + + case *ArrayJob_MinSuccesses: + // no validation rules for MinSuccesses + + case *ArrayJob_MinSuccessRatio: + // no validation rules for MinSuccessRatio + + } return nil } diff --git a/flyteidl/gen/pb-java/flyteidl/plugins/ArrayJobOuterClass.java b/flyteidl/gen/pb-java/flyteidl/plugins/ArrayJobOuterClass.java index 2d04618c42..f94f3683e1 100644 --- a/flyteidl/gen/pb-java/flyteidl/plugins/ArrayJobOuterClass.java +++ b/flyteidl/gen/pb-java/flyteidl/plugins/ArrayJobOuterClass.java @@ -33,7 +33,7 @@ public interface ArrayJobOrBuilder extends *
      * Defines the number of instances to launch at most. This number should match the size of the input if the job
      * requires processing of all input data. This has to be a positive number.
-     * +required.
+     * In the case this is not defined, the back-end will determine the size at run-time by reading the inputs.
      * 
* * int64 size = 2; @@ -44,12 +44,24 @@ public interface ArrayJobOrBuilder extends *
      * An absolute number of the minimum number of successful completions of subtasks. As soon as this criteria is met,
      * the array job will be marked as successful and outputs will be computed. This has to be a non-negative number if
-     * assigned. Default value is size.
+     * assigned. Default value is size (if specified).
      * 
* * int64 min_successes = 3; */ long getMinSuccesses(); + + /** + *
+     * If the array job size is not known beforehand, the min_success_ratio can instead be used to determine when an array
+     * job can be marked successful.
+     * 
+ * + * float min_success_ratio = 4; + */ + float getMinSuccessRatio(); + + public flyteidl.plugins.ArrayJobOuterClass.ArrayJob.SuccessCriteriaCase getSuccessCriteriaCase(); } /** *
@@ -106,8 +118,13 @@ private ArrayJob(
               break;
             }
             case 24: {
-
-              minSuccesses_ = input.readInt64();
+              successCriteriaCase_ = 3;
+              successCriteria_ = input.readInt64();
+              break;
+            }
+            case 37: {
+              successCriteriaCase_ = 4;
+              successCriteria_ = input.readFloat();
               break;
             }
             default: {
@@ -142,6 +159,44 @@ private ArrayJob(
               flyteidl.plugins.ArrayJobOuterClass.ArrayJob.class, flyteidl.plugins.ArrayJobOuterClass.ArrayJob.Builder.class);
     }
 
+    private int successCriteriaCase_ = 0;
+    private java.lang.Object successCriteria_;
+    public enum SuccessCriteriaCase
+        implements com.google.protobuf.Internal.EnumLite {
+      MIN_SUCCESSES(3),
+      MIN_SUCCESS_RATIO(4),
+      SUCCESSCRITERIA_NOT_SET(0);
+      private final int value;
+      private SuccessCriteriaCase(int value) {
+        this.value = value;
+      }
+      /**
+       * @deprecated Use {@link #forNumber(int)} instead.
+       */
+      @java.lang.Deprecated
+      public static SuccessCriteriaCase valueOf(int value) {
+        return forNumber(value);
+      }
+
+      public static SuccessCriteriaCase forNumber(int value) {
+        switch (value) {
+          case 3: return MIN_SUCCESSES;
+          case 4: return MIN_SUCCESS_RATIO;
+          case 0: return SUCCESSCRITERIA_NOT_SET;
+          default: return null;
+        }
+      }
+      public int getNumber() {
+        return this.value;
+      }
+    };
+
+    public SuccessCriteriaCase
+    getSuccessCriteriaCase() {
+      return SuccessCriteriaCase.forNumber(
+          successCriteriaCase_);
+    }
+
     public static final int PARALLELISM_FIELD_NUMBER = 1;
     private long parallelism_;
     /**
@@ -163,7 +218,7 @@ public long getParallelism() {
      * 
      * Defines the number of instances to launch at most. This number should match the size of the input if the job
      * requires processing of all input data. This has to be a positive number.
-     * +required.
+     * In the case this is not defined, the back-end will determine the size at run-time by reading the inputs.
      * 
* * int64 size = 2; @@ -173,18 +228,36 @@ public long getSize() { } public static final int MIN_SUCCESSES_FIELD_NUMBER = 3; - private long minSuccesses_; /** *
      * An absolute number of the minimum number of successful completions of subtasks. As soon as this criteria is met,
      * the array job will be marked as successful and outputs will be computed. This has to be a non-negative number if
-     * assigned. Default value is size.
+     * assigned. Default value is size (if specified).
      * 
* * int64 min_successes = 3; */ public long getMinSuccesses() { - return minSuccesses_; + if (successCriteriaCase_ == 3) { + return (java.lang.Long) successCriteria_; + } + return 0L; + } + + public static final int MIN_SUCCESS_RATIO_FIELD_NUMBER = 4; + /** + *
+     * If the array job size is not known beforehand, the min_success_ratio can instead be used to determine when an array
+     * job can be marked successful.
+     * 
+ * + * float min_success_ratio = 4; + */ + public float getMinSuccessRatio() { + if (successCriteriaCase_ == 4) { + return (java.lang.Float) successCriteria_; + } + return 0F; } private byte memoizedIsInitialized = -1; @@ -207,8 +280,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (size_ != 0L) { output.writeInt64(2, size_); } - if (minSuccesses_ != 0L) { - output.writeInt64(3, minSuccesses_); + if (successCriteriaCase_ == 3) { + output.writeInt64( + 3, (long)((java.lang.Long) successCriteria_)); + } + if (successCriteriaCase_ == 4) { + output.writeFloat( + 4, (float)((java.lang.Float) successCriteria_)); } unknownFields.writeTo(output); } @@ -227,9 +305,15 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeInt64Size(2, size_); } - if (minSuccesses_ != 0L) { + if (successCriteriaCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size( + 3, (long)((java.lang.Long) successCriteria_)); + } + if (successCriteriaCase_ == 4) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, minSuccesses_); + .computeFloatSize( + 4, (float)((java.lang.Float) successCriteria_)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -250,8 +334,20 @@ public boolean equals(final java.lang.Object obj) { != other.getParallelism()) return false; if (getSize() != other.getSize()) return false; - if (getMinSuccesses() - != other.getMinSuccesses()) return false; + if (!getSuccessCriteriaCase().equals(other.getSuccessCriteriaCase())) return false; + switch (successCriteriaCase_) { + case 3: + if (getMinSuccesses() + != other.getMinSuccesses()) return false; + break; + case 4: + if (java.lang.Float.floatToIntBits(getMinSuccessRatio()) + != java.lang.Float.floatToIntBits( + other.getMinSuccessRatio())) return false; + break; + case 0: + default: + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -269,9 +365,20 @@ public int hashCode() { hash = (37 * hash) + SIZE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getSize()); - hash = (37 * hash) + MIN_SUCCESSES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getMinSuccesses()); + switch (successCriteriaCase_) { + case 3: + hash = (37 * hash) + MIN_SUCCESSES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMinSuccesses()); + break; + case 4: + hash = (37 * hash) + MIN_SUCCESS_RATIO_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getMinSuccessRatio()); + break; + case 0: + default: + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -414,8 +521,8 @@ public Builder clear() { size_ = 0L; - minSuccesses_ = 0L; - + successCriteriaCase_ = 0; + successCriteria_ = null; return this; } @@ -444,7 +551,13 @@ public flyteidl.plugins.ArrayJobOuterClass.ArrayJob buildPartial() { flyteidl.plugins.ArrayJobOuterClass.ArrayJob result = new flyteidl.plugins.ArrayJobOuterClass.ArrayJob(this); result.parallelism_ = parallelism_; result.size_ = size_; - result.minSuccesses_ = minSuccesses_; + if (successCriteriaCase_ == 3) { + result.successCriteria_ = successCriteria_; + } + if (successCriteriaCase_ == 4) { + result.successCriteria_ = successCriteria_; + } + result.successCriteriaCase_ = successCriteriaCase_; onBuilt(); return result; } @@ -499,8 +612,18 @@ public Builder mergeFrom(flyteidl.plugins.ArrayJobOuterClass.ArrayJob other) { if (other.getSize() != 0L) { setSize(other.getSize()); } - if (other.getMinSuccesses() != 0L) { - setMinSuccesses(other.getMinSuccesses()); + switch (other.getSuccessCriteriaCase()) { + case MIN_SUCCESSES: { + setMinSuccesses(other.getMinSuccesses()); + break; + } + case MIN_SUCCESS_RATIO: { + setMinSuccessRatio(other.getMinSuccessRatio()); + break; + } + case SUCCESSCRITERIA_NOT_SET: { + break; + } } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -530,6 +653,21 @@ public Builder mergeFrom( } return this; } + private int successCriteriaCase_ = 0; + private java.lang.Object successCriteria_; + public SuccessCriteriaCase + getSuccessCriteriaCase() { + return SuccessCriteriaCase.forNumber( + successCriteriaCase_); + } + + public Builder clearSuccessCriteria() { + successCriteriaCase_ = 0; + successCriteria_ = null; + onChanged(); + return this; + } + private long parallelism_ ; /** @@ -580,7 +718,7 @@ public Builder clearParallelism() { *
        * Defines the number of instances to launch at most. This number should match the size of the input if the job
        * requires processing of all input data. This has to be a positive number.
-       * +required.
+       * In the case this is not defined, the back-end will determine the size at run-time by reading the inputs.
        * 
* * int64 size = 2; @@ -592,7 +730,7 @@ public long getSize() { *
        * Defines the number of instances to launch at most. This number should match the size of the input if the job
        * requires processing of all input data. This has to be a positive number.
-       * +required.
+       * In the case this is not defined, the back-end will determine the size at run-time by reading the inputs.
        * 
* * int64 size = 2; @@ -607,7 +745,7 @@ public Builder setSize(long value) { *
        * Defines the number of instances to launch at most. This number should match the size of the input if the job
        * requires processing of all input data. This has to be a positive number.
-       * +required.
+       * In the case this is not defined, the back-end will determine the size at run-time by reading the inputs.
        * 
* * int64 size = 2; @@ -619,31 +757,33 @@ public Builder clearSize() { return this; } - private long minSuccesses_ ; /** *
        * An absolute number of the minimum number of successful completions of subtasks. As soon as this criteria is met,
        * the array job will be marked as successful and outputs will be computed. This has to be a non-negative number if
-       * assigned. Default value is size.
+       * assigned. Default value is size (if specified).
        * 
* * int64 min_successes = 3; */ public long getMinSuccesses() { - return minSuccesses_; + if (successCriteriaCase_ == 3) { + return (java.lang.Long) successCriteria_; + } + return 0L; } /** *
        * An absolute number of the minimum number of successful completions of subtasks. As soon as this criteria is met,
        * the array job will be marked as successful and outputs will be computed. This has to be a non-negative number if
-       * assigned. Default value is size.
+       * assigned. Default value is size (if specified).
        * 
* * int64 min_successes = 3; */ public Builder setMinSuccesses(long value) { - - minSuccesses_ = value; + successCriteriaCase_ = 3; + successCriteria_ = value; onChanged(); return this; } @@ -651,17 +791,64 @@ public Builder setMinSuccesses(long value) { *
        * An absolute number of the minimum number of successful completions of subtasks. As soon as this criteria is met,
        * the array job will be marked as successful and outputs will be computed. This has to be a non-negative number if
-       * assigned. Default value is size.
+       * assigned. Default value is size (if specified).
        * 
* * int64 min_successes = 3; */ public Builder clearMinSuccesses() { - - minSuccesses_ = 0L; + if (successCriteriaCase_ == 3) { + successCriteriaCase_ = 0; + successCriteria_ = null; + onChanged(); + } + return this; + } + + /** + *
+       * If the array job size is not known beforehand, the min_success_ratio can instead be used to determine when an array
+       * job can be marked successful.
+       * 
+ * + * float min_success_ratio = 4; + */ + public float getMinSuccessRatio() { + if (successCriteriaCase_ == 4) { + return (java.lang.Float) successCriteria_; + } + return 0F; + } + /** + *
+       * If the array job size is not known beforehand, the min_success_ratio can instead be used to determine when an array
+       * job can be marked successful.
+       * 
+ * + * float min_success_ratio = 4; + */ + public Builder setMinSuccessRatio(float value) { + successCriteriaCase_ = 4; + successCriteria_ = value; onChanged(); return this; } + /** + *
+       * If the array job size is not known beforehand, the min_success_ratio can instead be used to determine when an array
+       * job can be marked successful.
+       * 
+ * + * float min_success_ratio = 4; + */ + public Builder clearMinSuccessRatio() { + if (successCriteriaCase_ == 4) { + successCriteriaCase_ = 0; + successCriteria_ = null; + onChanged(); + } + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -730,10 +917,11 @@ public flyteidl.plugins.ArrayJobOuterClass.ArrayJob getDefaultInstanceForType() static { java.lang.String[] descriptorData = { "\n flyteidl/plugins/array_job.proto\022\020flyt" + - "eidl.plugins\"D\n\010ArrayJob\022\023\n\013parallelism\030" + - "\001 \001(\003\022\014\n\004size\030\002 \001(\003\022\025\n\rmin_successes\030\003 \001" + - "(\003B5Z3github.com/lyft/flyteidl/gen/pb-go" + - "/flyteidl/pluginsb\006proto3" + "eidl.plugins\"w\n\010ArrayJob\022\023\n\013parallelism\030" + + "\001 \001(\003\022\014\n\004size\030\002 \001(\003\022\027\n\rmin_successes\030\003 \001" + + "(\003H\000\022\033\n\021min_success_ratio\030\004 \001(\002H\000B\022\n\020suc" + + "cess_criteriaB5Z3github.com/lyft/flyteid" + + "l/gen/pb-go/flyteidl/pluginsb\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -752,7 +940,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( internal_static_flyteidl_plugins_ArrayJob_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_flyteidl_plugins_ArrayJob_descriptor, - new java.lang.String[] { "Parallelism", "Size", "MinSuccesses", }); + new java.lang.String[] { "Parallelism", "Size", "MinSuccesses", "MinSuccessRatio", "SuccessCriteria", }); } // @@protoc_insertion_point(outer_class_scope) diff --git a/flyteidl/gen/pb-protodoc/flyteidl/plugins/array_job.proto.rst b/flyteidl/gen/pb-protodoc/flyteidl/plugins/array_job.proto.rst index 4b8d867952..21118e61bd 100644 --- a/flyteidl/gen/pb-protodoc/flyteidl/plugins/array_job.proto.rst +++ b/flyteidl/gen/pb-protodoc/flyteidl/plugins/array_job.proto.rst @@ -18,7 +18,8 @@ will be executed concurrently. { "parallelism": "...", "size": "...", - "min_successes": "..." + "min_successes": "...", + "min_success_ratio": "..." } .. _api_field_flyteidl.plugins.ArrayJob.parallelism: @@ -34,7 +35,7 @@ parallelism size (`int64 `_) Defines the number of instances to launch at most. This number should match the size of the input if the job requires processing of all input data. This has to be a positive number. - +required. + In the case this is not defined, the back-end will determine the size at run-time by reading the inputs. .. _api_field_flyteidl.plugins.ArrayJob.min_successes: @@ -42,7 +43,20 @@ size min_successes (`int64 `_) An absolute number of the minimum number of successful completions of subtasks. As soon as this criteria is met, the array job will be marked as successful and outputs will be computed. This has to be a non-negative number if - assigned. Default value is size. + assigned. Default value is size (if specified). + + Only one of :ref:`min_successes `, :ref:`min_success_ratio ` may be set. + +.. _api_field_flyteidl.plugins.ArrayJob.min_success_ratio: + +min_success_ratio + (`float `_) If the array job size is not known beforehand, the min_success_ratio can instead be used to determine when an array + job can be marked successful. + + + + Only one of :ref:`min_successes `, :ref:`min_success_ratio ` may be set. + diff --git a/flyteidl/gen/pb_python/flyteidl/plugins/array_job_pb2.py b/flyteidl/gen/pb_python/flyteidl/plugins/array_job_pb2.py index bece9e3e13..9097352f7d 100644 --- a/flyteidl/gen/pb_python/flyteidl/plugins/array_job_pb2.py +++ b/flyteidl/gen/pb_python/flyteidl/plugins/array_job_pb2.py @@ -20,7 +20,7 @@ package='flyteidl.plugins', syntax='proto3', serialized_options=_b('Z3github.com/lyft/flyteidl/gen/pb-go/flyteidl/plugins'), - serialized_pb=_b('\n flyteidl/plugins/array_job.proto\x12\x10\x66lyteidl.plugins\"D\n\x08\x41rrayJob\x12\x13\n\x0bparallelism\x18\x01 \x01(\x03\x12\x0c\n\x04size\x18\x02 \x01(\x03\x12\x15\n\rmin_successes\x18\x03 \x01(\x03\x42\x35Z3github.com/lyft/flyteidl/gen/pb-go/flyteidl/pluginsb\x06proto3') + serialized_pb=_b('\n flyteidl/plugins/array_job.proto\x12\x10\x66lyteidl.plugins\"w\n\x08\x41rrayJob\x12\x13\n\x0bparallelism\x18\x01 \x01(\x03\x12\x0c\n\x04size\x18\x02 \x01(\x03\x12\x17\n\rmin_successes\x18\x03 \x01(\x03H\x00\x12\x1b\n\x11min_success_ratio\x18\x04 \x01(\x02H\x00\x42\x12\n\x10success_criteriaB5Z3github.com/lyft/flyteidl/gen/pb-go/flyteidl/pluginsb\x06proto3') ) @@ -54,6 +54,13 @@ message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='min_success_ratio', full_name='flyteidl.plugins.ArrayJob.min_success_ratio', index=3, + number=4, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -65,11 +72,20 @@ syntax='proto3', extension_ranges=[], oneofs=[ + _descriptor.OneofDescriptor( + name='success_criteria', full_name='flyteidl.plugins.ArrayJob.success_criteria', + index=0, containing_type=None, fields=[]), ], serialized_start=54, - serialized_end=122, + serialized_end=173, ) +_ARRAYJOB.oneofs_by_name['success_criteria'].fields.append( + _ARRAYJOB.fields_by_name['min_successes']) +_ARRAYJOB.fields_by_name['min_successes'].containing_oneof = _ARRAYJOB.oneofs_by_name['success_criteria'] +_ARRAYJOB.oneofs_by_name['success_criteria'].fields.append( + _ARRAYJOB.fields_by_name['min_success_ratio']) +_ARRAYJOB.fields_by_name['min_success_ratio'].containing_oneof = _ARRAYJOB.oneofs_by_name['success_criteria'] DESCRIPTOR.message_types_by_name['ArrayJob'] = _ARRAYJOB _sym_db.RegisterFileDescriptor(DESCRIPTOR) diff --git a/flyteidl/package.json b/flyteidl/package.json index 501d1399a0..d245447bf4 100644 --- a/flyteidl/package.json +++ b/flyteidl/package.json @@ -1,6 +1,6 @@ { "name": "@flyteorg/flyteidl", - "version": "0.18.13", + "version": "0.18.14", "description": "Compiled protocol buffers and gRPC service clients/servers for Flyte IDLs", "repository": { "type": "git", diff --git a/flyteidl/protos/flyteidl/plugins/array_job.proto b/flyteidl/protos/flyteidl/plugins/array_job.proto index 3a3a288f2f..b3d34c4025 100644 --- a/flyteidl/protos/flyteidl/plugins/array_job.proto +++ b/flyteidl/protos/flyteidl/plugins/array_job.proto @@ -14,11 +14,17 @@ message ArrayJob { // Defines the number of instances to launch at most. This number should match the size of the input if the job // requires processing of all input data. This has to be a positive number. - // +required. + // In the case this is not defined, the back-end will determine the size at run-time by reading the inputs. int64 size = 2; - // An absolute number of the minimum number of successful completions of subtasks. As soon as this criteria is met, - // the array job will be marked as successful and outputs will be computed. This has to be a non-negative number if - // assigned. Default value is size. - int64 min_successes = 3; + oneof success_criteria { + // An absolute number of the minimum number of successful completions of subtasks. As soon as this criteria is met, + // the array job will be marked as successful and outputs will be computed. This has to be a non-negative number if + // assigned. Default value is size (if specified). + int64 min_successes = 3; + + // If the array job size is not known beforehand, the min_success_ratio can instead be used to determine when an array + // job can be marked successful. + float min_success_ratio = 4; + } } diff --git a/flyteidl/setup.py b/flyteidl/setup.py index f906a0799d..ebf5ba4c2b 100644 --- a/flyteidl/setup.py +++ b/flyteidl/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -__version__ = '0.18.13' +__version__ = '0.18.14' setup( name='flyteidl',