diff --git a/gen/pb-cpp/flyteidl/plugins/kubeflow/common.grpc.pb.cc b/gen/pb-cpp/flyteidl/plugins/kubeflow/common.grpc.pb.cc new file mode 100644 index 000000000..97c982009 --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/kubeflow/common.grpc.pb.cc @@ -0,0 +1,26 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: flyteidl/plugins/kubeflow/common.proto + +#include "flyteidl/plugins/kubeflow/common.pb.h" +#include "flyteidl/plugins/kubeflow/common.grpc.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +namespace flyteidl { +namespace plugins { +namespace kubeflow { + +} // namespace flyteidl +} // namespace plugins +} // namespace kubeflow + diff --git a/gen/pb-cpp/flyteidl/plugins/kubeflow/common.grpc.pb.h b/gen/pb-cpp/flyteidl/plugins/kubeflow/common.grpc.pb.h new file mode 100644 index 000000000..010f31fab --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/kubeflow/common.grpc.pb.h @@ -0,0 +1,49 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: flyteidl/plugins/kubeflow/common.proto +#ifndef GRPC_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto__INCLUDED +#define GRPC_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto__INCLUDED + +#include "flyteidl/plugins/kubeflow/common.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace grpc_impl { +class Channel; +class CompletionQueue; +class ServerCompletionQueue; +} // namespace grpc_impl + +namespace grpc { +namespace experimental { +template +class MessageAllocator; +} // namespace experimental +} // namespace grpc_impl + +namespace grpc { +class ServerContext; +} // namespace grpc + +namespace flyteidl { +namespace plugins { +namespace kubeflow { + +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl + + +#endif // GRPC_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto__INCLUDED diff --git a/gen/pb-cpp/flyteidl/plugins/kubeflow/common.pb.cc b/gen/pb-cpp/flyteidl/plugins/kubeflow/common.pb.cc new file mode 100644 index 000000000..3ee0fd441 --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/kubeflow/common.pb.cc @@ -0,0 +1,548 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/kubeflow/common.proto + +#include "flyteidl/plugins/kubeflow/common.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +namespace flyteidl { +namespace plugins { +namespace kubeflow { +class RunPolicyDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _RunPolicy_default_instance_; +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl +static void InitDefaultsRunPolicy_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::flyteidl::plugins::kubeflow::_RunPolicy_default_instance_; + new (ptr) ::flyteidl::plugins::kubeflow::RunPolicy(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::flyteidl::plugins::kubeflow::RunPolicy::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_RunPolicy_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsRunPolicy_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto}, {}}; + +void InitDefaults_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto() { + ::google::protobuf::internal::InitSCC(&scc_info_RunPolicy_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto.base); +} + +::google::protobuf::Metadata file_level_metadata_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto[1]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto[2]; +constexpr ::google::protobuf::ServiceDescriptor const** file_level_service_descriptors_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto = nullptr; + +const ::google::protobuf::uint32 TableStruct_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::RunPolicy, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::RunPolicy, clean_pod_policy_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::RunPolicy, ttl_seconds_after_finished_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::RunPolicy, active_deadline_seconds_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::RunPolicy, backoff_limit_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::flyteidl::plugins::kubeflow::RunPolicy)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::flyteidl::plugins::kubeflow::_RunPolicy_default_instance_), +}; + +::google::protobuf::internal::AssignDescriptorsTable assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto = { + {}, AddDescriptors_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto, "flyteidl/plugins/kubeflow/common.proto", schemas, + file_default_instances, TableStruct_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto::offsets, + file_level_metadata_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto, 1, file_level_enum_descriptors_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto, file_level_service_descriptors_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto, +}; + +const char descriptor_table_protodef_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto[] = + "\n&flyteidl/plugins/kubeflow/common.proto" + "\022\031flyteidl.plugins.kubeflow\"\254\001\n\tRunPolic" + "y\022C\n\020clean_pod_policy\030\001 \001(\0162).flyteidl.p" + "lugins.kubeflow.CleanPodPolicy\022\"\n\032ttl_se" + "conds_after_finished\030\002 \001(\005\022\037\n\027active_dea" + "dline_seconds\030\003 \001(\005\022\025\n\rbackoff_limit\030\004 \001" + "(\005*c\n\rRestartPolicy\022\030\n\024RESTART_POLICY_NE" + "VER\020\000\022\035\n\031RESTART_POLICY_ON_FAILURE\020\001\022\031\n\025" + "RESTART_POLICY_ALWAYS\020\002*`\n\016CleanPodPolic" + "y\022\030\n\024CLEANPOD_POLICY_NONE\020\000\022\033\n\027CLEANPOD_" + "POLICY_RUNNING\020\001\022\027\n\023CLEANPOD_POLICY_ALL\020" + "\002B9Z7github.com/flyteorg/flyteidl/gen/pb" + "-go/flyteidl/pluginsb\006proto3" + ; +::google::protobuf::internal::DescriptorTable descriptor_table_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto = { + false, InitDefaults_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto, + descriptor_table_protodef_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto, + "flyteidl/plugins/kubeflow/common.proto", &assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto, 508, +}; + +void AddDescriptors_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto() { + static constexpr ::google::protobuf::internal::InitFunc deps[1] = + { + }; + ::google::protobuf::internal::AddDescriptors(&descriptor_table_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto, deps, 0); +} + +// Force running AddDescriptors() at dynamic initialization time. +static bool dynamic_init_dummy_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto = []() { AddDescriptors_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto(); return true; }(); +namespace flyteidl { +namespace plugins { +namespace kubeflow { +const ::google::protobuf::EnumDescriptor* RestartPolicy_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto); + return file_level_enum_descriptors_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto[0]; +} +bool RestartPolicy_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* CleanPodPolicy_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto); + return file_level_enum_descriptors_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto[1]; +} +bool CleanPodPolicy_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + + +// =================================================================== + +void RunPolicy::InitAsDefaultInstance() { +} +class RunPolicy::HasBitSetters { + public: +}; + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int RunPolicy::kCleanPodPolicyFieldNumber; +const int RunPolicy::kTtlSecondsAfterFinishedFieldNumber; +const int RunPolicy::kActiveDeadlineSecondsFieldNumber; +const int RunPolicy::kBackoffLimitFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +RunPolicy::RunPolicy() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:flyteidl.plugins.kubeflow.RunPolicy) +} +RunPolicy::RunPolicy(const RunPolicy& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&clean_pod_policy_, &from.clean_pod_policy_, + static_cast(reinterpret_cast(&backoff_limit_) - + reinterpret_cast(&clean_pod_policy_)) + sizeof(backoff_limit_)); + // @@protoc_insertion_point(copy_constructor:flyteidl.plugins.kubeflow.RunPolicy) +} + +void RunPolicy::SharedCtor() { + ::memset(&clean_pod_policy_, 0, static_cast( + reinterpret_cast(&backoff_limit_) - + reinterpret_cast(&clean_pod_policy_)) + sizeof(backoff_limit_)); +} + +RunPolicy::~RunPolicy() { + // @@protoc_insertion_point(destructor:flyteidl.plugins.kubeflow.RunPolicy) + SharedDtor(); +} + +void RunPolicy::SharedDtor() { +} + +void RunPolicy::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const RunPolicy& RunPolicy::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_RunPolicy_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto.base); + return *internal_default_instance(); +} + + +void RunPolicy::Clear() { +// @@protoc_insertion_point(message_clear_start:flyteidl.plugins.kubeflow.RunPolicy) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&clean_pod_policy_, 0, static_cast( + reinterpret_cast(&backoff_limit_) - + reinterpret_cast(&clean_pod_policy_)) + sizeof(backoff_limit_)); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* RunPolicy::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // .flyteidl.plugins.kubeflow.CleanPodPolicy clean_pod_policy = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 8) goto handle_unusual; + ::google::protobuf::uint64 val = ::google::protobuf::internal::ReadVarint(&ptr); + msg->set_clean_pod_policy(static_cast<::flyteidl::plugins::kubeflow::CleanPodPolicy>(val)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + // int32 ttl_seconds_after_finished = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) != 16) goto handle_unusual; + msg->set_ttl_seconds_after_finished(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + // int32 active_deadline_seconds = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) != 24) goto handle_unusual; + msg->set_active_deadline_seconds(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + // int32 backoff_limit = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) != 32) goto handle_unusual; + msg->set_backoff_limit(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool RunPolicy::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:flyteidl.plugins.kubeflow.RunPolicy) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .flyteidl.plugins.kubeflow.CleanPodPolicy clean_pod_policy = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (8 & 0xFF)) { + int value = 0; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_clean_pod_policy(static_cast< ::flyteidl::plugins::kubeflow::CleanPodPolicy >(value)); + } else { + goto handle_unusual; + } + break; + } + + // int32 ttl_seconds_after_finished = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (16 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &ttl_seconds_after_finished_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 active_deadline_seconds = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == (24 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &active_deadline_seconds_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 backoff_limit = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == (32 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &backoff_limit_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:flyteidl.plugins.kubeflow.RunPolicy) + return true; +failure: + // @@protoc_insertion_point(parse_failure:flyteidl.plugins.kubeflow.RunPolicy) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void RunPolicy::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:flyteidl.plugins.kubeflow.RunPolicy) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .flyteidl.plugins.kubeflow.CleanPodPolicy clean_pod_policy = 1; + if (this->clean_pod_policy() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->clean_pod_policy(), output); + } + + // int32 ttl_seconds_after_finished = 2; + if (this->ttl_seconds_after_finished() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->ttl_seconds_after_finished(), output); + } + + // int32 active_deadline_seconds = 3; + if (this->active_deadline_seconds() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->active_deadline_seconds(), output); + } + + // int32 backoff_limit = 4; + if (this->backoff_limit() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->backoff_limit(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:flyteidl.plugins.kubeflow.RunPolicy) +} + +::google::protobuf::uint8* RunPolicy::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:flyteidl.plugins.kubeflow.RunPolicy) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .flyteidl.plugins.kubeflow.CleanPodPolicy clean_pod_policy = 1; + if (this->clean_pod_policy() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->clean_pod_policy(), target); + } + + // int32 ttl_seconds_after_finished = 2; + if (this->ttl_seconds_after_finished() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->ttl_seconds_after_finished(), target); + } + + // int32 active_deadline_seconds = 3; + if (this->active_deadline_seconds() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->active_deadline_seconds(), target); + } + + // int32 backoff_limit = 4; + if (this->backoff_limit() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->backoff_limit(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:flyteidl.plugins.kubeflow.RunPolicy) + return target; +} + +size_t RunPolicy::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:flyteidl.plugins.kubeflow.RunPolicy) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .flyteidl.plugins.kubeflow.CleanPodPolicy clean_pod_policy = 1; + if (this->clean_pod_policy() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->clean_pod_policy()); + } + + // int32 ttl_seconds_after_finished = 2; + if (this->ttl_seconds_after_finished() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->ttl_seconds_after_finished()); + } + + // int32 active_deadline_seconds = 3; + if (this->active_deadline_seconds() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->active_deadline_seconds()); + } + + // int32 backoff_limit = 4; + if (this->backoff_limit() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->backoff_limit()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void RunPolicy::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:flyteidl.plugins.kubeflow.RunPolicy) + GOOGLE_DCHECK_NE(&from, this); + const RunPolicy* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:flyteidl.plugins.kubeflow.RunPolicy) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:flyteidl.plugins.kubeflow.RunPolicy) + MergeFrom(*source); + } +} + +void RunPolicy::MergeFrom(const RunPolicy& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:flyteidl.plugins.kubeflow.RunPolicy) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.clean_pod_policy() != 0) { + set_clean_pod_policy(from.clean_pod_policy()); + } + if (from.ttl_seconds_after_finished() != 0) { + set_ttl_seconds_after_finished(from.ttl_seconds_after_finished()); + } + if (from.active_deadline_seconds() != 0) { + set_active_deadline_seconds(from.active_deadline_seconds()); + } + if (from.backoff_limit() != 0) { + set_backoff_limit(from.backoff_limit()); + } +} + +void RunPolicy::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:flyteidl.plugins.kubeflow.RunPolicy) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void RunPolicy::CopyFrom(const RunPolicy& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:flyteidl.plugins.kubeflow.RunPolicy) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool RunPolicy::IsInitialized() const { + return true; +} + +void RunPolicy::Swap(RunPolicy* other) { + if (other == this) return; + InternalSwap(other); +} +void RunPolicy::InternalSwap(RunPolicy* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(clean_pod_policy_, other->clean_pod_policy_); + swap(ttl_seconds_after_finished_, other->ttl_seconds_after_finished_); + swap(active_deadline_seconds_, other->active_deadline_seconds_); + swap(backoff_limit_, other->backoff_limit_); +} + +::google::protobuf::Metadata RunPolicy::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto); + return ::file_level_metadata_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl +namespace google { +namespace protobuf { +template<> PROTOBUF_NOINLINE ::flyteidl::plugins::kubeflow::RunPolicy* Arena::CreateMaybeMessage< ::flyteidl::plugins::kubeflow::RunPolicy >(Arena* arena) { + return Arena::CreateInternal< ::flyteidl::plugins::kubeflow::RunPolicy >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) +#include diff --git a/gen/pb-cpp/flyteidl/plugins/kubeflow/common.pb.h b/gen/pb-cpp/flyteidl/plugins/kubeflow/common.pb.h new file mode 100644 index 000000000..de4d80d2a --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/kubeflow/common.pb.h @@ -0,0 +1,344 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/kubeflow/common.proto + +#ifndef PROTOBUF_INCLUDED_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto +#define PROTOBUF_INCLUDED_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3007000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto + +// Internal implementation detail -- do not use these members. +struct TableStruct_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto { + static const ::google::protobuf::internal::ParseTableField entries[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::AuxillaryParseTableField aux[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::ParseTable schema[1] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto(); +namespace flyteidl { +namespace plugins { +namespace kubeflow { +class RunPolicy; +class RunPolicyDefaultTypeInternal; +extern RunPolicyDefaultTypeInternal _RunPolicy_default_instance_; +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl +namespace google { +namespace protobuf { +template<> ::flyteidl::plugins::kubeflow::RunPolicy* Arena::CreateMaybeMessage<::flyteidl::plugins::kubeflow::RunPolicy>(Arena*); +} // namespace protobuf +} // namespace google +namespace flyteidl { +namespace plugins { +namespace kubeflow { + +enum RestartPolicy { + RESTART_POLICY_NEVER = 0, + RESTART_POLICY_ON_FAILURE = 1, + RESTART_POLICY_ALWAYS = 2, + RestartPolicy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::google::protobuf::int32>::min(), + RestartPolicy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::google::protobuf::int32>::max() +}; +bool RestartPolicy_IsValid(int value); +const RestartPolicy RestartPolicy_MIN = RESTART_POLICY_NEVER; +const RestartPolicy RestartPolicy_MAX = RESTART_POLICY_ALWAYS; +const int RestartPolicy_ARRAYSIZE = RestartPolicy_MAX + 1; + +const ::google::protobuf::EnumDescriptor* RestartPolicy_descriptor(); +inline const ::std::string& RestartPolicy_Name(RestartPolicy value) { + return ::google::protobuf::internal::NameOfEnum( + RestartPolicy_descriptor(), value); +} +inline bool RestartPolicy_Parse( + const ::std::string& name, RestartPolicy* value) { + return ::google::protobuf::internal::ParseNamedEnum( + RestartPolicy_descriptor(), name, value); +} +enum CleanPodPolicy { + CLEANPOD_POLICY_NONE = 0, + CLEANPOD_POLICY_RUNNING = 1, + CLEANPOD_POLICY_ALL = 2, + CleanPodPolicy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::google::protobuf::int32>::min(), + CleanPodPolicy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::google::protobuf::int32>::max() +}; +bool CleanPodPolicy_IsValid(int value); +const CleanPodPolicy CleanPodPolicy_MIN = CLEANPOD_POLICY_NONE; +const CleanPodPolicy CleanPodPolicy_MAX = CLEANPOD_POLICY_ALL; +const int CleanPodPolicy_ARRAYSIZE = CleanPodPolicy_MAX + 1; + +const ::google::protobuf::EnumDescriptor* CleanPodPolicy_descriptor(); +inline const ::std::string& CleanPodPolicy_Name(CleanPodPolicy value) { + return ::google::protobuf::internal::NameOfEnum( + CleanPodPolicy_descriptor(), value); +} +inline bool CleanPodPolicy_Parse( + const ::std::string& name, CleanPodPolicy* value) { + return ::google::protobuf::internal::ParseNamedEnum( + CleanPodPolicy_descriptor(), name, value); +} +// =================================================================== + +class RunPolicy final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:flyteidl.plugins.kubeflow.RunPolicy) */ { + public: + RunPolicy(); + virtual ~RunPolicy(); + + RunPolicy(const RunPolicy& from); + + inline RunPolicy& operator=(const RunPolicy& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + RunPolicy(RunPolicy&& from) noexcept + : RunPolicy() { + *this = ::std::move(from); + } + + inline RunPolicy& operator=(RunPolicy&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const RunPolicy& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const RunPolicy* internal_default_instance() { + return reinterpret_cast( + &_RunPolicy_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(RunPolicy* other); + friend void swap(RunPolicy& a, RunPolicy& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline RunPolicy* New() const final { + return CreateMaybeMessage(nullptr); + } + + RunPolicy* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const RunPolicy& from); + void MergeFrom(const RunPolicy& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(RunPolicy* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .flyteidl.plugins.kubeflow.CleanPodPolicy clean_pod_policy = 1; + void clear_clean_pod_policy(); + static const int kCleanPodPolicyFieldNumber = 1; + ::flyteidl::plugins::kubeflow::CleanPodPolicy clean_pod_policy() const; + void set_clean_pod_policy(::flyteidl::plugins::kubeflow::CleanPodPolicy value); + + // int32 ttl_seconds_after_finished = 2; + void clear_ttl_seconds_after_finished(); + static const int kTtlSecondsAfterFinishedFieldNumber = 2; + ::google::protobuf::int32 ttl_seconds_after_finished() const; + void set_ttl_seconds_after_finished(::google::protobuf::int32 value); + + // int32 active_deadline_seconds = 3; + void clear_active_deadline_seconds(); + static const int kActiveDeadlineSecondsFieldNumber = 3; + ::google::protobuf::int32 active_deadline_seconds() const; + void set_active_deadline_seconds(::google::protobuf::int32 value); + + // int32 backoff_limit = 4; + void clear_backoff_limit(); + static const int kBackoffLimitFieldNumber = 4; + ::google::protobuf::int32 backoff_limit() const; + void set_backoff_limit(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.kubeflow.RunPolicy) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + int clean_pod_policy_; + ::google::protobuf::int32 ttl_seconds_after_finished_; + ::google::protobuf::int32 active_deadline_seconds_; + ::google::protobuf::int32 backoff_limit_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// RunPolicy + +// .flyteidl.plugins.kubeflow.CleanPodPolicy clean_pod_policy = 1; +inline void RunPolicy::clear_clean_pod_policy() { + clean_pod_policy_ = 0; +} +inline ::flyteidl::plugins::kubeflow::CleanPodPolicy RunPolicy::clean_pod_policy() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.RunPolicy.clean_pod_policy) + return static_cast< ::flyteidl::plugins::kubeflow::CleanPodPolicy >(clean_pod_policy_); +} +inline void RunPolicy::set_clean_pod_policy(::flyteidl::plugins::kubeflow::CleanPodPolicy value) { + + clean_pod_policy_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.RunPolicy.clean_pod_policy) +} + +// int32 ttl_seconds_after_finished = 2; +inline void RunPolicy::clear_ttl_seconds_after_finished() { + ttl_seconds_after_finished_ = 0; +} +inline ::google::protobuf::int32 RunPolicy::ttl_seconds_after_finished() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.RunPolicy.ttl_seconds_after_finished) + return ttl_seconds_after_finished_; +} +inline void RunPolicy::set_ttl_seconds_after_finished(::google::protobuf::int32 value) { + + ttl_seconds_after_finished_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.RunPolicy.ttl_seconds_after_finished) +} + +// int32 active_deadline_seconds = 3; +inline void RunPolicy::clear_active_deadline_seconds() { + active_deadline_seconds_ = 0; +} +inline ::google::protobuf::int32 RunPolicy::active_deadline_seconds() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.RunPolicy.active_deadline_seconds) + return active_deadline_seconds_; +} +inline void RunPolicy::set_active_deadline_seconds(::google::protobuf::int32 value) { + + active_deadline_seconds_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.RunPolicy.active_deadline_seconds) +} + +// int32 backoff_limit = 4; +inline void RunPolicy::clear_backoff_limit() { + backoff_limit_ = 0; +} +inline ::google::protobuf::int32 RunPolicy::backoff_limit() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.RunPolicy.backoff_limit) + return backoff_limit_; +} +inline void RunPolicy::set_backoff_limit(::google::protobuf::int32 value) { + + backoff_limit_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.RunPolicy.backoff_limit) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::flyteidl::plugins::kubeflow::RestartPolicy> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::flyteidl::plugins::kubeflow::RestartPolicy>() { + return ::flyteidl::plugins::kubeflow::RestartPolicy_descriptor(); +} +template <> struct is_proto_enum< ::flyteidl::plugins::kubeflow::CleanPodPolicy> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::flyteidl::plugins::kubeflow::CleanPodPolicy>() { + return ::flyteidl::plugins::kubeflow::CleanPodPolicy_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#include +#endif // PROTOBUF_INCLUDED_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto diff --git a/gen/pb-cpp/flyteidl/plugins/kubeflow/mpi.grpc.pb.cc b/gen/pb-cpp/flyteidl/plugins/kubeflow/mpi.grpc.pb.cc new file mode 100644 index 000000000..bbf565e02 --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/kubeflow/mpi.grpc.pb.cc @@ -0,0 +1,26 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: flyteidl/plugins/kubeflow/mpi.proto + +#include "flyteidl/plugins/kubeflow/mpi.pb.h" +#include "flyteidl/plugins/kubeflow/mpi.grpc.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +namespace flyteidl { +namespace plugins { +namespace kubeflow { + +} // namespace flyteidl +} // namespace plugins +} // namespace kubeflow + diff --git a/gen/pb-cpp/flyteidl/plugins/kubeflow/mpi.grpc.pb.h b/gen/pb-cpp/flyteidl/plugins/kubeflow/mpi.grpc.pb.h new file mode 100644 index 000000000..c6570dd36 --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/kubeflow/mpi.grpc.pb.h @@ -0,0 +1,49 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: flyteidl/plugins/kubeflow/mpi.proto +#ifndef GRPC_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto__INCLUDED +#define GRPC_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto__INCLUDED + +#include "flyteidl/plugins/kubeflow/mpi.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace grpc_impl { +class Channel; +class CompletionQueue; +class ServerCompletionQueue; +} // namespace grpc_impl + +namespace grpc { +namespace experimental { +template +class MessageAllocator; +} // namespace experimental +} // namespace grpc_impl + +namespace grpc { +class ServerContext; +} // namespace grpc + +namespace flyteidl { +namespace plugins { +namespace kubeflow { + +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl + + +#endif // GRPC_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto__INCLUDED diff --git a/gen/pb-cpp/flyteidl/plugins/kubeflow/mpi.pb.cc b/gen/pb-cpp/flyteidl/plugins/kubeflow/mpi.pb.cc new file mode 100644 index 000000000..bac650d44 --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/kubeflow/mpi.pb.cc @@ -0,0 +1,1173 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/kubeflow/mpi.proto + +#include "flyteidl/plugins/kubeflow/mpi.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fcore_2ftasks_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Resources_flyteidl_2fcore_2ftasks_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_RunPolicy_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_DistributedMPITrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto; +namespace flyteidl { +namespace plugins { +namespace kubeflow { +class DistributedMPITrainingTaskDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _DistributedMPITrainingTask_default_instance_; +class DistributedMPITrainingReplicaSpecDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _DistributedMPITrainingReplicaSpec_default_instance_; +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl +static void InitDefaultsDistributedMPITrainingTask_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::flyteidl::plugins::kubeflow::_DistributedMPITrainingTask_default_instance_; + new (ptr) ::flyteidl::plugins::kubeflow::DistributedMPITrainingTask(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::flyteidl::plugins::kubeflow::DistributedMPITrainingTask::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_DistributedMPITrainingTask_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsDistributedMPITrainingTask_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto}, { + &scc_info_DistributedMPITrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto.base, + &scc_info_RunPolicy_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto.base,}}; + +static void InitDefaultsDistributedMPITrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::flyteidl::plugins::kubeflow::_DistributedMPITrainingReplicaSpec_default_instance_; + new (ptr) ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_DistributedMPITrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsDistributedMPITrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto}, { + &scc_info_Resources_flyteidl_2fcore_2ftasks_2eproto.base,}}; + +void InitDefaults_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto() { + ::google::protobuf::internal::InitSCC(&scc_info_DistributedMPITrainingTask_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_DistributedMPITrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto.base); +} + +::google::protobuf::Metadata file_level_metadata_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto[2]; +constexpr ::google::protobuf::EnumDescriptor const** file_level_enum_descriptors_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto = nullptr; +constexpr ::google::protobuf::ServiceDescriptor const** file_level_service_descriptors_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto = nullptr; + +const ::google::protobuf::uint32 TableStruct_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedMPITrainingTask, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedMPITrainingTask, worker_replicas_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedMPITrainingTask, launcher_replicas_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedMPITrainingTask, run_policy_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedMPITrainingTask, slots_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec, replicas_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec, image_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec, resources_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec, restart_policy_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec, command_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::flyteidl::plugins::kubeflow::DistributedMPITrainingTask)}, + { 9, -1, sizeof(::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::flyteidl::plugins::kubeflow::_DistributedMPITrainingTask_default_instance_), + reinterpret_cast(&::flyteidl::plugins::kubeflow::_DistributedMPITrainingReplicaSpec_default_instance_), +}; + +::google::protobuf::internal::AssignDescriptorsTable assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto = { + {}, AddDescriptors_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto, "flyteidl/plugins/kubeflow/mpi.proto", schemas, + file_default_instances, TableStruct_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto::offsets, + file_level_metadata_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto, 2, file_level_enum_descriptors_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto, file_level_service_descriptors_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto, +}; + +const char descriptor_table_protodef_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto[] = + "\n#flyteidl/plugins/kubeflow/mpi.proto\022\031f" + "lyteidl.plugins.kubeflow\032\031flyteidl/core/" + "tasks.proto\032&flyteidl/plugins/kubeflow/c" + "ommon.proto\"\225\002\n\032DistributedMPITrainingTa" + "sk\022U\n\017worker_replicas\030\001 \001(\0132<.flyteidl.p" + "lugins.kubeflow.DistributedMPITrainingRe" + "plicaSpec\022W\n\021launcher_replicas\030\002 \001(\0132<.f" + "lyteidl.plugins.kubeflow.DistributedMPIT" + "rainingReplicaSpec\0228\n\nrun_policy\030\003 \001(\0132$" + ".flyteidl.plugins.kubeflow.RunPolicy\022\r\n\005" + "slots\030\004 \001(\005\"\304\001\n!DistributedMPITrainingRe" + "plicaSpec\022\020\n\010replicas\030\001 \001(\005\022\r\n\005image\030\002 \001" + "(\t\022+\n\tresources\030\003 \001(\0132\030.flyteidl.core.Re" + "sources\022@\n\016restart_policy\030\004 \001(\0162(.flytei" + "dl.plugins.kubeflow.RestartPolicy\022\017\n\007com" + "mand\030\005 \003(\tB9Z7github.com/flyteorg/flytei" + "dl/gen/pb-go/flyteidl/pluginsb\006proto3" + ; +::google::protobuf::internal::DescriptorTable descriptor_table_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto = { + false, InitDefaults_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto, + descriptor_table_protodef_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto, + "flyteidl/plugins/kubeflow/mpi.proto", &assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto, 677, +}; + +void AddDescriptors_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto() { + static constexpr ::google::protobuf::internal::InitFunc deps[2] = + { + ::AddDescriptors_flyteidl_2fcore_2ftasks_2eproto, + ::AddDescriptors_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto, + }; + ::google::protobuf::internal::AddDescriptors(&descriptor_table_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto, deps, 2); +} + +// Force running AddDescriptors() at dynamic initialization time. +static bool dynamic_init_dummy_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto = []() { AddDescriptors_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto(); return true; }(); +namespace flyteidl { +namespace plugins { +namespace kubeflow { + +// =================================================================== + +void DistributedMPITrainingTask::InitAsDefaultInstance() { + ::flyteidl::plugins::kubeflow::_DistributedMPITrainingTask_default_instance_._instance.get_mutable()->worker_replicas_ = const_cast< ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec*>( + ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec::internal_default_instance()); + ::flyteidl::plugins::kubeflow::_DistributedMPITrainingTask_default_instance_._instance.get_mutable()->launcher_replicas_ = const_cast< ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec*>( + ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec::internal_default_instance()); + ::flyteidl::plugins::kubeflow::_DistributedMPITrainingTask_default_instance_._instance.get_mutable()->run_policy_ = const_cast< ::flyteidl::plugins::kubeflow::RunPolicy*>( + ::flyteidl::plugins::kubeflow::RunPolicy::internal_default_instance()); +} +class DistributedMPITrainingTask::HasBitSetters { + public: + static const ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec& worker_replicas(const DistributedMPITrainingTask* msg); + static const ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec& launcher_replicas(const DistributedMPITrainingTask* msg); + static const ::flyteidl::plugins::kubeflow::RunPolicy& run_policy(const DistributedMPITrainingTask* msg); +}; + +const ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec& +DistributedMPITrainingTask::HasBitSetters::worker_replicas(const DistributedMPITrainingTask* msg) { + return *msg->worker_replicas_; +} +const ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec& +DistributedMPITrainingTask::HasBitSetters::launcher_replicas(const DistributedMPITrainingTask* msg) { + return *msg->launcher_replicas_; +} +const ::flyteidl::plugins::kubeflow::RunPolicy& +DistributedMPITrainingTask::HasBitSetters::run_policy(const DistributedMPITrainingTask* msg) { + return *msg->run_policy_; +} +void DistributedMPITrainingTask::clear_run_policy() { + if (GetArenaNoVirtual() == nullptr && run_policy_ != nullptr) { + delete run_policy_; + } + run_policy_ = nullptr; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DistributedMPITrainingTask::kWorkerReplicasFieldNumber; +const int DistributedMPITrainingTask::kLauncherReplicasFieldNumber; +const int DistributedMPITrainingTask::kRunPolicyFieldNumber; +const int DistributedMPITrainingTask::kSlotsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DistributedMPITrainingTask::DistributedMPITrainingTask() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) +} +DistributedMPITrainingTask::DistributedMPITrainingTask(const DistributedMPITrainingTask& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_worker_replicas()) { + worker_replicas_ = new ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec(*from.worker_replicas_); + } else { + worker_replicas_ = nullptr; + } + if (from.has_launcher_replicas()) { + launcher_replicas_ = new ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec(*from.launcher_replicas_); + } else { + launcher_replicas_ = nullptr; + } + if (from.has_run_policy()) { + run_policy_ = new ::flyteidl::plugins::kubeflow::RunPolicy(*from.run_policy_); + } else { + run_policy_ = nullptr; + } + slots_ = from.slots_; + // @@protoc_insertion_point(copy_constructor:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) +} + +void DistributedMPITrainingTask::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_DistributedMPITrainingTask_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto.base); + ::memset(&worker_replicas_, 0, static_cast( + reinterpret_cast(&slots_) - + reinterpret_cast(&worker_replicas_)) + sizeof(slots_)); +} + +DistributedMPITrainingTask::~DistributedMPITrainingTask() { + // @@protoc_insertion_point(destructor:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + SharedDtor(); +} + +void DistributedMPITrainingTask::SharedDtor() { + if (this != internal_default_instance()) delete worker_replicas_; + if (this != internal_default_instance()) delete launcher_replicas_; + if (this != internal_default_instance()) delete run_policy_; +} + +void DistributedMPITrainingTask::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const DistributedMPITrainingTask& DistributedMPITrainingTask::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_DistributedMPITrainingTask_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto.base); + return *internal_default_instance(); +} + + +void DistributedMPITrainingTask::Clear() { +// @@protoc_insertion_point(message_clear_start:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == nullptr && worker_replicas_ != nullptr) { + delete worker_replicas_; + } + worker_replicas_ = nullptr; + if (GetArenaNoVirtual() == nullptr && launcher_replicas_ != nullptr) { + delete launcher_replicas_; + } + launcher_replicas_ = nullptr; + if (GetArenaNoVirtual() == nullptr && run_policy_ != nullptr) { + delete run_policy_; + } + run_policy_ = nullptr; + slots_ = 0; + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* DistributedMPITrainingTask::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec::_InternalParse; + object = msg->mutable_worker_replicas(); + 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; + } + // .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 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::plugins::kubeflow::DistributedMPITrainingReplicaSpec::_InternalParse; + object = msg->mutable_launcher_replicas(); + 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; + } + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) != 26) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::flyteidl::plugins::kubeflow::RunPolicy::_InternalParse; + object = msg->mutable_run_policy(); + 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; + } + // int32 slots = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) != 32) goto handle_unusual; + msg->set_slots(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool DistributedMPITrainingTask::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_worker_replicas())); + } else { + goto handle_unusual; + } + break; + } + + // .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_launcher_replicas())); + } else { + goto handle_unusual; + } + break; + } + + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == (26 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_run_policy())); + } else { + goto handle_unusual; + } + break; + } + + // int32 slots = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == (32 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &slots_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + return true; +failure: + // @@protoc_insertion_point(parse_failure:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void DistributedMPITrainingTask::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + if (this->has_worker_replicas()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, HasBitSetters::worker_replicas(this), output); + } + + // .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + if (this->has_launcher_replicas()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, HasBitSetters::launcher_replicas(this), output); + } + + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + if (this->has_run_policy()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, HasBitSetters::run_policy(this), output); + } + + // int32 slots = 4; + if (this->slots() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->slots(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) +} + +::google::protobuf::uint8* DistributedMPITrainingTask::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + if (this->has_worker_replicas()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, HasBitSetters::worker_replicas(this), target); + } + + // .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + if (this->has_launcher_replicas()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, HasBitSetters::launcher_replicas(this), target); + } + + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + if (this->has_run_policy()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, HasBitSetters::run_policy(this), target); + } + + // int32 slots = 4; + if (this->slots() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->slots(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + return target; +} + +size_t DistributedMPITrainingTask::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + if (this->has_worker_replicas()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *worker_replicas_); + } + + // .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + if (this->has_launcher_replicas()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *launcher_replicas_); + } + + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + if (this->has_run_policy()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *run_policy_); + } + + // int32 slots = 4; + if (this->slots() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->slots()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DistributedMPITrainingTask::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + GOOGLE_DCHECK_NE(&from, this); + const DistributedMPITrainingTask* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + MergeFrom(*source); + } +} + +void DistributedMPITrainingTask::MergeFrom(const DistributedMPITrainingTask& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_worker_replicas()) { + mutable_worker_replicas()->::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec::MergeFrom(from.worker_replicas()); + } + if (from.has_launcher_replicas()) { + mutable_launcher_replicas()->::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec::MergeFrom(from.launcher_replicas()); + } + if (from.has_run_policy()) { + mutable_run_policy()->::flyteidl::plugins::kubeflow::RunPolicy::MergeFrom(from.run_policy()); + } + if (from.slots() != 0) { + set_slots(from.slots()); + } +} + +void DistributedMPITrainingTask::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DistributedMPITrainingTask::CopyFrom(const DistributedMPITrainingTask& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DistributedMPITrainingTask::IsInitialized() const { + return true; +} + +void DistributedMPITrainingTask::Swap(DistributedMPITrainingTask* other) { + if (other == this) return; + InternalSwap(other); +} +void DistributedMPITrainingTask::InternalSwap(DistributedMPITrainingTask* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(worker_replicas_, other->worker_replicas_); + swap(launcher_replicas_, other->launcher_replicas_); + swap(run_policy_, other->run_policy_); + swap(slots_, other->slots_); +} + +::google::protobuf::Metadata DistributedMPITrainingTask::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto); + return ::file_level_metadata_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void DistributedMPITrainingReplicaSpec::InitAsDefaultInstance() { + ::flyteidl::plugins::kubeflow::_DistributedMPITrainingReplicaSpec_default_instance_._instance.get_mutable()->resources_ = const_cast< ::flyteidl::core::Resources*>( + ::flyteidl::core::Resources::internal_default_instance()); +} +class DistributedMPITrainingReplicaSpec::HasBitSetters { + public: + static const ::flyteidl::core::Resources& resources(const DistributedMPITrainingReplicaSpec* msg); +}; + +const ::flyteidl::core::Resources& +DistributedMPITrainingReplicaSpec::HasBitSetters::resources(const DistributedMPITrainingReplicaSpec* msg) { + return *msg->resources_; +} +void DistributedMPITrainingReplicaSpec::clear_resources() { + if (GetArenaNoVirtual() == nullptr && resources_ != nullptr) { + delete resources_; + } + resources_ = nullptr; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DistributedMPITrainingReplicaSpec::kReplicasFieldNumber; +const int DistributedMPITrainingReplicaSpec::kImageFieldNumber; +const int DistributedMPITrainingReplicaSpec::kResourcesFieldNumber; +const int DistributedMPITrainingReplicaSpec::kRestartPolicyFieldNumber; +const int DistributedMPITrainingReplicaSpec::kCommandFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DistributedMPITrainingReplicaSpec::DistributedMPITrainingReplicaSpec() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) +} +DistributedMPITrainingReplicaSpec::DistributedMPITrainingReplicaSpec(const DistributedMPITrainingReplicaSpec& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr), + command_(from.command_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + image_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.image().size() > 0) { + image_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.image_); + } + if (from.has_resources()) { + resources_ = new ::flyteidl::core::Resources(*from.resources_); + } else { + resources_ = nullptr; + } + ::memcpy(&replicas_, &from.replicas_, + static_cast(reinterpret_cast(&restart_policy_) - + reinterpret_cast(&replicas_)) + sizeof(restart_policy_)); + // @@protoc_insertion_point(copy_constructor:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) +} + +void DistributedMPITrainingReplicaSpec::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_DistributedMPITrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto.base); + image_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&resources_, 0, static_cast( + reinterpret_cast(&restart_policy_) - + reinterpret_cast(&resources_)) + sizeof(restart_policy_)); +} + +DistributedMPITrainingReplicaSpec::~DistributedMPITrainingReplicaSpec() { + // @@protoc_insertion_point(destructor:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + SharedDtor(); +} + +void DistributedMPITrainingReplicaSpec::SharedDtor() { + image_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete resources_; +} + +void DistributedMPITrainingReplicaSpec::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const DistributedMPITrainingReplicaSpec& DistributedMPITrainingReplicaSpec::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_DistributedMPITrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto.base); + return *internal_default_instance(); +} + + +void DistributedMPITrainingReplicaSpec::Clear() { +// @@protoc_insertion_point(message_clear_start:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + command_.Clear(); + image_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == nullptr && resources_ != nullptr) { + delete resources_; + } + resources_ = nullptr; + ::memset(&replicas_, 0, static_cast( + reinterpret_cast(&restart_policy_) - + reinterpret_cast(&replicas_)) + sizeof(restart_policy_)); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* DistributedMPITrainingReplicaSpec::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // int32 replicas = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 8) goto handle_unusual; + msg->set_replicas(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + // string image = 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); + ctx->extra_parse_data().SetFieldName("flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.image"); + object = msg->mutable_image(); + if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) { + parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8; + goto string_till_end; + } + GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx)); + ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx); + ptr += size; + break; + } + // .flyteidl.core.Resources resources = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) != 26) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::flyteidl::core::Resources::_InternalParse; + object = msg->mutable_resources(); + 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; + } + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) != 32) goto handle_unusual; + ::google::protobuf::uint64 val = ::google::protobuf::internal::ReadVarint(&ptr); + msg->set_restart_policy(static_cast<::flyteidl::plugins::kubeflow::RestartPolicy>(val)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + // repeated string command = 5; + case 5: { + if (static_cast<::google::protobuf::uint8>(tag) != 42) goto handle_unusual; + do { + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + ctx->extra_parse_data().SetFieldName("flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.command"); + object = msg->add_command(); + if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) { + parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8; + goto string_till_end; + } + GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx)); + ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx); + ptr += size; + if (ptr >= end) break; + } while ((::google::protobuf::io::UnalignedLoad<::google::protobuf::uint64>(ptr) & 255) == 42 && (ptr += 1)); + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +string_till_end: + static_cast<::std::string*>(object)->clear(); + static_cast<::std::string*>(object)->reserve(size); + goto len_delim_till_end; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool DistributedMPITrainingReplicaSpec::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 replicas = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (8 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &replicas_))); + } else { + goto handle_unusual; + } + break; + } + + // string image = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_image())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->image().data(), static_cast(this->image().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.image")); + } else { + goto handle_unusual; + } + break; + } + + // .flyteidl.core.Resources resources = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == (26 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_resources())); + } else { + goto handle_unusual; + } + break; + } + + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == (32 & 0xFF)) { + int value = 0; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_restart_policy(static_cast< ::flyteidl::plugins::kubeflow::RestartPolicy >(value)); + } else { + goto handle_unusual; + } + break; + } + + // repeated string command = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == (42 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_command())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->command(this->command_size() - 1).data(), + static_cast(this->command(this->command_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.command")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + return true; +failure: + // @@protoc_insertion_point(parse_failure:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void DistributedMPITrainingReplicaSpec::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 replicas = 1; + if (this->replicas() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->replicas(), output); + } + + // string image = 2; + if (this->image().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->image().data(), static_cast(this->image().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.image"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->image(), output); + } + + // .flyteidl.core.Resources resources = 3; + if (this->has_resources()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, HasBitSetters::resources(this), output); + } + + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + if (this->restart_policy() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 4, this->restart_policy(), output); + } + + // repeated string command = 5; + for (int i = 0, n = this->command_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->command(i).data(), static_cast(this->command(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.command"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 5, this->command(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) +} + +::google::protobuf::uint8* DistributedMPITrainingReplicaSpec::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 replicas = 1; + if (this->replicas() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->replicas(), target); + } + + // string image = 2; + if (this->image().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->image().data(), static_cast(this->image().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.image"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->image(), target); + } + + // .flyteidl.core.Resources resources = 3; + if (this->has_resources()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, HasBitSetters::resources(this), target); + } + + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + if (this->restart_policy() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 4, this->restart_policy(), target); + } + + // repeated string command = 5; + for (int i = 0, n = this->command_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->command(i).data(), static_cast(this->command(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.command"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(5, this->command(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + return target; +} + +size_t DistributedMPITrainingReplicaSpec::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated string command = 5; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->command_size()); + for (int i = 0, n = this->command_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->command(i)); + } + + // string image = 2; + if (this->image().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->image()); + } + + // .flyteidl.core.Resources resources = 3; + if (this->has_resources()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *resources_); + } + + // int32 replicas = 1; + if (this->replicas() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->replicas()); + } + + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + if (this->restart_policy() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->restart_policy()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DistributedMPITrainingReplicaSpec::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + GOOGLE_DCHECK_NE(&from, this); + const DistributedMPITrainingReplicaSpec* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + MergeFrom(*source); + } +} + +void DistributedMPITrainingReplicaSpec::MergeFrom(const DistributedMPITrainingReplicaSpec& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + command_.MergeFrom(from.command_); + if (from.image().size() > 0) { + + image_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.image_); + } + if (from.has_resources()) { + mutable_resources()->::flyteidl::core::Resources::MergeFrom(from.resources()); + } + if (from.replicas() != 0) { + set_replicas(from.replicas()); + } + if (from.restart_policy() != 0) { + set_restart_policy(from.restart_policy()); + } +} + +void DistributedMPITrainingReplicaSpec::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DistributedMPITrainingReplicaSpec::CopyFrom(const DistributedMPITrainingReplicaSpec& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DistributedMPITrainingReplicaSpec::IsInitialized() const { + return true; +} + +void DistributedMPITrainingReplicaSpec::Swap(DistributedMPITrainingReplicaSpec* other) { + if (other == this) return; + InternalSwap(other); +} +void DistributedMPITrainingReplicaSpec::InternalSwap(DistributedMPITrainingReplicaSpec* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + command_.InternalSwap(CastToBase(&other->command_)); + image_.Swap(&other->image_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(resources_, other->resources_); + swap(replicas_, other->replicas_); + swap(restart_policy_, other->restart_policy_); +} + +::google::protobuf::Metadata DistributedMPITrainingReplicaSpec::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto); + return ::file_level_metadata_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl +namespace google { +namespace protobuf { +template<> PROTOBUF_NOINLINE ::flyteidl::plugins::kubeflow::DistributedMPITrainingTask* Arena::CreateMaybeMessage< ::flyteidl::plugins::kubeflow::DistributedMPITrainingTask >(Arena* arena) { + return Arena::CreateInternal< ::flyteidl::plugins::kubeflow::DistributedMPITrainingTask >(arena); +} +template<> PROTOBUF_NOINLINE ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* Arena::CreateMaybeMessage< ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec >(Arena* arena) { + return Arena::CreateInternal< ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) +#include diff --git a/gen/pb-cpp/flyteidl/plugins/kubeflow/mpi.pb.h b/gen/pb-cpp/flyteidl/plugins/kubeflow/mpi.pb.h new file mode 100644 index 000000000..46d41ed49 --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/kubeflow/mpi.pb.h @@ -0,0 +1,770 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/kubeflow/mpi.proto + +#ifndef PROTOBUF_INCLUDED_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto +#define PROTOBUF_INCLUDED_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3007000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "flyteidl/core/tasks.pb.h" +#include "flyteidl/plugins/kubeflow/common.pb.h" +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto + +// Internal implementation detail -- do not use these members. +struct TableStruct_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto { + static const ::google::protobuf::internal::ParseTableField entries[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::AuxillaryParseTableField aux[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::ParseTable schema[2] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto(); +namespace flyteidl { +namespace plugins { +namespace kubeflow { +class DistributedMPITrainingReplicaSpec; +class DistributedMPITrainingReplicaSpecDefaultTypeInternal; +extern DistributedMPITrainingReplicaSpecDefaultTypeInternal _DistributedMPITrainingReplicaSpec_default_instance_; +class DistributedMPITrainingTask; +class DistributedMPITrainingTaskDefaultTypeInternal; +extern DistributedMPITrainingTaskDefaultTypeInternal _DistributedMPITrainingTask_default_instance_; +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl +namespace google { +namespace protobuf { +template<> ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* Arena::CreateMaybeMessage<::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec>(Arena*); +template<> ::flyteidl::plugins::kubeflow::DistributedMPITrainingTask* Arena::CreateMaybeMessage<::flyteidl::plugins::kubeflow::DistributedMPITrainingTask>(Arena*); +} // namespace protobuf +} // namespace google +namespace flyteidl { +namespace plugins { +namespace kubeflow { + +// =================================================================== + +class DistributedMPITrainingTask final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) */ { + public: + DistributedMPITrainingTask(); + virtual ~DistributedMPITrainingTask(); + + DistributedMPITrainingTask(const DistributedMPITrainingTask& from); + + inline DistributedMPITrainingTask& operator=(const DistributedMPITrainingTask& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DistributedMPITrainingTask(DistributedMPITrainingTask&& from) noexcept + : DistributedMPITrainingTask() { + *this = ::std::move(from); + } + + inline DistributedMPITrainingTask& operator=(DistributedMPITrainingTask&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const DistributedMPITrainingTask& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DistributedMPITrainingTask* internal_default_instance() { + return reinterpret_cast( + &_DistributedMPITrainingTask_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(DistributedMPITrainingTask* other); + friend void swap(DistributedMPITrainingTask& a, DistributedMPITrainingTask& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DistributedMPITrainingTask* New() const final { + return CreateMaybeMessage(nullptr); + } + + DistributedMPITrainingTask* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DistributedMPITrainingTask& from); + void MergeFrom(const DistributedMPITrainingTask& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DistributedMPITrainingTask* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + bool has_worker_replicas() const; + void clear_worker_replicas(); + static const int kWorkerReplicasFieldNumber = 1; + const ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec& worker_replicas() const; + ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* release_worker_replicas(); + ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* mutable_worker_replicas(); + void set_allocated_worker_replicas(::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* worker_replicas); + + // .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + bool has_launcher_replicas() const; + void clear_launcher_replicas(); + static const int kLauncherReplicasFieldNumber = 2; + const ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec& launcher_replicas() const; + ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* release_launcher_replicas(); + ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* mutable_launcher_replicas(); + void set_allocated_launcher_replicas(::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* launcher_replicas); + + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + bool has_run_policy() const; + void clear_run_policy(); + static const int kRunPolicyFieldNumber = 3; + const ::flyteidl::plugins::kubeflow::RunPolicy& run_policy() const; + ::flyteidl::plugins::kubeflow::RunPolicy* release_run_policy(); + ::flyteidl::plugins::kubeflow::RunPolicy* mutable_run_policy(); + void set_allocated_run_policy(::flyteidl::plugins::kubeflow::RunPolicy* run_policy); + + // int32 slots = 4; + void clear_slots(); + static const int kSlotsFieldNumber = 4; + ::google::protobuf::int32 slots() const; + void set_slots(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* worker_replicas_; + ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* launcher_replicas_; + ::flyteidl::plugins::kubeflow::RunPolicy* run_policy_; + ::google::protobuf::int32 slots_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto; +}; +// ------------------------------------------------------------------- + +class DistributedMPITrainingReplicaSpec final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) */ { + public: + DistributedMPITrainingReplicaSpec(); + virtual ~DistributedMPITrainingReplicaSpec(); + + DistributedMPITrainingReplicaSpec(const DistributedMPITrainingReplicaSpec& from); + + inline DistributedMPITrainingReplicaSpec& operator=(const DistributedMPITrainingReplicaSpec& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DistributedMPITrainingReplicaSpec(DistributedMPITrainingReplicaSpec&& from) noexcept + : DistributedMPITrainingReplicaSpec() { + *this = ::std::move(from); + } + + inline DistributedMPITrainingReplicaSpec& operator=(DistributedMPITrainingReplicaSpec&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const DistributedMPITrainingReplicaSpec& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DistributedMPITrainingReplicaSpec* internal_default_instance() { + return reinterpret_cast( + &_DistributedMPITrainingReplicaSpec_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(DistributedMPITrainingReplicaSpec* other); + friend void swap(DistributedMPITrainingReplicaSpec& a, DistributedMPITrainingReplicaSpec& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DistributedMPITrainingReplicaSpec* New() const final { + return CreateMaybeMessage(nullptr); + } + + DistributedMPITrainingReplicaSpec* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DistributedMPITrainingReplicaSpec& from); + void MergeFrom(const DistributedMPITrainingReplicaSpec& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DistributedMPITrainingReplicaSpec* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated string command = 5; + int command_size() const; + void clear_command(); + static const int kCommandFieldNumber = 5; + const ::std::string& command(int index) const; + ::std::string* mutable_command(int index); + void set_command(int index, const ::std::string& value); + #if LANG_CXX11 + void set_command(int index, ::std::string&& value); + #endif + void set_command(int index, const char* value); + void set_command(int index, const char* value, size_t size); + ::std::string* add_command(); + void add_command(const ::std::string& value); + #if LANG_CXX11 + void add_command(::std::string&& value); + #endif + void add_command(const char* value); + void add_command(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField<::std::string>& command() const; + ::google::protobuf::RepeatedPtrField<::std::string>* mutable_command(); + + // string image = 2; + void clear_image(); + static const int kImageFieldNumber = 2; + const ::std::string& image() const; + void set_image(const ::std::string& value); + #if LANG_CXX11 + void set_image(::std::string&& value); + #endif + void set_image(const char* value); + void set_image(const char* value, size_t size); + ::std::string* mutable_image(); + ::std::string* release_image(); + void set_allocated_image(::std::string* image); + + // .flyteidl.core.Resources resources = 3; + bool has_resources() const; + void clear_resources(); + static const int kResourcesFieldNumber = 3; + const ::flyteidl::core::Resources& resources() const; + ::flyteidl::core::Resources* release_resources(); + ::flyteidl::core::Resources* mutable_resources(); + void set_allocated_resources(::flyteidl::core::Resources* resources); + + // int32 replicas = 1; + void clear_replicas(); + static const int kReplicasFieldNumber = 1; + ::google::protobuf::int32 replicas() const; + void set_replicas(::google::protobuf::int32 value); + + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + void clear_restart_policy(); + static const int kRestartPolicyFieldNumber = 4; + ::flyteidl::plugins::kubeflow::RestartPolicy restart_policy() const; + void set_restart_policy(::flyteidl::plugins::kubeflow::RestartPolicy value); + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField<::std::string> command_; + ::google::protobuf::internal::ArenaStringPtr image_; + ::flyteidl::core::Resources* resources_; + ::google::protobuf::int32 replicas_; + int restart_policy_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// DistributedMPITrainingTask + +// .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; +inline bool DistributedMPITrainingTask::has_worker_replicas() const { + return this != internal_default_instance() && worker_replicas_ != nullptr; +} +inline void DistributedMPITrainingTask::clear_worker_replicas() { + if (GetArenaNoVirtual() == nullptr && worker_replicas_ != nullptr) { + delete worker_replicas_; + } + worker_replicas_ = nullptr; +} +inline const ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec& DistributedMPITrainingTask::worker_replicas() const { + const ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* p = worker_replicas_; + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedMPITrainingTask.worker_replicas) + return p != nullptr ? *p : *reinterpret_cast( + &::flyteidl::plugins::kubeflow::_DistributedMPITrainingReplicaSpec_default_instance_); +} +inline ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* DistributedMPITrainingTask::release_worker_replicas() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.DistributedMPITrainingTask.worker_replicas) + + ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* temp = worker_replicas_; + worker_replicas_ = nullptr; + return temp; +} +inline ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* DistributedMPITrainingTask::mutable_worker_replicas() { + + if (worker_replicas_ == nullptr) { + auto* p = CreateMaybeMessage<::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec>(GetArenaNoVirtual()); + worker_replicas_ = p; + } + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedMPITrainingTask.worker_replicas) + return worker_replicas_; +} +inline void DistributedMPITrainingTask::set_allocated_worker_replicas(::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* worker_replicas) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete worker_replicas_; + } + if (worker_replicas) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + worker_replicas = ::google::protobuf::internal::GetOwnedMessage( + message_arena, worker_replicas, submessage_arena); + } + + } else { + + } + worker_replicas_ = worker_replicas; + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.DistributedMPITrainingTask.worker_replicas) +} + +// .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; +inline bool DistributedMPITrainingTask::has_launcher_replicas() const { + return this != internal_default_instance() && launcher_replicas_ != nullptr; +} +inline void DistributedMPITrainingTask::clear_launcher_replicas() { + if (GetArenaNoVirtual() == nullptr && launcher_replicas_ != nullptr) { + delete launcher_replicas_; + } + launcher_replicas_ = nullptr; +} +inline const ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec& DistributedMPITrainingTask::launcher_replicas() const { + const ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* p = launcher_replicas_; + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedMPITrainingTask.launcher_replicas) + return p != nullptr ? *p : *reinterpret_cast( + &::flyteidl::plugins::kubeflow::_DistributedMPITrainingReplicaSpec_default_instance_); +} +inline ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* DistributedMPITrainingTask::release_launcher_replicas() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.DistributedMPITrainingTask.launcher_replicas) + + ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* temp = launcher_replicas_; + launcher_replicas_ = nullptr; + return temp; +} +inline ::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* DistributedMPITrainingTask::mutable_launcher_replicas() { + + if (launcher_replicas_ == nullptr) { + auto* p = CreateMaybeMessage<::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec>(GetArenaNoVirtual()); + launcher_replicas_ = p; + } + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedMPITrainingTask.launcher_replicas) + return launcher_replicas_; +} +inline void DistributedMPITrainingTask::set_allocated_launcher_replicas(::flyteidl::plugins::kubeflow::DistributedMPITrainingReplicaSpec* launcher_replicas) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete launcher_replicas_; + } + if (launcher_replicas) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + launcher_replicas = ::google::protobuf::internal::GetOwnedMessage( + message_arena, launcher_replicas, submessage_arena); + } + + } else { + + } + launcher_replicas_ = launcher_replicas; + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.DistributedMPITrainingTask.launcher_replicas) +} + +// .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; +inline bool DistributedMPITrainingTask::has_run_policy() const { + return this != internal_default_instance() && run_policy_ != nullptr; +} +inline const ::flyteidl::plugins::kubeflow::RunPolicy& DistributedMPITrainingTask::run_policy() const { + const ::flyteidl::plugins::kubeflow::RunPolicy* p = run_policy_; + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedMPITrainingTask.run_policy) + return p != nullptr ? *p : *reinterpret_cast( + &::flyteidl::plugins::kubeflow::_RunPolicy_default_instance_); +} +inline ::flyteidl::plugins::kubeflow::RunPolicy* DistributedMPITrainingTask::release_run_policy() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.DistributedMPITrainingTask.run_policy) + + ::flyteidl::plugins::kubeflow::RunPolicy* temp = run_policy_; + run_policy_ = nullptr; + return temp; +} +inline ::flyteidl::plugins::kubeflow::RunPolicy* DistributedMPITrainingTask::mutable_run_policy() { + + if (run_policy_ == nullptr) { + auto* p = CreateMaybeMessage<::flyteidl::plugins::kubeflow::RunPolicy>(GetArenaNoVirtual()); + run_policy_ = p; + } + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedMPITrainingTask.run_policy) + return run_policy_; +} +inline void DistributedMPITrainingTask::set_allocated_run_policy(::flyteidl::plugins::kubeflow::RunPolicy* run_policy) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(run_policy_); + } + if (run_policy) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + run_policy = ::google::protobuf::internal::GetOwnedMessage( + message_arena, run_policy, submessage_arena); + } + + } else { + + } + run_policy_ = run_policy; + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.DistributedMPITrainingTask.run_policy) +} + +// int32 slots = 4; +inline void DistributedMPITrainingTask::clear_slots() { + slots_ = 0; +} +inline ::google::protobuf::int32 DistributedMPITrainingTask::slots() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedMPITrainingTask.slots) + return slots_; +} +inline void DistributedMPITrainingTask::set_slots(::google::protobuf::int32 value) { + + slots_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.DistributedMPITrainingTask.slots) +} + +// ------------------------------------------------------------------- + +// DistributedMPITrainingReplicaSpec + +// int32 replicas = 1; +inline void DistributedMPITrainingReplicaSpec::clear_replicas() { + replicas_ = 0; +} +inline ::google::protobuf::int32 DistributedMPITrainingReplicaSpec::replicas() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.replicas) + return replicas_; +} +inline void DistributedMPITrainingReplicaSpec::set_replicas(::google::protobuf::int32 value) { + + replicas_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.replicas) +} + +// string image = 2; +inline void DistributedMPITrainingReplicaSpec::clear_image() { + image_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& DistributedMPITrainingReplicaSpec::image() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.image) + return image_.GetNoArena(); +} +inline void DistributedMPITrainingReplicaSpec::set_image(const ::std::string& value) { + + image_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.image) +} +#if LANG_CXX11 +inline void DistributedMPITrainingReplicaSpec::set_image(::std::string&& value) { + + image_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.image) +} +#endif +inline void DistributedMPITrainingReplicaSpec::set_image(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + image_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.image) +} +inline void DistributedMPITrainingReplicaSpec::set_image(const char* value, size_t size) { + + image_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.image) +} +inline ::std::string* DistributedMPITrainingReplicaSpec::mutable_image() { + + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.image) + return image_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DistributedMPITrainingReplicaSpec::release_image() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.image) + + return image_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DistributedMPITrainingReplicaSpec::set_allocated_image(::std::string* image) { + if (image != nullptr) { + + } else { + + } + image_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), image); + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.image) +} + +// .flyteidl.core.Resources resources = 3; +inline bool DistributedMPITrainingReplicaSpec::has_resources() const { + return this != internal_default_instance() && resources_ != nullptr; +} +inline const ::flyteidl::core::Resources& DistributedMPITrainingReplicaSpec::resources() const { + const ::flyteidl::core::Resources* p = resources_; + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.resources) + return p != nullptr ? *p : *reinterpret_cast( + &::flyteidl::core::_Resources_default_instance_); +} +inline ::flyteidl::core::Resources* DistributedMPITrainingReplicaSpec::release_resources() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.resources) + + ::flyteidl::core::Resources* temp = resources_; + resources_ = nullptr; + return temp; +} +inline ::flyteidl::core::Resources* DistributedMPITrainingReplicaSpec::mutable_resources() { + + if (resources_ == nullptr) { + auto* p = CreateMaybeMessage<::flyteidl::core::Resources>(GetArenaNoVirtual()); + resources_ = p; + } + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.resources) + return resources_; +} +inline void DistributedMPITrainingReplicaSpec::set_allocated_resources(::flyteidl::core::Resources* resources) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(resources_); + } + if (resources) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + resources = ::google::protobuf::internal::GetOwnedMessage( + message_arena, resources, submessage_arena); + } + + } else { + + } + resources_ = resources; + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.resources) +} + +// .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; +inline void DistributedMPITrainingReplicaSpec::clear_restart_policy() { + restart_policy_ = 0; +} +inline ::flyteidl::plugins::kubeflow::RestartPolicy DistributedMPITrainingReplicaSpec::restart_policy() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.restart_policy) + return static_cast< ::flyteidl::plugins::kubeflow::RestartPolicy >(restart_policy_); +} +inline void DistributedMPITrainingReplicaSpec::set_restart_policy(::flyteidl::plugins::kubeflow::RestartPolicy value) { + + restart_policy_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.restart_policy) +} + +// repeated string command = 5; +inline int DistributedMPITrainingReplicaSpec::command_size() const { + return command_.size(); +} +inline void DistributedMPITrainingReplicaSpec::clear_command() { + command_.Clear(); +} +inline const ::std::string& DistributedMPITrainingReplicaSpec::command(int index) const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.command) + return command_.Get(index); +} +inline ::std::string* DistributedMPITrainingReplicaSpec::mutable_command(int index) { + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.command) + return command_.Mutable(index); +} +inline void DistributedMPITrainingReplicaSpec::set_command(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.command) + command_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void DistributedMPITrainingReplicaSpec::set_command(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.command) + command_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void DistributedMPITrainingReplicaSpec::set_command(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + command_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.command) +} +inline void DistributedMPITrainingReplicaSpec::set_command(int index, const char* value, size_t size) { + command_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.command) +} +inline ::std::string* DistributedMPITrainingReplicaSpec::add_command() { + // @@protoc_insertion_point(field_add_mutable:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.command) + return command_.Add(); +} +inline void DistributedMPITrainingReplicaSpec::add_command(const ::std::string& value) { + command_.Add()->assign(value); + // @@protoc_insertion_point(field_add:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.command) +} +#if LANG_CXX11 +inline void DistributedMPITrainingReplicaSpec::add_command(::std::string&& value) { + command_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.command) +} +#endif +inline void DistributedMPITrainingReplicaSpec::add_command(const char* value) { + GOOGLE_DCHECK(value != nullptr); + command_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.command) +} +inline void DistributedMPITrainingReplicaSpec::add_command(const char* value, size_t size) { + command_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.command) +} +inline const ::google::protobuf::RepeatedPtrField<::std::string>& +DistributedMPITrainingReplicaSpec::command() const { + // @@protoc_insertion_point(field_list:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.command) + return command_; +} +inline ::google::protobuf::RepeatedPtrField<::std::string>* +DistributedMPITrainingReplicaSpec::mutable_command() { + // @@protoc_insertion_point(field_mutable_list:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec.command) + return &command_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl + +// @@protoc_insertion_point(global_scope) + +#include +#endif // PROTOBUF_INCLUDED_flyteidl_2fplugins_2fkubeflow_2fmpi_2eproto diff --git a/gen/pb-cpp/flyteidl/plugins/kubeflow/pytorch.grpc.pb.cc b/gen/pb-cpp/flyteidl/plugins/kubeflow/pytorch.grpc.pb.cc new file mode 100644 index 000000000..af2f89e97 --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/kubeflow/pytorch.grpc.pb.cc @@ -0,0 +1,26 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: flyteidl/plugins/kubeflow/pytorch.proto + +#include "flyteidl/plugins/kubeflow/pytorch.pb.h" +#include "flyteidl/plugins/kubeflow/pytorch.grpc.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +namespace flyteidl { +namespace plugins { +namespace kubeflow { + +} // namespace flyteidl +} // namespace plugins +} // namespace kubeflow + diff --git a/gen/pb-cpp/flyteidl/plugins/kubeflow/pytorch.grpc.pb.h b/gen/pb-cpp/flyteidl/plugins/kubeflow/pytorch.grpc.pb.h new file mode 100644 index 000000000..45c83cf06 --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/kubeflow/pytorch.grpc.pb.h @@ -0,0 +1,49 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: flyteidl/plugins/kubeflow/pytorch.proto +#ifndef GRPC_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto__INCLUDED +#define GRPC_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto__INCLUDED + +#include "flyteidl/plugins/kubeflow/pytorch.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace grpc_impl { +class Channel; +class CompletionQueue; +class ServerCompletionQueue; +} // namespace grpc_impl + +namespace grpc { +namespace experimental { +template +class MessageAllocator; +} // namespace experimental +} // namespace grpc_impl + +namespace grpc { +class ServerContext; +} // namespace grpc + +namespace flyteidl { +namespace plugins { +namespace kubeflow { + +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl + + +#endif // GRPC_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto__INCLUDED diff --git a/gen/pb-cpp/flyteidl/plugins/kubeflow/pytorch.pb.cc b/gen/pb-cpp/flyteidl/plugins/kubeflow/pytorch.pb.cc new file mode 100644 index 000000000..3c4fd38ab --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/kubeflow/pytorch.pb.cc @@ -0,0 +1,1641 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/kubeflow/pytorch.proto + +#include "flyteidl/plugins/kubeflow/pytorch.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fcore_2ftasks_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Resources_flyteidl_2fcore_2ftasks_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_RunPolicy_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ElasticConfig_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_DistributedPyTorchTrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto; +namespace flyteidl { +namespace plugins { +namespace kubeflow { +class ElasticConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _ElasticConfig_default_instance_; +class DistributedPyTorchTrainingTaskDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _DistributedPyTorchTrainingTask_default_instance_; +class DistributedPyTorchTrainingReplicaSpecDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _DistributedPyTorchTrainingReplicaSpec_default_instance_; +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl +static void InitDefaultsElasticConfig_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::flyteidl::plugins::kubeflow::_ElasticConfig_default_instance_; + new (ptr) ::flyteidl::plugins::kubeflow::ElasticConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::flyteidl::plugins::kubeflow::ElasticConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ElasticConfig_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsElasticConfig_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto}, {}}; + +static void InitDefaultsDistributedPyTorchTrainingTask_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::flyteidl::plugins::kubeflow::_DistributedPyTorchTrainingTask_default_instance_; + new (ptr) ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingTask(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingTask::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_DistributedPyTorchTrainingTask_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsDistributedPyTorchTrainingTask_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto}, { + &scc_info_DistributedPyTorchTrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto.base, + &scc_info_RunPolicy_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto.base, + &scc_info_ElasticConfig_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto.base,}}; + +static void InitDefaultsDistributedPyTorchTrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::flyteidl::plugins::kubeflow::_DistributedPyTorchTrainingReplicaSpec_default_instance_; + new (ptr) ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_DistributedPyTorchTrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsDistributedPyTorchTrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto}, { + &scc_info_Resources_flyteidl_2fcore_2ftasks_2eproto.base,}}; + +void InitDefaults_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto() { + ::google::protobuf::internal::InitSCC(&scc_info_ElasticConfig_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_DistributedPyTorchTrainingTask_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_DistributedPyTorchTrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto.base); +} + +::google::protobuf::Metadata file_level_metadata_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto[3]; +constexpr ::google::protobuf::EnumDescriptor const** file_level_enum_descriptors_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto = nullptr; +constexpr ::google::protobuf::ServiceDescriptor const** file_level_service_descriptors_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto = nullptr; + +const ::google::protobuf::uint32 TableStruct_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::ElasticConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::ElasticConfig, rdzv_backend_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::ElasticConfig, min_replicas_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::ElasticConfig, max_replicas_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::ElasticConfig, nproc_per_node_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::ElasticConfig, max_restarts_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingTask, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingTask, worker_replicas_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingTask, master_replicas_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingTask, run_policy_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingTask, elastic_config_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec, replicas_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec, image_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec, resources_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec, restart_policy_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::flyteidl::plugins::kubeflow::ElasticConfig)}, + { 10, -1, sizeof(::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingTask)}, + { 19, -1, sizeof(::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::flyteidl::plugins::kubeflow::_ElasticConfig_default_instance_), + reinterpret_cast(&::flyteidl::plugins::kubeflow::_DistributedPyTorchTrainingTask_default_instance_), + reinterpret_cast(&::flyteidl::plugins::kubeflow::_DistributedPyTorchTrainingReplicaSpec_default_instance_), +}; + +::google::protobuf::internal::AssignDescriptorsTable assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto = { + {}, AddDescriptors_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto, "flyteidl/plugins/kubeflow/pytorch.proto", schemas, + file_default_instances, TableStruct_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto::offsets, + file_level_metadata_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto, 3, file_level_enum_descriptors_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto, file_level_service_descriptors_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto, +}; + +const char descriptor_table_protodef_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto[] = + "\n\'flyteidl/plugins/kubeflow/pytorch.prot" + "o\022\031flyteidl.plugins.kubeflow\032\031flyteidl/c" + "ore/tasks.proto\032&flyteidl/plugins/kubefl" + "ow/common.proto\"\177\n\rElasticConfig\022\024\n\014rdzv" + "_backend\030\001 \001(\t\022\024\n\014min_replicas\030\002 \001(\005\022\024\n\014" + "max_replicas\030\003 \001(\005\022\026\n\016nproc_per_node\030\004 \001" + "(\005\022\024\n\014max_restarts\030\005 \001(\005\"\322\002\n\036Distributed" + "PyTorchTrainingTask\022Y\n\017worker_replicas\030\001" + " \001(\0132@.flyteidl.plugins.kubeflow.Distrib" + "utedPyTorchTrainingReplicaSpec\022Y\n\017master" + "_replicas\030\002 \001(\0132@.flyteidl.plugins.kubef" + "low.DistributedPyTorchTrainingReplicaSpe" + "c\0228\n\nrun_policy\030\003 \001(\0132$.flyteidl.plugins" + ".kubeflow.RunPolicy\022@\n\016elastic_config\030\004 " + "\001(\0132(.flyteidl.plugins.kubeflow.ElasticC" + "onfig\"\267\001\n%DistributedPyTorchTrainingRepl" + "icaSpec\022\020\n\010replicas\030\001 \001(\005\022\r\n\005image\030\002 \001(\t" + "\022+\n\tresources\030\003 \001(\0132\030.flyteidl.core.Reso" + "urces\022@\n\016restart_policy\030\004 \001(\0162(.flyteidl" + ".plugins.kubeflow.RestartPolicyB9Z7githu" + "b.com/flyteorg/flyteidl/gen/pb-go/flytei" + "dl/pluginsb\006proto3" + ; +::google::protobuf::internal::DescriptorTable descriptor_table_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto = { + false, InitDefaults_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto, + descriptor_table_protodef_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto, + "flyteidl/plugins/kubeflow/pytorch.proto", &assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto, 858, +}; + +void AddDescriptors_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto() { + static constexpr ::google::protobuf::internal::InitFunc deps[2] = + { + ::AddDescriptors_flyteidl_2fcore_2ftasks_2eproto, + ::AddDescriptors_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto, + }; + ::google::protobuf::internal::AddDescriptors(&descriptor_table_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto, deps, 2); +} + +// Force running AddDescriptors() at dynamic initialization time. +static bool dynamic_init_dummy_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto = []() { AddDescriptors_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto(); return true; }(); +namespace flyteidl { +namespace plugins { +namespace kubeflow { + +// =================================================================== + +void ElasticConfig::InitAsDefaultInstance() { +} +class ElasticConfig::HasBitSetters { + public: +}; + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ElasticConfig::kRdzvBackendFieldNumber; +const int ElasticConfig::kMinReplicasFieldNumber; +const int ElasticConfig::kMaxReplicasFieldNumber; +const int ElasticConfig::kNprocPerNodeFieldNumber; +const int ElasticConfig::kMaxRestartsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ElasticConfig::ElasticConfig() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:flyteidl.plugins.kubeflow.ElasticConfig) +} +ElasticConfig::ElasticConfig(const ElasticConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + rdzv_backend_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.rdzv_backend().size() > 0) { + rdzv_backend_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.rdzv_backend_); + } + ::memcpy(&min_replicas_, &from.min_replicas_, + static_cast(reinterpret_cast(&max_restarts_) - + reinterpret_cast(&min_replicas_)) + sizeof(max_restarts_)); + // @@protoc_insertion_point(copy_constructor:flyteidl.plugins.kubeflow.ElasticConfig) +} + +void ElasticConfig::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_ElasticConfig_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto.base); + rdzv_backend_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&min_replicas_, 0, static_cast( + reinterpret_cast(&max_restarts_) - + reinterpret_cast(&min_replicas_)) + sizeof(max_restarts_)); +} + +ElasticConfig::~ElasticConfig() { + // @@protoc_insertion_point(destructor:flyteidl.plugins.kubeflow.ElasticConfig) + SharedDtor(); +} + +void ElasticConfig::SharedDtor() { + rdzv_backend_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ElasticConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ElasticConfig& ElasticConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_ElasticConfig_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto.base); + return *internal_default_instance(); +} + + +void ElasticConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:flyteidl.plugins.kubeflow.ElasticConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + rdzv_backend_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&min_replicas_, 0, static_cast( + reinterpret_cast(&max_restarts_) - + reinterpret_cast(&min_replicas_)) + sizeof(max_restarts_)); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* ElasticConfig::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // string rdzv_backend = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + ctx->extra_parse_data().SetFieldName("flyteidl.plugins.kubeflow.ElasticConfig.rdzv_backend"); + object = msg->mutable_rdzv_backend(); + if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) { + parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8; + goto string_till_end; + } + GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx)); + ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx); + ptr += size; + break; + } + // int32 min_replicas = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) != 16) goto handle_unusual; + msg->set_min_replicas(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + // int32 max_replicas = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) != 24) goto handle_unusual; + msg->set_max_replicas(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + // int32 nproc_per_node = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) != 32) goto handle_unusual; + msg->set_nproc_per_node(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + // int32 max_restarts = 5; + case 5: { + if (static_cast<::google::protobuf::uint8>(tag) != 40) goto handle_unusual; + msg->set_max_restarts(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +string_till_end: + static_cast<::std::string*>(object)->clear(); + static_cast<::std::string*>(object)->reserve(size); + goto len_delim_till_end; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool ElasticConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:flyteidl.plugins.kubeflow.ElasticConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string rdzv_backend = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_rdzv_backend())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->rdzv_backend().data(), static_cast(this->rdzv_backend().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "flyteidl.plugins.kubeflow.ElasticConfig.rdzv_backend")); + } else { + goto handle_unusual; + } + break; + } + + // int32 min_replicas = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (16 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &min_replicas_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 max_replicas = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == (24 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &max_replicas_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 nproc_per_node = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == (32 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &nproc_per_node_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 max_restarts = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == (40 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &max_restarts_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:flyteidl.plugins.kubeflow.ElasticConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:flyteidl.plugins.kubeflow.ElasticConfig) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void ElasticConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:flyteidl.plugins.kubeflow.ElasticConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string rdzv_backend = 1; + if (this->rdzv_backend().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->rdzv_backend().data(), static_cast(this->rdzv_backend().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "flyteidl.plugins.kubeflow.ElasticConfig.rdzv_backend"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->rdzv_backend(), output); + } + + // int32 min_replicas = 2; + if (this->min_replicas() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->min_replicas(), output); + } + + // int32 max_replicas = 3; + if (this->max_replicas() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->max_replicas(), output); + } + + // int32 nproc_per_node = 4; + if (this->nproc_per_node() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->nproc_per_node(), output); + } + + // int32 max_restarts = 5; + if (this->max_restarts() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->max_restarts(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:flyteidl.plugins.kubeflow.ElasticConfig) +} + +::google::protobuf::uint8* ElasticConfig::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:flyteidl.plugins.kubeflow.ElasticConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string rdzv_backend = 1; + if (this->rdzv_backend().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->rdzv_backend().data(), static_cast(this->rdzv_backend().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "flyteidl.plugins.kubeflow.ElasticConfig.rdzv_backend"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->rdzv_backend(), target); + } + + // int32 min_replicas = 2; + if (this->min_replicas() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->min_replicas(), target); + } + + // int32 max_replicas = 3; + if (this->max_replicas() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->max_replicas(), target); + } + + // int32 nproc_per_node = 4; + if (this->nproc_per_node() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->nproc_per_node(), target); + } + + // int32 max_restarts = 5; + if (this->max_restarts() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->max_restarts(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:flyteidl.plugins.kubeflow.ElasticConfig) + return target; +} + +size_t ElasticConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:flyteidl.plugins.kubeflow.ElasticConfig) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string rdzv_backend = 1; + if (this->rdzv_backend().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->rdzv_backend()); + } + + // int32 min_replicas = 2; + if (this->min_replicas() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->min_replicas()); + } + + // int32 max_replicas = 3; + if (this->max_replicas() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->max_replicas()); + } + + // int32 nproc_per_node = 4; + if (this->nproc_per_node() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->nproc_per_node()); + } + + // int32 max_restarts = 5; + if (this->max_restarts() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->max_restarts()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ElasticConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:flyteidl.plugins.kubeflow.ElasticConfig) + GOOGLE_DCHECK_NE(&from, this); + const ElasticConfig* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:flyteidl.plugins.kubeflow.ElasticConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:flyteidl.plugins.kubeflow.ElasticConfig) + MergeFrom(*source); + } +} + +void ElasticConfig::MergeFrom(const ElasticConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:flyteidl.plugins.kubeflow.ElasticConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.rdzv_backend().size() > 0) { + + rdzv_backend_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.rdzv_backend_); + } + if (from.min_replicas() != 0) { + set_min_replicas(from.min_replicas()); + } + if (from.max_replicas() != 0) { + set_max_replicas(from.max_replicas()); + } + if (from.nproc_per_node() != 0) { + set_nproc_per_node(from.nproc_per_node()); + } + if (from.max_restarts() != 0) { + set_max_restarts(from.max_restarts()); + } +} + +void ElasticConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:flyteidl.plugins.kubeflow.ElasticConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ElasticConfig::CopyFrom(const ElasticConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:flyteidl.plugins.kubeflow.ElasticConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ElasticConfig::IsInitialized() const { + return true; +} + +void ElasticConfig::Swap(ElasticConfig* other) { + if (other == this) return; + InternalSwap(other); +} +void ElasticConfig::InternalSwap(ElasticConfig* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + rdzv_backend_.Swap(&other->rdzv_backend_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(min_replicas_, other->min_replicas_); + swap(max_replicas_, other->max_replicas_); + swap(nproc_per_node_, other->nproc_per_node_); + swap(max_restarts_, other->max_restarts_); +} + +::google::protobuf::Metadata ElasticConfig::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto); + return ::file_level_metadata_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void DistributedPyTorchTrainingTask::InitAsDefaultInstance() { + ::flyteidl::plugins::kubeflow::_DistributedPyTorchTrainingTask_default_instance_._instance.get_mutable()->worker_replicas_ = const_cast< ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec*>( + ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec::internal_default_instance()); + ::flyteidl::plugins::kubeflow::_DistributedPyTorchTrainingTask_default_instance_._instance.get_mutable()->master_replicas_ = const_cast< ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec*>( + ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec::internal_default_instance()); + ::flyteidl::plugins::kubeflow::_DistributedPyTorchTrainingTask_default_instance_._instance.get_mutable()->run_policy_ = const_cast< ::flyteidl::plugins::kubeflow::RunPolicy*>( + ::flyteidl::plugins::kubeflow::RunPolicy::internal_default_instance()); + ::flyteidl::plugins::kubeflow::_DistributedPyTorchTrainingTask_default_instance_._instance.get_mutable()->elastic_config_ = const_cast< ::flyteidl::plugins::kubeflow::ElasticConfig*>( + ::flyteidl::plugins::kubeflow::ElasticConfig::internal_default_instance()); +} +class DistributedPyTorchTrainingTask::HasBitSetters { + public: + static const ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec& worker_replicas(const DistributedPyTorchTrainingTask* msg); + static const ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec& master_replicas(const DistributedPyTorchTrainingTask* msg); + static const ::flyteidl::plugins::kubeflow::RunPolicy& run_policy(const DistributedPyTorchTrainingTask* msg); + static const ::flyteidl::plugins::kubeflow::ElasticConfig& elastic_config(const DistributedPyTorchTrainingTask* msg); +}; + +const ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec& +DistributedPyTorchTrainingTask::HasBitSetters::worker_replicas(const DistributedPyTorchTrainingTask* msg) { + return *msg->worker_replicas_; +} +const ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec& +DistributedPyTorchTrainingTask::HasBitSetters::master_replicas(const DistributedPyTorchTrainingTask* msg) { + return *msg->master_replicas_; +} +const ::flyteidl::plugins::kubeflow::RunPolicy& +DistributedPyTorchTrainingTask::HasBitSetters::run_policy(const DistributedPyTorchTrainingTask* msg) { + return *msg->run_policy_; +} +const ::flyteidl::plugins::kubeflow::ElasticConfig& +DistributedPyTorchTrainingTask::HasBitSetters::elastic_config(const DistributedPyTorchTrainingTask* msg) { + return *msg->elastic_config_; +} +void DistributedPyTorchTrainingTask::clear_run_policy() { + if (GetArenaNoVirtual() == nullptr && run_policy_ != nullptr) { + delete run_policy_; + } + run_policy_ = nullptr; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DistributedPyTorchTrainingTask::kWorkerReplicasFieldNumber; +const int DistributedPyTorchTrainingTask::kMasterReplicasFieldNumber; +const int DistributedPyTorchTrainingTask::kRunPolicyFieldNumber; +const int DistributedPyTorchTrainingTask::kElasticConfigFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DistributedPyTorchTrainingTask::DistributedPyTorchTrainingTask() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) +} +DistributedPyTorchTrainingTask::DistributedPyTorchTrainingTask(const DistributedPyTorchTrainingTask& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_worker_replicas()) { + worker_replicas_ = new ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec(*from.worker_replicas_); + } else { + worker_replicas_ = nullptr; + } + if (from.has_master_replicas()) { + master_replicas_ = new ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec(*from.master_replicas_); + } else { + master_replicas_ = nullptr; + } + if (from.has_run_policy()) { + run_policy_ = new ::flyteidl::plugins::kubeflow::RunPolicy(*from.run_policy_); + } else { + run_policy_ = nullptr; + } + if (from.has_elastic_config()) { + elastic_config_ = new ::flyteidl::plugins::kubeflow::ElasticConfig(*from.elastic_config_); + } else { + elastic_config_ = nullptr; + } + // @@protoc_insertion_point(copy_constructor:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) +} + +void DistributedPyTorchTrainingTask::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_DistributedPyTorchTrainingTask_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto.base); + ::memset(&worker_replicas_, 0, static_cast( + reinterpret_cast(&elastic_config_) - + reinterpret_cast(&worker_replicas_)) + sizeof(elastic_config_)); +} + +DistributedPyTorchTrainingTask::~DistributedPyTorchTrainingTask() { + // @@protoc_insertion_point(destructor:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + SharedDtor(); +} + +void DistributedPyTorchTrainingTask::SharedDtor() { + if (this != internal_default_instance()) delete worker_replicas_; + if (this != internal_default_instance()) delete master_replicas_; + if (this != internal_default_instance()) delete run_policy_; + if (this != internal_default_instance()) delete elastic_config_; +} + +void DistributedPyTorchTrainingTask::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const DistributedPyTorchTrainingTask& DistributedPyTorchTrainingTask::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_DistributedPyTorchTrainingTask_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto.base); + return *internal_default_instance(); +} + + +void DistributedPyTorchTrainingTask::Clear() { +// @@protoc_insertion_point(message_clear_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == nullptr && worker_replicas_ != nullptr) { + delete worker_replicas_; + } + worker_replicas_ = nullptr; + if (GetArenaNoVirtual() == nullptr && master_replicas_ != nullptr) { + delete master_replicas_; + } + master_replicas_ = nullptr; + if (GetArenaNoVirtual() == nullptr && run_policy_ != nullptr) { + delete run_policy_; + } + run_policy_ = nullptr; + if (GetArenaNoVirtual() == nullptr && elastic_config_ != nullptr) { + delete elastic_config_; + } + elastic_config_ = nullptr; + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* DistributedPyTorchTrainingTask::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec::_InternalParse; + object = msg->mutable_worker_replicas(); + 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; + } + // .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 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::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec::_InternalParse; + object = msg->mutable_master_replicas(); + 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; + } + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) != 26) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::flyteidl::plugins::kubeflow::RunPolicy::_InternalParse; + object = msg->mutable_run_policy(); + 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; + } + // .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) != 34) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::flyteidl::plugins::kubeflow::ElasticConfig::_InternalParse; + object = msg->mutable_elastic_config(); + 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) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool DistributedPyTorchTrainingTask::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_worker_replicas())); + } else { + goto handle_unusual; + } + break; + } + + // .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_master_replicas())); + } else { + goto handle_unusual; + } + break; + } + + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == (26 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_run_policy())); + } else { + goto handle_unusual; + } + break; + } + + // .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == (34 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_elastic_config())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + return true; +failure: + // @@protoc_insertion_point(parse_failure:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void DistributedPyTorchTrainingTask::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + if (this->has_worker_replicas()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, HasBitSetters::worker_replicas(this), output); + } + + // .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + if (this->has_master_replicas()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, HasBitSetters::master_replicas(this), output); + } + + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + if (this->has_run_policy()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, HasBitSetters::run_policy(this), output); + } + + // .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + if (this->has_elastic_config()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, HasBitSetters::elastic_config(this), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) +} + +::google::protobuf::uint8* DistributedPyTorchTrainingTask::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + if (this->has_worker_replicas()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, HasBitSetters::worker_replicas(this), target); + } + + // .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + if (this->has_master_replicas()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, HasBitSetters::master_replicas(this), target); + } + + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + if (this->has_run_policy()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, HasBitSetters::run_policy(this), target); + } + + // .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + if (this->has_elastic_config()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, HasBitSetters::elastic_config(this), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + return target; +} + +size_t DistributedPyTorchTrainingTask::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + if (this->has_worker_replicas()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *worker_replicas_); + } + + // .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + if (this->has_master_replicas()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *master_replicas_); + } + + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + if (this->has_run_policy()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *run_policy_); + } + + // .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + if (this->has_elastic_config()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *elastic_config_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DistributedPyTorchTrainingTask::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + GOOGLE_DCHECK_NE(&from, this); + const DistributedPyTorchTrainingTask* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + MergeFrom(*source); + } +} + +void DistributedPyTorchTrainingTask::MergeFrom(const DistributedPyTorchTrainingTask& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_worker_replicas()) { + mutable_worker_replicas()->::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec::MergeFrom(from.worker_replicas()); + } + if (from.has_master_replicas()) { + mutable_master_replicas()->::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec::MergeFrom(from.master_replicas()); + } + if (from.has_run_policy()) { + mutable_run_policy()->::flyteidl::plugins::kubeflow::RunPolicy::MergeFrom(from.run_policy()); + } + if (from.has_elastic_config()) { + mutable_elastic_config()->::flyteidl::plugins::kubeflow::ElasticConfig::MergeFrom(from.elastic_config()); + } +} + +void DistributedPyTorchTrainingTask::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DistributedPyTorchTrainingTask::CopyFrom(const DistributedPyTorchTrainingTask& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DistributedPyTorchTrainingTask::IsInitialized() const { + return true; +} + +void DistributedPyTorchTrainingTask::Swap(DistributedPyTorchTrainingTask* other) { + if (other == this) return; + InternalSwap(other); +} +void DistributedPyTorchTrainingTask::InternalSwap(DistributedPyTorchTrainingTask* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(worker_replicas_, other->worker_replicas_); + swap(master_replicas_, other->master_replicas_); + swap(run_policy_, other->run_policy_); + swap(elastic_config_, other->elastic_config_); +} + +::google::protobuf::Metadata DistributedPyTorchTrainingTask::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto); + return ::file_level_metadata_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void DistributedPyTorchTrainingReplicaSpec::InitAsDefaultInstance() { + ::flyteidl::plugins::kubeflow::_DistributedPyTorchTrainingReplicaSpec_default_instance_._instance.get_mutable()->resources_ = const_cast< ::flyteidl::core::Resources*>( + ::flyteidl::core::Resources::internal_default_instance()); +} +class DistributedPyTorchTrainingReplicaSpec::HasBitSetters { + public: + static const ::flyteidl::core::Resources& resources(const DistributedPyTorchTrainingReplicaSpec* msg); +}; + +const ::flyteidl::core::Resources& +DistributedPyTorchTrainingReplicaSpec::HasBitSetters::resources(const DistributedPyTorchTrainingReplicaSpec* msg) { + return *msg->resources_; +} +void DistributedPyTorchTrainingReplicaSpec::clear_resources() { + if (GetArenaNoVirtual() == nullptr && resources_ != nullptr) { + delete resources_; + } + resources_ = nullptr; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DistributedPyTorchTrainingReplicaSpec::kReplicasFieldNumber; +const int DistributedPyTorchTrainingReplicaSpec::kImageFieldNumber; +const int DistributedPyTorchTrainingReplicaSpec::kResourcesFieldNumber; +const int DistributedPyTorchTrainingReplicaSpec::kRestartPolicyFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DistributedPyTorchTrainingReplicaSpec::DistributedPyTorchTrainingReplicaSpec() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) +} +DistributedPyTorchTrainingReplicaSpec::DistributedPyTorchTrainingReplicaSpec(const DistributedPyTorchTrainingReplicaSpec& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + image_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.image().size() > 0) { + image_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.image_); + } + if (from.has_resources()) { + resources_ = new ::flyteidl::core::Resources(*from.resources_); + } else { + resources_ = nullptr; + } + ::memcpy(&replicas_, &from.replicas_, + static_cast(reinterpret_cast(&restart_policy_) - + reinterpret_cast(&replicas_)) + sizeof(restart_policy_)); + // @@protoc_insertion_point(copy_constructor:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) +} + +void DistributedPyTorchTrainingReplicaSpec::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_DistributedPyTorchTrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto.base); + image_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&resources_, 0, static_cast( + reinterpret_cast(&restart_policy_) - + reinterpret_cast(&resources_)) + sizeof(restart_policy_)); +} + +DistributedPyTorchTrainingReplicaSpec::~DistributedPyTorchTrainingReplicaSpec() { + // @@protoc_insertion_point(destructor:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + SharedDtor(); +} + +void DistributedPyTorchTrainingReplicaSpec::SharedDtor() { + image_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete resources_; +} + +void DistributedPyTorchTrainingReplicaSpec::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const DistributedPyTorchTrainingReplicaSpec& DistributedPyTorchTrainingReplicaSpec::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_DistributedPyTorchTrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto.base); + return *internal_default_instance(); +} + + +void DistributedPyTorchTrainingReplicaSpec::Clear() { +// @@protoc_insertion_point(message_clear_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + image_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == nullptr && resources_ != nullptr) { + delete resources_; + } + resources_ = nullptr; + ::memset(&replicas_, 0, static_cast( + reinterpret_cast(&restart_policy_) - + reinterpret_cast(&replicas_)) + sizeof(restart_policy_)); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* DistributedPyTorchTrainingReplicaSpec::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // int32 replicas = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 8) goto handle_unusual; + msg->set_replicas(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + // string image = 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); + ctx->extra_parse_data().SetFieldName("flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.image"); + object = msg->mutable_image(); + if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) { + parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8; + goto string_till_end; + } + GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx)); + ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx); + ptr += size; + break; + } + // .flyteidl.core.Resources resources = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) != 26) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::flyteidl::core::Resources::_InternalParse; + object = msg->mutable_resources(); + 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; + } + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) != 32) goto handle_unusual; + ::google::protobuf::uint64 val = ::google::protobuf::internal::ReadVarint(&ptr); + msg->set_restart_policy(static_cast<::flyteidl::plugins::kubeflow::RestartPolicy>(val)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +string_till_end: + static_cast<::std::string*>(object)->clear(); + static_cast<::std::string*>(object)->reserve(size); + goto len_delim_till_end; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool DistributedPyTorchTrainingReplicaSpec::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 replicas = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (8 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &replicas_))); + } else { + goto handle_unusual; + } + break; + } + + // string image = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_image())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->image().data(), static_cast(this->image().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.image")); + } else { + goto handle_unusual; + } + break; + } + + // .flyteidl.core.Resources resources = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == (26 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_resources())); + } else { + goto handle_unusual; + } + break; + } + + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == (32 & 0xFF)) { + int value = 0; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_restart_policy(static_cast< ::flyteidl::plugins::kubeflow::RestartPolicy >(value)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + return true; +failure: + // @@protoc_insertion_point(parse_failure:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void DistributedPyTorchTrainingReplicaSpec::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 replicas = 1; + if (this->replicas() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->replicas(), output); + } + + // string image = 2; + if (this->image().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->image().data(), static_cast(this->image().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.image"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->image(), output); + } + + // .flyteidl.core.Resources resources = 3; + if (this->has_resources()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, HasBitSetters::resources(this), output); + } + + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + if (this->restart_policy() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 4, this->restart_policy(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) +} + +::google::protobuf::uint8* DistributedPyTorchTrainingReplicaSpec::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 replicas = 1; + if (this->replicas() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->replicas(), target); + } + + // string image = 2; + if (this->image().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->image().data(), static_cast(this->image().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.image"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->image(), target); + } + + // .flyteidl.core.Resources resources = 3; + if (this->has_resources()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, HasBitSetters::resources(this), target); + } + + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + if (this->restart_policy() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 4, this->restart_policy(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + return target; +} + +size_t DistributedPyTorchTrainingReplicaSpec::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string image = 2; + if (this->image().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->image()); + } + + // .flyteidl.core.Resources resources = 3; + if (this->has_resources()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *resources_); + } + + // int32 replicas = 1; + if (this->replicas() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->replicas()); + } + + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + if (this->restart_policy() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->restart_policy()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DistributedPyTorchTrainingReplicaSpec::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + GOOGLE_DCHECK_NE(&from, this); + const DistributedPyTorchTrainingReplicaSpec* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + MergeFrom(*source); + } +} + +void DistributedPyTorchTrainingReplicaSpec::MergeFrom(const DistributedPyTorchTrainingReplicaSpec& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.image().size() > 0) { + + image_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.image_); + } + if (from.has_resources()) { + mutable_resources()->::flyteidl::core::Resources::MergeFrom(from.resources()); + } + if (from.replicas() != 0) { + set_replicas(from.replicas()); + } + if (from.restart_policy() != 0) { + set_restart_policy(from.restart_policy()); + } +} + +void DistributedPyTorchTrainingReplicaSpec::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DistributedPyTorchTrainingReplicaSpec::CopyFrom(const DistributedPyTorchTrainingReplicaSpec& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DistributedPyTorchTrainingReplicaSpec::IsInitialized() const { + return true; +} + +void DistributedPyTorchTrainingReplicaSpec::Swap(DistributedPyTorchTrainingReplicaSpec* other) { + if (other == this) return; + InternalSwap(other); +} +void DistributedPyTorchTrainingReplicaSpec::InternalSwap(DistributedPyTorchTrainingReplicaSpec* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + image_.Swap(&other->image_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(resources_, other->resources_); + swap(replicas_, other->replicas_); + swap(restart_policy_, other->restart_policy_); +} + +::google::protobuf::Metadata DistributedPyTorchTrainingReplicaSpec::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto); + return ::file_level_metadata_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl +namespace google { +namespace protobuf { +template<> PROTOBUF_NOINLINE ::flyteidl::plugins::kubeflow::ElasticConfig* Arena::CreateMaybeMessage< ::flyteidl::plugins::kubeflow::ElasticConfig >(Arena* arena) { + return Arena::CreateInternal< ::flyteidl::plugins::kubeflow::ElasticConfig >(arena); +} +template<> PROTOBUF_NOINLINE ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingTask* Arena::CreateMaybeMessage< ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingTask >(Arena* arena) { + return Arena::CreateInternal< ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingTask >(arena); +} +template<> PROTOBUF_NOINLINE ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* Arena::CreateMaybeMessage< ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec >(Arena* arena) { + return Arena::CreateInternal< ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) +#include diff --git a/gen/pb-cpp/flyteidl/plugins/kubeflow/pytorch.pb.h b/gen/pb-cpp/flyteidl/plugins/kubeflow/pytorch.pb.h new file mode 100644 index 000000000..f124f939a --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/kubeflow/pytorch.pb.h @@ -0,0 +1,985 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/kubeflow/pytorch.proto + +#ifndef PROTOBUF_INCLUDED_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto +#define PROTOBUF_INCLUDED_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3007000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "flyteidl/core/tasks.pb.h" +#include "flyteidl/plugins/kubeflow/common.pb.h" +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto + +// Internal implementation detail -- do not use these members. +struct TableStruct_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto { + static const ::google::protobuf::internal::ParseTableField entries[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::AuxillaryParseTableField aux[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::ParseTable schema[3] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto(); +namespace flyteidl { +namespace plugins { +namespace kubeflow { +class DistributedPyTorchTrainingReplicaSpec; +class DistributedPyTorchTrainingReplicaSpecDefaultTypeInternal; +extern DistributedPyTorchTrainingReplicaSpecDefaultTypeInternal _DistributedPyTorchTrainingReplicaSpec_default_instance_; +class DistributedPyTorchTrainingTask; +class DistributedPyTorchTrainingTaskDefaultTypeInternal; +extern DistributedPyTorchTrainingTaskDefaultTypeInternal _DistributedPyTorchTrainingTask_default_instance_; +class ElasticConfig; +class ElasticConfigDefaultTypeInternal; +extern ElasticConfigDefaultTypeInternal _ElasticConfig_default_instance_; +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl +namespace google { +namespace protobuf { +template<> ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* Arena::CreateMaybeMessage<::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec>(Arena*); +template<> ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingTask* Arena::CreateMaybeMessage<::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingTask>(Arena*); +template<> ::flyteidl::plugins::kubeflow::ElasticConfig* Arena::CreateMaybeMessage<::flyteidl::plugins::kubeflow::ElasticConfig>(Arena*); +} // namespace protobuf +} // namespace google +namespace flyteidl { +namespace plugins { +namespace kubeflow { + +// =================================================================== + +class ElasticConfig final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:flyteidl.plugins.kubeflow.ElasticConfig) */ { + public: + ElasticConfig(); + virtual ~ElasticConfig(); + + ElasticConfig(const ElasticConfig& from); + + inline ElasticConfig& operator=(const ElasticConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ElasticConfig(ElasticConfig&& from) noexcept + : ElasticConfig() { + *this = ::std::move(from); + } + + inline ElasticConfig& operator=(ElasticConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const ElasticConfig& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ElasticConfig* internal_default_instance() { + return reinterpret_cast( + &_ElasticConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(ElasticConfig* other); + friend void swap(ElasticConfig& a, ElasticConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ElasticConfig* New() const final { + return CreateMaybeMessage(nullptr); + } + + ElasticConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ElasticConfig& from); + void MergeFrom(const ElasticConfig& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ElasticConfig* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string rdzv_backend = 1; + void clear_rdzv_backend(); + static const int kRdzvBackendFieldNumber = 1; + const ::std::string& rdzv_backend() const; + void set_rdzv_backend(const ::std::string& value); + #if LANG_CXX11 + void set_rdzv_backend(::std::string&& value); + #endif + void set_rdzv_backend(const char* value); + void set_rdzv_backend(const char* value, size_t size); + ::std::string* mutable_rdzv_backend(); + ::std::string* release_rdzv_backend(); + void set_allocated_rdzv_backend(::std::string* rdzv_backend); + + // int32 min_replicas = 2; + void clear_min_replicas(); + static const int kMinReplicasFieldNumber = 2; + ::google::protobuf::int32 min_replicas() const; + void set_min_replicas(::google::protobuf::int32 value); + + // int32 max_replicas = 3; + void clear_max_replicas(); + static const int kMaxReplicasFieldNumber = 3; + ::google::protobuf::int32 max_replicas() const; + void set_max_replicas(::google::protobuf::int32 value); + + // int32 nproc_per_node = 4; + void clear_nproc_per_node(); + static const int kNprocPerNodeFieldNumber = 4; + ::google::protobuf::int32 nproc_per_node() const; + void set_nproc_per_node(::google::protobuf::int32 value); + + // int32 max_restarts = 5; + void clear_max_restarts(); + static const int kMaxRestartsFieldNumber = 5; + ::google::protobuf::int32 max_restarts() const; + void set_max_restarts(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.kubeflow.ElasticConfig) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr rdzv_backend_; + ::google::protobuf::int32 min_replicas_; + ::google::protobuf::int32 max_replicas_; + ::google::protobuf::int32 nproc_per_node_; + ::google::protobuf::int32 max_restarts_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto; +}; +// ------------------------------------------------------------------- + +class DistributedPyTorchTrainingTask final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) */ { + public: + DistributedPyTorchTrainingTask(); + virtual ~DistributedPyTorchTrainingTask(); + + DistributedPyTorchTrainingTask(const DistributedPyTorchTrainingTask& from); + + inline DistributedPyTorchTrainingTask& operator=(const DistributedPyTorchTrainingTask& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DistributedPyTorchTrainingTask(DistributedPyTorchTrainingTask&& from) noexcept + : DistributedPyTorchTrainingTask() { + *this = ::std::move(from); + } + + inline DistributedPyTorchTrainingTask& operator=(DistributedPyTorchTrainingTask&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const DistributedPyTorchTrainingTask& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DistributedPyTorchTrainingTask* internal_default_instance() { + return reinterpret_cast( + &_DistributedPyTorchTrainingTask_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(DistributedPyTorchTrainingTask* other); + friend void swap(DistributedPyTorchTrainingTask& a, DistributedPyTorchTrainingTask& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DistributedPyTorchTrainingTask* New() const final { + return CreateMaybeMessage(nullptr); + } + + DistributedPyTorchTrainingTask* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DistributedPyTorchTrainingTask& from); + void MergeFrom(const DistributedPyTorchTrainingTask& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DistributedPyTorchTrainingTask* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + bool has_worker_replicas() const; + void clear_worker_replicas(); + static const int kWorkerReplicasFieldNumber = 1; + const ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec& worker_replicas() const; + ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* release_worker_replicas(); + ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* mutable_worker_replicas(); + void set_allocated_worker_replicas(::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* worker_replicas); + + // .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + bool has_master_replicas() const; + void clear_master_replicas(); + static const int kMasterReplicasFieldNumber = 2; + const ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec& master_replicas() const; + ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* release_master_replicas(); + ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* mutable_master_replicas(); + void set_allocated_master_replicas(::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* master_replicas); + + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + bool has_run_policy() const; + void clear_run_policy(); + static const int kRunPolicyFieldNumber = 3; + const ::flyteidl::plugins::kubeflow::RunPolicy& run_policy() const; + ::flyteidl::plugins::kubeflow::RunPolicy* release_run_policy(); + ::flyteidl::plugins::kubeflow::RunPolicy* mutable_run_policy(); + void set_allocated_run_policy(::flyteidl::plugins::kubeflow::RunPolicy* run_policy); + + // .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + bool has_elastic_config() const; + void clear_elastic_config(); + static const int kElasticConfigFieldNumber = 4; + const ::flyteidl::plugins::kubeflow::ElasticConfig& elastic_config() const; + ::flyteidl::plugins::kubeflow::ElasticConfig* release_elastic_config(); + ::flyteidl::plugins::kubeflow::ElasticConfig* mutable_elastic_config(); + void set_allocated_elastic_config(::flyteidl::plugins::kubeflow::ElasticConfig* elastic_config); + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* worker_replicas_; + ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* master_replicas_; + ::flyteidl::plugins::kubeflow::RunPolicy* run_policy_; + ::flyteidl::plugins::kubeflow::ElasticConfig* elastic_config_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto; +}; +// ------------------------------------------------------------------- + +class DistributedPyTorchTrainingReplicaSpec final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) */ { + public: + DistributedPyTorchTrainingReplicaSpec(); + virtual ~DistributedPyTorchTrainingReplicaSpec(); + + DistributedPyTorchTrainingReplicaSpec(const DistributedPyTorchTrainingReplicaSpec& from); + + inline DistributedPyTorchTrainingReplicaSpec& operator=(const DistributedPyTorchTrainingReplicaSpec& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DistributedPyTorchTrainingReplicaSpec(DistributedPyTorchTrainingReplicaSpec&& from) noexcept + : DistributedPyTorchTrainingReplicaSpec() { + *this = ::std::move(from); + } + + inline DistributedPyTorchTrainingReplicaSpec& operator=(DistributedPyTorchTrainingReplicaSpec&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const DistributedPyTorchTrainingReplicaSpec& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DistributedPyTorchTrainingReplicaSpec* internal_default_instance() { + return reinterpret_cast( + &_DistributedPyTorchTrainingReplicaSpec_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void Swap(DistributedPyTorchTrainingReplicaSpec* other); + friend void swap(DistributedPyTorchTrainingReplicaSpec& a, DistributedPyTorchTrainingReplicaSpec& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DistributedPyTorchTrainingReplicaSpec* New() const final { + return CreateMaybeMessage(nullptr); + } + + DistributedPyTorchTrainingReplicaSpec* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DistributedPyTorchTrainingReplicaSpec& from); + void MergeFrom(const DistributedPyTorchTrainingReplicaSpec& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DistributedPyTorchTrainingReplicaSpec* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string image = 2; + void clear_image(); + static const int kImageFieldNumber = 2; + const ::std::string& image() const; + void set_image(const ::std::string& value); + #if LANG_CXX11 + void set_image(::std::string&& value); + #endif + void set_image(const char* value); + void set_image(const char* value, size_t size); + ::std::string* mutable_image(); + ::std::string* release_image(); + void set_allocated_image(::std::string* image); + + // .flyteidl.core.Resources resources = 3; + bool has_resources() const; + void clear_resources(); + static const int kResourcesFieldNumber = 3; + const ::flyteidl::core::Resources& resources() const; + ::flyteidl::core::Resources* release_resources(); + ::flyteidl::core::Resources* mutable_resources(); + void set_allocated_resources(::flyteidl::core::Resources* resources); + + // int32 replicas = 1; + void clear_replicas(); + static const int kReplicasFieldNumber = 1; + ::google::protobuf::int32 replicas() const; + void set_replicas(::google::protobuf::int32 value); + + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + void clear_restart_policy(); + static const int kRestartPolicyFieldNumber = 4; + ::flyteidl::plugins::kubeflow::RestartPolicy restart_policy() const; + void set_restart_policy(::flyteidl::plugins::kubeflow::RestartPolicy value); + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr image_; + ::flyteidl::core::Resources* resources_; + ::google::protobuf::int32 replicas_; + int restart_policy_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ElasticConfig + +// string rdzv_backend = 1; +inline void ElasticConfig::clear_rdzv_backend() { + rdzv_backend_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ElasticConfig::rdzv_backend() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.ElasticConfig.rdzv_backend) + return rdzv_backend_.GetNoArena(); +} +inline void ElasticConfig::set_rdzv_backend(const ::std::string& value) { + + rdzv_backend_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.ElasticConfig.rdzv_backend) +} +#if LANG_CXX11 +inline void ElasticConfig::set_rdzv_backend(::std::string&& value) { + + rdzv_backend_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:flyteidl.plugins.kubeflow.ElasticConfig.rdzv_backend) +} +#endif +inline void ElasticConfig::set_rdzv_backend(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + rdzv_backend_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:flyteidl.plugins.kubeflow.ElasticConfig.rdzv_backend) +} +inline void ElasticConfig::set_rdzv_backend(const char* value, size_t size) { + + rdzv_backend_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:flyteidl.plugins.kubeflow.ElasticConfig.rdzv_backend) +} +inline ::std::string* ElasticConfig::mutable_rdzv_backend() { + + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.ElasticConfig.rdzv_backend) + return rdzv_backend_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ElasticConfig::release_rdzv_backend() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.ElasticConfig.rdzv_backend) + + return rdzv_backend_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ElasticConfig::set_allocated_rdzv_backend(::std::string* rdzv_backend) { + if (rdzv_backend != nullptr) { + + } else { + + } + rdzv_backend_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), rdzv_backend); + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.ElasticConfig.rdzv_backend) +} + +// int32 min_replicas = 2; +inline void ElasticConfig::clear_min_replicas() { + min_replicas_ = 0; +} +inline ::google::protobuf::int32 ElasticConfig::min_replicas() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.ElasticConfig.min_replicas) + return min_replicas_; +} +inline void ElasticConfig::set_min_replicas(::google::protobuf::int32 value) { + + min_replicas_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.ElasticConfig.min_replicas) +} + +// int32 max_replicas = 3; +inline void ElasticConfig::clear_max_replicas() { + max_replicas_ = 0; +} +inline ::google::protobuf::int32 ElasticConfig::max_replicas() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.ElasticConfig.max_replicas) + return max_replicas_; +} +inline void ElasticConfig::set_max_replicas(::google::protobuf::int32 value) { + + max_replicas_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.ElasticConfig.max_replicas) +} + +// int32 nproc_per_node = 4; +inline void ElasticConfig::clear_nproc_per_node() { + nproc_per_node_ = 0; +} +inline ::google::protobuf::int32 ElasticConfig::nproc_per_node() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.ElasticConfig.nproc_per_node) + return nproc_per_node_; +} +inline void ElasticConfig::set_nproc_per_node(::google::protobuf::int32 value) { + + nproc_per_node_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.ElasticConfig.nproc_per_node) +} + +// int32 max_restarts = 5; +inline void ElasticConfig::clear_max_restarts() { + max_restarts_ = 0; +} +inline ::google::protobuf::int32 ElasticConfig::max_restarts() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.ElasticConfig.max_restarts) + return max_restarts_; +} +inline void ElasticConfig::set_max_restarts(::google::protobuf::int32 value) { + + max_restarts_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.ElasticConfig.max_restarts) +} + +// ------------------------------------------------------------------- + +// DistributedPyTorchTrainingTask + +// .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; +inline bool DistributedPyTorchTrainingTask::has_worker_replicas() const { + return this != internal_default_instance() && worker_replicas_ != nullptr; +} +inline void DistributedPyTorchTrainingTask::clear_worker_replicas() { + if (GetArenaNoVirtual() == nullptr && worker_replicas_ != nullptr) { + delete worker_replicas_; + } + worker_replicas_ = nullptr; +} +inline const ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec& DistributedPyTorchTrainingTask::worker_replicas() const { + const ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* p = worker_replicas_; + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask.worker_replicas) + return p != nullptr ? *p : *reinterpret_cast( + &::flyteidl::plugins::kubeflow::_DistributedPyTorchTrainingReplicaSpec_default_instance_); +} +inline ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* DistributedPyTorchTrainingTask::release_worker_replicas() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask.worker_replicas) + + ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* temp = worker_replicas_; + worker_replicas_ = nullptr; + return temp; +} +inline ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* DistributedPyTorchTrainingTask::mutable_worker_replicas() { + + if (worker_replicas_ == nullptr) { + auto* p = CreateMaybeMessage<::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec>(GetArenaNoVirtual()); + worker_replicas_ = p; + } + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask.worker_replicas) + return worker_replicas_; +} +inline void DistributedPyTorchTrainingTask::set_allocated_worker_replicas(::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* worker_replicas) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete worker_replicas_; + } + if (worker_replicas) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + worker_replicas = ::google::protobuf::internal::GetOwnedMessage( + message_arena, worker_replicas, submessage_arena); + } + + } else { + + } + worker_replicas_ = worker_replicas; + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask.worker_replicas) +} + +// .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; +inline bool DistributedPyTorchTrainingTask::has_master_replicas() const { + return this != internal_default_instance() && master_replicas_ != nullptr; +} +inline void DistributedPyTorchTrainingTask::clear_master_replicas() { + if (GetArenaNoVirtual() == nullptr && master_replicas_ != nullptr) { + delete master_replicas_; + } + master_replicas_ = nullptr; +} +inline const ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec& DistributedPyTorchTrainingTask::master_replicas() const { + const ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* p = master_replicas_; + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask.master_replicas) + return p != nullptr ? *p : *reinterpret_cast( + &::flyteidl::plugins::kubeflow::_DistributedPyTorchTrainingReplicaSpec_default_instance_); +} +inline ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* DistributedPyTorchTrainingTask::release_master_replicas() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask.master_replicas) + + ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* temp = master_replicas_; + master_replicas_ = nullptr; + return temp; +} +inline ::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* DistributedPyTorchTrainingTask::mutable_master_replicas() { + + if (master_replicas_ == nullptr) { + auto* p = CreateMaybeMessage<::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec>(GetArenaNoVirtual()); + master_replicas_ = p; + } + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask.master_replicas) + return master_replicas_; +} +inline void DistributedPyTorchTrainingTask::set_allocated_master_replicas(::flyteidl::plugins::kubeflow::DistributedPyTorchTrainingReplicaSpec* master_replicas) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete master_replicas_; + } + if (master_replicas) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + master_replicas = ::google::protobuf::internal::GetOwnedMessage( + message_arena, master_replicas, submessage_arena); + } + + } else { + + } + master_replicas_ = master_replicas; + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask.master_replicas) +} + +// .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; +inline bool DistributedPyTorchTrainingTask::has_run_policy() const { + return this != internal_default_instance() && run_policy_ != nullptr; +} +inline const ::flyteidl::plugins::kubeflow::RunPolicy& DistributedPyTorchTrainingTask::run_policy() const { + const ::flyteidl::plugins::kubeflow::RunPolicy* p = run_policy_; + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask.run_policy) + return p != nullptr ? *p : *reinterpret_cast( + &::flyteidl::plugins::kubeflow::_RunPolicy_default_instance_); +} +inline ::flyteidl::plugins::kubeflow::RunPolicy* DistributedPyTorchTrainingTask::release_run_policy() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask.run_policy) + + ::flyteidl::plugins::kubeflow::RunPolicy* temp = run_policy_; + run_policy_ = nullptr; + return temp; +} +inline ::flyteidl::plugins::kubeflow::RunPolicy* DistributedPyTorchTrainingTask::mutable_run_policy() { + + if (run_policy_ == nullptr) { + auto* p = CreateMaybeMessage<::flyteidl::plugins::kubeflow::RunPolicy>(GetArenaNoVirtual()); + run_policy_ = p; + } + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask.run_policy) + return run_policy_; +} +inline void DistributedPyTorchTrainingTask::set_allocated_run_policy(::flyteidl::plugins::kubeflow::RunPolicy* run_policy) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(run_policy_); + } + if (run_policy) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + run_policy = ::google::protobuf::internal::GetOwnedMessage( + message_arena, run_policy, submessage_arena); + } + + } else { + + } + run_policy_ = run_policy; + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask.run_policy) +} + +// .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; +inline bool DistributedPyTorchTrainingTask::has_elastic_config() const { + return this != internal_default_instance() && elastic_config_ != nullptr; +} +inline void DistributedPyTorchTrainingTask::clear_elastic_config() { + if (GetArenaNoVirtual() == nullptr && elastic_config_ != nullptr) { + delete elastic_config_; + } + elastic_config_ = nullptr; +} +inline const ::flyteidl::plugins::kubeflow::ElasticConfig& DistributedPyTorchTrainingTask::elastic_config() const { + const ::flyteidl::plugins::kubeflow::ElasticConfig* p = elastic_config_; + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask.elastic_config) + return p != nullptr ? *p : *reinterpret_cast( + &::flyteidl::plugins::kubeflow::_ElasticConfig_default_instance_); +} +inline ::flyteidl::plugins::kubeflow::ElasticConfig* DistributedPyTorchTrainingTask::release_elastic_config() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask.elastic_config) + + ::flyteidl::plugins::kubeflow::ElasticConfig* temp = elastic_config_; + elastic_config_ = nullptr; + return temp; +} +inline ::flyteidl::plugins::kubeflow::ElasticConfig* DistributedPyTorchTrainingTask::mutable_elastic_config() { + + if (elastic_config_ == nullptr) { + auto* p = CreateMaybeMessage<::flyteidl::plugins::kubeflow::ElasticConfig>(GetArenaNoVirtual()); + elastic_config_ = p; + } + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask.elastic_config) + return elastic_config_; +} +inline void DistributedPyTorchTrainingTask::set_allocated_elastic_config(::flyteidl::plugins::kubeflow::ElasticConfig* elastic_config) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete elastic_config_; + } + if (elastic_config) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + elastic_config = ::google::protobuf::internal::GetOwnedMessage( + message_arena, elastic_config, submessage_arena); + } + + } else { + + } + elastic_config_ = elastic_config; + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask.elastic_config) +} + +// ------------------------------------------------------------------- + +// DistributedPyTorchTrainingReplicaSpec + +// int32 replicas = 1; +inline void DistributedPyTorchTrainingReplicaSpec::clear_replicas() { + replicas_ = 0; +} +inline ::google::protobuf::int32 DistributedPyTorchTrainingReplicaSpec::replicas() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.replicas) + return replicas_; +} +inline void DistributedPyTorchTrainingReplicaSpec::set_replicas(::google::protobuf::int32 value) { + + replicas_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.replicas) +} + +// string image = 2; +inline void DistributedPyTorchTrainingReplicaSpec::clear_image() { + image_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& DistributedPyTorchTrainingReplicaSpec::image() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.image) + return image_.GetNoArena(); +} +inline void DistributedPyTorchTrainingReplicaSpec::set_image(const ::std::string& value) { + + image_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.image) +} +#if LANG_CXX11 +inline void DistributedPyTorchTrainingReplicaSpec::set_image(::std::string&& value) { + + image_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.image) +} +#endif +inline void DistributedPyTorchTrainingReplicaSpec::set_image(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + image_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.image) +} +inline void DistributedPyTorchTrainingReplicaSpec::set_image(const char* value, size_t size) { + + image_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.image) +} +inline ::std::string* DistributedPyTorchTrainingReplicaSpec::mutable_image() { + + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.image) + return image_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DistributedPyTorchTrainingReplicaSpec::release_image() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.image) + + return image_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DistributedPyTorchTrainingReplicaSpec::set_allocated_image(::std::string* image) { + if (image != nullptr) { + + } else { + + } + image_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), image); + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.image) +} + +// .flyteidl.core.Resources resources = 3; +inline bool DistributedPyTorchTrainingReplicaSpec::has_resources() const { + return this != internal_default_instance() && resources_ != nullptr; +} +inline const ::flyteidl::core::Resources& DistributedPyTorchTrainingReplicaSpec::resources() const { + const ::flyteidl::core::Resources* p = resources_; + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.resources) + return p != nullptr ? *p : *reinterpret_cast( + &::flyteidl::core::_Resources_default_instance_); +} +inline ::flyteidl::core::Resources* DistributedPyTorchTrainingReplicaSpec::release_resources() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.resources) + + ::flyteidl::core::Resources* temp = resources_; + resources_ = nullptr; + return temp; +} +inline ::flyteidl::core::Resources* DistributedPyTorchTrainingReplicaSpec::mutable_resources() { + + if (resources_ == nullptr) { + auto* p = CreateMaybeMessage<::flyteidl::core::Resources>(GetArenaNoVirtual()); + resources_ = p; + } + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.resources) + return resources_; +} +inline void DistributedPyTorchTrainingReplicaSpec::set_allocated_resources(::flyteidl::core::Resources* resources) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(resources_); + } + if (resources) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + resources = ::google::protobuf::internal::GetOwnedMessage( + message_arena, resources, submessage_arena); + } + + } else { + + } + resources_ = resources; + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.resources) +} + +// .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; +inline void DistributedPyTorchTrainingReplicaSpec::clear_restart_policy() { + restart_policy_ = 0; +} +inline ::flyteidl::plugins::kubeflow::RestartPolicy DistributedPyTorchTrainingReplicaSpec::restart_policy() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.restart_policy) + return static_cast< ::flyteidl::plugins::kubeflow::RestartPolicy >(restart_policy_); +} +inline void DistributedPyTorchTrainingReplicaSpec::set_restart_policy(::flyteidl::plugins::kubeflow::RestartPolicy value) { + + restart_policy_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec.restart_policy) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl + +// @@protoc_insertion_point(global_scope) + +#include +#endif // PROTOBUF_INCLUDED_flyteidl_2fplugins_2fkubeflow_2fpytorch_2eproto diff --git a/gen/pb-cpp/flyteidl/plugins/kubeflow/tensorflow.grpc.pb.cc b/gen/pb-cpp/flyteidl/plugins/kubeflow/tensorflow.grpc.pb.cc new file mode 100644 index 000000000..536038459 --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/kubeflow/tensorflow.grpc.pb.cc @@ -0,0 +1,26 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: flyteidl/plugins/kubeflow/tensorflow.proto + +#include "flyteidl/plugins/kubeflow/tensorflow.pb.h" +#include "flyteidl/plugins/kubeflow/tensorflow.grpc.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +namespace flyteidl { +namespace plugins { +namespace kubeflow { + +} // namespace flyteidl +} // namespace plugins +} // namespace kubeflow + diff --git a/gen/pb-cpp/flyteidl/plugins/kubeflow/tensorflow.grpc.pb.h b/gen/pb-cpp/flyteidl/plugins/kubeflow/tensorflow.grpc.pb.h new file mode 100644 index 000000000..2ab6f394d --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/kubeflow/tensorflow.grpc.pb.h @@ -0,0 +1,49 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: flyteidl/plugins/kubeflow/tensorflow.proto +#ifndef GRPC_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto__INCLUDED +#define GRPC_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto__INCLUDED + +#include "flyteidl/plugins/kubeflow/tensorflow.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace grpc_impl { +class Channel; +class CompletionQueue; +class ServerCompletionQueue; +} // namespace grpc_impl + +namespace grpc { +namespace experimental { +template +class MessageAllocator; +} // namespace experimental +} // namespace grpc_impl + +namespace grpc { +class ServerContext; +} // namespace grpc + +namespace flyteidl { +namespace plugins { +namespace kubeflow { + +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl + + +#endif // GRPC_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto__INCLUDED diff --git a/gen/pb-cpp/flyteidl/plugins/kubeflow/tensorflow.pb.cc b/gen/pb-cpp/flyteidl/plugins/kubeflow/tensorflow.pb.cc new file mode 100644 index 000000000..9227307c4 --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/kubeflow/tensorflow.pb.cc @@ -0,0 +1,1129 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/kubeflow/tensorflow.proto + +#include "flyteidl/plugins/kubeflow/tensorflow.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fcore_2ftasks_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Resources_flyteidl_2fcore_2ftasks_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_RunPolicy_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_DistributedTensorflowTrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto; +namespace flyteidl { +namespace plugins { +namespace kubeflow { +class DistributedTensorflowTrainingTaskDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _DistributedTensorflowTrainingTask_default_instance_; +class DistributedTensorflowTrainingReplicaSpecDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _DistributedTensorflowTrainingReplicaSpec_default_instance_; +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl +static void InitDefaultsDistributedTensorflowTrainingTask_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::flyteidl::plugins::kubeflow::_DistributedTensorflowTrainingTask_default_instance_; + new (ptr) ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingTask(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingTask::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_DistributedTensorflowTrainingTask_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsDistributedTensorflowTrainingTask_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto}, { + &scc_info_DistributedTensorflowTrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto.base, + &scc_info_RunPolicy_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto.base,}}; + +static void InitDefaultsDistributedTensorflowTrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::flyteidl::plugins::kubeflow::_DistributedTensorflowTrainingReplicaSpec_default_instance_; + new (ptr) ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_DistributedTensorflowTrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsDistributedTensorflowTrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto}, { + &scc_info_Resources_flyteidl_2fcore_2ftasks_2eproto.base,}}; + +void InitDefaults_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto() { + ::google::protobuf::internal::InitSCC(&scc_info_DistributedTensorflowTrainingTask_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_DistributedTensorflowTrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto.base); +} + +::google::protobuf::Metadata file_level_metadata_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto[2]; +constexpr ::google::protobuf::EnumDescriptor const** file_level_enum_descriptors_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto = nullptr; +constexpr ::google::protobuf::ServiceDescriptor const** file_level_service_descriptors_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto = nullptr; + +const ::google::protobuf::uint32 TableStruct_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingTask, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingTask, worker_replicas_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingTask, ps_replicas_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingTask, chief_replicas_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingTask, run_policy_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec, replicas_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec, image_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec, resources_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec, restart_policy_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingTask)}, + { 9, -1, sizeof(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::flyteidl::plugins::kubeflow::_DistributedTensorflowTrainingTask_default_instance_), + reinterpret_cast(&::flyteidl::plugins::kubeflow::_DistributedTensorflowTrainingReplicaSpec_default_instance_), +}; + +::google::protobuf::internal::AssignDescriptorsTable assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto = { + {}, AddDescriptors_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto, "flyteidl/plugins/kubeflow/tensorflow.proto", schemas, + file_default_instances, TableStruct_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto::offsets, + file_level_metadata_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto, 2, file_level_enum_descriptors_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto, file_level_service_descriptors_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto, +}; + +const char descriptor_table_protodef_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto[] = + "\n*flyteidl/plugins/kubeflow/tensorflow.p" + "roto\022\031flyteidl.plugins.kubeflow\032\031flyteid" + "l/core/tasks.proto\032&flyteidl/plugins/kub" + "eflow/common.proto\"\362\002\n!DistributedTensor" + "flowTrainingTask\022\\\n\017worker_replicas\030\001 \001(" + "\0132C.flyteidl.plugins.kubeflow.Distribute" + "dTensorflowTrainingReplicaSpec\022X\n\013ps_rep" + "licas\030\002 \001(\0132C.flyteidl.plugins.kubeflow." + "DistributedTensorflowTrainingReplicaSpec" + "\022[\n\016chief_replicas\030\003 \001(\0132C.flyteidl.plug" + "ins.kubeflow.DistributedTensorflowTraini" + "ngReplicaSpec\0228\n\nrun_policy\030\004 \001(\0132$.flyt" + "eidl.plugins.kubeflow.RunPolicy\"\272\001\n(Dist" + "ributedTensorflowTrainingReplicaSpec\022\020\n\010" + "replicas\030\001 \001(\005\022\r\n\005image\030\002 \001(\t\022+\n\tresourc" + "es\030\003 \001(\0132\030.flyteidl.core.Resources\022@\n\016re" + "start_policy\030\004 \001(\0162(.flyteidl.plugins.ku" + "beflow.RestartPolicyB9Z7github.com/flyte" + "org/flyteidl/gen/pb-go/flyteidl/pluginsb" + "\006proto3" + ; +::google::protobuf::internal::DescriptorTable descriptor_table_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto = { + false, InitDefaults_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto, + descriptor_table_protodef_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto, + "flyteidl/plugins/kubeflow/tensorflow.proto", &assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto, 767, +}; + +void AddDescriptors_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto() { + static constexpr ::google::protobuf::internal::InitFunc deps[2] = + { + ::AddDescriptors_flyteidl_2fcore_2ftasks_2eproto, + ::AddDescriptors_flyteidl_2fplugins_2fkubeflow_2fcommon_2eproto, + }; + ::google::protobuf::internal::AddDescriptors(&descriptor_table_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto, deps, 2); +} + +// Force running AddDescriptors() at dynamic initialization time. +static bool dynamic_init_dummy_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto = []() { AddDescriptors_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto(); return true; }(); +namespace flyteidl { +namespace plugins { +namespace kubeflow { + +// =================================================================== + +void DistributedTensorflowTrainingTask::InitAsDefaultInstance() { + ::flyteidl::plugins::kubeflow::_DistributedTensorflowTrainingTask_default_instance_._instance.get_mutable()->worker_replicas_ = const_cast< ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec*>( + ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec::internal_default_instance()); + ::flyteidl::plugins::kubeflow::_DistributedTensorflowTrainingTask_default_instance_._instance.get_mutable()->ps_replicas_ = const_cast< ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec*>( + ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec::internal_default_instance()); + ::flyteidl::plugins::kubeflow::_DistributedTensorflowTrainingTask_default_instance_._instance.get_mutable()->chief_replicas_ = const_cast< ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec*>( + ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec::internal_default_instance()); + ::flyteidl::plugins::kubeflow::_DistributedTensorflowTrainingTask_default_instance_._instance.get_mutable()->run_policy_ = const_cast< ::flyteidl::plugins::kubeflow::RunPolicy*>( + ::flyteidl::plugins::kubeflow::RunPolicy::internal_default_instance()); +} +class DistributedTensorflowTrainingTask::HasBitSetters { + public: + static const ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec& worker_replicas(const DistributedTensorflowTrainingTask* msg); + static const ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec& ps_replicas(const DistributedTensorflowTrainingTask* msg); + static const ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec& chief_replicas(const DistributedTensorflowTrainingTask* msg); + static const ::flyteidl::plugins::kubeflow::RunPolicy& run_policy(const DistributedTensorflowTrainingTask* msg); +}; + +const ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec& +DistributedTensorflowTrainingTask::HasBitSetters::worker_replicas(const DistributedTensorflowTrainingTask* msg) { + return *msg->worker_replicas_; +} +const ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec& +DistributedTensorflowTrainingTask::HasBitSetters::ps_replicas(const DistributedTensorflowTrainingTask* msg) { + return *msg->ps_replicas_; +} +const ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec& +DistributedTensorflowTrainingTask::HasBitSetters::chief_replicas(const DistributedTensorflowTrainingTask* msg) { + return *msg->chief_replicas_; +} +const ::flyteidl::plugins::kubeflow::RunPolicy& +DistributedTensorflowTrainingTask::HasBitSetters::run_policy(const DistributedTensorflowTrainingTask* msg) { + return *msg->run_policy_; +} +void DistributedTensorflowTrainingTask::clear_run_policy() { + if (GetArenaNoVirtual() == nullptr && run_policy_ != nullptr) { + delete run_policy_; + } + run_policy_ = nullptr; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DistributedTensorflowTrainingTask::kWorkerReplicasFieldNumber; +const int DistributedTensorflowTrainingTask::kPsReplicasFieldNumber; +const int DistributedTensorflowTrainingTask::kChiefReplicasFieldNumber; +const int DistributedTensorflowTrainingTask::kRunPolicyFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DistributedTensorflowTrainingTask::DistributedTensorflowTrainingTask() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) +} +DistributedTensorflowTrainingTask::DistributedTensorflowTrainingTask(const DistributedTensorflowTrainingTask& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_worker_replicas()) { + worker_replicas_ = new ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec(*from.worker_replicas_); + } else { + worker_replicas_ = nullptr; + } + if (from.has_ps_replicas()) { + ps_replicas_ = new ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec(*from.ps_replicas_); + } else { + ps_replicas_ = nullptr; + } + if (from.has_chief_replicas()) { + chief_replicas_ = new ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec(*from.chief_replicas_); + } else { + chief_replicas_ = nullptr; + } + if (from.has_run_policy()) { + run_policy_ = new ::flyteidl::plugins::kubeflow::RunPolicy(*from.run_policy_); + } else { + run_policy_ = nullptr; + } + // @@protoc_insertion_point(copy_constructor:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) +} + +void DistributedTensorflowTrainingTask::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_DistributedTensorflowTrainingTask_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto.base); + ::memset(&worker_replicas_, 0, static_cast( + reinterpret_cast(&run_policy_) - + reinterpret_cast(&worker_replicas_)) + sizeof(run_policy_)); +} + +DistributedTensorflowTrainingTask::~DistributedTensorflowTrainingTask() { + // @@protoc_insertion_point(destructor:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + SharedDtor(); +} + +void DistributedTensorflowTrainingTask::SharedDtor() { + if (this != internal_default_instance()) delete worker_replicas_; + if (this != internal_default_instance()) delete ps_replicas_; + if (this != internal_default_instance()) delete chief_replicas_; + if (this != internal_default_instance()) delete run_policy_; +} + +void DistributedTensorflowTrainingTask::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const DistributedTensorflowTrainingTask& DistributedTensorflowTrainingTask::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_DistributedTensorflowTrainingTask_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto.base); + return *internal_default_instance(); +} + + +void DistributedTensorflowTrainingTask::Clear() { +// @@protoc_insertion_point(message_clear_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == nullptr && worker_replicas_ != nullptr) { + delete worker_replicas_; + } + worker_replicas_ = nullptr; + if (GetArenaNoVirtual() == nullptr && ps_replicas_ != nullptr) { + delete ps_replicas_; + } + ps_replicas_ = nullptr; + if (GetArenaNoVirtual() == nullptr && chief_replicas_ != nullptr) { + delete chief_replicas_; + } + chief_replicas_ = nullptr; + if (GetArenaNoVirtual() == nullptr && run_policy_ != nullptr) { + delete run_policy_; + } + run_policy_ = nullptr; + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* DistributedTensorflowTrainingTask::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec::_InternalParse; + object = msg->mutable_worker_replicas(); + 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; + } + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 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::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec::_InternalParse; + object = msg->mutable_ps_replicas(); + 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; + } + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) != 26) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec::_InternalParse; + object = msg->mutable_chief_replicas(); + 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; + } + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) != 34) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::flyteidl::plugins::kubeflow::RunPolicy::_InternalParse; + object = msg->mutable_run_policy(); + 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) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool DistributedTensorflowTrainingTask::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_worker_replicas())); + } else { + goto handle_unusual; + } + break; + } + + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_ps_replicas())); + } else { + goto handle_unusual; + } + break; + } + + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == (26 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_chief_replicas())); + } else { + goto handle_unusual; + } + break; + } + + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == (34 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_run_policy())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + return true; +failure: + // @@protoc_insertion_point(parse_failure:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void DistributedTensorflowTrainingTask::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + if (this->has_worker_replicas()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, HasBitSetters::worker_replicas(this), output); + } + + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + if (this->has_ps_replicas()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, HasBitSetters::ps_replicas(this), output); + } + + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + if (this->has_chief_replicas()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, HasBitSetters::chief_replicas(this), output); + } + + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + if (this->has_run_policy()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, HasBitSetters::run_policy(this), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) +} + +::google::protobuf::uint8* DistributedTensorflowTrainingTask::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + if (this->has_worker_replicas()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, HasBitSetters::worker_replicas(this), target); + } + + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + if (this->has_ps_replicas()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, HasBitSetters::ps_replicas(this), target); + } + + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + if (this->has_chief_replicas()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, HasBitSetters::chief_replicas(this), target); + } + + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + if (this->has_run_policy()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, HasBitSetters::run_policy(this), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + return target; +} + +size_t DistributedTensorflowTrainingTask::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + if (this->has_worker_replicas()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *worker_replicas_); + } + + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + if (this->has_ps_replicas()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *ps_replicas_); + } + + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + if (this->has_chief_replicas()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *chief_replicas_); + } + + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + if (this->has_run_policy()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *run_policy_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DistributedTensorflowTrainingTask::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + GOOGLE_DCHECK_NE(&from, this); + const DistributedTensorflowTrainingTask* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + MergeFrom(*source); + } +} + +void DistributedTensorflowTrainingTask::MergeFrom(const DistributedTensorflowTrainingTask& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_worker_replicas()) { + mutable_worker_replicas()->::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec::MergeFrom(from.worker_replicas()); + } + if (from.has_ps_replicas()) { + mutable_ps_replicas()->::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec::MergeFrom(from.ps_replicas()); + } + if (from.has_chief_replicas()) { + mutable_chief_replicas()->::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec::MergeFrom(from.chief_replicas()); + } + if (from.has_run_policy()) { + mutable_run_policy()->::flyteidl::plugins::kubeflow::RunPolicy::MergeFrom(from.run_policy()); + } +} + +void DistributedTensorflowTrainingTask::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DistributedTensorflowTrainingTask::CopyFrom(const DistributedTensorflowTrainingTask& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DistributedTensorflowTrainingTask::IsInitialized() const { + return true; +} + +void DistributedTensorflowTrainingTask::Swap(DistributedTensorflowTrainingTask* other) { + if (other == this) return; + InternalSwap(other); +} +void DistributedTensorflowTrainingTask::InternalSwap(DistributedTensorflowTrainingTask* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(worker_replicas_, other->worker_replicas_); + swap(ps_replicas_, other->ps_replicas_); + swap(chief_replicas_, other->chief_replicas_); + swap(run_policy_, other->run_policy_); +} + +::google::protobuf::Metadata DistributedTensorflowTrainingTask::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto); + return ::file_level_metadata_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void DistributedTensorflowTrainingReplicaSpec::InitAsDefaultInstance() { + ::flyteidl::plugins::kubeflow::_DistributedTensorflowTrainingReplicaSpec_default_instance_._instance.get_mutable()->resources_ = const_cast< ::flyteidl::core::Resources*>( + ::flyteidl::core::Resources::internal_default_instance()); +} +class DistributedTensorflowTrainingReplicaSpec::HasBitSetters { + public: + static const ::flyteidl::core::Resources& resources(const DistributedTensorflowTrainingReplicaSpec* msg); +}; + +const ::flyteidl::core::Resources& +DistributedTensorflowTrainingReplicaSpec::HasBitSetters::resources(const DistributedTensorflowTrainingReplicaSpec* msg) { + return *msg->resources_; +} +void DistributedTensorflowTrainingReplicaSpec::clear_resources() { + if (GetArenaNoVirtual() == nullptr && resources_ != nullptr) { + delete resources_; + } + resources_ = nullptr; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DistributedTensorflowTrainingReplicaSpec::kReplicasFieldNumber; +const int DistributedTensorflowTrainingReplicaSpec::kImageFieldNumber; +const int DistributedTensorflowTrainingReplicaSpec::kResourcesFieldNumber; +const int DistributedTensorflowTrainingReplicaSpec::kRestartPolicyFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DistributedTensorflowTrainingReplicaSpec::DistributedTensorflowTrainingReplicaSpec() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) +} +DistributedTensorflowTrainingReplicaSpec::DistributedTensorflowTrainingReplicaSpec(const DistributedTensorflowTrainingReplicaSpec& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + image_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.image().size() > 0) { + image_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.image_); + } + if (from.has_resources()) { + resources_ = new ::flyteidl::core::Resources(*from.resources_); + } else { + resources_ = nullptr; + } + ::memcpy(&replicas_, &from.replicas_, + static_cast(reinterpret_cast(&restart_policy_) - + reinterpret_cast(&replicas_)) + sizeof(restart_policy_)); + // @@protoc_insertion_point(copy_constructor:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) +} + +void DistributedTensorflowTrainingReplicaSpec::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_DistributedTensorflowTrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto.base); + image_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&resources_, 0, static_cast( + reinterpret_cast(&restart_policy_) - + reinterpret_cast(&resources_)) + sizeof(restart_policy_)); +} + +DistributedTensorflowTrainingReplicaSpec::~DistributedTensorflowTrainingReplicaSpec() { + // @@protoc_insertion_point(destructor:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + SharedDtor(); +} + +void DistributedTensorflowTrainingReplicaSpec::SharedDtor() { + image_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete resources_; +} + +void DistributedTensorflowTrainingReplicaSpec::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const DistributedTensorflowTrainingReplicaSpec& DistributedTensorflowTrainingReplicaSpec::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_DistributedTensorflowTrainingReplicaSpec_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto.base); + return *internal_default_instance(); +} + + +void DistributedTensorflowTrainingReplicaSpec::Clear() { +// @@protoc_insertion_point(message_clear_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + image_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == nullptr && resources_ != nullptr) { + delete resources_; + } + resources_ = nullptr; + ::memset(&replicas_, 0, static_cast( + reinterpret_cast(&restart_policy_) - + reinterpret_cast(&replicas_)) + sizeof(restart_policy_)); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* DistributedTensorflowTrainingReplicaSpec::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // int32 replicas = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 8) goto handle_unusual; + msg->set_replicas(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + // string image = 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); + ctx->extra_parse_data().SetFieldName("flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.image"); + object = msg->mutable_image(); + if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) { + parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8; + goto string_till_end; + } + GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx)); + ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx); + ptr += size; + break; + } + // .flyteidl.core.Resources resources = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) != 26) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::flyteidl::core::Resources::_InternalParse; + object = msg->mutable_resources(); + 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; + } + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) != 32) goto handle_unusual; + ::google::protobuf::uint64 val = ::google::protobuf::internal::ReadVarint(&ptr); + msg->set_restart_policy(static_cast<::flyteidl::plugins::kubeflow::RestartPolicy>(val)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +string_till_end: + static_cast<::std::string*>(object)->clear(); + static_cast<::std::string*>(object)->reserve(size); + goto len_delim_till_end; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool DistributedTensorflowTrainingReplicaSpec::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 replicas = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (8 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &replicas_))); + } else { + goto handle_unusual; + } + break; + } + + // string image = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_image())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->image().data(), static_cast(this->image().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.image")); + } else { + goto handle_unusual; + } + break; + } + + // .flyteidl.core.Resources resources = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == (26 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_resources())); + } else { + goto handle_unusual; + } + break; + } + + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == (32 & 0xFF)) { + int value = 0; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_restart_policy(static_cast< ::flyteidl::plugins::kubeflow::RestartPolicy >(value)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + return true; +failure: + // @@protoc_insertion_point(parse_failure:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void DistributedTensorflowTrainingReplicaSpec::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 replicas = 1; + if (this->replicas() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->replicas(), output); + } + + // string image = 2; + if (this->image().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->image().data(), static_cast(this->image().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.image"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->image(), output); + } + + // .flyteidl.core.Resources resources = 3; + if (this->has_resources()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, HasBitSetters::resources(this), output); + } + + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + if (this->restart_policy() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 4, this->restart_policy(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) +} + +::google::protobuf::uint8* DistributedTensorflowTrainingReplicaSpec::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 replicas = 1; + if (this->replicas() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->replicas(), target); + } + + // string image = 2; + if (this->image().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->image().data(), static_cast(this->image().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.image"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->image(), target); + } + + // .flyteidl.core.Resources resources = 3; + if (this->has_resources()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, HasBitSetters::resources(this), target); + } + + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + if (this->restart_policy() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 4, this->restart_policy(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + return target; +} + +size_t DistributedTensorflowTrainingReplicaSpec::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string image = 2; + if (this->image().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->image()); + } + + // .flyteidl.core.Resources resources = 3; + if (this->has_resources()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *resources_); + } + + // int32 replicas = 1; + if (this->replicas() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->replicas()); + } + + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + if (this->restart_policy() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->restart_policy()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DistributedTensorflowTrainingReplicaSpec::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + GOOGLE_DCHECK_NE(&from, this); + const DistributedTensorflowTrainingReplicaSpec* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + MergeFrom(*source); + } +} + +void DistributedTensorflowTrainingReplicaSpec::MergeFrom(const DistributedTensorflowTrainingReplicaSpec& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.image().size() > 0) { + + image_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.image_); + } + if (from.has_resources()) { + mutable_resources()->::flyteidl::core::Resources::MergeFrom(from.resources()); + } + if (from.replicas() != 0) { + set_replicas(from.replicas()); + } + if (from.restart_policy() != 0) { + set_restart_policy(from.restart_policy()); + } +} + +void DistributedTensorflowTrainingReplicaSpec::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DistributedTensorflowTrainingReplicaSpec::CopyFrom(const DistributedTensorflowTrainingReplicaSpec& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DistributedTensorflowTrainingReplicaSpec::IsInitialized() const { + return true; +} + +void DistributedTensorflowTrainingReplicaSpec::Swap(DistributedTensorflowTrainingReplicaSpec* other) { + if (other == this) return; + InternalSwap(other); +} +void DistributedTensorflowTrainingReplicaSpec::InternalSwap(DistributedTensorflowTrainingReplicaSpec* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + image_.Swap(&other->image_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(resources_, other->resources_); + swap(replicas_, other->replicas_); + swap(restart_policy_, other->restart_policy_); +} + +::google::protobuf::Metadata DistributedTensorflowTrainingReplicaSpec::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto); + return ::file_level_metadata_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl +namespace google { +namespace protobuf { +template<> PROTOBUF_NOINLINE ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingTask* Arena::CreateMaybeMessage< ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingTask >(Arena* arena) { + return Arena::CreateInternal< ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingTask >(arena); +} +template<> PROTOBUF_NOINLINE ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* Arena::CreateMaybeMessage< ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec >(Arena* arena) { + return Arena::CreateInternal< ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) +#include diff --git a/gen/pb-cpp/flyteidl/plugins/kubeflow/tensorflow.pb.h b/gen/pb-cpp/flyteidl/plugins/kubeflow/tensorflow.pb.h new file mode 100644 index 000000000..9839ca481 --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/kubeflow/tensorflow.pb.h @@ -0,0 +1,718 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/kubeflow/tensorflow.proto + +#ifndef PROTOBUF_INCLUDED_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto +#define PROTOBUF_INCLUDED_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3007000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "flyteidl/core/tasks.pb.h" +#include "flyteidl/plugins/kubeflow/common.pb.h" +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto + +// Internal implementation detail -- do not use these members. +struct TableStruct_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto { + static const ::google::protobuf::internal::ParseTableField entries[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::AuxillaryParseTableField aux[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::ParseTable schema[2] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto(); +namespace flyteidl { +namespace plugins { +namespace kubeflow { +class DistributedTensorflowTrainingReplicaSpec; +class DistributedTensorflowTrainingReplicaSpecDefaultTypeInternal; +extern DistributedTensorflowTrainingReplicaSpecDefaultTypeInternal _DistributedTensorflowTrainingReplicaSpec_default_instance_; +class DistributedTensorflowTrainingTask; +class DistributedTensorflowTrainingTaskDefaultTypeInternal; +extern DistributedTensorflowTrainingTaskDefaultTypeInternal _DistributedTensorflowTrainingTask_default_instance_; +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl +namespace google { +namespace protobuf { +template<> ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* Arena::CreateMaybeMessage<::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec>(Arena*); +template<> ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingTask* Arena::CreateMaybeMessage<::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingTask>(Arena*); +} // namespace protobuf +} // namespace google +namespace flyteidl { +namespace plugins { +namespace kubeflow { + +// =================================================================== + +class DistributedTensorflowTrainingTask final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) */ { + public: + DistributedTensorflowTrainingTask(); + virtual ~DistributedTensorflowTrainingTask(); + + DistributedTensorflowTrainingTask(const DistributedTensorflowTrainingTask& from); + + inline DistributedTensorflowTrainingTask& operator=(const DistributedTensorflowTrainingTask& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DistributedTensorflowTrainingTask(DistributedTensorflowTrainingTask&& from) noexcept + : DistributedTensorflowTrainingTask() { + *this = ::std::move(from); + } + + inline DistributedTensorflowTrainingTask& operator=(DistributedTensorflowTrainingTask&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const DistributedTensorflowTrainingTask& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DistributedTensorflowTrainingTask* internal_default_instance() { + return reinterpret_cast( + &_DistributedTensorflowTrainingTask_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(DistributedTensorflowTrainingTask* other); + friend void swap(DistributedTensorflowTrainingTask& a, DistributedTensorflowTrainingTask& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DistributedTensorflowTrainingTask* New() const final { + return CreateMaybeMessage(nullptr); + } + + DistributedTensorflowTrainingTask* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DistributedTensorflowTrainingTask& from); + void MergeFrom(const DistributedTensorflowTrainingTask& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DistributedTensorflowTrainingTask* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + bool has_worker_replicas() const; + void clear_worker_replicas(); + static const int kWorkerReplicasFieldNumber = 1; + const ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec& worker_replicas() const; + ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* release_worker_replicas(); + ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* mutable_worker_replicas(); + void set_allocated_worker_replicas(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* worker_replicas); + + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + bool has_ps_replicas() const; + void clear_ps_replicas(); + static const int kPsReplicasFieldNumber = 2; + const ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec& ps_replicas() const; + ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* release_ps_replicas(); + ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* mutable_ps_replicas(); + void set_allocated_ps_replicas(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* ps_replicas); + + // .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + bool has_chief_replicas() const; + void clear_chief_replicas(); + static const int kChiefReplicasFieldNumber = 3; + const ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec& chief_replicas() const; + ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* release_chief_replicas(); + ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* mutable_chief_replicas(); + void set_allocated_chief_replicas(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* chief_replicas); + + // .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + bool has_run_policy() const; + void clear_run_policy(); + static const int kRunPolicyFieldNumber = 4; + const ::flyteidl::plugins::kubeflow::RunPolicy& run_policy() const; + ::flyteidl::plugins::kubeflow::RunPolicy* release_run_policy(); + ::flyteidl::plugins::kubeflow::RunPolicy* mutable_run_policy(); + void set_allocated_run_policy(::flyteidl::plugins::kubeflow::RunPolicy* run_policy); + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* worker_replicas_; + ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* ps_replicas_; + ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* chief_replicas_; + ::flyteidl::plugins::kubeflow::RunPolicy* run_policy_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto; +}; +// ------------------------------------------------------------------- + +class DistributedTensorflowTrainingReplicaSpec final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) */ { + public: + DistributedTensorflowTrainingReplicaSpec(); + virtual ~DistributedTensorflowTrainingReplicaSpec(); + + DistributedTensorflowTrainingReplicaSpec(const DistributedTensorflowTrainingReplicaSpec& from); + + inline DistributedTensorflowTrainingReplicaSpec& operator=(const DistributedTensorflowTrainingReplicaSpec& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DistributedTensorflowTrainingReplicaSpec(DistributedTensorflowTrainingReplicaSpec&& from) noexcept + : DistributedTensorflowTrainingReplicaSpec() { + *this = ::std::move(from); + } + + inline DistributedTensorflowTrainingReplicaSpec& operator=(DistributedTensorflowTrainingReplicaSpec&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const DistributedTensorflowTrainingReplicaSpec& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DistributedTensorflowTrainingReplicaSpec* internal_default_instance() { + return reinterpret_cast( + &_DistributedTensorflowTrainingReplicaSpec_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(DistributedTensorflowTrainingReplicaSpec* other); + friend void swap(DistributedTensorflowTrainingReplicaSpec& a, DistributedTensorflowTrainingReplicaSpec& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DistributedTensorflowTrainingReplicaSpec* New() const final { + return CreateMaybeMessage(nullptr); + } + + DistributedTensorflowTrainingReplicaSpec* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DistributedTensorflowTrainingReplicaSpec& from); + void MergeFrom(const DistributedTensorflowTrainingReplicaSpec& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DistributedTensorflowTrainingReplicaSpec* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string image = 2; + void clear_image(); + static const int kImageFieldNumber = 2; + const ::std::string& image() const; + void set_image(const ::std::string& value); + #if LANG_CXX11 + void set_image(::std::string&& value); + #endif + void set_image(const char* value); + void set_image(const char* value, size_t size); + ::std::string* mutable_image(); + ::std::string* release_image(); + void set_allocated_image(::std::string* image); + + // .flyteidl.core.Resources resources = 3; + bool has_resources() const; + void clear_resources(); + static const int kResourcesFieldNumber = 3; + const ::flyteidl::core::Resources& resources() const; + ::flyteidl::core::Resources* release_resources(); + ::flyteidl::core::Resources* mutable_resources(); + void set_allocated_resources(::flyteidl::core::Resources* resources); + + // int32 replicas = 1; + void clear_replicas(); + static const int kReplicasFieldNumber = 1; + ::google::protobuf::int32 replicas() const; + void set_replicas(::google::protobuf::int32 value); + + // .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + void clear_restart_policy(); + static const int kRestartPolicyFieldNumber = 4; + ::flyteidl::plugins::kubeflow::RestartPolicy restart_policy() const; + void set_restart_policy(::flyteidl::plugins::kubeflow::RestartPolicy value); + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr image_; + ::flyteidl::core::Resources* resources_; + ::google::protobuf::int32 replicas_; + int restart_policy_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// DistributedTensorflowTrainingTask + +// .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; +inline bool DistributedTensorflowTrainingTask::has_worker_replicas() const { + return this != internal_default_instance() && worker_replicas_ != nullptr; +} +inline void DistributedTensorflowTrainingTask::clear_worker_replicas() { + if (GetArenaNoVirtual() == nullptr && worker_replicas_ != nullptr) { + delete worker_replicas_; + } + worker_replicas_ = nullptr; +} +inline const ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec& DistributedTensorflowTrainingTask::worker_replicas() const { + const ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* p = worker_replicas_; + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask.worker_replicas) + return p != nullptr ? *p : *reinterpret_cast( + &::flyteidl::plugins::kubeflow::_DistributedTensorflowTrainingReplicaSpec_default_instance_); +} +inline ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* DistributedTensorflowTrainingTask::release_worker_replicas() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask.worker_replicas) + + ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* temp = worker_replicas_; + worker_replicas_ = nullptr; + return temp; +} +inline ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* DistributedTensorflowTrainingTask::mutable_worker_replicas() { + + if (worker_replicas_ == nullptr) { + auto* p = CreateMaybeMessage<::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec>(GetArenaNoVirtual()); + worker_replicas_ = p; + } + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask.worker_replicas) + return worker_replicas_; +} +inline void DistributedTensorflowTrainingTask::set_allocated_worker_replicas(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* worker_replicas) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete worker_replicas_; + } + if (worker_replicas) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + worker_replicas = ::google::protobuf::internal::GetOwnedMessage( + message_arena, worker_replicas, submessage_arena); + } + + } else { + + } + worker_replicas_ = worker_replicas; + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask.worker_replicas) +} + +// .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; +inline bool DistributedTensorflowTrainingTask::has_ps_replicas() const { + return this != internal_default_instance() && ps_replicas_ != nullptr; +} +inline void DistributedTensorflowTrainingTask::clear_ps_replicas() { + if (GetArenaNoVirtual() == nullptr && ps_replicas_ != nullptr) { + delete ps_replicas_; + } + ps_replicas_ = nullptr; +} +inline const ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec& DistributedTensorflowTrainingTask::ps_replicas() const { + const ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* p = ps_replicas_; + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask.ps_replicas) + return p != nullptr ? *p : *reinterpret_cast( + &::flyteidl::plugins::kubeflow::_DistributedTensorflowTrainingReplicaSpec_default_instance_); +} +inline ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* DistributedTensorflowTrainingTask::release_ps_replicas() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask.ps_replicas) + + ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* temp = ps_replicas_; + ps_replicas_ = nullptr; + return temp; +} +inline ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* DistributedTensorflowTrainingTask::mutable_ps_replicas() { + + if (ps_replicas_ == nullptr) { + auto* p = CreateMaybeMessage<::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec>(GetArenaNoVirtual()); + ps_replicas_ = p; + } + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask.ps_replicas) + return ps_replicas_; +} +inline void DistributedTensorflowTrainingTask::set_allocated_ps_replicas(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* ps_replicas) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete ps_replicas_; + } + if (ps_replicas) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + ps_replicas = ::google::protobuf::internal::GetOwnedMessage( + message_arena, ps_replicas, submessage_arena); + } + + } else { + + } + ps_replicas_ = ps_replicas; + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask.ps_replicas) +} + +// .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; +inline bool DistributedTensorflowTrainingTask::has_chief_replicas() const { + return this != internal_default_instance() && chief_replicas_ != nullptr; +} +inline void DistributedTensorflowTrainingTask::clear_chief_replicas() { + if (GetArenaNoVirtual() == nullptr && chief_replicas_ != nullptr) { + delete chief_replicas_; + } + chief_replicas_ = nullptr; +} +inline const ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec& DistributedTensorflowTrainingTask::chief_replicas() const { + const ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* p = chief_replicas_; + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask.chief_replicas) + return p != nullptr ? *p : *reinterpret_cast( + &::flyteidl::plugins::kubeflow::_DistributedTensorflowTrainingReplicaSpec_default_instance_); +} +inline ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* DistributedTensorflowTrainingTask::release_chief_replicas() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask.chief_replicas) + + ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* temp = chief_replicas_; + chief_replicas_ = nullptr; + return temp; +} +inline ::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* DistributedTensorflowTrainingTask::mutable_chief_replicas() { + + if (chief_replicas_ == nullptr) { + auto* p = CreateMaybeMessage<::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec>(GetArenaNoVirtual()); + chief_replicas_ = p; + } + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask.chief_replicas) + return chief_replicas_; +} +inline void DistributedTensorflowTrainingTask::set_allocated_chief_replicas(::flyteidl::plugins::kubeflow::DistributedTensorflowTrainingReplicaSpec* chief_replicas) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete chief_replicas_; + } + if (chief_replicas) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + chief_replicas = ::google::protobuf::internal::GetOwnedMessage( + message_arena, chief_replicas, submessage_arena); + } + + } else { + + } + chief_replicas_ = chief_replicas; + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask.chief_replicas) +} + +// .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; +inline bool DistributedTensorflowTrainingTask::has_run_policy() const { + return this != internal_default_instance() && run_policy_ != nullptr; +} +inline const ::flyteidl::plugins::kubeflow::RunPolicy& DistributedTensorflowTrainingTask::run_policy() const { + const ::flyteidl::plugins::kubeflow::RunPolicy* p = run_policy_; + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask.run_policy) + return p != nullptr ? *p : *reinterpret_cast( + &::flyteidl::plugins::kubeflow::_RunPolicy_default_instance_); +} +inline ::flyteidl::plugins::kubeflow::RunPolicy* DistributedTensorflowTrainingTask::release_run_policy() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask.run_policy) + + ::flyteidl::plugins::kubeflow::RunPolicy* temp = run_policy_; + run_policy_ = nullptr; + return temp; +} +inline ::flyteidl::plugins::kubeflow::RunPolicy* DistributedTensorflowTrainingTask::mutable_run_policy() { + + if (run_policy_ == nullptr) { + auto* p = CreateMaybeMessage<::flyteidl::plugins::kubeflow::RunPolicy>(GetArenaNoVirtual()); + run_policy_ = p; + } + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask.run_policy) + return run_policy_; +} +inline void DistributedTensorflowTrainingTask::set_allocated_run_policy(::flyteidl::plugins::kubeflow::RunPolicy* run_policy) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(run_policy_); + } + if (run_policy) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + run_policy = ::google::protobuf::internal::GetOwnedMessage( + message_arena, run_policy, submessage_arena); + } + + } else { + + } + run_policy_ = run_policy; + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask.run_policy) +} + +// ------------------------------------------------------------------- + +// DistributedTensorflowTrainingReplicaSpec + +// int32 replicas = 1; +inline void DistributedTensorflowTrainingReplicaSpec::clear_replicas() { + replicas_ = 0; +} +inline ::google::protobuf::int32 DistributedTensorflowTrainingReplicaSpec::replicas() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.replicas) + return replicas_; +} +inline void DistributedTensorflowTrainingReplicaSpec::set_replicas(::google::protobuf::int32 value) { + + replicas_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.replicas) +} + +// string image = 2; +inline void DistributedTensorflowTrainingReplicaSpec::clear_image() { + image_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& DistributedTensorflowTrainingReplicaSpec::image() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.image) + return image_.GetNoArena(); +} +inline void DistributedTensorflowTrainingReplicaSpec::set_image(const ::std::string& value) { + + image_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.image) +} +#if LANG_CXX11 +inline void DistributedTensorflowTrainingReplicaSpec::set_image(::std::string&& value) { + + image_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.image) +} +#endif +inline void DistributedTensorflowTrainingReplicaSpec::set_image(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + image_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.image) +} +inline void DistributedTensorflowTrainingReplicaSpec::set_image(const char* value, size_t size) { + + image_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.image) +} +inline ::std::string* DistributedTensorflowTrainingReplicaSpec::mutable_image() { + + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.image) + return image_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DistributedTensorflowTrainingReplicaSpec::release_image() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.image) + + return image_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DistributedTensorflowTrainingReplicaSpec::set_allocated_image(::std::string* image) { + if (image != nullptr) { + + } else { + + } + image_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), image); + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.image) +} + +// .flyteidl.core.Resources resources = 3; +inline bool DistributedTensorflowTrainingReplicaSpec::has_resources() const { + return this != internal_default_instance() && resources_ != nullptr; +} +inline const ::flyteidl::core::Resources& DistributedTensorflowTrainingReplicaSpec::resources() const { + const ::flyteidl::core::Resources* p = resources_; + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.resources) + return p != nullptr ? *p : *reinterpret_cast( + &::flyteidl::core::_Resources_default_instance_); +} +inline ::flyteidl::core::Resources* DistributedTensorflowTrainingReplicaSpec::release_resources() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.resources) + + ::flyteidl::core::Resources* temp = resources_; + resources_ = nullptr; + return temp; +} +inline ::flyteidl::core::Resources* DistributedTensorflowTrainingReplicaSpec::mutable_resources() { + + if (resources_ == nullptr) { + auto* p = CreateMaybeMessage<::flyteidl::core::Resources>(GetArenaNoVirtual()); + resources_ = p; + } + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.resources) + return resources_; +} +inline void DistributedTensorflowTrainingReplicaSpec::set_allocated_resources(::flyteidl::core::Resources* resources) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(resources_); + } + if (resources) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + resources = ::google::protobuf::internal::GetOwnedMessage( + message_arena, resources, submessage_arena); + } + + } else { + + } + resources_ = resources; + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.resources) +} + +// .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; +inline void DistributedTensorflowTrainingReplicaSpec::clear_restart_policy() { + restart_policy_ = 0; +} +inline ::flyteidl::plugins::kubeflow::RestartPolicy DistributedTensorflowTrainingReplicaSpec::restart_policy() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.restart_policy) + return static_cast< ::flyteidl::plugins::kubeflow::RestartPolicy >(restart_policy_); +} +inline void DistributedTensorflowTrainingReplicaSpec::set_restart_policy(::flyteidl::plugins::kubeflow::RestartPolicy value) { + + restart_policy_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec.restart_policy) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace kubeflow +} // namespace plugins +} // namespace flyteidl + +// @@protoc_insertion_point(global_scope) + +#include +#endif // PROTOBUF_INCLUDED_flyteidl_2fplugins_2fkubeflow_2ftensorflow_2eproto diff --git a/gen/pb-go/flyteidl/plugins/kubeflow/common.pb.go b/gen/pb-go/flyteidl/plugins/kubeflow/common.pb.go new file mode 100644 index 000000000..5a9e51d44 --- /dev/null +++ b/gen/pb-go/flyteidl/plugins/kubeflow/common.pb.go @@ -0,0 +1,183 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: flyteidl/plugins/kubeflow/common.proto + +package plugins + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type RestartPolicy int32 + +const ( + RestartPolicy_RESTART_POLICY_NEVER RestartPolicy = 0 + RestartPolicy_RESTART_POLICY_ON_FAILURE RestartPolicy = 1 + RestartPolicy_RESTART_POLICY_ALWAYS RestartPolicy = 2 +) + +var RestartPolicy_name = map[int32]string{ + 0: "RESTART_POLICY_NEVER", + 1: "RESTART_POLICY_ON_FAILURE", + 2: "RESTART_POLICY_ALWAYS", +} + +var RestartPolicy_value = map[string]int32{ + "RESTART_POLICY_NEVER": 0, + "RESTART_POLICY_ON_FAILURE": 1, + "RESTART_POLICY_ALWAYS": 2, +} + +func (x RestartPolicy) String() string { + return proto.EnumName(RestartPolicy_name, int32(x)) +} + +func (RestartPolicy) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_f625aa9156a15090, []int{0} +} + +type CleanPodPolicy int32 + +const ( + CleanPodPolicy_CLEANPOD_POLICY_NONE CleanPodPolicy = 0 + CleanPodPolicy_CLEANPOD_POLICY_RUNNING CleanPodPolicy = 1 + CleanPodPolicy_CLEANPOD_POLICY_ALL CleanPodPolicy = 2 +) + +var CleanPodPolicy_name = map[int32]string{ + 0: "CLEANPOD_POLICY_NONE", + 1: "CLEANPOD_POLICY_RUNNING", + 2: "CLEANPOD_POLICY_ALL", +} + +var CleanPodPolicy_value = map[string]int32{ + "CLEANPOD_POLICY_NONE": 0, + "CLEANPOD_POLICY_RUNNING": 1, + "CLEANPOD_POLICY_ALL": 2, +} + +func (x CleanPodPolicy) String() string { + return proto.EnumName(CleanPodPolicy_name, int32(x)) +} + +func (CleanPodPolicy) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_f625aa9156a15090, []int{1} +} + +type RunPolicy struct { + // Defines the policy to kill pods after the job completes. Default to None. + CleanPodPolicy CleanPodPolicy `protobuf:"varint,1,opt,name=clean_pod_policy,json=cleanPodPolicy,proto3,enum=flyteidl.plugins.kubeflow.CleanPodPolicy" json:"clean_pod_policy,omitempty"` + // TTL to clean up jobs. Default to infinite. + TtlSecondsAfterFinished int32 `protobuf:"varint,2,opt,name=ttl_seconds_after_finished,json=ttlSecondsAfterFinished,proto3" json:"ttl_seconds_after_finished,omitempty"` + // Specifies the duration in seconds relative to the startTime that the job may be active + // before the system tries to terminate it; value must be positive integer. + ActiveDeadlineSeconds int32 `protobuf:"varint,3,opt,name=active_deadline_seconds,json=activeDeadlineSeconds,proto3" json:"active_deadline_seconds,omitempty"` + // Number of retries before marking this job failed. + BackoffLimit int32 `protobuf:"varint,4,opt,name=backoff_limit,json=backoffLimit,proto3" json:"backoff_limit,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RunPolicy) Reset() { *m = RunPolicy{} } +func (m *RunPolicy) String() string { return proto.CompactTextString(m) } +func (*RunPolicy) ProtoMessage() {} +func (*RunPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_f625aa9156a15090, []int{0} +} + +func (m *RunPolicy) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RunPolicy.Unmarshal(m, b) +} +func (m *RunPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RunPolicy.Marshal(b, m, deterministic) +} +func (m *RunPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_RunPolicy.Merge(m, src) +} +func (m *RunPolicy) XXX_Size() int { + return xxx_messageInfo_RunPolicy.Size(m) +} +func (m *RunPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_RunPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_RunPolicy proto.InternalMessageInfo + +func (m *RunPolicy) GetCleanPodPolicy() CleanPodPolicy { + if m != nil { + return m.CleanPodPolicy + } + return CleanPodPolicy_CLEANPOD_POLICY_NONE +} + +func (m *RunPolicy) GetTtlSecondsAfterFinished() int32 { + if m != nil { + return m.TtlSecondsAfterFinished + } + return 0 +} + +func (m *RunPolicy) GetActiveDeadlineSeconds() int32 { + if m != nil { + return m.ActiveDeadlineSeconds + } + return 0 +} + +func (m *RunPolicy) GetBackoffLimit() int32 { + if m != nil { + return m.BackoffLimit + } + return 0 +} + +func init() { + proto.RegisterEnum("flyteidl.plugins.kubeflow.RestartPolicy", RestartPolicy_name, RestartPolicy_value) + proto.RegisterEnum("flyteidl.plugins.kubeflow.CleanPodPolicy", CleanPodPolicy_name, CleanPodPolicy_value) + proto.RegisterType((*RunPolicy)(nil), "flyteidl.plugins.kubeflow.RunPolicy") +} + +func init() { + proto.RegisterFile("flyteidl/plugins/kubeflow/common.proto", fileDescriptor_f625aa9156a15090) +} + +var fileDescriptor_f625aa9156a15090 = []byte{ + // 379 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xdf, 0xab, 0xd3, 0x30, + 0x1c, 0xc5, 0x6f, 0xe7, 0x0f, 0x30, 0x78, 0x47, 0x89, 0x5e, 0xda, 0x29, 0xc2, 0x50, 0x90, 0x39, + 0xb0, 0x05, 0x05, 0x45, 0x7c, 0xaa, 0x5b, 0x27, 0x83, 0xd2, 0x96, 0x74, 0x53, 0xe6, 0x4b, 0x6c, + 0xd3, 0xb4, 0x0b, 0x4b, 0x93, 0xd2, 0xa6, 0xca, 0xfe, 0x75, 0x9f, 0xa4, 0x5d, 0x37, 0x58, 0xe1, + 0x3e, 0xe6, 0x7c, 0xce, 0xf7, 0x7c, 0x43, 0x72, 0xc0, 0xdb, 0x8c, 0x1f, 0x15, 0x65, 0x29, 0xb7, + 0x4b, 0xde, 0xe4, 0x4c, 0xd4, 0xf6, 0xa1, 0x49, 0x68, 0xc6, 0xe5, 0x5f, 0x9b, 0xc8, 0xa2, 0x90, + 0xc2, 0x2a, 0x2b, 0xa9, 0x24, 0x9c, 0x9c, 0x7d, 0x56, 0xef, 0xb3, 0xce, 0xbe, 0xd7, 0xff, 0x34, + 0xf0, 0x04, 0x35, 0x22, 0x94, 0x9c, 0x91, 0x23, 0x8c, 0x80, 0x4e, 0x38, 0x8d, 0x05, 0x2e, 0x65, + 0x8a, 0xcb, 0x4e, 0x33, 0xb5, 0xa9, 0x36, 0x1b, 0x7f, 0x78, 0x67, 0xdd, 0x9b, 0x61, 0x2d, 0xda, + 0x91, 0x50, 0xa6, 0xa7, 0x10, 0x34, 0x26, 0x57, 0x67, 0xf8, 0x15, 0xbc, 0x50, 0x8a, 0xe3, 0x9a, + 0x12, 0x29, 0xd2, 0x1a, 0xc7, 0x99, 0xa2, 0x15, 0xce, 0x98, 0x60, 0xf5, 0x9e, 0xa6, 0xe6, 0x68, + 0xaa, 0xcd, 0x1e, 0x21, 0x43, 0x29, 0x1e, 0x9d, 0x0c, 0x4e, 0xcb, 0x57, 0x3d, 0x86, 0x9f, 0x80, + 0x11, 0x13, 0xc5, 0xfe, 0x50, 0x9c, 0xd2, 0x38, 0xe5, 0x4c, 0xd0, 0x73, 0x90, 0xf9, 0xa0, 0x9b, + 0xbc, 0x3b, 0xe1, 0x65, 0x4f, 0xfb, 0x10, 0xf8, 0x06, 0xdc, 0x26, 0x31, 0x39, 0xc8, 0x2c, 0xc3, + 0x9c, 0x15, 0x4c, 0x99, 0x0f, 0x3b, 0xf7, 0xd3, 0x5e, 0xf4, 0x5a, 0x6d, 0x4e, 0xc0, 0x2d, 0xa2, + 0xb5, 0x8a, 0x2b, 0xd5, 0x5f, 0xd5, 0x04, 0xcf, 0x91, 0x1b, 0x6d, 0x1c, 0xb4, 0xc1, 0x61, 0xe0, + 0xad, 0x17, 0x3b, 0xec, 0xbb, 0x3f, 0x5c, 0xa4, 0xdf, 0xc0, 0x57, 0x60, 0x32, 0x20, 0x81, 0x8f, + 0x57, 0xce, 0xda, 0xdb, 0x22, 0x57, 0xd7, 0xe0, 0x04, 0xdc, 0x0d, 0xb0, 0xe3, 0xfd, 0x74, 0x76, + 0x91, 0x3e, 0x9a, 0xff, 0x06, 0xe3, 0xeb, 0x07, 0x6a, 0xb7, 0x2c, 0x3c, 0xd7, 0xf1, 0xc3, 0x60, + 0x79, 0x59, 0x13, 0xf8, 0xae, 0x7e, 0x03, 0x5f, 0x02, 0x63, 0x48, 0xd0, 0xd6, 0xf7, 0xd7, 0xfe, + 0x77, 0x5d, 0x83, 0x06, 0x78, 0x36, 0x84, 0x8e, 0xe7, 0xe9, 0xa3, 0x6f, 0x5f, 0x7e, 0x7d, 0xce, + 0x99, 0xda, 0x37, 0x89, 0x45, 0x64, 0x61, 0x77, 0xff, 0x24, 0xab, 0xdc, 0xbe, 0x94, 0x23, 0xa7, + 0xc2, 0x2e, 0x93, 0xf7, 0xb9, 0xb4, 0x87, 0x7d, 0x49, 0x1e, 0x77, 0x05, 0xf9, 0xf8, 0x3f, 0x00, + 0x00, 0xff, 0xff, 0x98, 0x4b, 0x46, 0x68, 0x4a, 0x02, 0x00, 0x00, +} diff --git a/gen/pb-go/flyteidl/plugins/kubeflow/common.pb.validate.go b/gen/pb-go/flyteidl/plugins/kubeflow/common.pb.validate.go new file mode 100644 index 000000000..0ec2f0e0e --- /dev/null +++ b/gen/pb-go/flyteidl/plugins/kubeflow/common.pb.validate.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: flyteidl/plugins/kubeflow/common.proto + +package plugins + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _common_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on RunPolicy with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *RunPolicy) Validate() error { + if m == nil { + return nil + } + + // no validation rules for CleanPodPolicy + + // no validation rules for TtlSecondsAfterFinished + + // no validation rules for ActiveDeadlineSeconds + + // no validation rules for BackoffLimit + + return nil +} + +// RunPolicyValidationError is the validation error returned by +// RunPolicy.Validate if the designated constraints aren't met. +type RunPolicyValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RunPolicyValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RunPolicyValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RunPolicyValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RunPolicyValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RunPolicyValidationError) ErrorName() string { return "RunPolicyValidationError" } + +// Error satisfies the builtin error interface +func (e RunPolicyValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRunPolicy.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RunPolicyValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RunPolicyValidationError{} diff --git a/gen/pb-go/flyteidl/plugins/kubeflow/mpi.pb.go b/gen/pb-go/flyteidl/plugins/kubeflow/mpi.pb.go new file mode 100644 index 000000000..40420db3e --- /dev/null +++ b/gen/pb-go/flyteidl/plugins/kubeflow/mpi.pb.go @@ -0,0 +1,206 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: flyteidl/plugins/kubeflow/mpi.proto + +package plugins + +import ( + fmt "fmt" + core "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + proto "github.com/golang/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// Proto for plugin that enables distributed training using https://github.com/kubeflow/mpi-operator +type DistributedMPITrainingTask struct { + // Worker replicas spec + WorkerReplicas *DistributedMPITrainingReplicaSpec `protobuf:"bytes,1,opt,name=worker_replicas,json=workerReplicas,proto3" json:"worker_replicas,omitempty"` + // Master replicas spec + LauncherReplicas *DistributedMPITrainingReplicaSpec `protobuf:"bytes,2,opt,name=launcher_replicas,json=launcherReplicas,proto3" json:"launcher_replicas,omitempty"` + // RunPolicy encapsulates various runtime policies of the distributed training + // job, for example how to clean up resources and how long the job can stay + // active. + RunPolicy *RunPolicy `protobuf:"bytes,3,opt,name=run_policy,json=runPolicy,proto3" json:"run_policy,omitempty"` + // Number of slots per worker + Slots int32 `protobuf:"varint,4,opt,name=slots,proto3" json:"slots,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DistributedMPITrainingTask) Reset() { *m = DistributedMPITrainingTask{} } +func (m *DistributedMPITrainingTask) String() string { return proto.CompactTextString(m) } +func (*DistributedMPITrainingTask) ProtoMessage() {} +func (*DistributedMPITrainingTask) Descriptor() ([]byte, []int) { + return fileDescriptor_298b02c608b0cddf, []int{0} +} + +func (m *DistributedMPITrainingTask) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DistributedMPITrainingTask.Unmarshal(m, b) +} +func (m *DistributedMPITrainingTask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DistributedMPITrainingTask.Marshal(b, m, deterministic) +} +func (m *DistributedMPITrainingTask) XXX_Merge(src proto.Message) { + xxx_messageInfo_DistributedMPITrainingTask.Merge(m, src) +} +func (m *DistributedMPITrainingTask) XXX_Size() int { + return xxx_messageInfo_DistributedMPITrainingTask.Size(m) +} +func (m *DistributedMPITrainingTask) XXX_DiscardUnknown() { + xxx_messageInfo_DistributedMPITrainingTask.DiscardUnknown(m) +} + +var xxx_messageInfo_DistributedMPITrainingTask proto.InternalMessageInfo + +func (m *DistributedMPITrainingTask) GetWorkerReplicas() *DistributedMPITrainingReplicaSpec { + if m != nil { + return m.WorkerReplicas + } + return nil +} + +func (m *DistributedMPITrainingTask) GetLauncherReplicas() *DistributedMPITrainingReplicaSpec { + if m != nil { + return m.LauncherReplicas + } + return nil +} + +func (m *DistributedMPITrainingTask) GetRunPolicy() *RunPolicy { + if m != nil { + return m.RunPolicy + } + return nil +} + +func (m *DistributedMPITrainingTask) GetSlots() int32 { + if m != nil { + return m.Slots + } + return 0 +} + +// Replica specification for distributed MPI training +type DistributedMPITrainingReplicaSpec struct { + // Number of replicas + Replicas int32 `protobuf:"varint,1,opt,name=replicas,proto3" json:"replicas,omitempty"` + // Image used for the replica group + Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` + // Resources required for the replica group + Resources *core.Resources `protobuf:"bytes,3,opt,name=resources,proto3" json:"resources,omitempty"` + // Restart policy determines whether pods will be restarted when they exit + RestartPolicy RestartPolicy `protobuf:"varint,4,opt,name=restart_policy,json=restartPolicy,proto3,enum=flyteidl.plugins.kubeflow.RestartPolicy" json:"restart_policy,omitempty"` + // MPI sometimes requires different command set for different replica groups + Command []string `protobuf:"bytes,5,rep,name=command,proto3" json:"command,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DistributedMPITrainingReplicaSpec) Reset() { *m = DistributedMPITrainingReplicaSpec{} } +func (m *DistributedMPITrainingReplicaSpec) String() string { return proto.CompactTextString(m) } +func (*DistributedMPITrainingReplicaSpec) ProtoMessage() {} +func (*DistributedMPITrainingReplicaSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_298b02c608b0cddf, []int{1} +} + +func (m *DistributedMPITrainingReplicaSpec) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DistributedMPITrainingReplicaSpec.Unmarshal(m, b) +} +func (m *DistributedMPITrainingReplicaSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DistributedMPITrainingReplicaSpec.Marshal(b, m, deterministic) +} +func (m *DistributedMPITrainingReplicaSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_DistributedMPITrainingReplicaSpec.Merge(m, src) +} +func (m *DistributedMPITrainingReplicaSpec) XXX_Size() int { + return xxx_messageInfo_DistributedMPITrainingReplicaSpec.Size(m) +} +func (m *DistributedMPITrainingReplicaSpec) XXX_DiscardUnknown() { + xxx_messageInfo_DistributedMPITrainingReplicaSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_DistributedMPITrainingReplicaSpec proto.InternalMessageInfo + +func (m *DistributedMPITrainingReplicaSpec) GetReplicas() int32 { + if m != nil { + return m.Replicas + } + return 0 +} + +func (m *DistributedMPITrainingReplicaSpec) GetImage() string { + if m != nil { + return m.Image + } + return "" +} + +func (m *DistributedMPITrainingReplicaSpec) GetResources() *core.Resources { + if m != nil { + return m.Resources + } + return nil +} + +func (m *DistributedMPITrainingReplicaSpec) GetRestartPolicy() RestartPolicy { + if m != nil { + return m.RestartPolicy + } + return RestartPolicy_RESTART_POLICY_NEVER +} + +func (m *DistributedMPITrainingReplicaSpec) GetCommand() []string { + if m != nil { + return m.Command + } + return nil +} + +func init() { + proto.RegisterType((*DistributedMPITrainingTask)(nil), "flyteidl.plugins.kubeflow.DistributedMPITrainingTask") + proto.RegisterType((*DistributedMPITrainingReplicaSpec)(nil), "flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec") +} + +func init() { + proto.RegisterFile("flyteidl/plugins/kubeflow/mpi.proto", fileDescriptor_298b02c608b0cddf) +} + +var fileDescriptor_298b02c608b0cddf = []byte{ + // 373 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0x4d, 0x6b, 0xdb, 0x30, + 0x00, 0xc5, 0xc9, 0xbc, 0xcd, 0x1a, 0xcb, 0x36, 0xb1, 0x83, 0xe7, 0x53, 0x96, 0x8d, 0xe1, 0xcb, + 0x2c, 0xc8, 0x60, 0xa5, 0xd0, 0x53, 0xdb, 0x4b, 0x0f, 0xa5, 0x41, 0xcd, 0xa9, 0x97, 0x20, 0x2b, + 0x8a, 0x23, 0x2c, 0x4b, 0x46, 0x1f, 0x84, 0xfc, 0xc4, 0xfe, 0xa3, 0x1e, 0x8b, 0x3f, 0x93, 0x96, + 0x26, 0xbd, 0xf4, 0xe6, 0x67, 0x3d, 0xbd, 0x0f, 0xfb, 0x81, 0x5f, 0x2b, 0xb1, 0xb5, 0x8c, 0x2f, + 0x05, 0x2a, 0x85, 0xcb, 0xb8, 0x34, 0x28, 0x77, 0x29, 0x5b, 0x09, 0xb5, 0x41, 0x45, 0xc9, 0x93, + 0x52, 0x2b, 0xab, 0xe0, 0x8f, 0x8e, 0x94, 0xb4, 0xa4, 0xa4, 0x23, 0x45, 0xfd, 0x11, 0xa2, 0x4a, + 0x33, 0x64, 0x89, 0xc9, 0x4d, 0x73, 0x2b, 0xfa, 0x73, 0x58, 0x9a, 0xaa, 0xa2, 0x50, 0xb2, 0xe1, + 0x4d, 0xee, 0x07, 0x20, 0xba, 0xe4, 0xc6, 0x6a, 0x9e, 0x3a, 0xcb, 0x96, 0xd7, 0xb3, 0xab, 0xb9, + 0x26, 0x5c, 0x72, 0x99, 0xcd, 0x89, 0xc9, 0x21, 0x03, 0x5f, 0x36, 0x4a, 0xe7, 0x4c, 0x2f, 0x34, + 0x2b, 0x05, 0xa7, 0xc4, 0x84, 0xde, 0xd8, 0x8b, 0x3f, 0x4d, 0xcf, 0x92, 0x83, 0xb1, 0x92, 0x97, + 0xf5, 0x70, 0x23, 0x70, 0x5b, 0x32, 0x8a, 0x47, 0x8d, 0x68, 0xfb, 0xca, 0x40, 0x0e, 0xbe, 0x09, + 0xe2, 0x24, 0x5d, 0xef, 0x1b, 0x0d, 0xde, 0xc0, 0xe8, 0x6b, 0x27, 0xdb, 0x5b, 0x5d, 0x00, 0xa0, + 0x9d, 0x5c, 0x94, 0x4a, 0x70, 0xba, 0x0d, 0x87, 0xb5, 0xc7, 0xef, 0x23, 0x1e, 0xd8, 0xc9, 0x59, + 0xcd, 0xc5, 0x81, 0xee, 0x1e, 0xe1, 0x77, 0xe0, 0x1b, 0xa1, 0xac, 0x09, 0xdf, 0x8d, 0xbd, 0xd8, + 0xc7, 0x0d, 0x98, 0x3c, 0x78, 0xe0, 0xe7, 0xab, 0x91, 0x60, 0x04, 0x3e, 0x3e, 0xf9, 0x96, 0x3e, + 0xee, 0x71, 0xa5, 0xcb, 0x0b, 0x92, 0xb1, 0xba, 0x7b, 0x80, 0x1b, 0x00, 0xff, 0x83, 0x40, 0x33, + 0xa3, 0x9c, 0xa6, 0xcc, 0xb4, 0x89, 0xc3, 0x5d, 0xe2, 0xea, 0xd7, 0x27, 0xb8, 0x3b, 0xc7, 0x3b, + 0x2a, 0xbc, 0x01, 0x23, 0xcd, 0x8c, 0x25, 0xda, 0x76, 0x75, 0xab, 0xb8, 0xa3, 0x69, 0x7c, 0xac, + 0x6e, 0x73, 0xa1, 0xad, 0xfc, 0x59, 0xef, 0x43, 0x18, 0x82, 0x0f, 0xd5, 0x78, 0x88, 0x5c, 0x86, + 0xfe, 0x78, 0x18, 0x07, 0xb8, 0x83, 0xe7, 0xa7, 0x77, 0x27, 0x19, 0xb7, 0x6b, 0x97, 0x26, 0x54, + 0x15, 0xa8, 0x96, 0x57, 0x3a, 0x43, 0xfd, 0x08, 0x33, 0x26, 0x51, 0x99, 0xfe, 0xcd, 0x14, 0x7a, + 0xbe, 0xcb, 0xf4, 0x7d, 0x3d, 0xc4, 0x7f, 0x8f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x31, 0xf8, 0x1a, + 0x19, 0x0d, 0x03, 0x00, 0x00, +} diff --git a/gen/pb-go/flyteidl/plugins/kubeflow/mpi.pb.validate.go b/gen/pb-go/flyteidl/plugins/kubeflow/mpi.pb.validate.go new file mode 100644 index 000000000..a68e68a3f --- /dev/null +++ b/gen/pb-go/flyteidl/plugins/kubeflow/mpi.pb.validate.go @@ -0,0 +1,220 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: flyteidl/plugins/kubeflow/mpi.proto + +package plugins + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _mpi_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on DistributedMPITrainingTask with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *DistributedMPITrainingTask) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetWorkerReplicas()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DistributedMPITrainingTaskValidationError{ + field: "WorkerReplicas", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetLauncherReplicas()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DistributedMPITrainingTaskValidationError{ + field: "LauncherReplicas", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetRunPolicy()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DistributedMPITrainingTaskValidationError{ + field: "RunPolicy", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Slots + + return nil +} + +// DistributedMPITrainingTaskValidationError is the validation error returned +// by DistributedMPITrainingTask.Validate if the designated constraints aren't met. +type DistributedMPITrainingTaskValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DistributedMPITrainingTaskValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DistributedMPITrainingTaskValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DistributedMPITrainingTaskValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DistributedMPITrainingTaskValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DistributedMPITrainingTaskValidationError) ErrorName() string { + return "DistributedMPITrainingTaskValidationError" +} + +// Error satisfies the builtin error interface +func (e DistributedMPITrainingTaskValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDistributedMPITrainingTask.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DistributedMPITrainingTaskValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DistributedMPITrainingTaskValidationError{} + +// Validate checks the field values on DistributedMPITrainingReplicaSpec with +// the rules defined in the proto definition for this message. If any rules +// are violated, an error is returned. +func (m *DistributedMPITrainingReplicaSpec) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Replicas + + // no validation rules for Image + + if v, ok := interface{}(m.GetResources()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DistributedMPITrainingReplicaSpecValidationError{ + field: "Resources", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for RestartPolicy + + return nil +} + +// DistributedMPITrainingReplicaSpecValidationError is the validation error +// returned by DistributedMPITrainingReplicaSpec.Validate if the designated +// constraints aren't met. +type DistributedMPITrainingReplicaSpecValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DistributedMPITrainingReplicaSpecValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DistributedMPITrainingReplicaSpecValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DistributedMPITrainingReplicaSpecValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DistributedMPITrainingReplicaSpecValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DistributedMPITrainingReplicaSpecValidationError) ErrorName() string { + return "DistributedMPITrainingReplicaSpecValidationError" +} + +// Error satisfies the builtin error interface +func (e DistributedMPITrainingReplicaSpecValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDistributedMPITrainingReplicaSpec.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DistributedMPITrainingReplicaSpecValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DistributedMPITrainingReplicaSpecValidationError{} diff --git a/gen/pb-go/flyteidl/plugins/kubeflow/pytorch.pb.go b/gen/pb-go/flyteidl/plugins/kubeflow/pytorch.pb.go new file mode 100644 index 000000000..7cef6b322 --- /dev/null +++ b/gen/pb-go/flyteidl/plugins/kubeflow/pytorch.pb.go @@ -0,0 +1,276 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: flyteidl/plugins/kubeflow/pytorch.proto + +package plugins + +import ( + fmt "fmt" + core "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + proto "github.com/golang/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// Custom proto for torch elastic config for distributed training using +// https://github.com/kubeflow/training-operator/blob/master/pkg/apis/kubeflow.org/v1/pytorch_types.go +type ElasticConfig struct { + RdzvBackend string `protobuf:"bytes,1,opt,name=rdzv_backend,json=rdzvBackend,proto3" json:"rdzv_backend,omitempty"` + MinReplicas int32 `protobuf:"varint,2,opt,name=min_replicas,json=minReplicas,proto3" json:"min_replicas,omitempty"` + MaxReplicas int32 `protobuf:"varint,3,opt,name=max_replicas,json=maxReplicas,proto3" json:"max_replicas,omitempty"` + NprocPerNode int32 `protobuf:"varint,4,opt,name=nproc_per_node,json=nprocPerNode,proto3" json:"nproc_per_node,omitempty"` + MaxRestarts int32 `protobuf:"varint,5,opt,name=max_restarts,json=maxRestarts,proto3" json:"max_restarts,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ElasticConfig) Reset() { *m = ElasticConfig{} } +func (m *ElasticConfig) String() string { return proto.CompactTextString(m) } +func (*ElasticConfig) ProtoMessage() {} +func (*ElasticConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_37e97bee6e09d707, []int{0} +} + +func (m *ElasticConfig) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ElasticConfig.Unmarshal(m, b) +} +func (m *ElasticConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ElasticConfig.Marshal(b, m, deterministic) +} +func (m *ElasticConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_ElasticConfig.Merge(m, src) +} +func (m *ElasticConfig) XXX_Size() int { + return xxx_messageInfo_ElasticConfig.Size(m) +} +func (m *ElasticConfig) XXX_DiscardUnknown() { + xxx_messageInfo_ElasticConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_ElasticConfig proto.InternalMessageInfo + +func (m *ElasticConfig) GetRdzvBackend() string { + if m != nil { + return m.RdzvBackend + } + return "" +} + +func (m *ElasticConfig) GetMinReplicas() int32 { + if m != nil { + return m.MinReplicas + } + return 0 +} + +func (m *ElasticConfig) GetMaxReplicas() int32 { + if m != nil { + return m.MaxReplicas + } + return 0 +} + +func (m *ElasticConfig) GetNprocPerNode() int32 { + if m != nil { + return m.NprocPerNode + } + return 0 +} + +func (m *ElasticConfig) GetMaxRestarts() int32 { + if m != nil { + return m.MaxRestarts + } + return 0 +} + +// Proto for plugin that enables distributed training using https://github.com/kubeflow/pytorch-operator +type DistributedPyTorchTrainingTask struct { + // Worker replicas spec + WorkerReplicas *DistributedPyTorchTrainingReplicaSpec `protobuf:"bytes,1,opt,name=worker_replicas,json=workerReplicas,proto3" json:"worker_replicas,omitempty"` + // Master replicas spec, master replicas can only have 1 replica + MasterReplicas *DistributedPyTorchTrainingReplicaSpec `protobuf:"bytes,2,opt,name=master_replicas,json=masterReplicas,proto3" json:"master_replicas,omitempty"` + // RunPolicy encapsulates various runtime policies of the distributed training + // job, for example how to clean up resources and how long the job can stay + // active. + RunPolicy *RunPolicy `protobuf:"bytes,3,opt,name=run_policy,json=runPolicy,proto3" json:"run_policy,omitempty"` + // config for an elastic pytorch job + ElasticConfig *ElasticConfig `protobuf:"bytes,4,opt,name=elastic_config,json=elasticConfig,proto3" json:"elastic_config,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DistributedPyTorchTrainingTask) Reset() { *m = DistributedPyTorchTrainingTask{} } +func (m *DistributedPyTorchTrainingTask) String() string { return proto.CompactTextString(m) } +func (*DistributedPyTorchTrainingTask) ProtoMessage() {} +func (*DistributedPyTorchTrainingTask) Descriptor() ([]byte, []int) { + return fileDescriptor_37e97bee6e09d707, []int{1} +} + +func (m *DistributedPyTorchTrainingTask) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DistributedPyTorchTrainingTask.Unmarshal(m, b) +} +func (m *DistributedPyTorchTrainingTask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DistributedPyTorchTrainingTask.Marshal(b, m, deterministic) +} +func (m *DistributedPyTorchTrainingTask) XXX_Merge(src proto.Message) { + xxx_messageInfo_DistributedPyTorchTrainingTask.Merge(m, src) +} +func (m *DistributedPyTorchTrainingTask) XXX_Size() int { + return xxx_messageInfo_DistributedPyTorchTrainingTask.Size(m) +} +func (m *DistributedPyTorchTrainingTask) XXX_DiscardUnknown() { + xxx_messageInfo_DistributedPyTorchTrainingTask.DiscardUnknown(m) +} + +var xxx_messageInfo_DistributedPyTorchTrainingTask proto.InternalMessageInfo + +func (m *DistributedPyTorchTrainingTask) GetWorkerReplicas() *DistributedPyTorchTrainingReplicaSpec { + if m != nil { + return m.WorkerReplicas + } + return nil +} + +func (m *DistributedPyTorchTrainingTask) GetMasterReplicas() *DistributedPyTorchTrainingReplicaSpec { + if m != nil { + return m.MasterReplicas + } + return nil +} + +func (m *DistributedPyTorchTrainingTask) GetRunPolicy() *RunPolicy { + if m != nil { + return m.RunPolicy + } + return nil +} + +func (m *DistributedPyTorchTrainingTask) GetElasticConfig() *ElasticConfig { + if m != nil { + return m.ElasticConfig + } + return nil +} + +type DistributedPyTorchTrainingReplicaSpec struct { + // Number of replicas + Replicas int32 `protobuf:"varint,1,opt,name=replicas,proto3" json:"replicas,omitempty"` + // Image used for the replica group + Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` + // Resources required for the replica group + Resources *core.Resources `protobuf:"bytes,3,opt,name=resources,proto3" json:"resources,omitempty"` + // RestartPolicy determines whether pods will be restarted when they exit + RestartPolicy RestartPolicy `protobuf:"varint,4,opt,name=restart_policy,json=restartPolicy,proto3,enum=flyteidl.plugins.kubeflow.RestartPolicy" json:"restart_policy,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DistributedPyTorchTrainingReplicaSpec) Reset() { *m = DistributedPyTorchTrainingReplicaSpec{} } +func (m *DistributedPyTorchTrainingReplicaSpec) String() string { return proto.CompactTextString(m) } +func (*DistributedPyTorchTrainingReplicaSpec) ProtoMessage() {} +func (*DistributedPyTorchTrainingReplicaSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_37e97bee6e09d707, []int{2} +} + +func (m *DistributedPyTorchTrainingReplicaSpec) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DistributedPyTorchTrainingReplicaSpec.Unmarshal(m, b) +} +func (m *DistributedPyTorchTrainingReplicaSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DistributedPyTorchTrainingReplicaSpec.Marshal(b, m, deterministic) +} +func (m *DistributedPyTorchTrainingReplicaSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_DistributedPyTorchTrainingReplicaSpec.Merge(m, src) +} +func (m *DistributedPyTorchTrainingReplicaSpec) XXX_Size() int { + return xxx_messageInfo_DistributedPyTorchTrainingReplicaSpec.Size(m) +} +func (m *DistributedPyTorchTrainingReplicaSpec) XXX_DiscardUnknown() { + xxx_messageInfo_DistributedPyTorchTrainingReplicaSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_DistributedPyTorchTrainingReplicaSpec proto.InternalMessageInfo + +func (m *DistributedPyTorchTrainingReplicaSpec) GetReplicas() int32 { + if m != nil { + return m.Replicas + } + return 0 +} + +func (m *DistributedPyTorchTrainingReplicaSpec) GetImage() string { + if m != nil { + return m.Image + } + return "" +} + +func (m *DistributedPyTorchTrainingReplicaSpec) GetResources() *core.Resources { + if m != nil { + return m.Resources + } + return nil +} + +func (m *DistributedPyTorchTrainingReplicaSpec) GetRestartPolicy() RestartPolicy { + if m != nil { + return m.RestartPolicy + } + return RestartPolicy_RESTART_POLICY_NEVER +} + +func init() { + proto.RegisterType((*ElasticConfig)(nil), "flyteidl.plugins.kubeflow.ElasticConfig") + proto.RegisterType((*DistributedPyTorchTrainingTask)(nil), "flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask") + proto.RegisterType((*DistributedPyTorchTrainingReplicaSpec)(nil), "flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec") +} + +func init() { + proto.RegisterFile("flyteidl/plugins/kubeflow/pytorch.proto", fileDescriptor_37e97bee6e09d707) +} + +var fileDescriptor_37e97bee6e09d707 = []byte{ + // 468 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xcf, 0x8e, 0xd3, 0x30, + 0x10, 0xc6, 0xd5, 0x5d, 0x8a, 0xa8, 0xb3, 0xed, 0x4a, 0x11, 0x87, 0xd0, 0x03, 0x5a, 0xaa, 0x05, + 0x7a, 0x21, 0x91, 0x8a, 0x04, 0xe2, 0x86, 0x76, 0xe1, 0x0a, 0x95, 0xe9, 0x89, 0x4b, 0xe4, 0x38, + 0xd3, 0xac, 0x95, 0xc4, 0xb6, 0xc6, 0x0e, 0xbb, 0xe5, 0x19, 0x78, 0x29, 0x5e, 0x85, 0x27, 0x41, + 0x71, 0xfe, 0x75, 0x91, 0x5a, 0x71, 0xd8, 0x5b, 0x66, 0xfc, 0xcb, 0x37, 0xfe, 0xc6, 0x33, 0xe4, + 0xf5, 0xb6, 0xd8, 0x59, 0x10, 0x69, 0x11, 0xe9, 0xa2, 0xca, 0x84, 0x34, 0x51, 0x5e, 0x25, 0xb0, + 0x2d, 0xd4, 0x6d, 0xa4, 0x77, 0x56, 0x21, 0xbf, 0x09, 0x35, 0x2a, 0xab, 0xfc, 0x67, 0x1d, 0x18, + 0xb6, 0x60, 0xd8, 0x81, 0xf3, 0xfe, 0x28, 0xe2, 0x0a, 0x21, 0xb2, 0xcc, 0xe4, 0xa6, 0xf9, 0x6b, + 0xfe, 0xea, 0xb0, 0x3c, 0x57, 0x65, 0xa9, 0x64, 0xc3, 0x2d, 0x7e, 0x8f, 0xc8, 0xf4, 0x73, 0xc1, + 0x8c, 0x15, 0xfc, 0x5a, 0xc9, 0xad, 0xc8, 0xfc, 0x17, 0xe4, 0x0c, 0xd3, 0x9f, 0x3f, 0xe2, 0x84, + 0xf1, 0x1c, 0x64, 0x1a, 0x8c, 0x2e, 0x46, 0xcb, 0x09, 0xf5, 0xea, 0xdc, 0x55, 0x93, 0xaa, 0x91, + 0x52, 0xc8, 0x18, 0x41, 0x17, 0x82, 0x33, 0x13, 0x9c, 0x5c, 0x8c, 0x96, 0x63, 0xea, 0x95, 0x42, + 0xd2, 0x36, 0xe5, 0x10, 0x76, 0x37, 0x20, 0xa7, 0x2d, 0xc2, 0xee, 0x7a, 0xe4, 0x92, 0xcc, 0xa4, + 0x46, 0xc5, 0x63, 0x0d, 0x18, 0x4b, 0x95, 0x42, 0xf0, 0xc8, 0x41, 0x67, 0x2e, 0xbb, 0x06, 0xfc, + 0xa2, 0x52, 0x18, 0x84, 0x8c, 0x65, 0x68, 0x4d, 0x30, 0xde, 0x13, 0x6a, 0x52, 0x8b, 0x5f, 0xa7, + 0xe4, 0xf9, 0x27, 0x61, 0x2c, 0x8a, 0xa4, 0xb2, 0x90, 0xae, 0x77, 0x9b, 0xba, 0x7d, 0x1b, 0x64, + 0x42, 0x0a, 0x99, 0x6d, 0x98, 0xc9, 0x7d, 0x41, 0xce, 0x6f, 0x15, 0xe6, 0x80, 0xc3, 0x8d, 0x6a, + 0x5f, 0xde, 0xea, 0x63, 0x78, 0xb0, 0xbd, 0xe1, 0x61, 0xcd, 0xd6, 0xc3, 0x37, 0x0d, 0x9c, 0xce, + 0x1a, 0xe1, 0xde, 0x96, 0x20, 0xe7, 0x25, 0x33, 0x76, 0xbf, 0xd4, 0xc9, 0x43, 0x95, 0x6a, 0x84, + 0xfb, 0x52, 0xd7, 0x84, 0x60, 0x25, 0x63, 0xad, 0x0a, 0xc1, 0x77, 0xae, 0xc5, 0xde, 0xea, 0xf2, + 0x48, 0x15, 0x5a, 0xc9, 0xb5, 0x63, 0xe9, 0x04, 0xbb, 0x4f, 0xff, 0x2b, 0x99, 0x41, 0x33, 0x00, + 0x31, 0x77, 0x13, 0xe0, 0x9e, 0xc1, 0x5b, 0x2d, 0x8f, 0x08, 0xdd, 0x9b, 0x18, 0x3a, 0x85, 0xfd, + 0x70, 0xf1, 0x67, 0x44, 0x5e, 0xfe, 0x97, 0x1f, 0x7f, 0x4e, 0x9e, 0xdc, 0x7b, 0x8e, 0x31, 0xed, + 0x63, 0xff, 0x29, 0x19, 0x8b, 0x92, 0x65, 0xe0, 0x9a, 0x37, 0xa1, 0x4d, 0xe0, 0xbf, 0x23, 0x13, + 0x04, 0xa3, 0x2a, 0xe4, 0x60, 0x5a, 0xc3, 0xc1, 0x70, 0xcf, 0x7a, 0x0b, 0x42, 0xda, 0x9d, 0xd3, + 0x01, 0xad, 0x4d, 0xb6, 0x13, 0xd4, 0x75, 0xab, 0x36, 0x39, 0x3b, 0x6a, 0xb2, 0x9d, 0xaf, 0xb6, + 0x63, 0x53, 0xdc, 0x0f, 0xaf, 0x3e, 0x7c, 0x7f, 0x9f, 0x09, 0x7b, 0x53, 0x25, 0x21, 0x57, 0x65, + 0xe4, 0x44, 0x14, 0x66, 0x51, 0xbf, 0x75, 0x19, 0xc8, 0x48, 0x27, 0x6f, 0x32, 0x15, 0xfd, 0xbb, + 0x88, 0xc9, 0x63, 0xb7, 0x79, 0x6f, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xa3, 0xdb, 0x04, 0x89, + 0x02, 0x04, 0x00, 0x00, +} diff --git a/gen/pb-go/flyteidl/plugins/kubeflow/pytorch.pb.validate.go b/gen/pb-go/flyteidl/plugins/kubeflow/pytorch.pb.validate.go new file mode 100644 index 000000000..fa6e40749 --- /dev/null +++ b/gen/pb-go/flyteidl/plugins/kubeflow/pytorch.pb.validate.go @@ -0,0 +1,304 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: flyteidl/plugins/kubeflow/pytorch.proto + +package plugins + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _pytorch_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on ElasticConfig with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *ElasticConfig) Validate() error { + if m == nil { + return nil + } + + // no validation rules for RdzvBackend + + // no validation rules for MinReplicas + + // no validation rules for MaxReplicas + + // no validation rules for NprocPerNode + + // no validation rules for MaxRestarts + + return nil +} + +// ElasticConfigValidationError is the validation error returned by +// ElasticConfig.Validate if the designated constraints aren't met. +type ElasticConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ElasticConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ElasticConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ElasticConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ElasticConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ElasticConfigValidationError) ErrorName() string { return "ElasticConfigValidationError" } + +// Error satisfies the builtin error interface +func (e ElasticConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sElasticConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ElasticConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ElasticConfigValidationError{} + +// Validate checks the field values on DistributedPyTorchTrainingTask with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *DistributedPyTorchTrainingTask) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetWorkerReplicas()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DistributedPyTorchTrainingTaskValidationError{ + field: "WorkerReplicas", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetMasterReplicas()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DistributedPyTorchTrainingTaskValidationError{ + field: "MasterReplicas", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetRunPolicy()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DistributedPyTorchTrainingTaskValidationError{ + field: "RunPolicy", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetElasticConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DistributedPyTorchTrainingTaskValidationError{ + field: "ElasticConfig", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// DistributedPyTorchTrainingTaskValidationError is the validation error +// returned by DistributedPyTorchTrainingTask.Validate if the designated +// constraints aren't met. +type DistributedPyTorchTrainingTaskValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DistributedPyTorchTrainingTaskValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DistributedPyTorchTrainingTaskValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DistributedPyTorchTrainingTaskValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DistributedPyTorchTrainingTaskValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DistributedPyTorchTrainingTaskValidationError) ErrorName() string { + return "DistributedPyTorchTrainingTaskValidationError" +} + +// Error satisfies the builtin error interface +func (e DistributedPyTorchTrainingTaskValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDistributedPyTorchTrainingTask.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DistributedPyTorchTrainingTaskValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DistributedPyTorchTrainingTaskValidationError{} + +// Validate checks the field values on DistributedPyTorchTrainingReplicaSpec +// with the rules defined in the proto definition for this message. If any +// rules are violated, an error is returned. +func (m *DistributedPyTorchTrainingReplicaSpec) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Replicas + + // no validation rules for Image + + if v, ok := interface{}(m.GetResources()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DistributedPyTorchTrainingReplicaSpecValidationError{ + field: "Resources", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for RestartPolicy + + return nil +} + +// DistributedPyTorchTrainingReplicaSpecValidationError is the validation error +// returned by DistributedPyTorchTrainingReplicaSpec.Validate if the +// designated constraints aren't met. +type DistributedPyTorchTrainingReplicaSpecValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DistributedPyTorchTrainingReplicaSpecValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DistributedPyTorchTrainingReplicaSpecValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DistributedPyTorchTrainingReplicaSpecValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DistributedPyTorchTrainingReplicaSpecValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DistributedPyTorchTrainingReplicaSpecValidationError) ErrorName() string { + return "DistributedPyTorchTrainingReplicaSpecValidationError" +} + +// Error satisfies the builtin error interface +func (e DistributedPyTorchTrainingReplicaSpecValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDistributedPyTorchTrainingReplicaSpec.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DistributedPyTorchTrainingReplicaSpecValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DistributedPyTorchTrainingReplicaSpecValidationError{} diff --git a/gen/pb-go/flyteidl/plugins/kubeflow/tensorflow.pb.go b/gen/pb-go/flyteidl/plugins/kubeflow/tensorflow.pb.go new file mode 100644 index 000000000..b62e7fc9d --- /dev/null +++ b/gen/pb-go/flyteidl/plugins/kubeflow/tensorflow.pb.go @@ -0,0 +1,197 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: flyteidl/plugins/kubeflow/tensorflow.proto + +package plugins + +import ( + fmt "fmt" + core "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + proto "github.com/golang/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// Proto for plugin that enables distributed training using https://github.com/kubeflow/tf-operator +type DistributedTensorflowTrainingTask struct { + // Worker replicas spec + WorkerReplicas *DistributedTensorflowTrainingReplicaSpec `protobuf:"bytes,1,opt,name=worker_replicas,json=workerReplicas,proto3" json:"worker_replicas,omitempty"` + // Parameter server replicas spec + PsReplicas *DistributedTensorflowTrainingReplicaSpec `protobuf:"bytes,2,opt,name=ps_replicas,json=psReplicas,proto3" json:"ps_replicas,omitempty"` + // Chief replicas spec + ChiefReplicas *DistributedTensorflowTrainingReplicaSpec `protobuf:"bytes,3,opt,name=chief_replicas,json=chiefReplicas,proto3" json:"chief_replicas,omitempty"` + // RunPolicy encapsulates various runtime policies of the distributed training + // job, for example how to clean up resources and how long the job can stay + // active. + RunPolicy *RunPolicy `protobuf:"bytes,4,opt,name=run_policy,json=runPolicy,proto3" json:"run_policy,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DistributedTensorflowTrainingTask) Reset() { *m = DistributedTensorflowTrainingTask{} } +func (m *DistributedTensorflowTrainingTask) String() string { return proto.CompactTextString(m) } +func (*DistributedTensorflowTrainingTask) ProtoMessage() {} +func (*DistributedTensorflowTrainingTask) Descriptor() ([]byte, []int) { + return fileDescriptor_93de2bd764ddf01a, []int{0} +} + +func (m *DistributedTensorflowTrainingTask) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DistributedTensorflowTrainingTask.Unmarshal(m, b) +} +func (m *DistributedTensorflowTrainingTask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DistributedTensorflowTrainingTask.Marshal(b, m, deterministic) +} +func (m *DistributedTensorflowTrainingTask) XXX_Merge(src proto.Message) { + xxx_messageInfo_DistributedTensorflowTrainingTask.Merge(m, src) +} +func (m *DistributedTensorflowTrainingTask) XXX_Size() int { + return xxx_messageInfo_DistributedTensorflowTrainingTask.Size(m) +} +func (m *DistributedTensorflowTrainingTask) XXX_DiscardUnknown() { + xxx_messageInfo_DistributedTensorflowTrainingTask.DiscardUnknown(m) +} + +var xxx_messageInfo_DistributedTensorflowTrainingTask proto.InternalMessageInfo + +func (m *DistributedTensorflowTrainingTask) GetWorkerReplicas() *DistributedTensorflowTrainingReplicaSpec { + if m != nil { + return m.WorkerReplicas + } + return nil +} + +func (m *DistributedTensorflowTrainingTask) GetPsReplicas() *DistributedTensorflowTrainingReplicaSpec { + if m != nil { + return m.PsReplicas + } + return nil +} + +func (m *DistributedTensorflowTrainingTask) GetChiefReplicas() *DistributedTensorflowTrainingReplicaSpec { + if m != nil { + return m.ChiefReplicas + } + return nil +} + +func (m *DistributedTensorflowTrainingTask) GetRunPolicy() *RunPolicy { + if m != nil { + return m.RunPolicy + } + return nil +} + +type DistributedTensorflowTrainingReplicaSpec struct { + // Number of replicas + Replicas int32 `protobuf:"varint,1,opt,name=replicas,proto3" json:"replicas,omitempty"` + // Image used for the replica group + Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` + // Resources required for the replica group + Resources *core.Resources `protobuf:"bytes,3,opt,name=resources,proto3" json:"resources,omitempty"` + // RestartPolicy Determines whether pods will be restarted when they exit + RestartPolicy RestartPolicy `protobuf:"varint,4,opt,name=restart_policy,json=restartPolicy,proto3,enum=flyteidl.plugins.kubeflow.RestartPolicy" json:"restart_policy,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DistributedTensorflowTrainingReplicaSpec) Reset() { + *m = DistributedTensorflowTrainingReplicaSpec{} +} +func (m *DistributedTensorflowTrainingReplicaSpec) String() string { return proto.CompactTextString(m) } +func (*DistributedTensorflowTrainingReplicaSpec) ProtoMessage() {} +func (*DistributedTensorflowTrainingReplicaSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_93de2bd764ddf01a, []int{1} +} + +func (m *DistributedTensorflowTrainingReplicaSpec) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DistributedTensorflowTrainingReplicaSpec.Unmarshal(m, b) +} +func (m *DistributedTensorflowTrainingReplicaSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DistributedTensorflowTrainingReplicaSpec.Marshal(b, m, deterministic) +} +func (m *DistributedTensorflowTrainingReplicaSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_DistributedTensorflowTrainingReplicaSpec.Merge(m, src) +} +func (m *DistributedTensorflowTrainingReplicaSpec) XXX_Size() int { + return xxx_messageInfo_DistributedTensorflowTrainingReplicaSpec.Size(m) +} +func (m *DistributedTensorflowTrainingReplicaSpec) XXX_DiscardUnknown() { + xxx_messageInfo_DistributedTensorflowTrainingReplicaSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_DistributedTensorflowTrainingReplicaSpec proto.InternalMessageInfo + +func (m *DistributedTensorflowTrainingReplicaSpec) GetReplicas() int32 { + if m != nil { + return m.Replicas + } + return 0 +} + +func (m *DistributedTensorflowTrainingReplicaSpec) GetImage() string { + if m != nil { + return m.Image + } + return "" +} + +func (m *DistributedTensorflowTrainingReplicaSpec) GetResources() *core.Resources { + if m != nil { + return m.Resources + } + return nil +} + +func (m *DistributedTensorflowTrainingReplicaSpec) GetRestartPolicy() RestartPolicy { + if m != nil { + return m.RestartPolicy + } + return RestartPolicy_RESTART_POLICY_NEVER +} + +func init() { + proto.RegisterType((*DistributedTensorflowTrainingTask)(nil), "flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask") + proto.RegisterType((*DistributedTensorflowTrainingReplicaSpec)(nil), "flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec") +} + +func init() { + proto.RegisterFile("flyteidl/plugins/kubeflow/tensorflow.proto", fileDescriptor_93de2bd764ddf01a) +} + +var fileDescriptor_93de2bd764ddf01a = []byte{ + // 356 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0x41, 0x4b, 0xc3, 0x30, + 0x14, 0xc7, 0x99, 0x73, 0xe2, 0x32, 0x56, 0xa1, 0x78, 0x98, 0x3b, 0xe9, 0x10, 0x19, 0x82, 0x0d, + 0x4c, 0x50, 0xbc, 0x3a, 0xef, 0x4a, 0xdc, 0xc9, 0xcb, 0x68, 0xb3, 0xb7, 0x2e, 0xb6, 0x4d, 0xc2, + 0x4b, 0xc2, 0xd8, 0x37, 0xf2, 0x8b, 0xf9, 0x3d, 0x64, 0xed, 0xda, 0x4e, 0x61, 0xc3, 0xc3, 0x6e, + 0x79, 0xcd, 0x3f, 0xff, 0xdf, 0x7b, 0xaf, 0x7f, 0x72, 0x3b, 0x4f, 0x57, 0x16, 0xc4, 0x2c, 0xa5, + 0x3a, 0x75, 0xb1, 0x90, 0x86, 0x26, 0x2e, 0x82, 0x79, 0xaa, 0x96, 0xd4, 0x82, 0x34, 0x0a, 0xd7, + 0xc7, 0x40, 0xa3, 0xb2, 0xca, 0xbf, 0x28, 0xb5, 0xc1, 0x46, 0x1b, 0x94, 0xda, 0x7e, 0x75, 0x45, + 0xb9, 0x42, 0xa0, 0x36, 0x34, 0x89, 0x29, 0x5e, 0xf5, 0x6f, 0x76, 0x13, 0xb8, 0xca, 0x32, 0x25, + 0x0b, 0xdd, 0xe0, 0xab, 0x49, 0xae, 0x5e, 0x84, 0xb1, 0x28, 0x22, 0x67, 0x61, 0x36, 0xa9, 0xe8, + 0x13, 0x0c, 0x85, 0x14, 0x32, 0x9e, 0x84, 0x26, 0xf1, 0x53, 0x72, 0xb6, 0x54, 0x98, 0x00, 0x4e, + 0x11, 0x74, 0x2a, 0x78, 0x68, 0x7a, 0x8d, 0xcb, 0xc6, 0xb0, 0x33, 0x1a, 0x07, 0x3b, 0xbb, 0x0b, + 0xf6, 0xda, 0xb2, 0xc2, 0xe7, 0x5d, 0x03, 0x67, 0x5e, 0xe1, 0xbd, 0xf9, 0x64, 0xfc, 0x19, 0xe9, + 0x68, 0x53, 0x93, 0x8e, 0x0e, 0x47, 0x22, 0xda, 0x54, 0x94, 0x4f, 0xe2, 0xf1, 0x85, 0x80, 0x79, + 0x0d, 0x6a, 0x1e, 0x0e, 0xd4, 0xcd, 0xad, 0x2b, 0xd6, 0x98, 0x10, 0x74, 0x72, 0xaa, 0x55, 0x2a, + 0xf8, 0xaa, 0x77, 0x9c, 0x73, 0xae, 0xf7, 0x70, 0x98, 0x93, 0x6f, 0xb9, 0x96, 0xb5, 0xb1, 0x3c, + 0x0e, 0xbe, 0x1b, 0x64, 0xf8, 0xdf, 0x06, 0xfc, 0x3e, 0x39, 0xfd, 0xf5, 0xab, 0x5a, 0xac, 0xaa, + 0xfd, 0x73, 0xd2, 0x12, 0x59, 0x18, 0x43, 0xbe, 0xd9, 0x36, 0x2b, 0x0a, 0xff, 0x81, 0xb4, 0x11, + 0x8c, 0x72, 0xc8, 0xa1, 0x5c, 0x45, 0xaf, 0x6e, 0x71, 0x1d, 0xb0, 0x80, 0x95, 0xf7, 0xac, 0x96, + 0xfa, 0xaf, 0xc4, 0x43, 0x30, 0x36, 0x44, 0xbb, 0x3d, 0x9f, 0x37, 0x1a, 0xee, 0x9b, 0xaf, 0x78, + 0xb0, 0x99, 0xb1, 0x8b, 0xdb, 0xe5, 0xf3, 0xd3, 0xc7, 0x63, 0x2c, 0xec, 0xc2, 0x45, 0x01, 0x57, + 0x19, 0xcd, 0x4d, 0x14, 0xc6, 0xb4, 0x0a, 0x74, 0x0c, 0x92, 0xea, 0xe8, 0x2e, 0x56, 0xf4, 0x6f, + 0xc6, 0xa3, 0x93, 0x3c, 0xd4, 0xf7, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x01, 0x7d, 0x16, + 0x60, 0x03, 0x00, 0x00, +} diff --git a/gen/pb-go/flyteidl/plugins/kubeflow/tensorflow.pb.validate.go b/gen/pb-go/flyteidl/plugins/kubeflow/tensorflow.pb.validate.go new file mode 100644 index 000000000..098b4dc7c --- /dev/null +++ b/gen/pb-go/flyteidl/plugins/kubeflow/tensorflow.pb.validate.go @@ -0,0 +1,229 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: flyteidl/plugins/kubeflow/tensorflow.proto + +package plugins + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _tensorflow_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on DistributedTensorflowTrainingTask with +// the rules defined in the proto definition for this message. If any rules +// are violated, an error is returned. +func (m *DistributedTensorflowTrainingTask) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetWorkerReplicas()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DistributedTensorflowTrainingTaskValidationError{ + field: "WorkerReplicas", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetPsReplicas()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DistributedTensorflowTrainingTaskValidationError{ + field: "PsReplicas", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetChiefReplicas()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DistributedTensorflowTrainingTaskValidationError{ + field: "ChiefReplicas", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if v, ok := interface{}(m.GetRunPolicy()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DistributedTensorflowTrainingTaskValidationError{ + field: "RunPolicy", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// DistributedTensorflowTrainingTaskValidationError is the validation error +// returned by DistributedTensorflowTrainingTask.Validate if the designated +// constraints aren't met. +type DistributedTensorflowTrainingTaskValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DistributedTensorflowTrainingTaskValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DistributedTensorflowTrainingTaskValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DistributedTensorflowTrainingTaskValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DistributedTensorflowTrainingTaskValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DistributedTensorflowTrainingTaskValidationError) ErrorName() string { + return "DistributedTensorflowTrainingTaskValidationError" +} + +// Error satisfies the builtin error interface +func (e DistributedTensorflowTrainingTaskValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDistributedTensorflowTrainingTask.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DistributedTensorflowTrainingTaskValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DistributedTensorflowTrainingTaskValidationError{} + +// Validate checks the field values on DistributedTensorflowTrainingReplicaSpec +// with the rules defined in the proto definition for this message. If any +// rules are violated, an error is returned. +func (m *DistributedTensorflowTrainingReplicaSpec) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Replicas + + // no validation rules for Image + + if v, ok := interface{}(m.GetResources()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DistributedTensorflowTrainingReplicaSpecValidationError{ + field: "Resources", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for RestartPolicy + + return nil +} + +// DistributedTensorflowTrainingReplicaSpecValidationError is the validation +// error returned by DistributedTensorflowTrainingReplicaSpec.Validate if the +// designated constraints aren't met. +type DistributedTensorflowTrainingReplicaSpecValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DistributedTensorflowTrainingReplicaSpecValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DistributedTensorflowTrainingReplicaSpecValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DistributedTensorflowTrainingReplicaSpecValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DistributedTensorflowTrainingReplicaSpecValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DistributedTensorflowTrainingReplicaSpecValidationError) ErrorName() string { + return "DistributedTensorflowTrainingReplicaSpecValidationError" +} + +// Error satisfies the builtin error interface +func (e DistributedTensorflowTrainingReplicaSpecValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDistributedTensorflowTrainingReplicaSpec.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DistributedTensorflowTrainingReplicaSpecValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DistributedTensorflowTrainingReplicaSpecValidationError{} diff --git a/gen/pb-java/flyteidl/plugins/kubeflow/Common.java b/gen/pb-java/flyteidl/plugins/kubeflow/Common.java new file mode 100644 index 000000000..a260c723a --- /dev/null +++ b/gen/pb-java/flyteidl/plugins/kubeflow/Common.java @@ -0,0 +1,1073 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/kubeflow/common.proto + +package flyteidl.plugins.kubeflow; + +public final class Common { + private Common() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code flyteidl.plugins.kubeflow.RestartPolicy} + */ + public enum RestartPolicy + implements com.google.protobuf.ProtocolMessageEnum { + /** + * RESTART_POLICY_NEVER = 0; + */ + RESTART_POLICY_NEVER(0), + /** + * RESTART_POLICY_ON_FAILURE = 1; + */ + RESTART_POLICY_ON_FAILURE(1), + /** + * RESTART_POLICY_ALWAYS = 2; + */ + RESTART_POLICY_ALWAYS(2), + UNRECOGNIZED(-1), + ; + + /** + * RESTART_POLICY_NEVER = 0; + */ + public static final int RESTART_POLICY_NEVER_VALUE = 0; + /** + * RESTART_POLICY_ON_FAILURE = 1; + */ + public static final int RESTART_POLICY_ON_FAILURE_VALUE = 1; + /** + * RESTART_POLICY_ALWAYS = 2; + */ + public static final int RESTART_POLICY_ALWAYS_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RestartPolicy valueOf(int value) { + return forNumber(value); + } + + public static RestartPolicy forNumber(int value) { + switch (value) { + case 0: return RESTART_POLICY_NEVER; + case 1: return RESTART_POLICY_ON_FAILURE; + case 2: return RESTART_POLICY_ALWAYS; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + RestartPolicy> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RestartPolicy findValueByNumber(int number) { + return RestartPolicy.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Common.getDescriptor().getEnumTypes().get(0); + } + + private static final RestartPolicy[] VALUES = values(); + + public static RestartPolicy valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RestartPolicy(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:flyteidl.plugins.kubeflow.RestartPolicy) + } + + /** + * Protobuf enum {@code flyteidl.plugins.kubeflow.CleanPodPolicy} + */ + public enum CleanPodPolicy + implements com.google.protobuf.ProtocolMessageEnum { + /** + * CLEANPOD_POLICY_NONE = 0; + */ + CLEANPOD_POLICY_NONE(0), + /** + * CLEANPOD_POLICY_RUNNING = 1; + */ + CLEANPOD_POLICY_RUNNING(1), + /** + * CLEANPOD_POLICY_ALL = 2; + */ + CLEANPOD_POLICY_ALL(2), + UNRECOGNIZED(-1), + ; + + /** + * CLEANPOD_POLICY_NONE = 0; + */ + public static final int CLEANPOD_POLICY_NONE_VALUE = 0; + /** + * CLEANPOD_POLICY_RUNNING = 1; + */ + public static final int CLEANPOD_POLICY_RUNNING_VALUE = 1; + /** + * CLEANPOD_POLICY_ALL = 2; + */ + public static final int CLEANPOD_POLICY_ALL_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CleanPodPolicy valueOf(int value) { + return forNumber(value); + } + + public static CleanPodPolicy forNumber(int value) { + switch (value) { + case 0: return CLEANPOD_POLICY_NONE; + case 1: return CLEANPOD_POLICY_RUNNING; + case 2: return CLEANPOD_POLICY_ALL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + CleanPodPolicy> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public CleanPodPolicy findValueByNumber(int number) { + return CleanPodPolicy.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Common.getDescriptor().getEnumTypes().get(1); + } + + private static final CleanPodPolicy[] VALUES = values(); + + public static CleanPodPolicy valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private CleanPodPolicy(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:flyteidl.plugins.kubeflow.CleanPodPolicy) + } + + public interface RunPolicyOrBuilder extends + // @@protoc_insertion_point(interface_extends:flyteidl.plugins.kubeflow.RunPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Defines the policy to kill pods after the job completes. Default to None.
+     * 
+ * + * .flyteidl.plugins.kubeflow.CleanPodPolicy clean_pod_policy = 1; + */ + int getCleanPodPolicyValue(); + /** + *
+     * Defines the policy to kill pods after the job completes. Default to None.
+     * 
+ * + * .flyteidl.plugins.kubeflow.CleanPodPolicy clean_pod_policy = 1; + */ + flyteidl.plugins.kubeflow.Common.CleanPodPolicy getCleanPodPolicy(); + + /** + *
+     * TTL to clean up jobs. Default to infinite.
+     * 
+ * + * int32 ttl_seconds_after_finished = 2; + */ + int getTtlSecondsAfterFinished(); + + /** + *
+     * Specifies the duration in seconds relative to the startTime that the job may be active
+     * before the system tries to terminate it; value must be positive integer.
+     * 
+ * + * int32 active_deadline_seconds = 3; + */ + int getActiveDeadlineSeconds(); + + /** + *
+     * Number of retries before marking this job failed.
+     * 
+ * + * int32 backoff_limit = 4; + */ + int getBackoffLimit(); + } + /** + * Protobuf type {@code flyteidl.plugins.kubeflow.RunPolicy} + */ + public static final class RunPolicy extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:flyteidl.plugins.kubeflow.RunPolicy) + RunPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use RunPolicy.newBuilder() to construct. + private RunPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RunPolicy() { + cleanPodPolicy_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RunPolicy( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + cleanPodPolicy_ = rawValue; + break; + } + case 16: { + + ttlSecondsAfterFinished_ = input.readInt32(); + break; + } + case 24: { + + activeDeadlineSeconds_ = input.readInt32(); + break; + } + case 32: { + + backoffLimit_ = input.readInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Common.internal_static_flyteidl_plugins_kubeflow_RunPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.kubeflow.Common.internal_static_flyteidl_plugins_kubeflow_RunPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.kubeflow.Common.RunPolicy.class, flyteidl.plugins.kubeflow.Common.RunPolicy.Builder.class); + } + + public static final int CLEAN_POD_POLICY_FIELD_NUMBER = 1; + private int cleanPodPolicy_; + /** + *
+     * Defines the policy to kill pods after the job completes. Default to None.
+     * 
+ * + * .flyteidl.plugins.kubeflow.CleanPodPolicy clean_pod_policy = 1; + */ + public int getCleanPodPolicyValue() { + return cleanPodPolicy_; + } + /** + *
+     * Defines the policy to kill pods after the job completes. Default to None.
+     * 
+ * + * .flyteidl.plugins.kubeflow.CleanPodPolicy clean_pod_policy = 1; + */ + public flyteidl.plugins.kubeflow.Common.CleanPodPolicy getCleanPodPolicy() { + @SuppressWarnings("deprecation") + flyteidl.plugins.kubeflow.Common.CleanPodPolicy result = flyteidl.plugins.kubeflow.Common.CleanPodPolicy.valueOf(cleanPodPolicy_); + return result == null ? flyteidl.plugins.kubeflow.Common.CleanPodPolicy.UNRECOGNIZED : result; + } + + public static final int TTL_SECONDS_AFTER_FINISHED_FIELD_NUMBER = 2; + private int ttlSecondsAfterFinished_; + /** + *
+     * TTL to clean up jobs. Default to infinite.
+     * 
+ * + * int32 ttl_seconds_after_finished = 2; + */ + public int getTtlSecondsAfterFinished() { + return ttlSecondsAfterFinished_; + } + + public static final int ACTIVE_DEADLINE_SECONDS_FIELD_NUMBER = 3; + private int activeDeadlineSeconds_; + /** + *
+     * Specifies the duration in seconds relative to the startTime that the job may be active
+     * before the system tries to terminate it; value must be positive integer.
+     * 
+ * + * int32 active_deadline_seconds = 3; + */ + public int getActiveDeadlineSeconds() { + return activeDeadlineSeconds_; + } + + public static final int BACKOFF_LIMIT_FIELD_NUMBER = 4; + private int backoffLimit_; + /** + *
+     * Number of retries before marking this job failed.
+     * 
+ * + * int32 backoff_limit = 4; + */ + public int getBackoffLimit() { + return backoffLimit_; + } + + 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 + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (cleanPodPolicy_ != flyteidl.plugins.kubeflow.Common.CleanPodPolicy.CLEANPOD_POLICY_NONE.getNumber()) { + output.writeEnum(1, cleanPodPolicy_); + } + if (ttlSecondsAfterFinished_ != 0) { + output.writeInt32(2, ttlSecondsAfterFinished_); + } + if (activeDeadlineSeconds_ != 0) { + output.writeInt32(3, activeDeadlineSeconds_); + } + if (backoffLimit_ != 0) { + output.writeInt32(4, backoffLimit_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (cleanPodPolicy_ != flyteidl.plugins.kubeflow.Common.CleanPodPolicy.CLEANPOD_POLICY_NONE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, cleanPodPolicy_); + } + if (ttlSecondsAfterFinished_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, ttlSecondsAfterFinished_); + } + if (activeDeadlineSeconds_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, activeDeadlineSeconds_); + } + if (backoffLimit_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, backoffLimit_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof flyteidl.plugins.kubeflow.Common.RunPolicy)) { + return super.equals(obj); + } + flyteidl.plugins.kubeflow.Common.RunPolicy other = (flyteidl.plugins.kubeflow.Common.RunPolicy) obj; + + if (cleanPodPolicy_ != other.cleanPodPolicy_) return false; + if (getTtlSecondsAfterFinished() + != other.getTtlSecondsAfterFinished()) return false; + if (getActiveDeadlineSeconds() + != other.getActiveDeadlineSeconds()) return false; + if (getBackoffLimit() + != other.getBackoffLimit()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CLEAN_POD_POLICY_FIELD_NUMBER; + hash = (53 * hash) + cleanPodPolicy_; + hash = (37 * hash) + TTL_SECONDS_AFTER_FINISHED_FIELD_NUMBER; + hash = (53 * hash) + getTtlSecondsAfterFinished(); + hash = (37 * hash) + ACTIVE_DEADLINE_SECONDS_FIELD_NUMBER; + hash = (53 * hash) + getActiveDeadlineSeconds(); + hash = (37 * hash) + BACKOFF_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getBackoffLimit(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static flyteidl.plugins.kubeflow.Common.RunPolicy parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Common.RunPolicy parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Common.RunPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Common.RunPolicy parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Common.RunPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Common.RunPolicy parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Common.RunPolicy parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Common.RunPolicy parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Common.RunPolicy parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Common.RunPolicy parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Common.RunPolicy parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Common.RunPolicy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(flyteidl.plugins.kubeflow.Common.RunPolicy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code flyteidl.plugins.kubeflow.RunPolicy} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:flyteidl.plugins.kubeflow.RunPolicy) + flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Common.internal_static_flyteidl_plugins_kubeflow_RunPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.kubeflow.Common.internal_static_flyteidl_plugins_kubeflow_RunPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.kubeflow.Common.RunPolicy.class, flyteidl.plugins.kubeflow.Common.RunPolicy.Builder.class); + } + + // Construct using flyteidl.plugins.kubeflow.Common.RunPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + cleanPodPolicy_ = 0; + + ttlSecondsAfterFinished_ = 0; + + activeDeadlineSeconds_ = 0; + + backoffLimit_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return flyteidl.plugins.kubeflow.Common.internal_static_flyteidl_plugins_kubeflow_RunPolicy_descriptor; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Common.RunPolicy getDefaultInstanceForType() { + return flyteidl.plugins.kubeflow.Common.RunPolicy.getDefaultInstance(); + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Common.RunPolicy build() { + flyteidl.plugins.kubeflow.Common.RunPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Common.RunPolicy buildPartial() { + flyteidl.plugins.kubeflow.Common.RunPolicy result = new flyteidl.plugins.kubeflow.Common.RunPolicy(this); + result.cleanPodPolicy_ = cleanPodPolicy_; + result.ttlSecondsAfterFinished_ = ttlSecondsAfterFinished_; + result.activeDeadlineSeconds_ = activeDeadlineSeconds_; + result.backoffLimit_ = backoffLimit_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof flyteidl.plugins.kubeflow.Common.RunPolicy) { + return mergeFrom((flyteidl.plugins.kubeflow.Common.RunPolicy)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(flyteidl.plugins.kubeflow.Common.RunPolicy other) { + if (other == flyteidl.plugins.kubeflow.Common.RunPolicy.getDefaultInstance()) return this; + if (other.cleanPodPolicy_ != 0) { + setCleanPodPolicyValue(other.getCleanPodPolicyValue()); + } + if (other.getTtlSecondsAfterFinished() != 0) { + setTtlSecondsAfterFinished(other.getTtlSecondsAfterFinished()); + } + if (other.getActiveDeadlineSeconds() != 0) { + setActiveDeadlineSeconds(other.getActiveDeadlineSeconds()); + } + if (other.getBackoffLimit() != 0) { + setBackoffLimit(other.getBackoffLimit()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + flyteidl.plugins.kubeflow.Common.RunPolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (flyteidl.plugins.kubeflow.Common.RunPolicy) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int cleanPodPolicy_ = 0; + /** + *
+       * Defines the policy to kill pods after the job completes. Default to None.
+       * 
+ * + * .flyteidl.plugins.kubeflow.CleanPodPolicy clean_pod_policy = 1; + */ + public int getCleanPodPolicyValue() { + return cleanPodPolicy_; + } + /** + *
+       * Defines the policy to kill pods after the job completes. Default to None.
+       * 
+ * + * .flyteidl.plugins.kubeflow.CleanPodPolicy clean_pod_policy = 1; + */ + public Builder setCleanPodPolicyValue(int value) { + cleanPodPolicy_ = value; + onChanged(); + return this; + } + /** + *
+       * Defines the policy to kill pods after the job completes. Default to None.
+       * 
+ * + * .flyteidl.plugins.kubeflow.CleanPodPolicy clean_pod_policy = 1; + */ + public flyteidl.plugins.kubeflow.Common.CleanPodPolicy getCleanPodPolicy() { + @SuppressWarnings("deprecation") + flyteidl.plugins.kubeflow.Common.CleanPodPolicy result = flyteidl.plugins.kubeflow.Common.CleanPodPolicy.valueOf(cleanPodPolicy_); + return result == null ? flyteidl.plugins.kubeflow.Common.CleanPodPolicy.UNRECOGNIZED : result; + } + /** + *
+       * Defines the policy to kill pods after the job completes. Default to None.
+       * 
+ * + * .flyteidl.plugins.kubeflow.CleanPodPolicy clean_pod_policy = 1; + */ + public Builder setCleanPodPolicy(flyteidl.plugins.kubeflow.Common.CleanPodPolicy value) { + if (value == null) { + throw new NullPointerException(); + } + + cleanPodPolicy_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       * Defines the policy to kill pods after the job completes. Default to None.
+       * 
+ * + * .flyteidl.plugins.kubeflow.CleanPodPolicy clean_pod_policy = 1; + */ + public Builder clearCleanPodPolicy() { + + cleanPodPolicy_ = 0; + onChanged(); + return this; + } + + private int ttlSecondsAfterFinished_ ; + /** + *
+       * TTL to clean up jobs. Default to infinite.
+       * 
+ * + * int32 ttl_seconds_after_finished = 2; + */ + public int getTtlSecondsAfterFinished() { + return ttlSecondsAfterFinished_; + } + /** + *
+       * TTL to clean up jobs. Default to infinite.
+       * 
+ * + * int32 ttl_seconds_after_finished = 2; + */ + public Builder setTtlSecondsAfterFinished(int value) { + + ttlSecondsAfterFinished_ = value; + onChanged(); + return this; + } + /** + *
+       * TTL to clean up jobs. Default to infinite.
+       * 
+ * + * int32 ttl_seconds_after_finished = 2; + */ + public Builder clearTtlSecondsAfterFinished() { + + ttlSecondsAfterFinished_ = 0; + onChanged(); + return this; + } + + private int activeDeadlineSeconds_ ; + /** + *
+       * Specifies the duration in seconds relative to the startTime that the job may be active
+       * before the system tries to terminate it; value must be positive integer.
+       * 
+ * + * int32 active_deadline_seconds = 3; + */ + public int getActiveDeadlineSeconds() { + return activeDeadlineSeconds_; + } + /** + *
+       * Specifies the duration in seconds relative to the startTime that the job may be active
+       * before the system tries to terminate it; value must be positive integer.
+       * 
+ * + * int32 active_deadline_seconds = 3; + */ + public Builder setActiveDeadlineSeconds(int value) { + + activeDeadlineSeconds_ = value; + onChanged(); + return this; + } + /** + *
+       * Specifies the duration in seconds relative to the startTime that the job may be active
+       * before the system tries to terminate it; value must be positive integer.
+       * 
+ * + * int32 active_deadline_seconds = 3; + */ + public Builder clearActiveDeadlineSeconds() { + + activeDeadlineSeconds_ = 0; + onChanged(); + return this; + } + + private int backoffLimit_ ; + /** + *
+       * Number of retries before marking this job failed.
+       * 
+ * + * int32 backoff_limit = 4; + */ + public int getBackoffLimit() { + return backoffLimit_; + } + /** + *
+       * Number of retries before marking this job failed.
+       * 
+ * + * int32 backoff_limit = 4; + */ + public Builder setBackoffLimit(int value) { + + backoffLimit_ = value; + onChanged(); + return this; + } + /** + *
+       * Number of retries before marking this job failed.
+       * 
+ * + * int32 backoff_limit = 4; + */ + public Builder clearBackoffLimit() { + + backoffLimit_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:flyteidl.plugins.kubeflow.RunPolicy) + } + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.kubeflow.RunPolicy) + private static final flyteidl.plugins.kubeflow.Common.RunPolicy DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new flyteidl.plugins.kubeflow.Common.RunPolicy(); + } + + public static flyteidl.plugins.kubeflow.Common.RunPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RunPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RunPolicy(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Common.RunPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_flyteidl_plugins_kubeflow_RunPolicy_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_flyteidl_plugins_kubeflow_RunPolicy_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n&flyteidl/plugins/kubeflow/common.proto" + + "\022\031flyteidl.plugins.kubeflow\"\254\001\n\tRunPolic" + + "y\022C\n\020clean_pod_policy\030\001 \001(\0162).flyteidl.p" + + "lugins.kubeflow.CleanPodPolicy\022\"\n\032ttl_se" + + "conds_after_finished\030\002 \001(\005\022\037\n\027active_dea" + + "dline_seconds\030\003 \001(\005\022\025\n\rbackoff_limit\030\004 \001" + + "(\005*c\n\rRestartPolicy\022\030\n\024RESTART_POLICY_NE" + + "VER\020\000\022\035\n\031RESTART_POLICY_ON_FAILURE\020\001\022\031\n\025" + + "RESTART_POLICY_ALWAYS\020\002*`\n\016CleanPodPolic" + + "y\022\030\n\024CLEANPOD_POLICY_NONE\020\000\022\033\n\027CLEANPOD_" + + "POLICY_RUNNING\020\001\022\027\n\023CLEANPOD_POLICY_ALL\020" + + "\002B9Z7github.com/flyteorg/flyteidl/gen/pb" + + "-go/flyteidl/pluginsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_flyteidl_plugins_kubeflow_RunPolicy_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_flyteidl_plugins_kubeflow_RunPolicy_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_flyteidl_plugins_kubeflow_RunPolicy_descriptor, + new java.lang.String[] { "CleanPodPolicy", "TtlSecondsAfterFinished", "ActiveDeadlineSeconds", "BackoffLimit", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/gen/pb-java/flyteidl/plugins/kubeflow/Mpi.java b/gen/pb-java/flyteidl/plugins/kubeflow/Mpi.java new file mode 100644 index 000000000..f467a15e0 --- /dev/null +++ b/gen/pb-java/flyteidl/plugins/kubeflow/Mpi.java @@ -0,0 +1,2700 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/kubeflow/mpi.proto + +package flyteidl.plugins.kubeflow; + +public final class Mpi { + private Mpi() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface DistributedMPITrainingTaskOrBuilder extends + // @@protoc_insertion_point(interface_extends:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + */ + boolean hasWorkerReplicas(); + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + */ + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec getWorkerReplicas(); + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + */ + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpecOrBuilder getWorkerReplicasOrBuilder(); + + /** + *
+     * Master replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + */ + boolean hasLauncherReplicas(); + /** + *
+     * Master replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + */ + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec getLauncherReplicas(); + /** + *
+     * Master replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + */ + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpecOrBuilder getLauncherReplicasOrBuilder(); + + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + boolean hasRunPolicy(); + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + flyteidl.plugins.kubeflow.Common.RunPolicy getRunPolicy(); + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder getRunPolicyOrBuilder(); + + /** + *
+     * Number of slots per worker
+     * 
+ * + * int32 slots = 4; + */ + int getSlots(); + } + /** + *
+   * Proto for plugin that enables distributed training using https://github.com/kubeflow/mpi-operator
+   * 
+ * + * Protobuf type {@code flyteidl.plugins.kubeflow.DistributedMPITrainingTask} + */ + public static final class DistributedMPITrainingTask extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + DistributedMPITrainingTaskOrBuilder { + private static final long serialVersionUID = 0L; + // Use DistributedMPITrainingTask.newBuilder() to construct. + private DistributedMPITrainingTask(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DistributedMPITrainingTask() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DistributedMPITrainingTask( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.Builder subBuilder = null; + if (workerReplicas_ != null) { + subBuilder = workerReplicas_.toBuilder(); + } + workerReplicas_ = input.readMessage(flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(workerReplicas_); + workerReplicas_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.Builder subBuilder = null; + if (launcherReplicas_ != null) { + subBuilder = launcherReplicas_.toBuilder(); + } + launcherReplicas_ = input.readMessage(flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(launcherReplicas_); + launcherReplicas_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + flyteidl.plugins.kubeflow.Common.RunPolicy.Builder subBuilder = null; + if (runPolicy_ != null) { + subBuilder = runPolicy_.toBuilder(); + } + runPolicy_ = input.readMessage(flyteidl.plugins.kubeflow.Common.RunPolicy.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(runPolicy_); + runPolicy_ = subBuilder.buildPartial(); + } + + break; + } + case 32: { + + slots_ = input.readInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Mpi.internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingTask_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.kubeflow.Mpi.internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingTask_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask.class, flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask.Builder.class); + } + + public static final int WORKER_REPLICAS_FIELD_NUMBER = 1; + private flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec workerReplicas_; + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + */ + public boolean hasWorkerReplicas() { + return workerReplicas_ != null; + } + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + */ + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec getWorkerReplicas() { + return workerReplicas_ == null ? flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.getDefaultInstance() : workerReplicas_; + } + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + */ + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpecOrBuilder getWorkerReplicasOrBuilder() { + return getWorkerReplicas(); + } + + public static final int LAUNCHER_REPLICAS_FIELD_NUMBER = 2; + private flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec launcherReplicas_; + /** + *
+     * Master replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + */ + public boolean hasLauncherReplicas() { + return launcherReplicas_ != null; + } + /** + *
+     * Master replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + */ + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec getLauncherReplicas() { + return launcherReplicas_ == null ? flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.getDefaultInstance() : launcherReplicas_; + } + /** + *
+     * Master replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + */ + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpecOrBuilder getLauncherReplicasOrBuilder() { + return getLauncherReplicas(); + } + + public static final int RUN_POLICY_FIELD_NUMBER = 3; + private flyteidl.plugins.kubeflow.Common.RunPolicy runPolicy_; + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public boolean hasRunPolicy() { + return runPolicy_ != null; + } + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public flyteidl.plugins.kubeflow.Common.RunPolicy getRunPolicy() { + return runPolicy_ == null ? flyteidl.plugins.kubeflow.Common.RunPolicy.getDefaultInstance() : runPolicy_; + } + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder getRunPolicyOrBuilder() { + return getRunPolicy(); + } + + public static final int SLOTS_FIELD_NUMBER = 4; + private int slots_; + /** + *
+     * Number of slots per worker
+     * 
+ * + * int32 slots = 4; + */ + public int getSlots() { + return slots_; + } + + 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 + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (workerReplicas_ != null) { + output.writeMessage(1, getWorkerReplicas()); + } + if (launcherReplicas_ != null) { + output.writeMessage(2, getLauncherReplicas()); + } + if (runPolicy_ != null) { + output.writeMessage(3, getRunPolicy()); + } + if (slots_ != 0) { + output.writeInt32(4, slots_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (workerReplicas_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getWorkerReplicas()); + } + if (launcherReplicas_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getLauncherReplicas()); + } + if (runPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getRunPolicy()); + } + if (slots_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, slots_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask)) { + return super.equals(obj); + } + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask other = (flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask) obj; + + if (hasWorkerReplicas() != other.hasWorkerReplicas()) return false; + if (hasWorkerReplicas()) { + if (!getWorkerReplicas() + .equals(other.getWorkerReplicas())) return false; + } + if (hasLauncherReplicas() != other.hasLauncherReplicas()) return false; + if (hasLauncherReplicas()) { + if (!getLauncherReplicas() + .equals(other.getLauncherReplicas())) return false; + } + if (hasRunPolicy() != other.hasRunPolicy()) return false; + if (hasRunPolicy()) { + if (!getRunPolicy() + .equals(other.getRunPolicy())) return false; + } + if (getSlots() + != other.getSlots()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasWorkerReplicas()) { + hash = (37 * hash) + WORKER_REPLICAS_FIELD_NUMBER; + hash = (53 * hash) + getWorkerReplicas().hashCode(); + } + if (hasLauncherReplicas()) { + hash = (37 * hash) + LAUNCHER_REPLICAS_FIELD_NUMBER; + hash = (53 * hash) + getLauncherReplicas().hashCode(); + } + if (hasRunPolicy()) { + hash = (37 * hash) + RUN_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getRunPolicy().hashCode(); + } + hash = (37 * hash) + SLOTS_FIELD_NUMBER; + hash = (53 * hash) + getSlots(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Proto for plugin that enables distributed training using https://github.com/kubeflow/mpi-operator
+     * 
+ * + * Protobuf type {@code flyteidl.plugins.kubeflow.DistributedMPITrainingTask} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTaskOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Mpi.internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingTask_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.kubeflow.Mpi.internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingTask_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask.class, flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask.Builder.class); + } + + // Construct using flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (workerReplicasBuilder_ == null) { + workerReplicas_ = null; + } else { + workerReplicas_ = null; + workerReplicasBuilder_ = null; + } + if (launcherReplicasBuilder_ == null) { + launcherReplicas_ = null; + } else { + launcherReplicas_ = null; + launcherReplicasBuilder_ = null; + } + if (runPolicyBuilder_ == null) { + runPolicy_ = null; + } else { + runPolicy_ = null; + runPolicyBuilder_ = null; + } + slots_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return flyteidl.plugins.kubeflow.Mpi.internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingTask_descriptor; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask getDefaultInstanceForType() { + return flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask.getDefaultInstance(); + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask build() { + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask buildPartial() { + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask result = new flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask(this); + if (workerReplicasBuilder_ == null) { + result.workerReplicas_ = workerReplicas_; + } else { + result.workerReplicas_ = workerReplicasBuilder_.build(); + } + if (launcherReplicasBuilder_ == null) { + result.launcherReplicas_ = launcherReplicas_; + } else { + result.launcherReplicas_ = launcherReplicasBuilder_.build(); + } + if (runPolicyBuilder_ == null) { + result.runPolicy_ = runPolicy_; + } else { + result.runPolicy_ = runPolicyBuilder_.build(); + } + result.slots_ = slots_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask) { + return mergeFrom((flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask other) { + if (other == flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask.getDefaultInstance()) return this; + if (other.hasWorkerReplicas()) { + mergeWorkerReplicas(other.getWorkerReplicas()); + } + if (other.hasLauncherReplicas()) { + mergeLauncherReplicas(other.getLauncherReplicas()); + } + if (other.hasRunPolicy()) { + mergeRunPolicy(other.getRunPolicy()); + } + if (other.getSlots() != 0) { + setSlots(other.getSlots()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec workerReplicas_; + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec, flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpecOrBuilder> workerReplicasBuilder_; + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + */ + public boolean hasWorkerReplicas() { + return workerReplicasBuilder_ != null || workerReplicas_ != null; + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + */ + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec getWorkerReplicas() { + if (workerReplicasBuilder_ == null) { + return workerReplicas_ == null ? flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.getDefaultInstance() : workerReplicas_; + } else { + return workerReplicasBuilder_.getMessage(); + } + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + */ + public Builder setWorkerReplicas(flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec value) { + if (workerReplicasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + workerReplicas_ = value; + onChanged(); + } else { + workerReplicasBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + */ + public Builder setWorkerReplicas( + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.Builder builderForValue) { + if (workerReplicasBuilder_ == null) { + workerReplicas_ = builderForValue.build(); + onChanged(); + } else { + workerReplicasBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + */ + public Builder mergeWorkerReplicas(flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec value) { + if (workerReplicasBuilder_ == null) { + if (workerReplicas_ != null) { + workerReplicas_ = + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.newBuilder(workerReplicas_).mergeFrom(value).buildPartial(); + } else { + workerReplicas_ = value; + } + onChanged(); + } else { + workerReplicasBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + */ + public Builder clearWorkerReplicas() { + if (workerReplicasBuilder_ == null) { + workerReplicas_ = null; + onChanged(); + } else { + workerReplicas_ = null; + workerReplicasBuilder_ = null; + } + + return this; + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + */ + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.Builder getWorkerReplicasBuilder() { + + onChanged(); + return getWorkerReplicasFieldBuilder().getBuilder(); + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + */ + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpecOrBuilder getWorkerReplicasOrBuilder() { + if (workerReplicasBuilder_ != null) { + return workerReplicasBuilder_.getMessageOrBuilder(); + } else { + return workerReplicas_ == null ? + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.getDefaultInstance() : workerReplicas_; + } + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec worker_replicas = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec, flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpecOrBuilder> + getWorkerReplicasFieldBuilder() { + if (workerReplicasBuilder_ == null) { + workerReplicasBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec, flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpecOrBuilder>( + getWorkerReplicas(), + getParentForChildren(), + isClean()); + workerReplicas_ = null; + } + return workerReplicasBuilder_; + } + + private flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec launcherReplicas_; + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec, flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpecOrBuilder> launcherReplicasBuilder_; + /** + *
+       * Master replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + */ + public boolean hasLauncherReplicas() { + return launcherReplicasBuilder_ != null || launcherReplicas_ != null; + } + /** + *
+       * Master replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + */ + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec getLauncherReplicas() { + if (launcherReplicasBuilder_ == null) { + return launcherReplicas_ == null ? flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.getDefaultInstance() : launcherReplicas_; + } else { + return launcherReplicasBuilder_.getMessage(); + } + } + /** + *
+       * Master replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + */ + public Builder setLauncherReplicas(flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec value) { + if (launcherReplicasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + launcherReplicas_ = value; + onChanged(); + } else { + launcherReplicasBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Master replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + */ + public Builder setLauncherReplicas( + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.Builder builderForValue) { + if (launcherReplicasBuilder_ == null) { + launcherReplicas_ = builderForValue.build(); + onChanged(); + } else { + launcherReplicasBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Master replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + */ + public Builder mergeLauncherReplicas(flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec value) { + if (launcherReplicasBuilder_ == null) { + if (launcherReplicas_ != null) { + launcherReplicas_ = + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.newBuilder(launcherReplicas_).mergeFrom(value).buildPartial(); + } else { + launcherReplicas_ = value; + } + onChanged(); + } else { + launcherReplicasBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Master replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + */ + public Builder clearLauncherReplicas() { + if (launcherReplicasBuilder_ == null) { + launcherReplicas_ = null; + onChanged(); + } else { + launcherReplicas_ = null; + launcherReplicasBuilder_ = null; + } + + return this; + } + /** + *
+       * Master replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + */ + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.Builder getLauncherReplicasBuilder() { + + onChanged(); + return getLauncherReplicasFieldBuilder().getBuilder(); + } + /** + *
+       * Master replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + */ + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpecOrBuilder getLauncherReplicasOrBuilder() { + if (launcherReplicasBuilder_ != null) { + return launcherReplicasBuilder_.getMessageOrBuilder(); + } else { + return launcherReplicas_ == null ? + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.getDefaultInstance() : launcherReplicas_; + } + } + /** + *
+       * Master replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec launcher_replicas = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec, flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpecOrBuilder> + getLauncherReplicasFieldBuilder() { + if (launcherReplicasBuilder_ == null) { + launcherReplicasBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec, flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpecOrBuilder>( + getLauncherReplicas(), + getParentForChildren(), + isClean()); + launcherReplicas_ = null; + } + return launcherReplicasBuilder_; + } + + private flyteidl.plugins.kubeflow.Common.RunPolicy runPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Common.RunPolicy, flyteidl.plugins.kubeflow.Common.RunPolicy.Builder, flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder> runPolicyBuilder_; + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public boolean hasRunPolicy() { + return runPolicyBuilder_ != null || runPolicy_ != null; + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public flyteidl.plugins.kubeflow.Common.RunPolicy getRunPolicy() { + if (runPolicyBuilder_ == null) { + return runPolicy_ == null ? flyteidl.plugins.kubeflow.Common.RunPolicy.getDefaultInstance() : runPolicy_; + } else { + return runPolicyBuilder_.getMessage(); + } + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public Builder setRunPolicy(flyteidl.plugins.kubeflow.Common.RunPolicy value) { + if (runPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + runPolicy_ = value; + onChanged(); + } else { + runPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public Builder setRunPolicy( + flyteidl.plugins.kubeflow.Common.RunPolicy.Builder builderForValue) { + if (runPolicyBuilder_ == null) { + runPolicy_ = builderForValue.build(); + onChanged(); + } else { + runPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public Builder mergeRunPolicy(flyteidl.plugins.kubeflow.Common.RunPolicy value) { + if (runPolicyBuilder_ == null) { + if (runPolicy_ != null) { + runPolicy_ = + flyteidl.plugins.kubeflow.Common.RunPolicy.newBuilder(runPolicy_).mergeFrom(value).buildPartial(); + } else { + runPolicy_ = value; + } + onChanged(); + } else { + runPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public Builder clearRunPolicy() { + if (runPolicyBuilder_ == null) { + runPolicy_ = null; + onChanged(); + } else { + runPolicy_ = null; + runPolicyBuilder_ = null; + } + + return this; + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public flyteidl.plugins.kubeflow.Common.RunPolicy.Builder getRunPolicyBuilder() { + + onChanged(); + return getRunPolicyFieldBuilder().getBuilder(); + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder getRunPolicyOrBuilder() { + if (runPolicyBuilder_ != null) { + return runPolicyBuilder_.getMessageOrBuilder(); + } else { + return runPolicy_ == null ? + flyteidl.plugins.kubeflow.Common.RunPolicy.getDefaultInstance() : runPolicy_; + } + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Common.RunPolicy, flyteidl.plugins.kubeflow.Common.RunPolicy.Builder, flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder> + getRunPolicyFieldBuilder() { + if (runPolicyBuilder_ == null) { + runPolicyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Common.RunPolicy, flyteidl.plugins.kubeflow.Common.RunPolicy.Builder, flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder>( + getRunPolicy(), + getParentForChildren(), + isClean()); + runPolicy_ = null; + } + return runPolicyBuilder_; + } + + private int slots_ ; + /** + *
+       * Number of slots per worker
+       * 
+ * + * int32 slots = 4; + */ + public int getSlots() { + return slots_; + } + /** + *
+       * Number of slots per worker
+       * 
+ * + * int32 slots = 4; + */ + public Builder setSlots(int value) { + + slots_ = value; + onChanged(); + return this; + } + /** + *
+       * Number of slots per worker
+       * 
+ * + * int32 slots = 4; + */ + public Builder clearSlots() { + + slots_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + } + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.kubeflow.DistributedMPITrainingTask) + private static final flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask(); + } + + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DistributedMPITrainingTask parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DistributedMPITrainingTask(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingTask getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DistributedMPITrainingReplicaSpecOrBuilder extends + // @@protoc_insertion_point(interface_extends:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Number of replicas
+     * 
+ * + * int32 replicas = 1; + */ + int getReplicas(); + + /** + *
+     * Image used for the replica group
+     * 
+ * + * string image = 2; + */ + java.lang.String getImage(); + /** + *
+     * Image used for the replica group
+     * 
+ * + * string image = 2; + */ + com.google.protobuf.ByteString + getImageBytes(); + + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + boolean hasResources(); + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + flyteidl.core.Tasks.Resources getResources(); + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + flyteidl.core.Tasks.ResourcesOrBuilder getResourcesOrBuilder(); + + /** + *
+     * Restart policy determines whether pods will be restarted when they exit
+     * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + int getRestartPolicyValue(); + /** + *
+     * Restart policy determines whether pods will be restarted when they exit
+     * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + flyteidl.plugins.kubeflow.Common.RestartPolicy getRestartPolicy(); + + /** + *
+     * MPI sometimes requires different command set for different replica groups
+     * 
+ * + * repeated string command = 5; + */ + java.util.List + getCommandList(); + /** + *
+     * MPI sometimes requires different command set for different replica groups
+     * 
+ * + * repeated string command = 5; + */ + int getCommandCount(); + /** + *
+     * MPI sometimes requires different command set for different replica groups
+     * 
+ * + * repeated string command = 5; + */ + java.lang.String getCommand(int index); + /** + *
+     * MPI sometimes requires different command set for different replica groups
+     * 
+ * + * repeated string command = 5; + */ + com.google.protobuf.ByteString + getCommandBytes(int index); + } + /** + *
+   * Replica specification for distributed MPI training
+   * 
+ * + * Protobuf type {@code flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec} + */ + public static final class DistributedMPITrainingReplicaSpec extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + DistributedMPITrainingReplicaSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use DistributedMPITrainingReplicaSpec.newBuilder() to construct. + private DistributedMPITrainingReplicaSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DistributedMPITrainingReplicaSpec() { + image_ = ""; + restartPolicy_ = 0; + command_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DistributedMPITrainingReplicaSpec( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + replicas_ = input.readInt32(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + image_ = s; + break; + } + case 26: { + flyteidl.core.Tasks.Resources.Builder subBuilder = null; + if (resources_ != null) { + subBuilder = resources_.toBuilder(); + } + resources_ = input.readMessage(flyteidl.core.Tasks.Resources.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resources_); + resources_ = subBuilder.buildPartial(); + } + + break; + } + case 32: { + int rawValue = input.readEnum(); + + restartPolicy_ = rawValue; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000010) != 0)) { + command_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000010; + } + command_.add(s); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000010) != 0)) { + command_ = command_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Mpi.internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingReplicaSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.kubeflow.Mpi.internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingReplicaSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.class, flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.Builder.class); + } + + private int bitField0_; + public static final int REPLICAS_FIELD_NUMBER = 1; + private int replicas_; + /** + *
+     * Number of replicas
+     * 
+ * + * int32 replicas = 1; + */ + public int getReplicas() { + return replicas_; + } + + public static final int IMAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object image_; + /** + *
+     * Image used for the replica group
+     * 
+ * + * string image = 2; + */ + public java.lang.String getImage() { + java.lang.Object ref = image_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + image_ = s; + return s; + } + } + /** + *
+     * Image used for the replica group
+     * 
+ * + * string image = 2; + */ + public com.google.protobuf.ByteString + getImageBytes() { + java.lang.Object ref = image_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + image_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCES_FIELD_NUMBER = 3; + private flyteidl.core.Tasks.Resources resources_; + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public boolean hasResources() { + return resources_ != null; + } + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public flyteidl.core.Tasks.Resources getResources() { + return resources_ == null ? flyteidl.core.Tasks.Resources.getDefaultInstance() : resources_; + } + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public flyteidl.core.Tasks.ResourcesOrBuilder getResourcesOrBuilder() { + return getResources(); + } + + public static final int RESTART_POLICY_FIELD_NUMBER = 4; + private int restartPolicy_; + /** + *
+     * Restart policy determines whether pods will be restarted when they exit
+     * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public int getRestartPolicyValue() { + return restartPolicy_; + } + /** + *
+     * Restart policy determines whether pods will be restarted when they exit
+     * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public flyteidl.plugins.kubeflow.Common.RestartPolicy getRestartPolicy() { + @SuppressWarnings("deprecation") + flyteidl.plugins.kubeflow.Common.RestartPolicy result = flyteidl.plugins.kubeflow.Common.RestartPolicy.valueOf(restartPolicy_); + return result == null ? flyteidl.plugins.kubeflow.Common.RestartPolicy.UNRECOGNIZED : result; + } + + public static final int COMMAND_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList command_; + /** + *
+     * MPI sometimes requires different command set for different replica groups
+     * 
+ * + * repeated string command = 5; + */ + public com.google.protobuf.ProtocolStringList + getCommandList() { + return command_; + } + /** + *
+     * MPI sometimes requires different command set for different replica groups
+     * 
+ * + * repeated string command = 5; + */ + public int getCommandCount() { + return command_.size(); + } + /** + *
+     * MPI sometimes requires different command set for different replica groups
+     * 
+ * + * repeated string command = 5; + */ + public java.lang.String getCommand(int index) { + return command_.get(index); + } + /** + *
+     * MPI sometimes requires different command set for different replica groups
+     * 
+ * + * repeated string command = 5; + */ + public com.google.protobuf.ByteString + getCommandBytes(int index) { + return command_.getByteString(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 + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (replicas_ != 0) { + output.writeInt32(1, replicas_); + } + if (!getImageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, image_); + } + if (resources_ != null) { + output.writeMessage(3, getResources()); + } + if (restartPolicy_ != flyteidl.plugins.kubeflow.Common.RestartPolicy.RESTART_POLICY_NEVER.getNumber()) { + output.writeEnum(4, restartPolicy_); + } + for (int i = 0; i < command_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, command_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (replicas_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, replicas_); + } + if (!getImageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, image_); + } + if (resources_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getResources()); + } + if (restartPolicy_ != flyteidl.plugins.kubeflow.Common.RestartPolicy.RESTART_POLICY_NEVER.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, restartPolicy_); + } + { + int dataSize = 0; + for (int i = 0; i < command_.size(); i++) { + dataSize += computeStringSizeNoTag(command_.getRaw(i)); + } + size += dataSize; + size += 1 * getCommandList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec)) { + return super.equals(obj); + } + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec other = (flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec) obj; + + if (getReplicas() + != other.getReplicas()) return false; + if (!getImage() + .equals(other.getImage())) return false; + if (hasResources() != other.hasResources()) return false; + if (hasResources()) { + if (!getResources() + .equals(other.getResources())) return false; + } + if (restartPolicy_ != other.restartPolicy_) return false; + if (!getCommandList() + .equals(other.getCommandList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REPLICAS_FIELD_NUMBER; + hash = (53 * hash) + getReplicas(); + hash = (37 * hash) + IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getImage().hashCode(); + if (hasResources()) { + hash = (37 * hash) + RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + getResources().hashCode(); + } + hash = (37 * hash) + RESTART_POLICY_FIELD_NUMBER; + hash = (53 * hash) + restartPolicy_; + if (getCommandCount() > 0) { + hash = (37 * hash) + COMMAND_FIELD_NUMBER; + hash = (53 * hash) + getCommandList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Replica specification for distributed MPI training
+     * 
+ * + * Protobuf type {@code flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Mpi.internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingReplicaSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.kubeflow.Mpi.internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingReplicaSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.class, flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.Builder.class); + } + + // Construct using flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + replicas_ = 0; + + image_ = ""; + + if (resourcesBuilder_ == null) { + resources_ = null; + } else { + resources_ = null; + resourcesBuilder_ = null; + } + restartPolicy_ = 0; + + command_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return flyteidl.plugins.kubeflow.Mpi.internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingReplicaSpec_descriptor; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec getDefaultInstanceForType() { + return flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.getDefaultInstance(); + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec build() { + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec buildPartial() { + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec result = new flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.replicas_ = replicas_; + result.image_ = image_; + if (resourcesBuilder_ == null) { + result.resources_ = resources_; + } else { + result.resources_ = resourcesBuilder_.build(); + } + result.restartPolicy_ = restartPolicy_; + if (((bitField0_ & 0x00000010) != 0)) { + command_ = command_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.command_ = command_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec) { + return mergeFrom((flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec other) { + if (other == flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec.getDefaultInstance()) return this; + if (other.getReplicas() != 0) { + setReplicas(other.getReplicas()); + } + if (!other.getImage().isEmpty()) { + image_ = other.image_; + onChanged(); + } + if (other.hasResources()) { + mergeResources(other.getResources()); + } + if (other.restartPolicy_ != 0) { + setRestartPolicyValue(other.getRestartPolicyValue()); + } + if (!other.command_.isEmpty()) { + if (command_.isEmpty()) { + command_ = other.command_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureCommandIsMutable(); + command_.addAll(other.command_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int replicas_ ; + /** + *
+       * Number of replicas
+       * 
+ * + * int32 replicas = 1; + */ + public int getReplicas() { + return replicas_; + } + /** + *
+       * Number of replicas
+       * 
+ * + * int32 replicas = 1; + */ + public Builder setReplicas(int value) { + + replicas_ = value; + onChanged(); + return this; + } + /** + *
+       * Number of replicas
+       * 
+ * + * int32 replicas = 1; + */ + public Builder clearReplicas() { + + replicas_ = 0; + onChanged(); + return this; + } + + private java.lang.Object image_ = ""; + /** + *
+       * Image used for the replica group
+       * 
+ * + * string image = 2; + */ + public java.lang.String getImage() { + java.lang.Object ref = image_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + image_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Image used for the replica group
+       * 
+ * + * string image = 2; + */ + public com.google.protobuf.ByteString + getImageBytes() { + java.lang.Object ref = image_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + image_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Image used for the replica group
+       * 
+ * + * string image = 2; + */ + public Builder setImage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + image_ = value; + onChanged(); + return this; + } + /** + *
+       * Image used for the replica group
+       * 
+ * + * string image = 2; + */ + public Builder clearImage() { + + image_ = getDefaultInstance().getImage(); + onChanged(); + return this; + } + /** + *
+       * Image used for the replica group
+       * 
+ * + * string image = 2; + */ + public Builder setImageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + image_ = value; + onChanged(); + return this; + } + + private flyteidl.core.Tasks.Resources resources_; + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.core.Tasks.Resources, flyteidl.core.Tasks.Resources.Builder, flyteidl.core.Tasks.ResourcesOrBuilder> resourcesBuilder_; + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public boolean hasResources() { + return resourcesBuilder_ != null || resources_ != null; + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public flyteidl.core.Tasks.Resources getResources() { + if (resourcesBuilder_ == null) { + return resources_ == null ? flyteidl.core.Tasks.Resources.getDefaultInstance() : resources_; + } else { + return resourcesBuilder_.getMessage(); + } + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public Builder setResources(flyteidl.core.Tasks.Resources value) { + if (resourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resources_ = value; + onChanged(); + } else { + resourcesBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public Builder setResources( + flyteidl.core.Tasks.Resources.Builder builderForValue) { + if (resourcesBuilder_ == null) { + resources_ = builderForValue.build(); + onChanged(); + } else { + resourcesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public Builder mergeResources(flyteidl.core.Tasks.Resources value) { + if (resourcesBuilder_ == null) { + if (resources_ != null) { + resources_ = + flyteidl.core.Tasks.Resources.newBuilder(resources_).mergeFrom(value).buildPartial(); + } else { + resources_ = value; + } + onChanged(); + } else { + resourcesBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public Builder clearResources() { + if (resourcesBuilder_ == null) { + resources_ = null; + onChanged(); + } else { + resources_ = null; + resourcesBuilder_ = null; + } + + return this; + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public flyteidl.core.Tasks.Resources.Builder getResourcesBuilder() { + + onChanged(); + return getResourcesFieldBuilder().getBuilder(); + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public flyteidl.core.Tasks.ResourcesOrBuilder getResourcesOrBuilder() { + if (resourcesBuilder_ != null) { + return resourcesBuilder_.getMessageOrBuilder(); + } else { + return resources_ == null ? + flyteidl.core.Tasks.Resources.getDefaultInstance() : resources_; + } + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.core.Tasks.Resources, flyteidl.core.Tasks.Resources.Builder, flyteidl.core.Tasks.ResourcesOrBuilder> + getResourcesFieldBuilder() { + if (resourcesBuilder_ == null) { + resourcesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + flyteidl.core.Tasks.Resources, flyteidl.core.Tasks.Resources.Builder, flyteidl.core.Tasks.ResourcesOrBuilder>( + getResources(), + getParentForChildren(), + isClean()); + resources_ = null; + } + return resourcesBuilder_; + } + + private int restartPolicy_ = 0; + /** + *
+       * Restart policy determines whether pods will be restarted when they exit
+       * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public int getRestartPolicyValue() { + return restartPolicy_; + } + /** + *
+       * Restart policy determines whether pods will be restarted when they exit
+       * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public Builder setRestartPolicyValue(int value) { + restartPolicy_ = value; + onChanged(); + return this; + } + /** + *
+       * Restart policy determines whether pods will be restarted when they exit
+       * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public flyteidl.plugins.kubeflow.Common.RestartPolicy getRestartPolicy() { + @SuppressWarnings("deprecation") + flyteidl.plugins.kubeflow.Common.RestartPolicy result = flyteidl.plugins.kubeflow.Common.RestartPolicy.valueOf(restartPolicy_); + return result == null ? flyteidl.plugins.kubeflow.Common.RestartPolicy.UNRECOGNIZED : result; + } + /** + *
+       * Restart policy determines whether pods will be restarted when they exit
+       * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public Builder setRestartPolicy(flyteidl.plugins.kubeflow.Common.RestartPolicy value) { + if (value == null) { + throw new NullPointerException(); + } + + restartPolicy_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       * Restart policy determines whether pods will be restarted when they exit
+       * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public Builder clearRestartPolicy() { + + restartPolicy_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList command_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureCommandIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + command_ = new com.google.protobuf.LazyStringArrayList(command_); + bitField0_ |= 0x00000010; + } + } + /** + *
+       * MPI sometimes requires different command set for different replica groups
+       * 
+ * + * repeated string command = 5; + */ + public com.google.protobuf.ProtocolStringList + getCommandList() { + return command_.getUnmodifiableView(); + } + /** + *
+       * MPI sometimes requires different command set for different replica groups
+       * 
+ * + * repeated string command = 5; + */ + public int getCommandCount() { + return command_.size(); + } + /** + *
+       * MPI sometimes requires different command set for different replica groups
+       * 
+ * + * repeated string command = 5; + */ + public java.lang.String getCommand(int index) { + return command_.get(index); + } + /** + *
+       * MPI sometimes requires different command set for different replica groups
+       * 
+ * + * repeated string command = 5; + */ + public com.google.protobuf.ByteString + getCommandBytes(int index) { + return command_.getByteString(index); + } + /** + *
+       * MPI sometimes requires different command set for different replica groups
+       * 
+ * + * repeated string command = 5; + */ + public Builder setCommand( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCommandIsMutable(); + command_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * MPI sometimes requires different command set for different replica groups
+       * 
+ * + * repeated string command = 5; + */ + public Builder addCommand( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCommandIsMutable(); + command_.add(value); + onChanged(); + return this; + } + /** + *
+       * MPI sometimes requires different command set for different replica groups
+       * 
+ * + * repeated string command = 5; + */ + public Builder addAllCommand( + java.lang.Iterable values) { + ensureCommandIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, command_); + onChanged(); + return this; + } + /** + *
+       * MPI sometimes requires different command set for different replica groups
+       * 
+ * + * repeated string command = 5; + */ + public Builder clearCommand() { + command_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
+       * MPI sometimes requires different command set for different replica groups
+       * 
+ * + * repeated string command = 5; + */ + public Builder addCommandBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCommandIsMutable(); + command_.add(value); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + } + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpec) + private static final flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec(); + } + + public static flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DistributedMPITrainingReplicaSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DistributedMPITrainingReplicaSpec(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Mpi.DistributedMPITrainingReplicaSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingTask_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingTask_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingReplicaSpec_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingReplicaSpec_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n#flyteidl/plugins/kubeflow/mpi.proto\022\031f" + + "lyteidl.plugins.kubeflow\032\031flyteidl/core/" + + "tasks.proto\032&flyteidl/plugins/kubeflow/c" + + "ommon.proto\"\225\002\n\032DistributedMPITrainingTa" + + "sk\022U\n\017worker_replicas\030\001 \001(\0132<.flyteidl.p" + + "lugins.kubeflow.DistributedMPITrainingRe" + + "plicaSpec\022W\n\021launcher_replicas\030\002 \001(\0132<.f" + + "lyteidl.plugins.kubeflow.DistributedMPIT" + + "rainingReplicaSpec\0228\n\nrun_policy\030\003 \001(\0132$" + + ".flyteidl.plugins.kubeflow.RunPolicy\022\r\n\005" + + "slots\030\004 \001(\005\"\304\001\n!DistributedMPITrainingRe" + + "plicaSpec\022\020\n\010replicas\030\001 \001(\005\022\r\n\005image\030\002 \001" + + "(\t\022+\n\tresources\030\003 \001(\0132\030.flyteidl.core.Re" + + "sources\022@\n\016restart_policy\030\004 \001(\0162(.flytei" + + "dl.plugins.kubeflow.RestartPolicy\022\017\n\007com" + + "mand\030\005 \003(\tB9Z7github.com/flyteorg/flytei" + + "dl/gen/pb-go/flyteidl/pluginsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + flyteidl.core.Tasks.getDescriptor(), + flyteidl.plugins.kubeflow.Common.getDescriptor(), + }, assigner); + internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingTask_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingTask_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingTask_descriptor, + new java.lang.String[] { "WorkerReplicas", "LauncherReplicas", "RunPolicy", "Slots", }); + internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingReplicaSpec_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingReplicaSpec_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_flyteidl_plugins_kubeflow_DistributedMPITrainingReplicaSpec_descriptor, + new java.lang.String[] { "Replicas", "Image", "Resources", "RestartPolicy", "Command", }); + flyteidl.core.Tasks.getDescriptor(); + flyteidl.plugins.kubeflow.Common.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/gen/pb-java/flyteidl/plugins/kubeflow/Pytorch.java b/gen/pb-java/flyteidl/plugins/kubeflow/Pytorch.java new file mode 100644 index 000000000..fa8d3d113 --- /dev/null +++ b/gen/pb-java/flyteidl/plugins/kubeflow/Pytorch.java @@ -0,0 +1,3425 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/kubeflow/pytorch.proto + +package flyteidl.plugins.kubeflow; + +public final class Pytorch { + private Pytorch() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ElasticConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:flyteidl.plugins.kubeflow.ElasticConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * string rdzv_backend = 1; + */ + java.lang.String getRdzvBackend(); + /** + * string rdzv_backend = 1; + */ + com.google.protobuf.ByteString + getRdzvBackendBytes(); + + /** + * int32 min_replicas = 2; + */ + int getMinReplicas(); + + /** + * int32 max_replicas = 3; + */ + int getMaxReplicas(); + + /** + * int32 nproc_per_node = 4; + */ + int getNprocPerNode(); + + /** + * int32 max_restarts = 5; + */ + int getMaxRestarts(); + } + /** + *
+   * Custom proto for torch elastic config for distributed training using 
+   * https://github.com/kubeflow/training-operator/blob/master/pkg/apis/kubeflow.org/v1/pytorch_types.go
+   * 
+ * + * Protobuf type {@code flyteidl.plugins.kubeflow.ElasticConfig} + */ + public static final class ElasticConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:flyteidl.plugins.kubeflow.ElasticConfig) + ElasticConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ElasticConfig.newBuilder() to construct. + private ElasticConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ElasticConfig() { + rdzvBackend_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ElasticConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + rdzvBackend_ = s; + break; + } + case 16: { + + minReplicas_ = input.readInt32(); + break; + } + case 24: { + + maxReplicas_ = input.readInt32(); + break; + } + case 32: { + + nprocPerNode_ = input.readInt32(); + break; + } + case 40: { + + maxRestarts_ = input.readInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Pytorch.internal_static_flyteidl_plugins_kubeflow_ElasticConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.kubeflow.Pytorch.internal_static_flyteidl_plugins_kubeflow_ElasticConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.class, flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.Builder.class); + } + + public static final int RDZV_BACKEND_FIELD_NUMBER = 1; + private volatile java.lang.Object rdzvBackend_; + /** + * string rdzv_backend = 1; + */ + public java.lang.String getRdzvBackend() { + java.lang.Object ref = rdzvBackend_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rdzvBackend_ = s; + return s; + } + } + /** + * string rdzv_backend = 1; + */ + public com.google.protobuf.ByteString + getRdzvBackendBytes() { + java.lang.Object ref = rdzvBackend_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + rdzvBackend_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MIN_REPLICAS_FIELD_NUMBER = 2; + private int minReplicas_; + /** + * int32 min_replicas = 2; + */ + public int getMinReplicas() { + return minReplicas_; + } + + public static final int MAX_REPLICAS_FIELD_NUMBER = 3; + private int maxReplicas_; + /** + * int32 max_replicas = 3; + */ + public int getMaxReplicas() { + return maxReplicas_; + } + + public static final int NPROC_PER_NODE_FIELD_NUMBER = 4; + private int nprocPerNode_; + /** + * int32 nproc_per_node = 4; + */ + public int getNprocPerNode() { + return nprocPerNode_; + } + + public static final int MAX_RESTARTS_FIELD_NUMBER = 5; + private int maxRestarts_; + /** + * int32 max_restarts = 5; + */ + public int getMaxRestarts() { + return maxRestarts_; + } + + 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 + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getRdzvBackendBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, rdzvBackend_); + } + if (minReplicas_ != 0) { + output.writeInt32(2, minReplicas_); + } + if (maxReplicas_ != 0) { + output.writeInt32(3, maxReplicas_); + } + if (nprocPerNode_ != 0) { + output.writeInt32(4, nprocPerNode_); + } + if (maxRestarts_ != 0) { + output.writeInt32(5, maxRestarts_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getRdzvBackendBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, rdzvBackend_); + } + if (minReplicas_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, minReplicas_); + } + if (maxReplicas_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, maxReplicas_); + } + if (nprocPerNode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, nprocPerNode_); + } + if (maxRestarts_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, maxRestarts_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof flyteidl.plugins.kubeflow.Pytorch.ElasticConfig)) { + return super.equals(obj); + } + flyteidl.plugins.kubeflow.Pytorch.ElasticConfig other = (flyteidl.plugins.kubeflow.Pytorch.ElasticConfig) obj; + + if (!getRdzvBackend() + .equals(other.getRdzvBackend())) return false; + if (getMinReplicas() + != other.getMinReplicas()) return false; + if (getMaxReplicas() + != other.getMaxReplicas()) return false; + if (getNprocPerNode() + != other.getNprocPerNode()) return false; + if (getMaxRestarts() + != other.getMaxRestarts()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RDZV_BACKEND_FIELD_NUMBER; + hash = (53 * hash) + getRdzvBackend().hashCode(); + hash = (37 * hash) + MIN_REPLICAS_FIELD_NUMBER; + hash = (53 * hash) + getMinReplicas(); + hash = (37 * hash) + MAX_REPLICAS_FIELD_NUMBER; + hash = (53 * hash) + getMaxReplicas(); + hash = (37 * hash) + NPROC_PER_NODE_FIELD_NUMBER; + hash = (53 * hash) + getNprocPerNode(); + hash = (37 * hash) + MAX_RESTARTS_FIELD_NUMBER; + hash = (53 * hash) + getMaxRestarts(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static flyteidl.plugins.kubeflow.Pytorch.ElasticConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Pytorch.ElasticConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Pytorch.ElasticConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Pytorch.ElasticConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Pytorch.ElasticConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Pytorch.ElasticConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Pytorch.ElasticConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Pytorch.ElasticConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Pytorch.ElasticConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Pytorch.ElasticConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Pytorch.ElasticConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Pytorch.ElasticConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(flyteidl.plugins.kubeflow.Pytorch.ElasticConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Custom proto for torch elastic config for distributed training using 
+     * https://github.com/kubeflow/training-operator/blob/master/pkg/apis/kubeflow.org/v1/pytorch_types.go
+     * 
+ * + * Protobuf type {@code flyteidl.plugins.kubeflow.ElasticConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:flyteidl.plugins.kubeflow.ElasticConfig) + flyteidl.plugins.kubeflow.Pytorch.ElasticConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Pytorch.internal_static_flyteidl_plugins_kubeflow_ElasticConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.kubeflow.Pytorch.internal_static_flyteidl_plugins_kubeflow_ElasticConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.class, flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.Builder.class); + } + + // Construct using flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + rdzvBackend_ = ""; + + minReplicas_ = 0; + + maxReplicas_ = 0; + + nprocPerNode_ = 0; + + maxRestarts_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return flyteidl.plugins.kubeflow.Pytorch.internal_static_flyteidl_plugins_kubeflow_ElasticConfig_descriptor; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Pytorch.ElasticConfig getDefaultInstanceForType() { + return flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.getDefaultInstance(); + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Pytorch.ElasticConfig build() { + flyteidl.plugins.kubeflow.Pytorch.ElasticConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Pytorch.ElasticConfig buildPartial() { + flyteidl.plugins.kubeflow.Pytorch.ElasticConfig result = new flyteidl.plugins.kubeflow.Pytorch.ElasticConfig(this); + result.rdzvBackend_ = rdzvBackend_; + result.minReplicas_ = minReplicas_; + result.maxReplicas_ = maxReplicas_; + result.nprocPerNode_ = nprocPerNode_; + result.maxRestarts_ = maxRestarts_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof flyteidl.plugins.kubeflow.Pytorch.ElasticConfig) { + return mergeFrom((flyteidl.plugins.kubeflow.Pytorch.ElasticConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(flyteidl.plugins.kubeflow.Pytorch.ElasticConfig other) { + if (other == flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.getDefaultInstance()) return this; + if (!other.getRdzvBackend().isEmpty()) { + rdzvBackend_ = other.rdzvBackend_; + onChanged(); + } + if (other.getMinReplicas() != 0) { + setMinReplicas(other.getMinReplicas()); + } + if (other.getMaxReplicas() != 0) { + setMaxReplicas(other.getMaxReplicas()); + } + if (other.getNprocPerNode() != 0) { + setNprocPerNode(other.getNprocPerNode()); + } + if (other.getMaxRestarts() != 0) { + setMaxRestarts(other.getMaxRestarts()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + flyteidl.plugins.kubeflow.Pytorch.ElasticConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (flyteidl.plugins.kubeflow.Pytorch.ElasticConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object rdzvBackend_ = ""; + /** + * string rdzv_backend = 1; + */ + public java.lang.String getRdzvBackend() { + java.lang.Object ref = rdzvBackend_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rdzvBackend_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string rdzv_backend = 1; + */ + public com.google.protobuf.ByteString + getRdzvBackendBytes() { + java.lang.Object ref = rdzvBackend_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + rdzvBackend_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string rdzv_backend = 1; + */ + public Builder setRdzvBackend( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + rdzvBackend_ = value; + onChanged(); + return this; + } + /** + * string rdzv_backend = 1; + */ + public Builder clearRdzvBackend() { + + rdzvBackend_ = getDefaultInstance().getRdzvBackend(); + onChanged(); + return this; + } + /** + * string rdzv_backend = 1; + */ + public Builder setRdzvBackendBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + rdzvBackend_ = value; + onChanged(); + return this; + } + + private int minReplicas_ ; + /** + * int32 min_replicas = 2; + */ + public int getMinReplicas() { + return minReplicas_; + } + /** + * int32 min_replicas = 2; + */ + public Builder setMinReplicas(int value) { + + minReplicas_ = value; + onChanged(); + return this; + } + /** + * int32 min_replicas = 2; + */ + public Builder clearMinReplicas() { + + minReplicas_ = 0; + onChanged(); + return this; + } + + private int maxReplicas_ ; + /** + * int32 max_replicas = 3; + */ + public int getMaxReplicas() { + return maxReplicas_; + } + /** + * int32 max_replicas = 3; + */ + public Builder setMaxReplicas(int value) { + + maxReplicas_ = value; + onChanged(); + return this; + } + /** + * int32 max_replicas = 3; + */ + public Builder clearMaxReplicas() { + + maxReplicas_ = 0; + onChanged(); + return this; + } + + private int nprocPerNode_ ; + /** + * int32 nproc_per_node = 4; + */ + public int getNprocPerNode() { + return nprocPerNode_; + } + /** + * int32 nproc_per_node = 4; + */ + public Builder setNprocPerNode(int value) { + + nprocPerNode_ = value; + onChanged(); + return this; + } + /** + * int32 nproc_per_node = 4; + */ + public Builder clearNprocPerNode() { + + nprocPerNode_ = 0; + onChanged(); + return this; + } + + private int maxRestarts_ ; + /** + * int32 max_restarts = 5; + */ + public int getMaxRestarts() { + return maxRestarts_; + } + /** + * int32 max_restarts = 5; + */ + public Builder setMaxRestarts(int value) { + + maxRestarts_ = value; + onChanged(); + return this; + } + /** + * int32 max_restarts = 5; + */ + public Builder clearMaxRestarts() { + + maxRestarts_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:flyteidl.plugins.kubeflow.ElasticConfig) + } + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.kubeflow.ElasticConfig) + private static final flyteidl.plugins.kubeflow.Pytorch.ElasticConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new flyteidl.plugins.kubeflow.Pytorch.ElasticConfig(); + } + + public static flyteidl.plugins.kubeflow.Pytorch.ElasticConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ElasticConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ElasticConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Pytorch.ElasticConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DistributedPyTorchTrainingTaskOrBuilder extends + // @@protoc_insertion_point(interface_extends:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + */ + boolean hasWorkerReplicas(); + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + */ + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec getWorkerReplicas(); + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + */ + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpecOrBuilder getWorkerReplicasOrBuilder(); + + /** + *
+     * Master replicas spec, master replicas can only have 1 replica
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + */ + boolean hasMasterReplicas(); + /** + *
+     * Master replicas spec, master replicas can only have 1 replica
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + */ + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec getMasterReplicas(); + /** + *
+     * Master replicas spec, master replicas can only have 1 replica
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + */ + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpecOrBuilder getMasterReplicasOrBuilder(); + + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + boolean hasRunPolicy(); + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + flyteidl.plugins.kubeflow.Common.RunPolicy getRunPolicy(); + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder getRunPolicyOrBuilder(); + + /** + *
+     * config for an elastic pytorch job
+     * 
+ * + * .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + */ + boolean hasElasticConfig(); + /** + *
+     * config for an elastic pytorch job
+     * 
+ * + * .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + */ + flyteidl.plugins.kubeflow.Pytorch.ElasticConfig getElasticConfig(); + /** + *
+     * config for an elastic pytorch job
+     * 
+ * + * .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + */ + flyteidl.plugins.kubeflow.Pytorch.ElasticConfigOrBuilder getElasticConfigOrBuilder(); + } + /** + *
+   * Proto for plugin that enables distributed training using https://github.com/kubeflow/pytorch-operator
+   * 
+ * + * Protobuf type {@code flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask} + */ + public static final class DistributedPyTorchTrainingTask extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + DistributedPyTorchTrainingTaskOrBuilder { + private static final long serialVersionUID = 0L; + // Use DistributedPyTorchTrainingTask.newBuilder() to construct. + private DistributedPyTorchTrainingTask(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DistributedPyTorchTrainingTask() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DistributedPyTorchTrainingTask( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.Builder subBuilder = null; + if (workerReplicas_ != null) { + subBuilder = workerReplicas_.toBuilder(); + } + workerReplicas_ = input.readMessage(flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(workerReplicas_); + workerReplicas_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.Builder subBuilder = null; + if (masterReplicas_ != null) { + subBuilder = masterReplicas_.toBuilder(); + } + masterReplicas_ = input.readMessage(flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(masterReplicas_); + masterReplicas_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + flyteidl.plugins.kubeflow.Common.RunPolicy.Builder subBuilder = null; + if (runPolicy_ != null) { + subBuilder = runPolicy_.toBuilder(); + } + runPolicy_ = input.readMessage(flyteidl.plugins.kubeflow.Common.RunPolicy.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(runPolicy_); + runPolicy_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.Builder subBuilder = null; + if (elasticConfig_ != null) { + subBuilder = elasticConfig_.toBuilder(); + } + elasticConfig_ = input.readMessage(flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(elasticConfig_); + elasticConfig_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Pytorch.internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingTask_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.kubeflow.Pytorch.internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingTask_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask.class, flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask.Builder.class); + } + + public static final int WORKER_REPLICAS_FIELD_NUMBER = 1; + private flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec workerReplicas_; + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + */ + public boolean hasWorkerReplicas() { + return workerReplicas_ != null; + } + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + */ + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec getWorkerReplicas() { + return workerReplicas_ == null ? flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.getDefaultInstance() : workerReplicas_; + } + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + */ + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpecOrBuilder getWorkerReplicasOrBuilder() { + return getWorkerReplicas(); + } + + public static final int MASTER_REPLICAS_FIELD_NUMBER = 2; + private flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec masterReplicas_; + /** + *
+     * Master replicas spec, master replicas can only have 1 replica
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + */ + public boolean hasMasterReplicas() { + return masterReplicas_ != null; + } + /** + *
+     * Master replicas spec, master replicas can only have 1 replica
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + */ + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec getMasterReplicas() { + return masterReplicas_ == null ? flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.getDefaultInstance() : masterReplicas_; + } + /** + *
+     * Master replicas spec, master replicas can only have 1 replica
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + */ + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpecOrBuilder getMasterReplicasOrBuilder() { + return getMasterReplicas(); + } + + public static final int RUN_POLICY_FIELD_NUMBER = 3; + private flyteidl.plugins.kubeflow.Common.RunPolicy runPolicy_; + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public boolean hasRunPolicy() { + return runPolicy_ != null; + } + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public flyteidl.plugins.kubeflow.Common.RunPolicy getRunPolicy() { + return runPolicy_ == null ? flyteidl.plugins.kubeflow.Common.RunPolicy.getDefaultInstance() : runPolicy_; + } + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder getRunPolicyOrBuilder() { + return getRunPolicy(); + } + + public static final int ELASTIC_CONFIG_FIELD_NUMBER = 4; + private flyteidl.plugins.kubeflow.Pytorch.ElasticConfig elasticConfig_; + /** + *
+     * config for an elastic pytorch job
+     * 
+ * + * .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + */ + public boolean hasElasticConfig() { + return elasticConfig_ != null; + } + /** + *
+     * config for an elastic pytorch job
+     * 
+ * + * .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + */ + public flyteidl.plugins.kubeflow.Pytorch.ElasticConfig getElasticConfig() { + return elasticConfig_ == null ? flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.getDefaultInstance() : elasticConfig_; + } + /** + *
+     * config for an elastic pytorch job
+     * 
+ * + * .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + */ + public flyteidl.plugins.kubeflow.Pytorch.ElasticConfigOrBuilder getElasticConfigOrBuilder() { + return getElasticConfig(); + } + + 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 + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (workerReplicas_ != null) { + output.writeMessage(1, getWorkerReplicas()); + } + if (masterReplicas_ != null) { + output.writeMessage(2, getMasterReplicas()); + } + if (runPolicy_ != null) { + output.writeMessage(3, getRunPolicy()); + } + if (elasticConfig_ != null) { + output.writeMessage(4, getElasticConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (workerReplicas_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getWorkerReplicas()); + } + if (masterReplicas_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getMasterReplicas()); + } + if (runPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getRunPolicy()); + } + if (elasticConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getElasticConfig()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask)) { + return super.equals(obj); + } + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask other = (flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask) obj; + + if (hasWorkerReplicas() != other.hasWorkerReplicas()) return false; + if (hasWorkerReplicas()) { + if (!getWorkerReplicas() + .equals(other.getWorkerReplicas())) return false; + } + if (hasMasterReplicas() != other.hasMasterReplicas()) return false; + if (hasMasterReplicas()) { + if (!getMasterReplicas() + .equals(other.getMasterReplicas())) return false; + } + if (hasRunPolicy() != other.hasRunPolicy()) return false; + if (hasRunPolicy()) { + if (!getRunPolicy() + .equals(other.getRunPolicy())) return false; + } + if (hasElasticConfig() != other.hasElasticConfig()) return false; + if (hasElasticConfig()) { + if (!getElasticConfig() + .equals(other.getElasticConfig())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasWorkerReplicas()) { + hash = (37 * hash) + WORKER_REPLICAS_FIELD_NUMBER; + hash = (53 * hash) + getWorkerReplicas().hashCode(); + } + if (hasMasterReplicas()) { + hash = (37 * hash) + MASTER_REPLICAS_FIELD_NUMBER; + hash = (53 * hash) + getMasterReplicas().hashCode(); + } + if (hasRunPolicy()) { + hash = (37 * hash) + RUN_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getRunPolicy().hashCode(); + } + if (hasElasticConfig()) { + hash = (37 * hash) + ELASTIC_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getElasticConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Proto for plugin that enables distributed training using https://github.com/kubeflow/pytorch-operator
+     * 
+ * + * Protobuf type {@code flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTaskOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Pytorch.internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingTask_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.kubeflow.Pytorch.internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingTask_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask.class, flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask.Builder.class); + } + + // Construct using flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (workerReplicasBuilder_ == null) { + workerReplicas_ = null; + } else { + workerReplicas_ = null; + workerReplicasBuilder_ = null; + } + if (masterReplicasBuilder_ == null) { + masterReplicas_ = null; + } else { + masterReplicas_ = null; + masterReplicasBuilder_ = null; + } + if (runPolicyBuilder_ == null) { + runPolicy_ = null; + } else { + runPolicy_ = null; + runPolicyBuilder_ = null; + } + if (elasticConfigBuilder_ == null) { + elasticConfig_ = null; + } else { + elasticConfig_ = null; + elasticConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return flyteidl.plugins.kubeflow.Pytorch.internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingTask_descriptor; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask getDefaultInstanceForType() { + return flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask.getDefaultInstance(); + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask build() { + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask buildPartial() { + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask result = new flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask(this); + if (workerReplicasBuilder_ == null) { + result.workerReplicas_ = workerReplicas_; + } else { + result.workerReplicas_ = workerReplicasBuilder_.build(); + } + if (masterReplicasBuilder_ == null) { + result.masterReplicas_ = masterReplicas_; + } else { + result.masterReplicas_ = masterReplicasBuilder_.build(); + } + if (runPolicyBuilder_ == null) { + result.runPolicy_ = runPolicy_; + } else { + result.runPolicy_ = runPolicyBuilder_.build(); + } + if (elasticConfigBuilder_ == null) { + result.elasticConfig_ = elasticConfig_; + } else { + result.elasticConfig_ = elasticConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask) { + return mergeFrom((flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask other) { + if (other == flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask.getDefaultInstance()) return this; + if (other.hasWorkerReplicas()) { + mergeWorkerReplicas(other.getWorkerReplicas()); + } + if (other.hasMasterReplicas()) { + mergeMasterReplicas(other.getMasterReplicas()); + } + if (other.hasRunPolicy()) { + mergeRunPolicy(other.getRunPolicy()); + } + if (other.hasElasticConfig()) { + mergeElasticConfig(other.getElasticConfig()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec workerReplicas_; + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec, flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpecOrBuilder> workerReplicasBuilder_; + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + */ + public boolean hasWorkerReplicas() { + return workerReplicasBuilder_ != null || workerReplicas_ != null; + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + */ + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec getWorkerReplicas() { + if (workerReplicasBuilder_ == null) { + return workerReplicas_ == null ? flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.getDefaultInstance() : workerReplicas_; + } else { + return workerReplicasBuilder_.getMessage(); + } + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + */ + public Builder setWorkerReplicas(flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec value) { + if (workerReplicasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + workerReplicas_ = value; + onChanged(); + } else { + workerReplicasBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + */ + public Builder setWorkerReplicas( + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.Builder builderForValue) { + if (workerReplicasBuilder_ == null) { + workerReplicas_ = builderForValue.build(); + onChanged(); + } else { + workerReplicasBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + */ + public Builder mergeWorkerReplicas(flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec value) { + if (workerReplicasBuilder_ == null) { + if (workerReplicas_ != null) { + workerReplicas_ = + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.newBuilder(workerReplicas_).mergeFrom(value).buildPartial(); + } else { + workerReplicas_ = value; + } + onChanged(); + } else { + workerReplicasBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + */ + public Builder clearWorkerReplicas() { + if (workerReplicasBuilder_ == null) { + workerReplicas_ = null; + onChanged(); + } else { + workerReplicas_ = null; + workerReplicasBuilder_ = null; + } + + return this; + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + */ + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.Builder getWorkerReplicasBuilder() { + + onChanged(); + return getWorkerReplicasFieldBuilder().getBuilder(); + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + */ + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpecOrBuilder getWorkerReplicasOrBuilder() { + if (workerReplicasBuilder_ != null) { + return workerReplicasBuilder_.getMessageOrBuilder(); + } else { + return workerReplicas_ == null ? + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.getDefaultInstance() : workerReplicas_; + } + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec, flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpecOrBuilder> + getWorkerReplicasFieldBuilder() { + if (workerReplicasBuilder_ == null) { + workerReplicasBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec, flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpecOrBuilder>( + getWorkerReplicas(), + getParentForChildren(), + isClean()); + workerReplicas_ = null; + } + return workerReplicasBuilder_; + } + + private flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec masterReplicas_; + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec, flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpecOrBuilder> masterReplicasBuilder_; + /** + *
+       * Master replicas spec, master replicas can only have 1 replica
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + */ + public boolean hasMasterReplicas() { + return masterReplicasBuilder_ != null || masterReplicas_ != null; + } + /** + *
+       * Master replicas spec, master replicas can only have 1 replica
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + */ + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec getMasterReplicas() { + if (masterReplicasBuilder_ == null) { + return masterReplicas_ == null ? flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.getDefaultInstance() : masterReplicas_; + } else { + return masterReplicasBuilder_.getMessage(); + } + } + /** + *
+       * Master replicas spec, master replicas can only have 1 replica
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + */ + public Builder setMasterReplicas(flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec value) { + if (masterReplicasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + masterReplicas_ = value; + onChanged(); + } else { + masterReplicasBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Master replicas spec, master replicas can only have 1 replica
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + */ + public Builder setMasterReplicas( + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.Builder builderForValue) { + if (masterReplicasBuilder_ == null) { + masterReplicas_ = builderForValue.build(); + onChanged(); + } else { + masterReplicasBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Master replicas spec, master replicas can only have 1 replica
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + */ + public Builder mergeMasterReplicas(flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec value) { + if (masterReplicasBuilder_ == null) { + if (masterReplicas_ != null) { + masterReplicas_ = + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.newBuilder(masterReplicas_).mergeFrom(value).buildPartial(); + } else { + masterReplicas_ = value; + } + onChanged(); + } else { + masterReplicasBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Master replicas spec, master replicas can only have 1 replica
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + */ + public Builder clearMasterReplicas() { + if (masterReplicasBuilder_ == null) { + masterReplicas_ = null; + onChanged(); + } else { + masterReplicas_ = null; + masterReplicasBuilder_ = null; + } + + return this; + } + /** + *
+       * Master replicas spec, master replicas can only have 1 replica
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + */ + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.Builder getMasterReplicasBuilder() { + + onChanged(); + return getMasterReplicasFieldBuilder().getBuilder(); + } + /** + *
+       * Master replicas spec, master replicas can only have 1 replica
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + */ + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpecOrBuilder getMasterReplicasOrBuilder() { + if (masterReplicasBuilder_ != null) { + return masterReplicasBuilder_.getMessageOrBuilder(); + } else { + return masterReplicas_ == null ? + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.getDefaultInstance() : masterReplicas_; + } + } + /** + *
+       * Master replicas spec, master replicas can only have 1 replica
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec, flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpecOrBuilder> + getMasterReplicasFieldBuilder() { + if (masterReplicasBuilder_ == null) { + masterReplicasBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec, flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpecOrBuilder>( + getMasterReplicas(), + getParentForChildren(), + isClean()); + masterReplicas_ = null; + } + return masterReplicasBuilder_; + } + + private flyteidl.plugins.kubeflow.Common.RunPolicy runPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Common.RunPolicy, flyteidl.plugins.kubeflow.Common.RunPolicy.Builder, flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder> runPolicyBuilder_; + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public boolean hasRunPolicy() { + return runPolicyBuilder_ != null || runPolicy_ != null; + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public flyteidl.plugins.kubeflow.Common.RunPolicy getRunPolicy() { + if (runPolicyBuilder_ == null) { + return runPolicy_ == null ? flyteidl.plugins.kubeflow.Common.RunPolicy.getDefaultInstance() : runPolicy_; + } else { + return runPolicyBuilder_.getMessage(); + } + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public Builder setRunPolicy(flyteidl.plugins.kubeflow.Common.RunPolicy value) { + if (runPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + runPolicy_ = value; + onChanged(); + } else { + runPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public Builder setRunPolicy( + flyteidl.plugins.kubeflow.Common.RunPolicy.Builder builderForValue) { + if (runPolicyBuilder_ == null) { + runPolicy_ = builderForValue.build(); + onChanged(); + } else { + runPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public Builder mergeRunPolicy(flyteidl.plugins.kubeflow.Common.RunPolicy value) { + if (runPolicyBuilder_ == null) { + if (runPolicy_ != null) { + runPolicy_ = + flyteidl.plugins.kubeflow.Common.RunPolicy.newBuilder(runPolicy_).mergeFrom(value).buildPartial(); + } else { + runPolicy_ = value; + } + onChanged(); + } else { + runPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public Builder clearRunPolicy() { + if (runPolicyBuilder_ == null) { + runPolicy_ = null; + onChanged(); + } else { + runPolicy_ = null; + runPolicyBuilder_ = null; + } + + return this; + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public flyteidl.plugins.kubeflow.Common.RunPolicy.Builder getRunPolicyBuilder() { + + onChanged(); + return getRunPolicyFieldBuilder().getBuilder(); + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + public flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder getRunPolicyOrBuilder() { + if (runPolicyBuilder_ != null) { + return runPolicyBuilder_.getMessageOrBuilder(); + } else { + return runPolicy_ == null ? + flyteidl.plugins.kubeflow.Common.RunPolicy.getDefaultInstance() : runPolicy_; + } + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Common.RunPolicy, flyteidl.plugins.kubeflow.Common.RunPolicy.Builder, flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder> + getRunPolicyFieldBuilder() { + if (runPolicyBuilder_ == null) { + runPolicyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Common.RunPolicy, flyteidl.plugins.kubeflow.Common.RunPolicy.Builder, flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder>( + getRunPolicy(), + getParentForChildren(), + isClean()); + runPolicy_ = null; + } + return runPolicyBuilder_; + } + + private flyteidl.plugins.kubeflow.Pytorch.ElasticConfig elasticConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Pytorch.ElasticConfig, flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.Builder, flyteidl.plugins.kubeflow.Pytorch.ElasticConfigOrBuilder> elasticConfigBuilder_; + /** + *
+       * config for an elastic pytorch job
+       * 
+ * + * .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + */ + public boolean hasElasticConfig() { + return elasticConfigBuilder_ != null || elasticConfig_ != null; + } + /** + *
+       * config for an elastic pytorch job
+       * 
+ * + * .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + */ + public flyteidl.plugins.kubeflow.Pytorch.ElasticConfig getElasticConfig() { + if (elasticConfigBuilder_ == null) { + return elasticConfig_ == null ? flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.getDefaultInstance() : elasticConfig_; + } else { + return elasticConfigBuilder_.getMessage(); + } + } + /** + *
+       * config for an elastic pytorch job
+       * 
+ * + * .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + */ + public Builder setElasticConfig(flyteidl.plugins.kubeflow.Pytorch.ElasticConfig value) { + if (elasticConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + elasticConfig_ = value; + onChanged(); + } else { + elasticConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * config for an elastic pytorch job
+       * 
+ * + * .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + */ + public Builder setElasticConfig( + flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.Builder builderForValue) { + if (elasticConfigBuilder_ == null) { + elasticConfig_ = builderForValue.build(); + onChanged(); + } else { + elasticConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * config for an elastic pytorch job
+       * 
+ * + * .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + */ + public Builder mergeElasticConfig(flyteidl.plugins.kubeflow.Pytorch.ElasticConfig value) { + if (elasticConfigBuilder_ == null) { + if (elasticConfig_ != null) { + elasticConfig_ = + flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.newBuilder(elasticConfig_).mergeFrom(value).buildPartial(); + } else { + elasticConfig_ = value; + } + onChanged(); + } else { + elasticConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * config for an elastic pytorch job
+       * 
+ * + * .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + */ + public Builder clearElasticConfig() { + if (elasticConfigBuilder_ == null) { + elasticConfig_ = null; + onChanged(); + } else { + elasticConfig_ = null; + elasticConfigBuilder_ = null; + } + + return this; + } + /** + *
+       * config for an elastic pytorch job
+       * 
+ * + * .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + */ + public flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.Builder getElasticConfigBuilder() { + + onChanged(); + return getElasticConfigFieldBuilder().getBuilder(); + } + /** + *
+       * config for an elastic pytorch job
+       * 
+ * + * .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + */ + public flyteidl.plugins.kubeflow.Pytorch.ElasticConfigOrBuilder getElasticConfigOrBuilder() { + if (elasticConfigBuilder_ != null) { + return elasticConfigBuilder_.getMessageOrBuilder(); + } else { + return elasticConfig_ == null ? + flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.getDefaultInstance() : elasticConfig_; + } + } + /** + *
+       * config for an elastic pytorch job
+       * 
+ * + * .flyteidl.plugins.kubeflow.ElasticConfig elastic_config = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Pytorch.ElasticConfig, flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.Builder, flyteidl.plugins.kubeflow.Pytorch.ElasticConfigOrBuilder> + getElasticConfigFieldBuilder() { + if (elasticConfigBuilder_ == null) { + elasticConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Pytorch.ElasticConfig, flyteidl.plugins.kubeflow.Pytorch.ElasticConfig.Builder, flyteidl.plugins.kubeflow.Pytorch.ElasticConfigOrBuilder>( + getElasticConfig(), + getParentForChildren(), + isClean()); + elasticConfig_ = null; + } + return elasticConfigBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + } + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingTask) + private static final flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask(); + } + + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DistributedPyTorchTrainingTask parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DistributedPyTorchTrainingTask(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingTask getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DistributedPyTorchTrainingReplicaSpecOrBuilder extends + // @@protoc_insertion_point(interface_extends:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Number of replicas
+     * 
+ * + * int32 replicas = 1; + */ + int getReplicas(); + + /** + *
+     * Image used for the replica group
+     * 
+ * + * string image = 2; + */ + java.lang.String getImage(); + /** + *
+     * Image used for the replica group
+     * 
+ * + * string image = 2; + */ + com.google.protobuf.ByteString + getImageBytes(); + + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + boolean hasResources(); + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + flyteidl.core.Tasks.Resources getResources(); + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + flyteidl.core.Tasks.ResourcesOrBuilder getResourcesOrBuilder(); + + /** + *
+     * RestartPolicy determines whether pods will be restarted when they exit
+     * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + int getRestartPolicyValue(); + /** + *
+     * RestartPolicy determines whether pods will be restarted when they exit
+     * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + flyteidl.plugins.kubeflow.Common.RestartPolicy getRestartPolicy(); + } + /** + * Protobuf type {@code flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec} + */ + public static final class DistributedPyTorchTrainingReplicaSpec extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + DistributedPyTorchTrainingReplicaSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use DistributedPyTorchTrainingReplicaSpec.newBuilder() to construct. + private DistributedPyTorchTrainingReplicaSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DistributedPyTorchTrainingReplicaSpec() { + image_ = ""; + restartPolicy_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DistributedPyTorchTrainingReplicaSpec( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + replicas_ = input.readInt32(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + image_ = s; + break; + } + case 26: { + flyteidl.core.Tasks.Resources.Builder subBuilder = null; + if (resources_ != null) { + subBuilder = resources_.toBuilder(); + } + resources_ = input.readMessage(flyteidl.core.Tasks.Resources.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resources_); + resources_ = subBuilder.buildPartial(); + } + + break; + } + case 32: { + int rawValue = input.readEnum(); + + restartPolicy_ = rawValue; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Pytorch.internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingReplicaSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.kubeflow.Pytorch.internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingReplicaSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.class, flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.Builder.class); + } + + public static final int REPLICAS_FIELD_NUMBER = 1; + private int replicas_; + /** + *
+     * Number of replicas
+     * 
+ * + * int32 replicas = 1; + */ + public int getReplicas() { + return replicas_; + } + + public static final int IMAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object image_; + /** + *
+     * Image used for the replica group
+     * 
+ * + * string image = 2; + */ + public java.lang.String getImage() { + java.lang.Object ref = image_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + image_ = s; + return s; + } + } + /** + *
+     * Image used for the replica group
+     * 
+ * + * string image = 2; + */ + public com.google.protobuf.ByteString + getImageBytes() { + java.lang.Object ref = image_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + image_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCES_FIELD_NUMBER = 3; + private flyteidl.core.Tasks.Resources resources_; + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public boolean hasResources() { + return resources_ != null; + } + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public flyteidl.core.Tasks.Resources getResources() { + return resources_ == null ? flyteidl.core.Tasks.Resources.getDefaultInstance() : resources_; + } + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public flyteidl.core.Tasks.ResourcesOrBuilder getResourcesOrBuilder() { + return getResources(); + } + + public static final int RESTART_POLICY_FIELD_NUMBER = 4; + private int restartPolicy_; + /** + *
+     * RestartPolicy determines whether pods will be restarted when they exit
+     * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public int getRestartPolicyValue() { + return restartPolicy_; + } + /** + *
+     * RestartPolicy determines whether pods will be restarted when they exit
+     * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public flyteidl.plugins.kubeflow.Common.RestartPolicy getRestartPolicy() { + @SuppressWarnings("deprecation") + flyteidl.plugins.kubeflow.Common.RestartPolicy result = flyteidl.plugins.kubeflow.Common.RestartPolicy.valueOf(restartPolicy_); + return result == null ? flyteidl.plugins.kubeflow.Common.RestartPolicy.UNRECOGNIZED : result; + } + + 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 + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (replicas_ != 0) { + output.writeInt32(1, replicas_); + } + if (!getImageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, image_); + } + if (resources_ != null) { + output.writeMessage(3, getResources()); + } + if (restartPolicy_ != flyteidl.plugins.kubeflow.Common.RestartPolicy.RESTART_POLICY_NEVER.getNumber()) { + output.writeEnum(4, restartPolicy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (replicas_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, replicas_); + } + if (!getImageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, image_); + } + if (resources_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getResources()); + } + if (restartPolicy_ != flyteidl.plugins.kubeflow.Common.RestartPolicy.RESTART_POLICY_NEVER.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, restartPolicy_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec)) { + return super.equals(obj); + } + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec other = (flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec) obj; + + if (getReplicas() + != other.getReplicas()) return false; + if (!getImage() + .equals(other.getImage())) return false; + if (hasResources() != other.hasResources()) return false; + if (hasResources()) { + if (!getResources() + .equals(other.getResources())) return false; + } + if (restartPolicy_ != other.restartPolicy_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REPLICAS_FIELD_NUMBER; + hash = (53 * hash) + getReplicas(); + hash = (37 * hash) + IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getImage().hashCode(); + if (hasResources()) { + hash = (37 * hash) + RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + getResources().hashCode(); + } + hash = (37 * hash) + RESTART_POLICY_FIELD_NUMBER; + hash = (53 * hash) + restartPolicy_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Pytorch.internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingReplicaSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.kubeflow.Pytorch.internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingReplicaSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.class, flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.Builder.class); + } + + // Construct using flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + replicas_ = 0; + + image_ = ""; + + if (resourcesBuilder_ == null) { + resources_ = null; + } else { + resources_ = null; + resourcesBuilder_ = null; + } + restartPolicy_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return flyteidl.plugins.kubeflow.Pytorch.internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingReplicaSpec_descriptor; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec getDefaultInstanceForType() { + return flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.getDefaultInstance(); + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec build() { + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec buildPartial() { + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec result = new flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec(this); + result.replicas_ = replicas_; + result.image_ = image_; + if (resourcesBuilder_ == null) { + result.resources_ = resources_; + } else { + result.resources_ = resourcesBuilder_.build(); + } + result.restartPolicy_ = restartPolicy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec) { + return mergeFrom((flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec other) { + if (other == flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec.getDefaultInstance()) return this; + if (other.getReplicas() != 0) { + setReplicas(other.getReplicas()); + } + if (!other.getImage().isEmpty()) { + image_ = other.image_; + onChanged(); + } + if (other.hasResources()) { + mergeResources(other.getResources()); + } + if (other.restartPolicy_ != 0) { + setRestartPolicyValue(other.getRestartPolicyValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int replicas_ ; + /** + *
+       * Number of replicas
+       * 
+ * + * int32 replicas = 1; + */ + public int getReplicas() { + return replicas_; + } + /** + *
+       * Number of replicas
+       * 
+ * + * int32 replicas = 1; + */ + public Builder setReplicas(int value) { + + replicas_ = value; + onChanged(); + return this; + } + /** + *
+       * Number of replicas
+       * 
+ * + * int32 replicas = 1; + */ + public Builder clearReplicas() { + + replicas_ = 0; + onChanged(); + return this; + } + + private java.lang.Object image_ = ""; + /** + *
+       * Image used for the replica group
+       * 
+ * + * string image = 2; + */ + public java.lang.String getImage() { + java.lang.Object ref = image_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + image_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Image used for the replica group
+       * 
+ * + * string image = 2; + */ + public com.google.protobuf.ByteString + getImageBytes() { + java.lang.Object ref = image_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + image_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Image used for the replica group
+       * 
+ * + * string image = 2; + */ + public Builder setImage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + image_ = value; + onChanged(); + return this; + } + /** + *
+       * Image used for the replica group
+       * 
+ * + * string image = 2; + */ + public Builder clearImage() { + + image_ = getDefaultInstance().getImage(); + onChanged(); + return this; + } + /** + *
+       * Image used for the replica group
+       * 
+ * + * string image = 2; + */ + public Builder setImageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + image_ = value; + onChanged(); + return this; + } + + private flyteidl.core.Tasks.Resources resources_; + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.core.Tasks.Resources, flyteidl.core.Tasks.Resources.Builder, flyteidl.core.Tasks.ResourcesOrBuilder> resourcesBuilder_; + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public boolean hasResources() { + return resourcesBuilder_ != null || resources_ != null; + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public flyteidl.core.Tasks.Resources getResources() { + if (resourcesBuilder_ == null) { + return resources_ == null ? flyteidl.core.Tasks.Resources.getDefaultInstance() : resources_; + } else { + return resourcesBuilder_.getMessage(); + } + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public Builder setResources(flyteidl.core.Tasks.Resources value) { + if (resourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resources_ = value; + onChanged(); + } else { + resourcesBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public Builder setResources( + flyteidl.core.Tasks.Resources.Builder builderForValue) { + if (resourcesBuilder_ == null) { + resources_ = builderForValue.build(); + onChanged(); + } else { + resourcesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public Builder mergeResources(flyteidl.core.Tasks.Resources value) { + if (resourcesBuilder_ == null) { + if (resources_ != null) { + resources_ = + flyteidl.core.Tasks.Resources.newBuilder(resources_).mergeFrom(value).buildPartial(); + } else { + resources_ = value; + } + onChanged(); + } else { + resourcesBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public Builder clearResources() { + if (resourcesBuilder_ == null) { + resources_ = null; + onChanged(); + } else { + resources_ = null; + resourcesBuilder_ = null; + } + + return this; + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public flyteidl.core.Tasks.Resources.Builder getResourcesBuilder() { + + onChanged(); + return getResourcesFieldBuilder().getBuilder(); + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public flyteidl.core.Tasks.ResourcesOrBuilder getResourcesOrBuilder() { + if (resourcesBuilder_ != null) { + return resourcesBuilder_.getMessageOrBuilder(); + } else { + return resources_ == null ? + flyteidl.core.Tasks.Resources.getDefaultInstance() : resources_; + } + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.core.Tasks.Resources, flyteidl.core.Tasks.Resources.Builder, flyteidl.core.Tasks.ResourcesOrBuilder> + getResourcesFieldBuilder() { + if (resourcesBuilder_ == null) { + resourcesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + flyteidl.core.Tasks.Resources, flyteidl.core.Tasks.Resources.Builder, flyteidl.core.Tasks.ResourcesOrBuilder>( + getResources(), + getParentForChildren(), + isClean()); + resources_ = null; + } + return resourcesBuilder_; + } + + private int restartPolicy_ = 0; + /** + *
+       * RestartPolicy determines whether pods will be restarted when they exit
+       * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public int getRestartPolicyValue() { + return restartPolicy_; + } + /** + *
+       * RestartPolicy determines whether pods will be restarted when they exit
+       * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public Builder setRestartPolicyValue(int value) { + restartPolicy_ = value; + onChanged(); + return this; + } + /** + *
+       * RestartPolicy determines whether pods will be restarted when they exit
+       * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public flyteidl.plugins.kubeflow.Common.RestartPolicy getRestartPolicy() { + @SuppressWarnings("deprecation") + flyteidl.plugins.kubeflow.Common.RestartPolicy result = flyteidl.plugins.kubeflow.Common.RestartPolicy.valueOf(restartPolicy_); + return result == null ? flyteidl.plugins.kubeflow.Common.RestartPolicy.UNRECOGNIZED : result; + } + /** + *
+       * RestartPolicy determines whether pods will be restarted when they exit
+       * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public Builder setRestartPolicy(flyteidl.plugins.kubeflow.Common.RestartPolicy value) { + if (value == null) { + throw new NullPointerException(); + } + + restartPolicy_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       * RestartPolicy determines whether pods will be restarted when they exit
+       * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public Builder clearRestartPolicy() { + + restartPolicy_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + } + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpec) + private static final flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec(); + } + + public static flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DistributedPyTorchTrainingReplicaSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DistributedPyTorchTrainingReplicaSpec(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Pytorch.DistributedPyTorchTrainingReplicaSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_flyteidl_plugins_kubeflow_ElasticConfig_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_flyteidl_plugins_kubeflow_ElasticConfig_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingTask_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingTask_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingReplicaSpec_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingReplicaSpec_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\'flyteidl/plugins/kubeflow/pytorch.prot" + + "o\022\031flyteidl.plugins.kubeflow\032\031flyteidl/c" + + "ore/tasks.proto\032&flyteidl/plugins/kubefl" + + "ow/common.proto\"\177\n\rElasticConfig\022\024\n\014rdzv" + + "_backend\030\001 \001(\t\022\024\n\014min_replicas\030\002 \001(\005\022\024\n\014" + + "max_replicas\030\003 \001(\005\022\026\n\016nproc_per_node\030\004 \001" + + "(\005\022\024\n\014max_restarts\030\005 \001(\005\"\322\002\n\036Distributed" + + "PyTorchTrainingTask\022Y\n\017worker_replicas\030\001" + + " \001(\0132@.flyteidl.plugins.kubeflow.Distrib" + + "utedPyTorchTrainingReplicaSpec\022Y\n\017master" + + "_replicas\030\002 \001(\0132@.flyteidl.plugins.kubef" + + "low.DistributedPyTorchTrainingReplicaSpe" + + "c\0228\n\nrun_policy\030\003 \001(\0132$.flyteidl.plugins" + + ".kubeflow.RunPolicy\022@\n\016elastic_config\030\004 " + + "\001(\0132(.flyteidl.plugins.kubeflow.ElasticC" + + "onfig\"\267\001\n%DistributedPyTorchTrainingRepl" + + "icaSpec\022\020\n\010replicas\030\001 \001(\005\022\r\n\005image\030\002 \001(\t" + + "\022+\n\tresources\030\003 \001(\0132\030.flyteidl.core.Reso" + + "urces\022@\n\016restart_policy\030\004 \001(\0162(.flyteidl" + + ".plugins.kubeflow.RestartPolicyB9Z7githu" + + "b.com/flyteorg/flyteidl/gen/pb-go/flytei" + + "dl/pluginsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + flyteidl.core.Tasks.getDescriptor(), + flyteidl.plugins.kubeflow.Common.getDescriptor(), + }, assigner); + internal_static_flyteidl_plugins_kubeflow_ElasticConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_flyteidl_plugins_kubeflow_ElasticConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_flyteidl_plugins_kubeflow_ElasticConfig_descriptor, + new java.lang.String[] { "RdzvBackend", "MinReplicas", "MaxReplicas", "NprocPerNode", "MaxRestarts", }); + internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingTask_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingTask_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingTask_descriptor, + new java.lang.String[] { "WorkerReplicas", "MasterReplicas", "RunPolicy", "ElasticConfig", }); + internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingReplicaSpec_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingReplicaSpec_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_flyteidl_plugins_kubeflow_DistributedPyTorchTrainingReplicaSpec_descriptor, + new java.lang.String[] { "Replicas", "Image", "Resources", "RestartPolicy", }); + flyteidl.core.Tasks.getDescriptor(); + flyteidl.plugins.kubeflow.Common.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/gen/pb-java/flyteidl/plugins/kubeflow/Tensorflow.java b/gen/pb-java/flyteidl/plugins/kubeflow/Tensorflow.java new file mode 100644 index 000000000..3e9c0a5cf --- /dev/null +++ b/gen/pb-java/flyteidl/plugins/kubeflow/Tensorflow.java @@ -0,0 +1,2605 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/kubeflow/tensorflow.proto + +package flyteidl.plugins.kubeflow; + +public final class Tensorflow { + private Tensorflow() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface DistributedTensorflowTrainingTaskOrBuilder extends + // @@protoc_insertion_point(interface_extends:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + */ + boolean hasWorkerReplicas(); + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + */ + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec getWorkerReplicas(); + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + */ + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder getWorkerReplicasOrBuilder(); + + /** + *
+     * Parameter server replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + */ + boolean hasPsReplicas(); + /** + *
+     * Parameter server replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + */ + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec getPsReplicas(); + /** + *
+     * Parameter server replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + */ + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder getPsReplicasOrBuilder(); + + /** + *
+     * Chief replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + */ + boolean hasChiefReplicas(); + /** + *
+     * Chief replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + */ + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec getChiefReplicas(); + /** + *
+     * Chief replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + */ + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder getChiefReplicasOrBuilder(); + + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + */ + boolean hasRunPolicy(); + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + */ + flyteidl.plugins.kubeflow.Common.RunPolicy getRunPolicy(); + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + */ + flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder getRunPolicyOrBuilder(); + } + /** + *
+   * Proto for plugin that enables distributed training using https://github.com/kubeflow/tf-operator
+   * 
+ * + * Protobuf type {@code flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask} + */ + public static final class DistributedTensorflowTrainingTask extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + DistributedTensorflowTrainingTaskOrBuilder { + private static final long serialVersionUID = 0L; + // Use DistributedTensorflowTrainingTask.newBuilder() to construct. + private DistributedTensorflowTrainingTask(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DistributedTensorflowTrainingTask() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DistributedTensorflowTrainingTask( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder subBuilder = null; + if (workerReplicas_ != null) { + subBuilder = workerReplicas_.toBuilder(); + } + workerReplicas_ = input.readMessage(flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(workerReplicas_); + workerReplicas_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder subBuilder = null; + if (psReplicas_ != null) { + subBuilder = psReplicas_.toBuilder(); + } + psReplicas_ = input.readMessage(flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(psReplicas_); + psReplicas_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder subBuilder = null; + if (chiefReplicas_ != null) { + subBuilder = chiefReplicas_.toBuilder(); + } + chiefReplicas_ = input.readMessage(flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(chiefReplicas_); + chiefReplicas_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + flyteidl.plugins.kubeflow.Common.RunPolicy.Builder subBuilder = null; + if (runPolicy_ != null) { + subBuilder = runPolicy_.toBuilder(); + } + runPolicy_ = input.readMessage(flyteidl.plugins.kubeflow.Common.RunPolicy.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(runPolicy_); + runPolicy_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Tensorflow.internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingTask_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.kubeflow.Tensorflow.internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingTask_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask.class, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask.Builder.class); + } + + public static final int WORKER_REPLICAS_FIELD_NUMBER = 1; + private flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec workerReplicas_; + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + */ + public boolean hasWorkerReplicas() { + return workerReplicas_ != null; + } + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + */ + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec getWorkerReplicas() { + return workerReplicas_ == null ? flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.getDefaultInstance() : workerReplicas_; + } + /** + *
+     * Worker replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + */ + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder getWorkerReplicasOrBuilder() { + return getWorkerReplicas(); + } + + public static final int PS_REPLICAS_FIELD_NUMBER = 2; + private flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec psReplicas_; + /** + *
+     * Parameter server replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + */ + public boolean hasPsReplicas() { + return psReplicas_ != null; + } + /** + *
+     * Parameter server replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + */ + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec getPsReplicas() { + return psReplicas_ == null ? flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.getDefaultInstance() : psReplicas_; + } + /** + *
+     * Parameter server replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + */ + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder getPsReplicasOrBuilder() { + return getPsReplicas(); + } + + public static final int CHIEF_REPLICAS_FIELD_NUMBER = 3; + private flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec chiefReplicas_; + /** + *
+     * Chief replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + */ + public boolean hasChiefReplicas() { + return chiefReplicas_ != null; + } + /** + *
+     * Chief replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + */ + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec getChiefReplicas() { + return chiefReplicas_ == null ? flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.getDefaultInstance() : chiefReplicas_; + } + /** + *
+     * Chief replicas spec
+     * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + */ + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder getChiefReplicasOrBuilder() { + return getChiefReplicas(); + } + + public static final int RUN_POLICY_FIELD_NUMBER = 4; + private flyteidl.plugins.kubeflow.Common.RunPolicy runPolicy_; + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + */ + public boolean hasRunPolicy() { + return runPolicy_ != null; + } + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + */ + public flyteidl.plugins.kubeflow.Common.RunPolicy getRunPolicy() { + return runPolicy_ == null ? flyteidl.plugins.kubeflow.Common.RunPolicy.getDefaultInstance() : runPolicy_; + } + /** + *
+     * RunPolicy encapsulates various runtime policies of the distributed training
+     * job, for example how to clean up resources and how long the job can stay
+     * active.
+     * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + */ + public flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder getRunPolicyOrBuilder() { + return getRunPolicy(); + } + + 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 + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (workerReplicas_ != null) { + output.writeMessage(1, getWorkerReplicas()); + } + if (psReplicas_ != null) { + output.writeMessage(2, getPsReplicas()); + } + if (chiefReplicas_ != null) { + output.writeMessage(3, getChiefReplicas()); + } + if (runPolicy_ != null) { + output.writeMessage(4, getRunPolicy()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (workerReplicas_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getWorkerReplicas()); + } + if (psReplicas_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getPsReplicas()); + } + if (chiefReplicas_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getChiefReplicas()); + } + if (runPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getRunPolicy()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask)) { + return super.equals(obj); + } + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask other = (flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask) obj; + + if (hasWorkerReplicas() != other.hasWorkerReplicas()) return false; + if (hasWorkerReplicas()) { + if (!getWorkerReplicas() + .equals(other.getWorkerReplicas())) return false; + } + if (hasPsReplicas() != other.hasPsReplicas()) return false; + if (hasPsReplicas()) { + if (!getPsReplicas() + .equals(other.getPsReplicas())) return false; + } + if (hasChiefReplicas() != other.hasChiefReplicas()) return false; + if (hasChiefReplicas()) { + if (!getChiefReplicas() + .equals(other.getChiefReplicas())) return false; + } + if (hasRunPolicy() != other.hasRunPolicy()) return false; + if (hasRunPolicy()) { + if (!getRunPolicy() + .equals(other.getRunPolicy())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasWorkerReplicas()) { + hash = (37 * hash) + WORKER_REPLICAS_FIELD_NUMBER; + hash = (53 * hash) + getWorkerReplicas().hashCode(); + } + if (hasPsReplicas()) { + hash = (37 * hash) + PS_REPLICAS_FIELD_NUMBER; + hash = (53 * hash) + getPsReplicas().hashCode(); + } + if (hasChiefReplicas()) { + hash = (37 * hash) + CHIEF_REPLICAS_FIELD_NUMBER; + hash = (53 * hash) + getChiefReplicas().hashCode(); + } + if (hasRunPolicy()) { + hash = (37 * hash) + RUN_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getRunPolicy().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Proto for plugin that enables distributed training using https://github.com/kubeflow/tf-operator
+     * 
+ * + * Protobuf type {@code flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTaskOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Tensorflow.internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingTask_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.kubeflow.Tensorflow.internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingTask_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask.class, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask.Builder.class); + } + + // Construct using flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (workerReplicasBuilder_ == null) { + workerReplicas_ = null; + } else { + workerReplicas_ = null; + workerReplicasBuilder_ = null; + } + if (psReplicasBuilder_ == null) { + psReplicas_ = null; + } else { + psReplicas_ = null; + psReplicasBuilder_ = null; + } + if (chiefReplicasBuilder_ == null) { + chiefReplicas_ = null; + } else { + chiefReplicas_ = null; + chiefReplicasBuilder_ = null; + } + if (runPolicyBuilder_ == null) { + runPolicy_ = null; + } else { + runPolicy_ = null; + runPolicyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return flyteidl.plugins.kubeflow.Tensorflow.internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingTask_descriptor; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask getDefaultInstanceForType() { + return flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask.getDefaultInstance(); + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask build() { + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask buildPartial() { + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask result = new flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask(this); + if (workerReplicasBuilder_ == null) { + result.workerReplicas_ = workerReplicas_; + } else { + result.workerReplicas_ = workerReplicasBuilder_.build(); + } + if (psReplicasBuilder_ == null) { + result.psReplicas_ = psReplicas_; + } else { + result.psReplicas_ = psReplicasBuilder_.build(); + } + if (chiefReplicasBuilder_ == null) { + result.chiefReplicas_ = chiefReplicas_; + } else { + result.chiefReplicas_ = chiefReplicasBuilder_.build(); + } + if (runPolicyBuilder_ == null) { + result.runPolicy_ = runPolicy_; + } else { + result.runPolicy_ = runPolicyBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask) { + return mergeFrom((flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask other) { + if (other == flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask.getDefaultInstance()) return this; + if (other.hasWorkerReplicas()) { + mergeWorkerReplicas(other.getWorkerReplicas()); + } + if (other.hasPsReplicas()) { + mergePsReplicas(other.getPsReplicas()); + } + if (other.hasChiefReplicas()) { + mergeChiefReplicas(other.getChiefReplicas()); + } + if (other.hasRunPolicy()) { + mergeRunPolicy(other.getRunPolicy()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec workerReplicas_; + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder> workerReplicasBuilder_; + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + */ + public boolean hasWorkerReplicas() { + return workerReplicasBuilder_ != null || workerReplicas_ != null; + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + */ + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec getWorkerReplicas() { + if (workerReplicasBuilder_ == null) { + return workerReplicas_ == null ? flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.getDefaultInstance() : workerReplicas_; + } else { + return workerReplicasBuilder_.getMessage(); + } + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + */ + public Builder setWorkerReplicas(flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec value) { + if (workerReplicasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + workerReplicas_ = value; + onChanged(); + } else { + workerReplicasBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + */ + public Builder setWorkerReplicas( + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder builderForValue) { + if (workerReplicasBuilder_ == null) { + workerReplicas_ = builderForValue.build(); + onChanged(); + } else { + workerReplicasBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + */ + public Builder mergeWorkerReplicas(flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec value) { + if (workerReplicasBuilder_ == null) { + if (workerReplicas_ != null) { + workerReplicas_ = + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.newBuilder(workerReplicas_).mergeFrom(value).buildPartial(); + } else { + workerReplicas_ = value; + } + onChanged(); + } else { + workerReplicasBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + */ + public Builder clearWorkerReplicas() { + if (workerReplicasBuilder_ == null) { + workerReplicas_ = null; + onChanged(); + } else { + workerReplicas_ = null; + workerReplicasBuilder_ = null; + } + + return this; + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + */ + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder getWorkerReplicasBuilder() { + + onChanged(); + return getWorkerReplicasFieldBuilder().getBuilder(); + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + */ + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder getWorkerReplicasOrBuilder() { + if (workerReplicasBuilder_ != null) { + return workerReplicasBuilder_.getMessageOrBuilder(); + } else { + return workerReplicas_ == null ? + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.getDefaultInstance() : workerReplicas_; + } + } + /** + *
+       * Worker replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder> + getWorkerReplicasFieldBuilder() { + if (workerReplicasBuilder_ == null) { + workerReplicasBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder>( + getWorkerReplicas(), + getParentForChildren(), + isClean()); + workerReplicas_ = null; + } + return workerReplicasBuilder_; + } + + private flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec psReplicas_; + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder> psReplicasBuilder_; + /** + *
+       * Parameter server replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + */ + public boolean hasPsReplicas() { + return psReplicasBuilder_ != null || psReplicas_ != null; + } + /** + *
+       * Parameter server replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + */ + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec getPsReplicas() { + if (psReplicasBuilder_ == null) { + return psReplicas_ == null ? flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.getDefaultInstance() : psReplicas_; + } else { + return psReplicasBuilder_.getMessage(); + } + } + /** + *
+       * Parameter server replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + */ + public Builder setPsReplicas(flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec value) { + if (psReplicasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + psReplicas_ = value; + onChanged(); + } else { + psReplicasBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Parameter server replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + */ + public Builder setPsReplicas( + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder builderForValue) { + if (psReplicasBuilder_ == null) { + psReplicas_ = builderForValue.build(); + onChanged(); + } else { + psReplicasBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Parameter server replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + */ + public Builder mergePsReplicas(flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec value) { + if (psReplicasBuilder_ == null) { + if (psReplicas_ != null) { + psReplicas_ = + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.newBuilder(psReplicas_).mergeFrom(value).buildPartial(); + } else { + psReplicas_ = value; + } + onChanged(); + } else { + psReplicasBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Parameter server replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + */ + public Builder clearPsReplicas() { + if (psReplicasBuilder_ == null) { + psReplicas_ = null; + onChanged(); + } else { + psReplicas_ = null; + psReplicasBuilder_ = null; + } + + return this; + } + /** + *
+       * Parameter server replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + */ + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder getPsReplicasBuilder() { + + onChanged(); + return getPsReplicasFieldBuilder().getBuilder(); + } + /** + *
+       * Parameter server replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + */ + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder getPsReplicasOrBuilder() { + if (psReplicasBuilder_ != null) { + return psReplicasBuilder_.getMessageOrBuilder(); + } else { + return psReplicas_ == null ? + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.getDefaultInstance() : psReplicas_; + } + } + /** + *
+       * Parameter server replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder> + getPsReplicasFieldBuilder() { + if (psReplicasBuilder_ == null) { + psReplicasBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder>( + getPsReplicas(), + getParentForChildren(), + isClean()); + psReplicas_ = null; + } + return psReplicasBuilder_; + } + + private flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec chiefReplicas_; + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder> chiefReplicasBuilder_; + /** + *
+       * Chief replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + */ + public boolean hasChiefReplicas() { + return chiefReplicasBuilder_ != null || chiefReplicas_ != null; + } + /** + *
+       * Chief replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + */ + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec getChiefReplicas() { + if (chiefReplicasBuilder_ == null) { + return chiefReplicas_ == null ? flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.getDefaultInstance() : chiefReplicas_; + } else { + return chiefReplicasBuilder_.getMessage(); + } + } + /** + *
+       * Chief replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + */ + public Builder setChiefReplicas(flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec value) { + if (chiefReplicasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + chiefReplicas_ = value; + onChanged(); + } else { + chiefReplicasBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Chief replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + */ + public Builder setChiefReplicas( + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder builderForValue) { + if (chiefReplicasBuilder_ == null) { + chiefReplicas_ = builderForValue.build(); + onChanged(); + } else { + chiefReplicasBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Chief replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + */ + public Builder mergeChiefReplicas(flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec value) { + if (chiefReplicasBuilder_ == null) { + if (chiefReplicas_ != null) { + chiefReplicas_ = + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.newBuilder(chiefReplicas_).mergeFrom(value).buildPartial(); + } else { + chiefReplicas_ = value; + } + onChanged(); + } else { + chiefReplicasBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Chief replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + */ + public Builder clearChiefReplicas() { + if (chiefReplicasBuilder_ == null) { + chiefReplicas_ = null; + onChanged(); + } else { + chiefReplicas_ = null; + chiefReplicasBuilder_ = null; + } + + return this; + } + /** + *
+       * Chief replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + */ + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder getChiefReplicasBuilder() { + + onChanged(); + return getChiefReplicasFieldBuilder().getBuilder(); + } + /** + *
+       * Chief replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + */ + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder getChiefReplicasOrBuilder() { + if (chiefReplicasBuilder_ != null) { + return chiefReplicasBuilder_.getMessageOrBuilder(); + } else { + return chiefReplicas_ == null ? + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.getDefaultInstance() : chiefReplicas_; + } + } + /** + *
+       * Chief replicas spec
+       * 
+ * + * .flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder> + getChiefReplicasFieldBuilder() { + if (chiefReplicasBuilder_ == null) { + chiefReplicasBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder>( + getChiefReplicas(), + getParentForChildren(), + isClean()); + chiefReplicas_ = null; + } + return chiefReplicasBuilder_; + } + + private flyteidl.plugins.kubeflow.Common.RunPolicy runPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Common.RunPolicy, flyteidl.plugins.kubeflow.Common.RunPolicy.Builder, flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder> runPolicyBuilder_; + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + */ + public boolean hasRunPolicy() { + return runPolicyBuilder_ != null || runPolicy_ != null; + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + */ + public flyteidl.plugins.kubeflow.Common.RunPolicy getRunPolicy() { + if (runPolicyBuilder_ == null) { + return runPolicy_ == null ? flyteidl.plugins.kubeflow.Common.RunPolicy.getDefaultInstance() : runPolicy_; + } else { + return runPolicyBuilder_.getMessage(); + } + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + */ + public Builder setRunPolicy(flyteidl.plugins.kubeflow.Common.RunPolicy value) { + if (runPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + runPolicy_ = value; + onChanged(); + } else { + runPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + */ + public Builder setRunPolicy( + flyteidl.plugins.kubeflow.Common.RunPolicy.Builder builderForValue) { + if (runPolicyBuilder_ == null) { + runPolicy_ = builderForValue.build(); + onChanged(); + } else { + runPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + */ + public Builder mergeRunPolicy(flyteidl.plugins.kubeflow.Common.RunPolicy value) { + if (runPolicyBuilder_ == null) { + if (runPolicy_ != null) { + runPolicy_ = + flyteidl.plugins.kubeflow.Common.RunPolicy.newBuilder(runPolicy_).mergeFrom(value).buildPartial(); + } else { + runPolicy_ = value; + } + onChanged(); + } else { + runPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + */ + public Builder clearRunPolicy() { + if (runPolicyBuilder_ == null) { + runPolicy_ = null; + onChanged(); + } else { + runPolicy_ = null; + runPolicyBuilder_ = null; + } + + return this; + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + */ + public flyteidl.plugins.kubeflow.Common.RunPolicy.Builder getRunPolicyBuilder() { + + onChanged(); + return getRunPolicyFieldBuilder().getBuilder(); + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + */ + public flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder getRunPolicyOrBuilder() { + if (runPolicyBuilder_ != null) { + return runPolicyBuilder_.getMessageOrBuilder(); + } else { + return runPolicy_ == null ? + flyteidl.plugins.kubeflow.Common.RunPolicy.getDefaultInstance() : runPolicy_; + } + } + /** + *
+       * RunPolicy encapsulates various runtime policies of the distributed training
+       * job, for example how to clean up resources and how long the job can stay
+       * active.
+       * 
+ * + * .flyteidl.plugins.kubeflow.RunPolicy run_policy = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Common.RunPolicy, flyteidl.plugins.kubeflow.Common.RunPolicy.Builder, flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder> + getRunPolicyFieldBuilder() { + if (runPolicyBuilder_ == null) { + runPolicyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + flyteidl.plugins.kubeflow.Common.RunPolicy, flyteidl.plugins.kubeflow.Common.RunPolicy.Builder, flyteidl.plugins.kubeflow.Common.RunPolicyOrBuilder>( + getRunPolicy(), + getParentForChildren(), + isClean()); + runPolicy_ = null; + } + return runPolicyBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + } + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask) + private static final flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask(); + } + + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DistributedTensorflowTrainingTask parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DistributedTensorflowTrainingTask(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingTask getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DistributedTensorflowTrainingReplicaSpecOrBuilder extends + // @@protoc_insertion_point(interface_extends:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Number of replicas
+     * 
+ * + * int32 replicas = 1; + */ + int getReplicas(); + + /** + *
+     * Image used for the replica group
+     * 
+ * + * string image = 2; + */ + java.lang.String getImage(); + /** + *
+     * Image used for the replica group
+     * 
+ * + * string image = 2; + */ + com.google.protobuf.ByteString + getImageBytes(); + + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + boolean hasResources(); + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + flyteidl.core.Tasks.Resources getResources(); + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + flyteidl.core.Tasks.ResourcesOrBuilder getResourcesOrBuilder(); + + /** + *
+     * RestartPolicy Determines whether pods will be restarted when they exit
+     * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + int getRestartPolicyValue(); + /** + *
+     * RestartPolicy Determines whether pods will be restarted when they exit
+     * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + flyteidl.plugins.kubeflow.Common.RestartPolicy getRestartPolicy(); + } + /** + * Protobuf type {@code flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec} + */ + public static final class DistributedTensorflowTrainingReplicaSpec extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + DistributedTensorflowTrainingReplicaSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use DistributedTensorflowTrainingReplicaSpec.newBuilder() to construct. + private DistributedTensorflowTrainingReplicaSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DistributedTensorflowTrainingReplicaSpec() { + image_ = ""; + restartPolicy_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DistributedTensorflowTrainingReplicaSpec( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + replicas_ = input.readInt32(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + image_ = s; + break; + } + case 26: { + flyteidl.core.Tasks.Resources.Builder subBuilder = null; + if (resources_ != null) { + subBuilder = resources_.toBuilder(); + } + resources_ = input.readMessage(flyteidl.core.Tasks.Resources.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resources_); + resources_ = subBuilder.buildPartial(); + } + + break; + } + case 32: { + int rawValue = input.readEnum(); + + restartPolicy_ = rawValue; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Tensorflow.internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingReplicaSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.kubeflow.Tensorflow.internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingReplicaSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.class, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder.class); + } + + public static final int REPLICAS_FIELD_NUMBER = 1; + private int replicas_; + /** + *
+     * Number of replicas
+     * 
+ * + * int32 replicas = 1; + */ + public int getReplicas() { + return replicas_; + } + + public static final int IMAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object image_; + /** + *
+     * Image used for the replica group
+     * 
+ * + * string image = 2; + */ + public java.lang.String getImage() { + java.lang.Object ref = image_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + image_ = s; + return s; + } + } + /** + *
+     * Image used for the replica group
+     * 
+ * + * string image = 2; + */ + public com.google.protobuf.ByteString + getImageBytes() { + java.lang.Object ref = image_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + image_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCES_FIELD_NUMBER = 3; + private flyteidl.core.Tasks.Resources resources_; + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public boolean hasResources() { + return resources_ != null; + } + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public flyteidl.core.Tasks.Resources getResources() { + return resources_ == null ? flyteidl.core.Tasks.Resources.getDefaultInstance() : resources_; + } + /** + *
+     * Resources required for the replica group
+     * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public flyteidl.core.Tasks.ResourcesOrBuilder getResourcesOrBuilder() { + return getResources(); + } + + public static final int RESTART_POLICY_FIELD_NUMBER = 4; + private int restartPolicy_; + /** + *
+     * RestartPolicy Determines whether pods will be restarted when they exit
+     * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public int getRestartPolicyValue() { + return restartPolicy_; + } + /** + *
+     * RestartPolicy Determines whether pods will be restarted when they exit
+     * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public flyteidl.plugins.kubeflow.Common.RestartPolicy getRestartPolicy() { + @SuppressWarnings("deprecation") + flyteidl.plugins.kubeflow.Common.RestartPolicy result = flyteidl.plugins.kubeflow.Common.RestartPolicy.valueOf(restartPolicy_); + return result == null ? flyteidl.plugins.kubeflow.Common.RestartPolicy.UNRECOGNIZED : result; + } + + 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 + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (replicas_ != 0) { + output.writeInt32(1, replicas_); + } + if (!getImageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, image_); + } + if (resources_ != null) { + output.writeMessage(3, getResources()); + } + if (restartPolicy_ != flyteidl.plugins.kubeflow.Common.RestartPolicy.RESTART_POLICY_NEVER.getNumber()) { + output.writeEnum(4, restartPolicy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (replicas_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, replicas_); + } + if (!getImageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, image_); + } + if (resources_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getResources()); + } + if (restartPolicy_ != flyteidl.plugins.kubeflow.Common.RestartPolicy.RESTART_POLICY_NEVER.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, restartPolicy_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec)) { + return super.equals(obj); + } + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec other = (flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec) obj; + + if (getReplicas() + != other.getReplicas()) return false; + if (!getImage() + .equals(other.getImage())) return false; + if (hasResources() != other.hasResources()) return false; + if (hasResources()) { + if (!getResources() + .equals(other.getResources())) return false; + } + if (restartPolicy_ != other.restartPolicy_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REPLICAS_FIELD_NUMBER; + hash = (53 * hash) + getReplicas(); + hash = (37 * hash) + IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getImage().hashCode(); + if (hasResources()) { + hash = (37 * hash) + RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + getResources().hashCode(); + } + hash = (37 * hash) + RESTART_POLICY_FIELD_NUMBER; + hash = (53 * hash) + restartPolicy_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.kubeflow.Tensorflow.internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingReplicaSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.kubeflow.Tensorflow.internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingReplicaSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.class, flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.Builder.class); + } + + // Construct using flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + replicas_ = 0; + + image_ = ""; + + if (resourcesBuilder_ == null) { + resources_ = null; + } else { + resources_ = null; + resourcesBuilder_ = null; + } + restartPolicy_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return flyteidl.plugins.kubeflow.Tensorflow.internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingReplicaSpec_descriptor; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec getDefaultInstanceForType() { + return flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.getDefaultInstance(); + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec build() { + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec buildPartial() { + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec result = new flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec(this); + result.replicas_ = replicas_; + result.image_ = image_; + if (resourcesBuilder_ == null) { + result.resources_ = resources_; + } else { + result.resources_ = resourcesBuilder_.build(); + } + result.restartPolicy_ = restartPolicy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec) { + return mergeFrom((flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec other) { + if (other == flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec.getDefaultInstance()) return this; + if (other.getReplicas() != 0) { + setReplicas(other.getReplicas()); + } + if (!other.getImage().isEmpty()) { + image_ = other.image_; + onChanged(); + } + if (other.hasResources()) { + mergeResources(other.getResources()); + } + if (other.restartPolicy_ != 0) { + setRestartPolicyValue(other.getRestartPolicyValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int replicas_ ; + /** + *
+       * Number of replicas
+       * 
+ * + * int32 replicas = 1; + */ + public int getReplicas() { + return replicas_; + } + /** + *
+       * Number of replicas
+       * 
+ * + * int32 replicas = 1; + */ + public Builder setReplicas(int value) { + + replicas_ = value; + onChanged(); + return this; + } + /** + *
+       * Number of replicas
+       * 
+ * + * int32 replicas = 1; + */ + public Builder clearReplicas() { + + replicas_ = 0; + onChanged(); + return this; + } + + private java.lang.Object image_ = ""; + /** + *
+       * Image used for the replica group
+       * 
+ * + * string image = 2; + */ + public java.lang.String getImage() { + java.lang.Object ref = image_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + image_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Image used for the replica group
+       * 
+ * + * string image = 2; + */ + public com.google.protobuf.ByteString + getImageBytes() { + java.lang.Object ref = image_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + image_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Image used for the replica group
+       * 
+ * + * string image = 2; + */ + public Builder setImage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + image_ = value; + onChanged(); + return this; + } + /** + *
+       * Image used for the replica group
+       * 
+ * + * string image = 2; + */ + public Builder clearImage() { + + image_ = getDefaultInstance().getImage(); + onChanged(); + return this; + } + /** + *
+       * Image used for the replica group
+       * 
+ * + * string image = 2; + */ + public Builder setImageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + image_ = value; + onChanged(); + return this; + } + + private flyteidl.core.Tasks.Resources resources_; + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.core.Tasks.Resources, flyteidl.core.Tasks.Resources.Builder, flyteidl.core.Tasks.ResourcesOrBuilder> resourcesBuilder_; + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public boolean hasResources() { + return resourcesBuilder_ != null || resources_ != null; + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public flyteidl.core.Tasks.Resources getResources() { + if (resourcesBuilder_ == null) { + return resources_ == null ? flyteidl.core.Tasks.Resources.getDefaultInstance() : resources_; + } else { + return resourcesBuilder_.getMessage(); + } + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public Builder setResources(flyteidl.core.Tasks.Resources value) { + if (resourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resources_ = value; + onChanged(); + } else { + resourcesBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public Builder setResources( + flyteidl.core.Tasks.Resources.Builder builderForValue) { + if (resourcesBuilder_ == null) { + resources_ = builderForValue.build(); + onChanged(); + } else { + resourcesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public Builder mergeResources(flyteidl.core.Tasks.Resources value) { + if (resourcesBuilder_ == null) { + if (resources_ != null) { + resources_ = + flyteidl.core.Tasks.Resources.newBuilder(resources_).mergeFrom(value).buildPartial(); + } else { + resources_ = value; + } + onChanged(); + } else { + resourcesBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public Builder clearResources() { + if (resourcesBuilder_ == null) { + resources_ = null; + onChanged(); + } else { + resources_ = null; + resourcesBuilder_ = null; + } + + return this; + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public flyteidl.core.Tasks.Resources.Builder getResourcesBuilder() { + + onChanged(); + return getResourcesFieldBuilder().getBuilder(); + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + public flyteidl.core.Tasks.ResourcesOrBuilder getResourcesOrBuilder() { + if (resourcesBuilder_ != null) { + return resourcesBuilder_.getMessageOrBuilder(); + } else { + return resources_ == null ? + flyteidl.core.Tasks.Resources.getDefaultInstance() : resources_; + } + } + /** + *
+       * Resources required for the replica group
+       * 
+ * + * .flyteidl.core.Resources resources = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + flyteidl.core.Tasks.Resources, flyteidl.core.Tasks.Resources.Builder, flyteidl.core.Tasks.ResourcesOrBuilder> + getResourcesFieldBuilder() { + if (resourcesBuilder_ == null) { + resourcesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + flyteidl.core.Tasks.Resources, flyteidl.core.Tasks.Resources.Builder, flyteidl.core.Tasks.ResourcesOrBuilder>( + getResources(), + getParentForChildren(), + isClean()); + resources_ = null; + } + return resourcesBuilder_; + } + + private int restartPolicy_ = 0; + /** + *
+       * RestartPolicy Determines whether pods will be restarted when they exit
+       * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public int getRestartPolicyValue() { + return restartPolicy_; + } + /** + *
+       * RestartPolicy Determines whether pods will be restarted when they exit
+       * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public Builder setRestartPolicyValue(int value) { + restartPolicy_ = value; + onChanged(); + return this; + } + /** + *
+       * RestartPolicy Determines whether pods will be restarted when they exit
+       * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public flyteidl.plugins.kubeflow.Common.RestartPolicy getRestartPolicy() { + @SuppressWarnings("deprecation") + flyteidl.plugins.kubeflow.Common.RestartPolicy result = flyteidl.plugins.kubeflow.Common.RestartPolicy.valueOf(restartPolicy_); + return result == null ? flyteidl.plugins.kubeflow.Common.RestartPolicy.UNRECOGNIZED : result; + } + /** + *
+       * RestartPolicy Determines whether pods will be restarted when they exit
+       * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public Builder setRestartPolicy(flyteidl.plugins.kubeflow.Common.RestartPolicy value) { + if (value == null) { + throw new NullPointerException(); + } + + restartPolicy_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       * RestartPolicy Determines whether pods will be restarted when they exit
+       * 
+ * + * .flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4; + */ + public Builder clearRestartPolicy() { + + restartPolicy_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + } + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec) + private static final flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec(); + } + + public static flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DistributedTensorflowTrainingReplicaSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DistributedTensorflowTrainingReplicaSpec(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public flyteidl.plugins.kubeflow.Tensorflow.DistributedTensorflowTrainingReplicaSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingTask_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingTask_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingReplicaSpec_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingReplicaSpec_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n*flyteidl/plugins/kubeflow/tensorflow.p" + + "roto\022\031flyteidl.plugins.kubeflow\032\031flyteid" + + "l/core/tasks.proto\032&flyteidl/plugins/kub" + + "eflow/common.proto\"\362\002\n!DistributedTensor" + + "flowTrainingTask\022\\\n\017worker_replicas\030\001 \001(" + + "\0132C.flyteidl.plugins.kubeflow.Distribute" + + "dTensorflowTrainingReplicaSpec\022X\n\013ps_rep" + + "licas\030\002 \001(\0132C.flyteidl.plugins.kubeflow." + + "DistributedTensorflowTrainingReplicaSpec" + + "\022[\n\016chief_replicas\030\003 \001(\0132C.flyteidl.plug" + + "ins.kubeflow.DistributedTensorflowTraini" + + "ngReplicaSpec\0228\n\nrun_policy\030\004 \001(\0132$.flyt" + + "eidl.plugins.kubeflow.RunPolicy\"\272\001\n(Dist" + + "ributedTensorflowTrainingReplicaSpec\022\020\n\010" + + "replicas\030\001 \001(\005\022\r\n\005image\030\002 \001(\t\022+\n\tresourc" + + "es\030\003 \001(\0132\030.flyteidl.core.Resources\022@\n\016re" + + "start_policy\030\004 \001(\0162(.flyteidl.plugins.ku" + + "beflow.RestartPolicyB9Z7github.com/flyte" + + "org/flyteidl/gen/pb-go/flyteidl/pluginsb" + + "\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + flyteidl.core.Tasks.getDescriptor(), + flyteidl.plugins.kubeflow.Common.getDescriptor(), + }, assigner); + internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingTask_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingTask_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingTask_descriptor, + new java.lang.String[] { "WorkerReplicas", "PsReplicas", "ChiefReplicas", "RunPolicy", }); + internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingReplicaSpec_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingReplicaSpec_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_flyteidl_plugins_kubeflow_DistributedTensorflowTrainingReplicaSpec_descriptor, + new java.lang.String[] { "Replicas", "Image", "Resources", "RestartPolicy", }); + flyteidl.core.Tasks.getDescriptor(); + flyteidl.plugins.kubeflow.Common.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/gen/pb_python/flyteidl/plugins/kubeflow/__init__.py b/gen/pb_python/flyteidl/plugins/kubeflow/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/gen/pb_python/flyteidl/plugins/kubeflow/common_pb2.py b/gen/pb_python/flyteidl/plugins/kubeflow/common_pb2.py new file mode 100644 index 000000000..62a159a4e --- /dev/null +++ b/gen/pb_python/flyteidl/plugins/kubeflow/common_pb2.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: flyteidl/plugins/kubeflow/common.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&flyteidl/plugins/kubeflow/common.proto\x12\x19\x66lyteidl.plugins.kubeflow\"\xfa\x01\n\tRunPolicy\x12S\n\x10\x63lean_pod_policy\x18\x01 \x01(\x0e\x32).flyteidl.plugins.kubeflow.CleanPodPolicyR\x0e\x63leanPodPolicy\x12;\n\x1attl_seconds_after_finished\x18\x02 \x01(\x05R\x17ttlSecondsAfterFinished\x12\x36\n\x17\x61\x63tive_deadline_seconds\x18\x03 \x01(\x05R\x15\x61\x63tiveDeadlineSeconds\x12#\n\rbackoff_limit\x18\x04 \x01(\x05R\x0c\x62\x61\x63koffLimit*c\n\rRestartPolicy\x12\x18\n\x14RESTART_POLICY_NEVER\x10\x00\x12\x1d\n\x19RESTART_POLICY_ON_FAILURE\x10\x01\x12\x19\n\x15RESTART_POLICY_ALWAYS\x10\x02*`\n\x0e\x43leanPodPolicy\x12\x18\n\x14\x43LEANPOD_POLICY_NONE\x10\x00\x12\x1b\n\x17\x43LEANPOD_POLICY_RUNNING\x10\x01\x12\x17\n\x13\x43LEANPOD_POLICY_ALL\x10\x02\x42\xeb\x01\n\x1d\x63om.flyteidl.plugins.kubeflowB\x0b\x43ommonProtoP\x01Z7github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/plugins\xa2\x02\x03\x46PK\xaa\x02\x19\x46lyteidl.Plugins.Kubeflow\xca\x02\x19\x46lyteidl\\Plugins\\Kubeflow\xe2\x02%Flyteidl\\Plugins\\Kubeflow\\GPBMetadata\xea\x02\x1b\x46lyteidl::Plugins::Kubeflowb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flyteidl.plugins.kubeflow.common_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\035com.flyteidl.plugins.kubeflowB\013CommonProtoP\001Z7github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/plugins\242\002\003FPK\252\002\031Flyteidl.Plugins.Kubeflow\312\002\031Flyteidl\\Plugins\\Kubeflow\342\002%Flyteidl\\Plugins\\Kubeflow\\GPBMetadata\352\002\033Flyteidl::Plugins::Kubeflow' + _globals['_RESTARTPOLICY']._serialized_start=322 + _globals['_RESTARTPOLICY']._serialized_end=421 + _globals['_CLEANPODPOLICY']._serialized_start=423 + _globals['_CLEANPODPOLICY']._serialized_end=519 + _globals['_RUNPOLICY']._serialized_start=70 + _globals['_RUNPOLICY']._serialized_end=320 +# @@protoc_insertion_point(module_scope) diff --git a/gen/pb_python/flyteidl/plugins/kubeflow/common_pb2.pyi b/gen/pb_python/flyteidl/plugins/kubeflow/common_pb2.pyi new file mode 100644 index 000000000..916c3344b --- /dev/null +++ b/gen/pb_python/flyteidl/plugins/kubeflow/common_pb2.pyi @@ -0,0 +1,36 @@ +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class RestartPolicy(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = [] + RESTART_POLICY_NEVER: _ClassVar[RestartPolicy] + RESTART_POLICY_ON_FAILURE: _ClassVar[RestartPolicy] + RESTART_POLICY_ALWAYS: _ClassVar[RestartPolicy] + +class CleanPodPolicy(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = [] + CLEANPOD_POLICY_NONE: _ClassVar[CleanPodPolicy] + CLEANPOD_POLICY_RUNNING: _ClassVar[CleanPodPolicy] + CLEANPOD_POLICY_ALL: _ClassVar[CleanPodPolicy] +RESTART_POLICY_NEVER: RestartPolicy +RESTART_POLICY_ON_FAILURE: RestartPolicy +RESTART_POLICY_ALWAYS: RestartPolicy +CLEANPOD_POLICY_NONE: CleanPodPolicy +CLEANPOD_POLICY_RUNNING: CleanPodPolicy +CLEANPOD_POLICY_ALL: CleanPodPolicy + +class RunPolicy(_message.Message): + __slots__ = ["clean_pod_policy", "ttl_seconds_after_finished", "active_deadline_seconds", "backoff_limit"] + CLEAN_POD_POLICY_FIELD_NUMBER: _ClassVar[int] + TTL_SECONDS_AFTER_FINISHED_FIELD_NUMBER: _ClassVar[int] + ACTIVE_DEADLINE_SECONDS_FIELD_NUMBER: _ClassVar[int] + BACKOFF_LIMIT_FIELD_NUMBER: _ClassVar[int] + clean_pod_policy: CleanPodPolicy + ttl_seconds_after_finished: int + active_deadline_seconds: int + backoff_limit: int + def __init__(self, clean_pod_policy: _Optional[_Union[CleanPodPolicy, str]] = ..., ttl_seconds_after_finished: _Optional[int] = ..., active_deadline_seconds: _Optional[int] = ..., backoff_limit: _Optional[int] = ...) -> None: ... diff --git a/gen/pb_python/flyteidl/plugins/kubeflow/common_pb2_grpc.py b/gen/pb_python/flyteidl/plugins/kubeflow/common_pb2_grpc.py new file mode 100644 index 000000000..2daafffeb --- /dev/null +++ b/gen/pb_python/flyteidl/plugins/kubeflow/common_pb2_grpc.py @@ -0,0 +1,4 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + diff --git a/gen/pb_python/flyteidl/plugins/kubeflow/mpi_pb2.py b/gen/pb_python/flyteidl/plugins/kubeflow/mpi_pb2.py new file mode 100644 index 000000000..539fcb59b --- /dev/null +++ b/gen/pb_python/flyteidl/plugins/kubeflow/mpi_pb2.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: flyteidl/plugins/kubeflow/mpi.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from flyteidl.core import tasks_pb2 as flyteidl_dot_core_dot_tasks__pb2 +from flyteidl.plugins.kubeflow import common_pb2 as flyteidl_dot_plugins_dot_kubeflow_dot_common__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#flyteidl/plugins/kubeflow/mpi.proto\x12\x19\x66lyteidl.plugins.kubeflow\x1a\x19\x66lyteidl/core/tasks.proto\x1a&flyteidl/plugins/kubeflow/common.proto\"\xc9\x02\n\x1a\x44istributedMPITrainingTask\x12\x65\n\x0fworker_replicas\x18\x01 \x01(\x0b\x32<.flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpecR\x0eworkerReplicas\x12i\n\x11launcher_replicas\x18\x02 \x01(\x0b\x32<.flyteidl.plugins.kubeflow.DistributedMPITrainingReplicaSpecR\x10launcherReplicas\x12\x43\n\nrun_policy\x18\x03 \x01(\x0b\x32$.flyteidl.plugins.kubeflow.RunPolicyR\trunPolicy\x12\x14\n\x05slots\x18\x04 \x01(\x05R\x05slots\"\xf8\x01\n!DistributedMPITrainingReplicaSpec\x12\x1a\n\x08replicas\x18\x01 \x01(\x05R\x08replicas\x12\x14\n\x05image\x18\x02 \x01(\tR\x05image\x12\x36\n\tresources\x18\x03 \x01(\x0b\x32\x18.flyteidl.core.ResourcesR\tresources\x12O\n\x0erestart_policy\x18\x04 \x01(\x0e\x32(.flyteidl.plugins.kubeflow.RestartPolicyR\rrestartPolicy\x12\x18\n\x07\x63ommand\x18\x05 \x03(\tR\x07\x63ommandB\xe8\x01\n\x1d\x63om.flyteidl.plugins.kubeflowB\x08MpiProtoP\x01Z7github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/plugins\xa2\x02\x03\x46PK\xaa\x02\x19\x46lyteidl.Plugins.Kubeflow\xca\x02\x19\x46lyteidl\\Plugins\\Kubeflow\xe2\x02%Flyteidl\\Plugins\\Kubeflow\\GPBMetadata\xea\x02\x1b\x46lyteidl::Plugins::Kubeflowb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flyteidl.plugins.kubeflow.mpi_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\035com.flyteidl.plugins.kubeflowB\010MpiProtoP\001Z7github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/plugins\242\002\003FPK\252\002\031Flyteidl.Plugins.Kubeflow\312\002\031Flyteidl\\Plugins\\Kubeflow\342\002%Flyteidl\\Plugins\\Kubeflow\\GPBMetadata\352\002\033Flyteidl::Plugins::Kubeflow' + _globals['_DISTRIBUTEDMPITRAININGTASK']._serialized_start=134 + _globals['_DISTRIBUTEDMPITRAININGTASK']._serialized_end=463 + _globals['_DISTRIBUTEDMPITRAININGREPLICASPEC']._serialized_start=466 + _globals['_DISTRIBUTEDMPITRAININGREPLICASPEC']._serialized_end=714 +# @@protoc_insertion_point(module_scope) diff --git a/gen/pb_python/flyteidl/plugins/kubeflow/mpi_pb2.pyi b/gen/pb_python/flyteidl/plugins/kubeflow/mpi_pb2.pyi new file mode 100644 index 000000000..625854299 --- /dev/null +++ b/gen/pb_python/flyteidl/plugins/kubeflow/mpi_pb2.pyi @@ -0,0 +1,34 @@ +from flyteidl.core import tasks_pb2 as _tasks_pb2 +from flyteidl.plugins.kubeflow import common_pb2 as _common_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class DistributedMPITrainingTask(_message.Message): + __slots__ = ["worker_replicas", "launcher_replicas", "run_policy", "slots"] + WORKER_REPLICAS_FIELD_NUMBER: _ClassVar[int] + LAUNCHER_REPLICAS_FIELD_NUMBER: _ClassVar[int] + RUN_POLICY_FIELD_NUMBER: _ClassVar[int] + SLOTS_FIELD_NUMBER: _ClassVar[int] + worker_replicas: DistributedMPITrainingReplicaSpec + launcher_replicas: DistributedMPITrainingReplicaSpec + run_policy: _common_pb2.RunPolicy + slots: int + def __init__(self, worker_replicas: _Optional[_Union[DistributedMPITrainingReplicaSpec, _Mapping]] = ..., launcher_replicas: _Optional[_Union[DistributedMPITrainingReplicaSpec, _Mapping]] = ..., run_policy: _Optional[_Union[_common_pb2.RunPolicy, _Mapping]] = ..., slots: _Optional[int] = ...) -> None: ... + +class DistributedMPITrainingReplicaSpec(_message.Message): + __slots__ = ["replicas", "image", "resources", "restart_policy", "command"] + REPLICAS_FIELD_NUMBER: _ClassVar[int] + IMAGE_FIELD_NUMBER: _ClassVar[int] + RESOURCES_FIELD_NUMBER: _ClassVar[int] + RESTART_POLICY_FIELD_NUMBER: _ClassVar[int] + COMMAND_FIELD_NUMBER: _ClassVar[int] + replicas: int + image: str + resources: _tasks_pb2.Resources + restart_policy: _common_pb2.RestartPolicy + command: _containers.RepeatedScalarFieldContainer[str] + def __init__(self, replicas: _Optional[int] = ..., image: _Optional[str] = ..., resources: _Optional[_Union[_tasks_pb2.Resources, _Mapping]] = ..., restart_policy: _Optional[_Union[_common_pb2.RestartPolicy, str]] = ..., command: _Optional[_Iterable[str]] = ...) -> None: ... diff --git a/gen/pb_python/flyteidl/plugins/kubeflow/mpi_pb2_grpc.py b/gen/pb_python/flyteidl/plugins/kubeflow/mpi_pb2_grpc.py new file mode 100644 index 000000000..2daafffeb --- /dev/null +++ b/gen/pb_python/flyteidl/plugins/kubeflow/mpi_pb2_grpc.py @@ -0,0 +1,4 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + diff --git a/gen/pb_python/flyteidl/plugins/kubeflow/pytorch_pb2.py b/gen/pb_python/flyteidl/plugins/kubeflow/pytorch_pb2.py new file mode 100644 index 000000000..7d0d3f454 --- /dev/null +++ b/gen/pb_python/flyteidl/plugins/kubeflow/pytorch_pb2.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: flyteidl/plugins/kubeflow/pytorch.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from flyteidl.core import tasks_pb2 as flyteidl_dot_core_dot_tasks__pb2 +from flyteidl.plugins.kubeflow import common_pb2 as flyteidl_dot_plugins_dot_kubeflow_dot_common__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'flyteidl/plugins/kubeflow/pytorch.proto\x12\x19\x66lyteidl.plugins.kubeflow\x1a\x19\x66lyteidl/core/tasks.proto\x1a&flyteidl/plugins/kubeflow/common.proto\"\xc1\x01\n\rElasticConfig\x12!\n\x0crdzv_backend\x18\x01 \x01(\tR\x0brdzvBackend\x12!\n\x0cmin_replicas\x18\x02 \x01(\x05R\x0bminReplicas\x12!\n\x0cmax_replicas\x18\x03 \x01(\x05R\x0bmaxReplicas\x12$\n\x0enproc_per_node\x18\x04 \x01(\x05R\x0cnprocPerNode\x12!\n\x0cmax_restarts\x18\x05 \x01(\x05R\x0bmaxRestarts\"\x8c\x03\n\x1e\x44istributedPyTorchTrainingTask\x12i\n\x0fworker_replicas\x18\x01 \x01(\x0b\x32@.flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpecR\x0eworkerReplicas\x12i\n\x0fmaster_replicas\x18\x02 \x01(\x0b\x32@.flyteidl.plugins.kubeflow.DistributedPyTorchTrainingReplicaSpecR\x0emasterReplicas\x12\x43\n\nrun_policy\x18\x03 \x01(\x0b\x32$.flyteidl.plugins.kubeflow.RunPolicyR\trunPolicy\x12O\n\x0e\x65lastic_config\x18\x04 \x01(\x0b\x32(.flyteidl.plugins.kubeflow.ElasticConfigR\relasticConfig\"\xe2\x01\n%DistributedPyTorchTrainingReplicaSpec\x12\x1a\n\x08replicas\x18\x01 \x01(\x05R\x08replicas\x12\x14\n\x05image\x18\x02 \x01(\tR\x05image\x12\x36\n\tresources\x18\x03 \x01(\x0b\x32\x18.flyteidl.core.ResourcesR\tresources\x12O\n\x0erestart_policy\x18\x04 \x01(\x0e\x32(.flyteidl.plugins.kubeflow.RestartPolicyR\rrestartPolicyB\xec\x01\n\x1d\x63om.flyteidl.plugins.kubeflowB\x0cPytorchProtoP\x01Z7github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/plugins\xa2\x02\x03\x46PK\xaa\x02\x19\x46lyteidl.Plugins.Kubeflow\xca\x02\x19\x46lyteidl\\Plugins\\Kubeflow\xe2\x02%Flyteidl\\Plugins\\Kubeflow\\GPBMetadata\xea\x02\x1b\x46lyteidl::Plugins::Kubeflowb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flyteidl.plugins.kubeflow.pytorch_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\035com.flyteidl.plugins.kubeflowB\014PytorchProtoP\001Z7github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/plugins\242\002\003FPK\252\002\031Flyteidl.Plugins.Kubeflow\312\002\031Flyteidl\\Plugins\\Kubeflow\342\002%Flyteidl\\Plugins\\Kubeflow\\GPBMetadata\352\002\033Flyteidl::Plugins::Kubeflow' + _globals['_ELASTICCONFIG']._serialized_start=138 + _globals['_ELASTICCONFIG']._serialized_end=331 + _globals['_DISTRIBUTEDPYTORCHTRAININGTASK']._serialized_start=334 + _globals['_DISTRIBUTEDPYTORCHTRAININGTASK']._serialized_end=730 + _globals['_DISTRIBUTEDPYTORCHTRAININGREPLICASPEC']._serialized_start=733 + _globals['_DISTRIBUTEDPYTORCHTRAININGREPLICASPEC']._serialized_end=959 +# @@protoc_insertion_point(module_scope) diff --git a/gen/pb_python/flyteidl/plugins/kubeflow/pytorch_pb2.pyi b/gen/pb_python/flyteidl/plugins/kubeflow/pytorch_pb2.pyi new file mode 100644 index 000000000..ee6599ad8 --- /dev/null +++ b/gen/pb_python/flyteidl/plugins/kubeflow/pytorch_pb2.pyi @@ -0,0 +1,45 @@ +from flyteidl.core import tasks_pb2 as _tasks_pb2 +from flyteidl.plugins.kubeflow import common_pb2 as _common_pb2 +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ClassVar as _ClassVar, Mapping as _Mapping, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class ElasticConfig(_message.Message): + __slots__ = ["rdzv_backend", "min_replicas", "max_replicas", "nproc_per_node", "max_restarts"] + RDZV_BACKEND_FIELD_NUMBER: _ClassVar[int] + MIN_REPLICAS_FIELD_NUMBER: _ClassVar[int] + MAX_REPLICAS_FIELD_NUMBER: _ClassVar[int] + NPROC_PER_NODE_FIELD_NUMBER: _ClassVar[int] + MAX_RESTARTS_FIELD_NUMBER: _ClassVar[int] + rdzv_backend: str + min_replicas: int + max_replicas: int + nproc_per_node: int + max_restarts: int + def __init__(self, rdzv_backend: _Optional[str] = ..., min_replicas: _Optional[int] = ..., max_replicas: _Optional[int] = ..., nproc_per_node: _Optional[int] = ..., max_restarts: _Optional[int] = ...) -> None: ... + +class DistributedPyTorchTrainingTask(_message.Message): + __slots__ = ["worker_replicas", "master_replicas", "run_policy", "elastic_config"] + WORKER_REPLICAS_FIELD_NUMBER: _ClassVar[int] + MASTER_REPLICAS_FIELD_NUMBER: _ClassVar[int] + RUN_POLICY_FIELD_NUMBER: _ClassVar[int] + ELASTIC_CONFIG_FIELD_NUMBER: _ClassVar[int] + worker_replicas: DistributedPyTorchTrainingReplicaSpec + master_replicas: DistributedPyTorchTrainingReplicaSpec + run_policy: _common_pb2.RunPolicy + elastic_config: ElasticConfig + def __init__(self, worker_replicas: _Optional[_Union[DistributedPyTorchTrainingReplicaSpec, _Mapping]] = ..., master_replicas: _Optional[_Union[DistributedPyTorchTrainingReplicaSpec, _Mapping]] = ..., run_policy: _Optional[_Union[_common_pb2.RunPolicy, _Mapping]] = ..., elastic_config: _Optional[_Union[ElasticConfig, _Mapping]] = ...) -> None: ... + +class DistributedPyTorchTrainingReplicaSpec(_message.Message): + __slots__ = ["replicas", "image", "resources", "restart_policy"] + REPLICAS_FIELD_NUMBER: _ClassVar[int] + IMAGE_FIELD_NUMBER: _ClassVar[int] + RESOURCES_FIELD_NUMBER: _ClassVar[int] + RESTART_POLICY_FIELD_NUMBER: _ClassVar[int] + replicas: int + image: str + resources: _tasks_pb2.Resources + restart_policy: _common_pb2.RestartPolicy + def __init__(self, replicas: _Optional[int] = ..., image: _Optional[str] = ..., resources: _Optional[_Union[_tasks_pb2.Resources, _Mapping]] = ..., restart_policy: _Optional[_Union[_common_pb2.RestartPolicy, str]] = ...) -> None: ... diff --git a/gen/pb_python/flyteidl/plugins/kubeflow/pytorch_pb2_grpc.py b/gen/pb_python/flyteidl/plugins/kubeflow/pytorch_pb2_grpc.py new file mode 100644 index 000000000..2daafffeb --- /dev/null +++ b/gen/pb_python/flyteidl/plugins/kubeflow/pytorch_pb2_grpc.py @@ -0,0 +1,4 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + diff --git a/gen/pb_python/flyteidl/plugins/kubeflow/tensorflow_pb2.py b/gen/pb_python/flyteidl/plugins/kubeflow/tensorflow_pb2.py new file mode 100644 index 000000000..f1c9eddb5 --- /dev/null +++ b/gen/pb_python/flyteidl/plugins/kubeflow/tensorflow_pb2.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: flyteidl/plugins/kubeflow/tensorflow.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from flyteidl.core import tasks_pb2 as flyteidl_dot_core_dot_tasks__pb2 +from flyteidl.plugins.kubeflow import common_pb2 as flyteidl_dot_plugins_dot_kubeflow_dot_common__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*flyteidl/plugins/kubeflow/tensorflow.proto\x12\x19\x66lyteidl.plugins.kubeflow\x1a\x19\x66lyteidl/core/tasks.proto\x1a&flyteidl/plugins/kubeflow/common.proto\"\xa8\x03\n!DistributedTensorflowTrainingTask\x12l\n\x0fworker_replicas\x18\x01 \x01(\x0b\x32\x43.flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpecR\x0eworkerReplicas\x12\x64\n\x0bps_replicas\x18\x02 \x01(\x0b\x32\x43.flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpecR\npsReplicas\x12j\n\x0e\x63hief_replicas\x18\x03 \x01(\x0b\x32\x43.flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpecR\rchiefReplicas\x12\x43\n\nrun_policy\x18\x04 \x01(\x0b\x32$.flyteidl.plugins.kubeflow.RunPolicyR\trunPolicy\"\xe5\x01\n(DistributedTensorflowTrainingReplicaSpec\x12\x1a\n\x08replicas\x18\x01 \x01(\x05R\x08replicas\x12\x14\n\x05image\x18\x02 \x01(\tR\x05image\x12\x36\n\tresources\x18\x03 \x01(\x0b\x32\x18.flyteidl.core.ResourcesR\tresources\x12O\n\x0erestart_policy\x18\x04 \x01(\x0e\x32(.flyteidl.plugins.kubeflow.RestartPolicyR\rrestartPolicyB\xef\x01\n\x1d\x63om.flyteidl.plugins.kubeflowB\x0fTensorflowProtoP\x01Z7github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/plugins\xa2\x02\x03\x46PK\xaa\x02\x19\x46lyteidl.Plugins.Kubeflow\xca\x02\x19\x46lyteidl\\Plugins\\Kubeflow\xe2\x02%Flyteidl\\Plugins\\Kubeflow\\GPBMetadata\xea\x02\x1b\x46lyteidl::Plugins::Kubeflowb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flyteidl.plugins.kubeflow.tensorflow_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\035com.flyteidl.plugins.kubeflowB\017TensorflowProtoP\001Z7github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/plugins\242\002\003FPK\252\002\031Flyteidl.Plugins.Kubeflow\312\002\031Flyteidl\\Plugins\\Kubeflow\342\002%Flyteidl\\Plugins\\Kubeflow\\GPBMetadata\352\002\033Flyteidl::Plugins::Kubeflow' + _globals['_DISTRIBUTEDTENSORFLOWTRAININGTASK']._serialized_start=141 + _globals['_DISTRIBUTEDTENSORFLOWTRAININGTASK']._serialized_end=565 + _globals['_DISTRIBUTEDTENSORFLOWTRAININGREPLICASPEC']._serialized_start=568 + _globals['_DISTRIBUTEDTENSORFLOWTRAININGREPLICASPEC']._serialized_end=797 +# @@protoc_insertion_point(module_scope) diff --git a/gen/pb_python/flyteidl/plugins/kubeflow/tensorflow_pb2.pyi b/gen/pb_python/flyteidl/plugins/kubeflow/tensorflow_pb2.pyi new file mode 100644 index 000000000..e08a1ff98 --- /dev/null +++ b/gen/pb_python/flyteidl/plugins/kubeflow/tensorflow_pb2.pyi @@ -0,0 +1,31 @@ +from flyteidl.core import tasks_pb2 as _tasks_pb2 +from flyteidl.plugins.kubeflow import common_pb2 as _common_pb2 +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ClassVar as _ClassVar, Mapping as _Mapping, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class DistributedTensorflowTrainingTask(_message.Message): + __slots__ = ["worker_replicas", "ps_replicas", "chief_replicas", "run_policy"] + WORKER_REPLICAS_FIELD_NUMBER: _ClassVar[int] + PS_REPLICAS_FIELD_NUMBER: _ClassVar[int] + CHIEF_REPLICAS_FIELD_NUMBER: _ClassVar[int] + RUN_POLICY_FIELD_NUMBER: _ClassVar[int] + worker_replicas: DistributedTensorflowTrainingReplicaSpec + ps_replicas: DistributedTensorflowTrainingReplicaSpec + chief_replicas: DistributedTensorflowTrainingReplicaSpec + run_policy: _common_pb2.RunPolicy + def __init__(self, worker_replicas: _Optional[_Union[DistributedTensorflowTrainingReplicaSpec, _Mapping]] = ..., ps_replicas: _Optional[_Union[DistributedTensorflowTrainingReplicaSpec, _Mapping]] = ..., chief_replicas: _Optional[_Union[DistributedTensorflowTrainingReplicaSpec, _Mapping]] = ..., run_policy: _Optional[_Union[_common_pb2.RunPolicy, _Mapping]] = ...) -> None: ... + +class DistributedTensorflowTrainingReplicaSpec(_message.Message): + __slots__ = ["replicas", "image", "resources", "restart_policy"] + REPLICAS_FIELD_NUMBER: _ClassVar[int] + IMAGE_FIELD_NUMBER: _ClassVar[int] + RESOURCES_FIELD_NUMBER: _ClassVar[int] + RESTART_POLICY_FIELD_NUMBER: _ClassVar[int] + replicas: int + image: str + resources: _tasks_pb2.Resources + restart_policy: _common_pb2.RestartPolicy + def __init__(self, replicas: _Optional[int] = ..., image: _Optional[str] = ..., resources: _Optional[_Union[_tasks_pb2.Resources, _Mapping]] = ..., restart_policy: _Optional[_Union[_common_pb2.RestartPolicy, str]] = ...) -> None: ... diff --git a/gen/pb_python/flyteidl/plugins/kubeflow/tensorflow_pb2_grpc.py b/gen/pb_python/flyteidl/plugins/kubeflow/tensorflow_pb2_grpc.py new file mode 100644 index 000000000..2daafffeb --- /dev/null +++ b/gen/pb_python/flyteidl/plugins/kubeflow/tensorflow_pb2_grpc.py @@ -0,0 +1,4 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + diff --git a/gen/pb_rust/flyteidl.plugins.kubeflow.rs b/gen/pb_rust/flyteidl.plugins.kubeflow.rs new file mode 100644 index 000000000..59c1f681a --- /dev/null +++ b/gen/pb_rust/flyteidl.plugins.kubeflow.rs @@ -0,0 +1,202 @@ +// @generated +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RunPolicy { + /// Defines the policy to kill pods after the job completes. Default to None. + #[prost(enumeration="CleanPodPolicy", tag="1")] + pub clean_pod_policy: i32, + /// TTL to clean up jobs. Default to infinite. + #[prost(int32, tag="2")] + pub ttl_seconds_after_finished: i32, + /// Specifies the duration in seconds relative to the startTime that the job may be active + /// before the system tries to terminate it; value must be positive integer. + #[prost(int32, tag="3")] + pub active_deadline_seconds: i32, + /// Number of retries before marking this job failed. + #[prost(int32, tag="4")] + pub backoff_limit: i32, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum RestartPolicy { + Never = 0, + OnFailure = 1, + Always = 2, +} +impl RestartPolicy { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + RestartPolicy::Never => "RESTART_POLICY_NEVER", + RestartPolicy::OnFailure => "RESTART_POLICY_ON_FAILURE", + RestartPolicy::Always => "RESTART_POLICY_ALWAYS", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "RESTART_POLICY_NEVER" => Some(Self::Never), + "RESTART_POLICY_ON_FAILURE" => Some(Self::OnFailure), + "RESTART_POLICY_ALWAYS" => Some(Self::Always), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum CleanPodPolicy { + CleanpodPolicyNone = 0, + CleanpodPolicyRunning = 1, + CleanpodPolicyAll = 2, +} +impl CleanPodPolicy { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + CleanPodPolicy::CleanpodPolicyNone => "CLEANPOD_POLICY_NONE", + CleanPodPolicy::CleanpodPolicyRunning => "CLEANPOD_POLICY_RUNNING", + CleanPodPolicy::CleanpodPolicyAll => "CLEANPOD_POLICY_ALL", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "CLEANPOD_POLICY_NONE" => Some(Self::CleanpodPolicyNone), + "CLEANPOD_POLICY_RUNNING" => Some(Self::CleanpodPolicyRunning), + "CLEANPOD_POLICY_ALL" => Some(Self::CleanpodPolicyAll), + _ => None, + } + } +} +/// Proto for plugin that enables distributed training using +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DistributedMpiTrainingTask { + /// Worker replicas spec + #[prost(message, optional, tag="1")] + pub worker_replicas: ::core::option::Option, + /// Master replicas spec + #[prost(message, optional, tag="2")] + pub launcher_replicas: ::core::option::Option, + /// RunPolicy encapsulates various runtime policies of the distributed training + /// job, for example how to clean up resources and how long the job can stay + /// active. + #[prost(message, optional, tag="3")] + pub run_policy: ::core::option::Option, + /// Number of slots per worker + #[prost(int32, tag="4")] + pub slots: i32, +} +/// Replica specification for distributed MPI training +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DistributedMpiTrainingReplicaSpec { + /// Number of replicas + #[prost(int32, tag="1")] + pub replicas: i32, + /// Image used for the replica group + #[prost(string, tag="2")] + pub image: ::prost::alloc::string::String, + /// Resources required for the replica group + #[prost(message, optional, tag="3")] + pub resources: ::core::option::Option, + /// Restart policy determines whether pods will be restarted when they exit + #[prost(enumeration="RestartPolicy", tag="4")] + pub restart_policy: i32, + /// MPI sometimes requires different command set for different replica groups + #[prost(string, repeated, tag="5")] + pub command: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// Custom proto for torch elastic config for distributed training using +/// +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ElasticConfig { + #[prost(string, tag="1")] + pub rdzv_backend: ::prost::alloc::string::String, + #[prost(int32, tag="2")] + pub min_replicas: i32, + #[prost(int32, tag="3")] + pub max_replicas: i32, + #[prost(int32, tag="4")] + pub nproc_per_node: i32, + #[prost(int32, tag="5")] + pub max_restarts: i32, +} +/// Proto for plugin that enables distributed training using +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DistributedPyTorchTrainingTask { + /// Worker replicas spec + #[prost(message, optional, tag="1")] + pub worker_replicas: ::core::option::Option, + /// Master replicas spec, master replicas can only have 1 replica + #[prost(message, optional, tag="2")] + pub master_replicas: ::core::option::Option, + /// RunPolicy encapsulates various runtime policies of the distributed training + /// job, for example how to clean up resources and how long the job can stay + /// active. + #[prost(message, optional, tag="3")] + pub run_policy: ::core::option::Option, + /// config for an elastic pytorch job + #[prost(message, optional, tag="4")] + pub elastic_config: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DistributedPyTorchTrainingReplicaSpec { + /// Number of replicas + #[prost(int32, tag="1")] + pub replicas: i32, + /// Image used for the replica group + #[prost(string, tag="2")] + pub image: ::prost::alloc::string::String, + /// Resources required for the replica group + #[prost(message, optional, tag="3")] + pub resources: ::core::option::Option, + /// RestartPolicy determines whether pods will be restarted when they exit + #[prost(enumeration="RestartPolicy", tag="4")] + pub restart_policy: i32, +} +/// Proto for plugin that enables distributed training using +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DistributedTensorflowTrainingTask { + /// Worker replicas spec + #[prost(message, optional, tag="1")] + pub worker_replicas: ::core::option::Option, + /// Parameter server replicas spec + #[prost(message, optional, tag="2")] + pub ps_replicas: ::core::option::Option, + /// Chief replicas spec + #[prost(message, optional, tag="3")] + pub chief_replicas: ::core::option::Option, + /// RunPolicy encapsulates various runtime policies of the distributed training + /// job, for example how to clean up resources and how long the job can stay + /// active. + #[prost(message, optional, tag="4")] + pub run_policy: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DistributedTensorflowTrainingReplicaSpec { + /// Number of replicas + #[prost(int32, tag="1")] + pub replicas: i32, + /// Image used for the replica group + #[prost(string, tag="2")] + pub image: ::prost::alloc::string::String, + /// Resources required for the replica group + #[prost(message, optional, tag="3")] + pub resources: ::core::option::Option, + /// RestartPolicy Determines whether pods will be restarted when they exit + #[prost(enumeration="RestartPolicy", tag="4")] + pub restart_policy: i32, +} +// @@protoc_insertion_point(module) diff --git a/protos/flyteidl/plugins/kubeflow/common.proto b/protos/flyteidl/plugins/kubeflow/common.proto new file mode 100644 index 000000000..99a3a8e8c --- /dev/null +++ b/protos/flyteidl/plugins/kubeflow/common.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; + +package flyteidl.plugins.kubeflow; + +option go_package = "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/plugins"; + + +enum RestartPolicy { + RESTART_POLICY_NEVER = 0; + RESTART_POLICY_ON_FAILURE = 1; + RESTART_POLICY_ALWAYS = 2; +} + +enum CleanPodPolicy { + CLEANPOD_POLICY_NONE = 0; + CLEANPOD_POLICY_RUNNING = 1; + CLEANPOD_POLICY_ALL = 2; +} + +message RunPolicy { + // Defines the policy to kill pods after the job completes. Default to None. + CleanPodPolicy clean_pod_policy = 1; + + // TTL to clean up jobs. Default to infinite. + int32 ttl_seconds_after_finished = 2; + + // Specifies the duration in seconds relative to the startTime that the job may be active + // before the system tries to terminate it; value must be positive integer. + int32 active_deadline_seconds = 3; + + // Number of retries before marking this job failed. + int32 backoff_limit = 4; +} \ No newline at end of file diff --git a/protos/flyteidl/plugins/kubeflow/mpi.proto b/protos/flyteidl/plugins/kubeflow/mpi.proto new file mode 100644 index 000000000..0013ceeb0 --- /dev/null +++ b/protos/flyteidl/plugins/kubeflow/mpi.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package flyteidl.plugins.kubeflow; + +option go_package = "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/plugins"; + +import "flyteidl/core/tasks.proto"; +import "flyteidl/plugins/kubeflow/common.proto"; + +// Proto for plugin that enables distributed training using https://github.com/kubeflow/mpi-operator +message DistributedMPITrainingTask { + // Worker replicas spec + DistributedMPITrainingReplicaSpec worker_replicas = 1; + + // Master replicas spec + DistributedMPITrainingReplicaSpec launcher_replicas = 2; + + // RunPolicy encapsulates various runtime policies of the distributed training + // job, for example how to clean up resources and how long the job can stay + // active. + RunPolicy run_policy = 3; + + // Number of slots per worker + int32 slots = 4; +} + +// Replica specification for distributed MPI training +message DistributedMPITrainingReplicaSpec { + // Number of replicas + int32 replicas = 1; + + // Image used for the replica group + string image = 2; + + // Resources required for the replica group + core.Resources resources = 3; + + // Restart policy determines whether pods will be restarted when they exit + RestartPolicy restart_policy = 4; + + // MPI sometimes requires different command set for different replica groups + repeated string command = 5; +} \ No newline at end of file diff --git a/protos/flyteidl/plugins/kubeflow/pytorch.proto b/protos/flyteidl/plugins/kubeflow/pytorch.proto new file mode 100644 index 000000000..0e69d890b --- /dev/null +++ b/protos/flyteidl/plugins/kubeflow/pytorch.proto @@ -0,0 +1,49 @@ +syntax = "proto3"; + +package flyteidl.plugins.kubeflow; + +option go_package = "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/plugins"; + +import "flyteidl/core/tasks.proto"; +import "flyteidl/plugins/kubeflow/common.proto"; + +// Custom proto for torch elastic config for distributed training using +// https://github.com/kubeflow/training-operator/blob/master/pkg/apis/kubeflow.org/v1/pytorch_types.go +message ElasticConfig { + string rdzv_backend = 1; + int32 min_replicas = 2; + int32 max_replicas = 3; + int32 nproc_per_node = 4; + int32 max_restarts = 5; +} + +// Proto for plugin that enables distributed training using https://github.com/kubeflow/pytorch-operator +message DistributedPyTorchTrainingTask { + // Worker replicas spec + DistributedPyTorchTrainingReplicaSpec worker_replicas = 1; + + // Master replicas spec, master replicas can only have 1 replica + DistributedPyTorchTrainingReplicaSpec master_replicas = 2; + + // RunPolicy encapsulates various runtime policies of the distributed training + // job, for example how to clean up resources and how long the job can stay + // active. + RunPolicy run_policy = 3; + + // config for an elastic pytorch job + ElasticConfig elastic_config = 4; +} + +message DistributedPyTorchTrainingReplicaSpec { + // Number of replicas + int32 replicas = 1; + + // Image used for the replica group + string image = 2; + + // Resources required for the replica group + core.Resources resources = 3; + + // RestartPolicy determines whether pods will be restarted when they exit + RestartPolicy restart_policy = 4; +} diff --git a/protos/flyteidl/plugins/kubeflow/tensorflow.proto b/protos/flyteidl/plugins/kubeflow/tensorflow.proto new file mode 100644 index 000000000..ae44ac6a2 --- /dev/null +++ b/protos/flyteidl/plugins/kubeflow/tensorflow.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; + +package flyteidl.plugins.kubeflow; + +option go_package = "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/plugins"; + +import "flyteidl/core/tasks.proto"; +import "flyteidl/plugins/kubeflow/common.proto"; + +// Proto for plugin that enables distributed training using https://github.com/kubeflow/tf-operator +message DistributedTensorflowTrainingTask { + // Worker replicas spec + DistributedTensorflowTrainingReplicaSpec worker_replicas = 1; + + // Parameter server replicas spec + DistributedTensorflowTrainingReplicaSpec ps_replicas = 2; + + // Chief replicas spec + DistributedTensorflowTrainingReplicaSpec chief_replicas = 3; + + // RunPolicy encapsulates various runtime policies of the distributed training + // job, for example how to clean up resources and how long the job can stay + // active. + RunPolicy run_policy = 4; +} + +message DistributedTensorflowTrainingReplicaSpec { + // Number of replicas + int32 replicas = 1; + + // Image used for the replica group + string image = 2; + + // Resources required for the replica group + core.Resources resources = 3; + + // RestartPolicy Determines whether pods will be restarted when they exit + RestartPolicy restart_policy = 4; +}