From 65ca943bc929141e9956a65471797412b186ce47 Mon Sep 17 00:00:00 2001 From: Ketan Umare Date: Tue, 12 May 2020 13:53:49 -0700 Subject: [PATCH] Arbitrary container support without Flytekit using FlyteCoPilot (#62) Signed-off-by: Eduardo Apolinario --- .../flyteidl/plugins/raw_container.grpc.pb.cc | 24 + .../flyteidl/plugins/raw_container.grpc.pb.h | 47 + .../flyteidl/plugins/raw_container.pb.cc | 553 ++++++++ .../flyteidl/plugins/raw_container.pb.h | 414 ++++++ .../flyteidl/plugins/raw_container.pb.go | 153 +++ .../plugins/raw_container.pb.validate.go | 107 ++ .../flyteidl/plugins/RawContainer.java | 1157 +++++++++++++++++ .../pb-protodoc/flyteidl/plugins/index.rst | 1 + .../flyteidl/plugins/raw_container.proto.rst | 81 ++ .../flyteidl/plugins/raw_container_pb2.py | 114 ++ .../plugins/raw_container_pb2_grpc.py | 3 + .../flyteidl/plugins/raw_container.proto | 37 + 12 files changed, 2691 insertions(+) create mode 100644 flyteidl/gen/pb-cpp/flyteidl/plugins/raw_container.grpc.pb.cc create mode 100644 flyteidl/gen/pb-cpp/flyteidl/plugins/raw_container.grpc.pb.h create mode 100644 flyteidl/gen/pb-cpp/flyteidl/plugins/raw_container.pb.cc create mode 100644 flyteidl/gen/pb-cpp/flyteidl/plugins/raw_container.pb.h create mode 100644 flyteidl/gen/pb-go/flyteidl/plugins/raw_container.pb.go create mode 100644 flyteidl/gen/pb-go/flyteidl/plugins/raw_container.pb.validate.go create mode 100644 flyteidl/gen/pb-java/flyteidl/plugins/RawContainer.java create mode 100644 flyteidl/gen/pb-protodoc/flyteidl/plugins/raw_container.proto.rst create mode 100644 flyteidl/gen/pb_python/flyteidl/plugins/raw_container_pb2.py create mode 100644 flyteidl/gen/pb_python/flyteidl/plugins/raw_container_pb2_grpc.py create mode 100644 flyteidl/protos/flyteidl/plugins/raw_container.proto diff --git a/flyteidl/gen/pb-cpp/flyteidl/plugins/raw_container.grpc.pb.cc b/flyteidl/gen/pb-cpp/flyteidl/plugins/raw_container.grpc.pb.cc new file mode 100644 index 00000000000..2e55fdbf439 --- /dev/null +++ b/flyteidl/gen/pb-cpp/flyteidl/plugins/raw_container.grpc.pb.cc @@ -0,0 +1,24 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: flyteidl/plugins/raw_container.proto + +#include "flyteidl/plugins/raw_container.pb.h" +#include "flyteidl/plugins/raw_container.grpc.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +namespace flyteidl { +namespace plugins { + +} // namespace flyteidl +} // namespace plugins + diff --git a/flyteidl/gen/pb-cpp/flyteidl/plugins/raw_container.grpc.pb.h b/flyteidl/gen/pb-cpp/flyteidl/plugins/raw_container.grpc.pb.h new file mode 100644 index 00000000000..a05acdbe9bc --- /dev/null +++ b/flyteidl/gen/pb-cpp/flyteidl/plugins/raw_container.grpc.pb.h @@ -0,0 +1,47 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: flyteidl/plugins/raw_container.proto +#ifndef GRPC_flyteidl_2fplugins_2fraw_5fcontainer_2eproto__INCLUDED +#define GRPC_flyteidl_2fplugins_2fraw_5fcontainer_2eproto__INCLUDED + +#include "flyteidl/plugins/raw_container.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 plugins +} // namespace flyteidl + + +#endif // GRPC_flyteidl_2fplugins_2fraw_5fcontainer_2eproto__INCLUDED diff --git a/flyteidl/gen/pb-cpp/flyteidl/plugins/raw_container.pb.cc b/flyteidl/gen/pb-cpp/flyteidl/plugins/raw_container.pb.cc new file mode 100644 index 00000000000..ccd48fefe0b --- /dev/null +++ b/flyteidl/gen/pb-cpp/flyteidl/plugins/raw_container.pb.cc @@ -0,0 +1,553 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/raw_container.proto + +#include "flyteidl/plugins/raw_container.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +namespace flyteidl { +namespace plugins { +class CoPilotDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _CoPilot_default_instance_; +} // namespace plugins +} // namespace flyteidl +static void InitDefaultsCoPilot_flyteidl_2fplugins_2fraw_5fcontainer_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::flyteidl::plugins::_CoPilot_default_instance_; + new (ptr) ::flyteidl::plugins::CoPilot(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::flyteidl::plugins::CoPilot::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_CoPilot_flyteidl_2fplugins_2fraw_5fcontainer_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsCoPilot_flyteidl_2fplugins_2fraw_5fcontainer_2eproto}, {}}; + +void InitDefaults_flyteidl_2fplugins_2fraw_5fcontainer_2eproto() { + ::google::protobuf::internal::InitSCC(&scc_info_CoPilot_flyteidl_2fplugins_2fraw_5fcontainer_2eproto.base); +} + +::google::protobuf::Metadata file_level_metadata_flyteidl_2fplugins_2fraw_5fcontainer_2eproto[1]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors_flyteidl_2fplugins_2fraw_5fcontainer_2eproto[1]; +constexpr ::google::protobuf::ServiceDescriptor const** file_level_service_descriptors_flyteidl_2fplugins_2fraw_5fcontainer_2eproto = nullptr; + +const ::google::protobuf::uint32 TableStruct_flyteidl_2fplugins_2fraw_5fcontainer_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::CoPilot, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::CoPilot, input_path_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::CoPilot, output_path_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::CoPilot, format_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::flyteidl::plugins::CoPilot)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::flyteidl::plugins::_CoPilot_default_instance_), +}; + +::google::protobuf::internal::AssignDescriptorsTable assign_descriptors_table_flyteidl_2fplugins_2fraw_5fcontainer_2eproto = { + {}, AddDescriptors_flyteidl_2fplugins_2fraw_5fcontainer_2eproto, "flyteidl/plugins/raw_container.proto", schemas, + file_default_instances, TableStruct_flyteidl_2fplugins_2fraw_5fcontainer_2eproto::offsets, + file_level_metadata_flyteidl_2fplugins_2fraw_5fcontainer_2eproto, 1, file_level_enum_descriptors_flyteidl_2fplugins_2fraw_5fcontainer_2eproto, file_level_service_descriptors_flyteidl_2fplugins_2fraw_5fcontainer_2eproto, +}; + +const char descriptor_table_protodef_flyteidl_2fplugins_2fraw_5fcontainer_2eproto[] = + "\n$flyteidl/plugins/raw_container.proto\022\020" + "flyteidl.plugins\"\235\001\n\007CoPilot\022\022\n\ninput_pa" + "th\030\001 \001(\t\022\023\n\013output_path\030\002 \001(\t\0228\n\006format\030" + "\003 \001(\0162(.flyteidl.plugins.CoPilot.Metadat" + "aFormat\"/\n\016MetadataFormat\022\010\n\004JSON\020\000\022\010\n\004Y" + "AML\020\001\022\t\n\005PROTO\020\002B5Z3github.com/lyft/flyt" + "eidl/gen/pb-go/flyteidl/pluginsb\006proto3" + ; +::google::protobuf::internal::DescriptorTable descriptor_table_flyteidl_2fplugins_2fraw_5fcontainer_2eproto = { + false, InitDefaults_flyteidl_2fplugins_2fraw_5fcontainer_2eproto, + descriptor_table_protodef_flyteidl_2fplugins_2fraw_5fcontainer_2eproto, + "flyteidl/plugins/raw_container.proto", &assign_descriptors_table_flyteidl_2fplugins_2fraw_5fcontainer_2eproto, 279, +}; + +void AddDescriptors_flyteidl_2fplugins_2fraw_5fcontainer_2eproto() { + static constexpr ::google::protobuf::internal::InitFunc deps[1] = + { + }; + ::google::protobuf::internal::AddDescriptors(&descriptor_table_flyteidl_2fplugins_2fraw_5fcontainer_2eproto, deps, 0); +} + +// Force running AddDescriptors() at dynamic initialization time. +static bool dynamic_init_dummy_flyteidl_2fplugins_2fraw_5fcontainer_2eproto = []() { AddDescriptors_flyteidl_2fplugins_2fraw_5fcontainer_2eproto(); return true; }(); +namespace flyteidl { +namespace plugins { +const ::google::protobuf::EnumDescriptor* CoPilot_MetadataFormat_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&assign_descriptors_table_flyteidl_2fplugins_2fraw_5fcontainer_2eproto); + return file_level_enum_descriptors_flyteidl_2fplugins_2fraw_5fcontainer_2eproto[0]; +} +bool CoPilot_MetadataFormat_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const CoPilot_MetadataFormat CoPilot::JSON; +const CoPilot_MetadataFormat CoPilot::YAML; +const CoPilot_MetadataFormat CoPilot::PROTO; +const CoPilot_MetadataFormat CoPilot::MetadataFormat_MIN; +const CoPilot_MetadataFormat CoPilot::MetadataFormat_MAX; +const int CoPilot::MetadataFormat_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +// =================================================================== + +void CoPilot::InitAsDefaultInstance() { +} +class CoPilot::HasBitSetters { + public: +}; + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int CoPilot::kInputPathFieldNumber; +const int CoPilot::kOutputPathFieldNumber; +const int CoPilot::kFormatFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +CoPilot::CoPilot() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:flyteidl.plugins.CoPilot) +} +CoPilot::CoPilot(const CoPilot& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + input_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.input_path().size() > 0) { + input_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.input_path_); + } + output_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.output_path().size() > 0) { + output_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_path_); + } + format_ = from.format_; + // @@protoc_insertion_point(copy_constructor:flyteidl.plugins.CoPilot) +} + +void CoPilot::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_CoPilot_flyteidl_2fplugins_2fraw_5fcontainer_2eproto.base); + input_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + output_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + format_ = 0; +} + +CoPilot::~CoPilot() { + // @@protoc_insertion_point(destructor:flyteidl.plugins.CoPilot) + SharedDtor(); +} + +void CoPilot::SharedDtor() { + input_path_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + output_path_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void CoPilot::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const CoPilot& CoPilot::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_CoPilot_flyteidl_2fplugins_2fraw_5fcontainer_2eproto.base); + return *internal_default_instance(); +} + + +void CoPilot::Clear() { +// @@protoc_insertion_point(message_clear_start:flyteidl.plugins.CoPilot) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + input_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + output_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + format_ = 0; + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* CoPilot::_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 input_path = 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.CoPilot.input_path"); + object = msg->mutable_input_path(); + 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; + } + // string output_path = 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.CoPilot.output_path"); + object = msg->mutable_output_path(); + 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.plugins.CoPilot.MetadataFormat format = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) != 24) goto handle_unusual; + ::google::protobuf::uint64 val = ::google::protobuf::internal::ReadVarint(&ptr); + msg->set_format(static_cast<::flyteidl::plugins::CoPilot_MetadataFormat>(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 CoPilot::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.CoPilot) + 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 input_path = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_input_path())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->input_path().data(), static_cast(this->input_path().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "flyteidl.plugins.CoPilot.input_path")); + } else { + goto handle_unusual; + } + break; + } + + // string output_path = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_output_path())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->output_path().data(), static_cast(this->output_path().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "flyteidl.plugins.CoPilot.output_path")); + } else { + goto handle_unusual; + } + break; + } + + // .flyteidl.plugins.CoPilot.MetadataFormat format = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == (24 & 0xFF)) { + int value = 0; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_format(static_cast< ::flyteidl::plugins::CoPilot_MetadataFormat >(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.CoPilot) + return true; +failure: + // @@protoc_insertion_point(parse_failure:flyteidl.plugins.CoPilot) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void CoPilot::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:flyteidl.plugins.CoPilot) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string input_path = 1; + if (this->input_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->input_path().data(), static_cast(this->input_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "flyteidl.plugins.CoPilot.input_path"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->input_path(), output); + } + + // string output_path = 2; + if (this->output_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->output_path().data(), static_cast(this->output_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "flyteidl.plugins.CoPilot.output_path"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->output_path(), output); + } + + // .flyteidl.plugins.CoPilot.MetadataFormat format = 3; + if (this->format() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 3, this->format(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:flyteidl.plugins.CoPilot) +} + +::google::protobuf::uint8* CoPilot::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:flyteidl.plugins.CoPilot) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string input_path = 1; + if (this->input_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->input_path().data(), static_cast(this->input_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "flyteidl.plugins.CoPilot.input_path"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->input_path(), target); + } + + // string output_path = 2; + if (this->output_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->output_path().data(), static_cast(this->output_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "flyteidl.plugins.CoPilot.output_path"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->output_path(), target); + } + + // .flyteidl.plugins.CoPilot.MetadataFormat format = 3; + if (this->format() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 3, this->format(), 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.CoPilot) + return target; +} + +size_t CoPilot::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:flyteidl.plugins.CoPilot) + 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 input_path = 1; + if (this->input_path().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->input_path()); + } + + // string output_path = 2; + if (this->output_path().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->output_path()); + } + + // .flyteidl.plugins.CoPilot.MetadataFormat format = 3; + if (this->format() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->format()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void CoPilot::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:flyteidl.plugins.CoPilot) + GOOGLE_DCHECK_NE(&from, this); + const CoPilot* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:flyteidl.plugins.CoPilot) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:flyteidl.plugins.CoPilot) + MergeFrom(*source); + } +} + +void CoPilot::MergeFrom(const CoPilot& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:flyteidl.plugins.CoPilot) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.input_path().size() > 0) { + + input_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.input_path_); + } + if (from.output_path().size() > 0) { + + output_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_path_); + } + if (from.format() != 0) { + set_format(from.format()); + } +} + +void CoPilot::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:flyteidl.plugins.CoPilot) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CoPilot::CopyFrom(const CoPilot& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:flyteidl.plugins.CoPilot) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CoPilot::IsInitialized() const { + return true; +} + +void CoPilot::Swap(CoPilot* other) { + if (other == this) return; + InternalSwap(other); +} +void CoPilot::InternalSwap(CoPilot* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + input_path_.Swap(&other->input_path_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + output_path_.Swap(&other->output_path_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(format_, other->format_); +} + +::google::protobuf::Metadata CoPilot::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_flyteidl_2fplugins_2fraw_5fcontainer_2eproto); + return ::file_level_metadata_flyteidl_2fplugins_2fraw_5fcontainer_2eproto[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace plugins +} // namespace flyteidl +namespace google { +namespace protobuf { +template<> PROTOBUF_NOINLINE ::flyteidl::plugins::CoPilot* Arena::CreateMaybeMessage< ::flyteidl::plugins::CoPilot >(Arena* arena) { + return Arena::CreateInternal< ::flyteidl::plugins::CoPilot >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) +#include diff --git a/flyteidl/gen/pb-cpp/flyteidl/plugins/raw_container.pb.h b/flyteidl/gen/pb-cpp/flyteidl/plugins/raw_container.pb.h new file mode 100644 index 00000000000..c4e3821cd6e --- /dev/null +++ b/flyteidl/gen/pb-cpp/flyteidl/plugins/raw_container.pb.h @@ -0,0 +1,414 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/raw_container.proto + +#ifndef PROTOBUF_INCLUDED_flyteidl_2fplugins_2fraw_5fcontainer_2eproto +#define PROTOBUF_INCLUDED_flyteidl_2fplugins_2fraw_5fcontainer_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_2fraw_5fcontainer_2eproto + +// Internal implementation detail -- do not use these members. +struct TableStruct_flyteidl_2fplugins_2fraw_5fcontainer_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_2fraw_5fcontainer_2eproto(); +namespace flyteidl { +namespace plugins { +class CoPilot; +class CoPilotDefaultTypeInternal; +extern CoPilotDefaultTypeInternal _CoPilot_default_instance_; +} // namespace plugins +} // namespace flyteidl +namespace google { +namespace protobuf { +template<> ::flyteidl::plugins::CoPilot* Arena::CreateMaybeMessage<::flyteidl::plugins::CoPilot>(Arena*); +} // namespace protobuf +} // namespace google +namespace flyteidl { +namespace plugins { + +enum CoPilot_MetadataFormat { + CoPilot_MetadataFormat_JSON = 0, + CoPilot_MetadataFormat_YAML = 1, + CoPilot_MetadataFormat_PROTO = 2, + CoPilot_MetadataFormat_CoPilot_MetadataFormat_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::google::protobuf::int32>::min(), + CoPilot_MetadataFormat_CoPilot_MetadataFormat_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::google::protobuf::int32>::max() +}; +bool CoPilot_MetadataFormat_IsValid(int value); +const CoPilot_MetadataFormat CoPilot_MetadataFormat_MetadataFormat_MIN = CoPilot_MetadataFormat_JSON; +const CoPilot_MetadataFormat CoPilot_MetadataFormat_MetadataFormat_MAX = CoPilot_MetadataFormat_PROTO; +const int CoPilot_MetadataFormat_MetadataFormat_ARRAYSIZE = CoPilot_MetadataFormat_MetadataFormat_MAX + 1; + +const ::google::protobuf::EnumDescriptor* CoPilot_MetadataFormat_descriptor(); +inline const ::std::string& CoPilot_MetadataFormat_Name(CoPilot_MetadataFormat value) { + return ::google::protobuf::internal::NameOfEnum( + CoPilot_MetadataFormat_descriptor(), value); +} +inline bool CoPilot_MetadataFormat_Parse( + const ::std::string& name, CoPilot_MetadataFormat* value) { + return ::google::protobuf::internal::ParseNamedEnum( + CoPilot_MetadataFormat_descriptor(), name, value); +} +// =================================================================== + +class CoPilot final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:flyteidl.plugins.CoPilot) */ { + public: + CoPilot(); + virtual ~CoPilot(); + + CoPilot(const CoPilot& from); + + inline CoPilot& operator=(const CoPilot& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + CoPilot(CoPilot&& from) noexcept + : CoPilot() { + *this = ::std::move(from); + } + + inline CoPilot& operator=(CoPilot&& 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 CoPilot& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const CoPilot* internal_default_instance() { + return reinterpret_cast( + &_CoPilot_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(CoPilot* other); + friend void swap(CoPilot& a, CoPilot& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline CoPilot* New() const final { + return CreateMaybeMessage(nullptr); + } + + CoPilot* 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 CoPilot& from); + void MergeFrom(const CoPilot& 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(CoPilot* 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 ---------------------------------------------------- + + typedef CoPilot_MetadataFormat MetadataFormat; + static const MetadataFormat JSON = + CoPilot_MetadataFormat_JSON; + static const MetadataFormat YAML = + CoPilot_MetadataFormat_YAML; + static const MetadataFormat PROTO = + CoPilot_MetadataFormat_PROTO; + static inline bool MetadataFormat_IsValid(int value) { + return CoPilot_MetadataFormat_IsValid(value); + } + static const MetadataFormat MetadataFormat_MIN = + CoPilot_MetadataFormat_MetadataFormat_MIN; + static const MetadataFormat MetadataFormat_MAX = + CoPilot_MetadataFormat_MetadataFormat_MAX; + static const int MetadataFormat_ARRAYSIZE = + CoPilot_MetadataFormat_MetadataFormat_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + MetadataFormat_descriptor() { + return CoPilot_MetadataFormat_descriptor(); + } + static inline const ::std::string& MetadataFormat_Name(MetadataFormat value) { + return CoPilot_MetadataFormat_Name(value); + } + static inline bool MetadataFormat_Parse(const ::std::string& name, + MetadataFormat* value) { + return CoPilot_MetadataFormat_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // string input_path = 1; + void clear_input_path(); + static const int kInputPathFieldNumber = 1; + const ::std::string& input_path() const; + void set_input_path(const ::std::string& value); + #if LANG_CXX11 + void set_input_path(::std::string&& value); + #endif + void set_input_path(const char* value); + void set_input_path(const char* value, size_t size); + ::std::string* mutable_input_path(); + ::std::string* release_input_path(); + void set_allocated_input_path(::std::string* input_path); + + // string output_path = 2; + void clear_output_path(); + static const int kOutputPathFieldNumber = 2; + const ::std::string& output_path() const; + void set_output_path(const ::std::string& value); + #if LANG_CXX11 + void set_output_path(::std::string&& value); + #endif + void set_output_path(const char* value); + void set_output_path(const char* value, size_t size); + ::std::string* mutable_output_path(); + ::std::string* release_output_path(); + void set_allocated_output_path(::std::string* output_path); + + // .flyteidl.plugins.CoPilot.MetadataFormat format = 3; + void clear_format(); + static const int kFormatFieldNumber = 3; + ::flyteidl::plugins::CoPilot_MetadataFormat format() const; + void set_format(::flyteidl::plugins::CoPilot_MetadataFormat value); + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.CoPilot) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr input_path_; + ::google::protobuf::internal::ArenaStringPtr output_path_; + int format_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_flyteidl_2fplugins_2fraw_5fcontainer_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// CoPilot + +// string input_path = 1; +inline void CoPilot::clear_input_path() { + input_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& CoPilot::input_path() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.CoPilot.input_path) + return input_path_.GetNoArena(); +} +inline void CoPilot::set_input_path(const ::std::string& value) { + + input_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:flyteidl.plugins.CoPilot.input_path) +} +#if LANG_CXX11 +inline void CoPilot::set_input_path(::std::string&& value) { + + input_path_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:flyteidl.plugins.CoPilot.input_path) +} +#endif +inline void CoPilot::set_input_path(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + input_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:flyteidl.plugins.CoPilot.input_path) +} +inline void CoPilot::set_input_path(const char* value, size_t size) { + + input_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:flyteidl.plugins.CoPilot.input_path) +} +inline ::std::string* CoPilot::mutable_input_path() { + + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.CoPilot.input_path) + return input_path_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* CoPilot::release_input_path() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.CoPilot.input_path) + + return input_path_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void CoPilot::set_allocated_input_path(::std::string* input_path) { + if (input_path != nullptr) { + + } else { + + } + input_path_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), input_path); + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.CoPilot.input_path) +} + +// string output_path = 2; +inline void CoPilot::clear_output_path() { + output_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& CoPilot::output_path() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.CoPilot.output_path) + return output_path_.GetNoArena(); +} +inline void CoPilot::set_output_path(const ::std::string& value) { + + output_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:flyteidl.plugins.CoPilot.output_path) +} +#if LANG_CXX11 +inline void CoPilot::set_output_path(::std::string&& value) { + + output_path_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:flyteidl.plugins.CoPilot.output_path) +} +#endif +inline void CoPilot::set_output_path(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + output_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:flyteidl.plugins.CoPilot.output_path) +} +inline void CoPilot::set_output_path(const char* value, size_t size) { + + output_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:flyteidl.plugins.CoPilot.output_path) +} +inline ::std::string* CoPilot::mutable_output_path() { + + // @@protoc_insertion_point(field_mutable:flyteidl.plugins.CoPilot.output_path) + return output_path_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* CoPilot::release_output_path() { + // @@protoc_insertion_point(field_release:flyteidl.plugins.CoPilot.output_path) + + return output_path_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void CoPilot::set_allocated_output_path(::std::string* output_path) { + if (output_path != nullptr) { + + } else { + + } + output_path_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_path); + // @@protoc_insertion_point(field_set_allocated:flyteidl.plugins.CoPilot.output_path) +} + +// .flyteidl.plugins.CoPilot.MetadataFormat format = 3; +inline void CoPilot::clear_format() { + format_ = 0; +} +inline ::flyteidl::plugins::CoPilot_MetadataFormat CoPilot::format() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.CoPilot.format) + return static_cast< ::flyteidl::plugins::CoPilot_MetadataFormat >(format_); +} +inline void CoPilot::set_format(::flyteidl::plugins::CoPilot_MetadataFormat value) { + + format_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.CoPilot.format) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace plugins +} // namespace flyteidl + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::flyteidl::plugins::CoPilot_MetadataFormat> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::flyteidl::plugins::CoPilot_MetadataFormat>() { + return ::flyteidl::plugins::CoPilot_MetadataFormat_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#include +#endif // PROTOBUF_INCLUDED_flyteidl_2fplugins_2fraw_5fcontainer_2eproto diff --git a/flyteidl/gen/pb-go/flyteidl/plugins/raw_container.pb.go b/flyteidl/gen/pb-go/flyteidl/plugins/raw_container.pb.go new file mode 100644 index 00000000000..14c1bcf67ae --- /dev/null +++ b/flyteidl/gen/pb-go/flyteidl/plugins/raw_container.pb.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: flyteidl/plugins/raw_container.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 + +// MetadataFormat decides the encoding format in which the input metadata should be made available to the containers. +// If the user has access to the protocol buffer definitions, it is recommended to use the PROTO format. +// JSON and YAML do not need any protobuf definitions to read it +// All remote references in core.LiteralMap are replaced with local filesystem references (the data is downloaded to local filesystem) +type CoPilot_MetadataFormat int32 + +const ( + // JSON / YAML are serialized represnetation of a map[string]primitive. primitive -> int, string, bool, double/float, bytes + CoPilot_JSON CoPilot_MetadataFormat = 0 + CoPilot_YAML CoPilot_MetadataFormat = 1 + // Proto is a serialized binary of `core.LiteralMap` defined in flyteidl/core + CoPilot_PROTO CoPilot_MetadataFormat = 2 +) + +var CoPilot_MetadataFormat_name = map[int32]string{ + 0: "JSON", + 1: "YAML", + 2: "PROTO", +} + +var CoPilot_MetadataFormat_value = map[string]int32{ + "JSON": 0, + "YAML": 1, + "PROTO": 2, +} + +func (x CoPilot_MetadataFormat) String() string { + return proto.EnumName(CoPilot_MetadataFormat_name, int32(x)) +} + +func (CoPilot_MetadataFormat) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_aa9a2ab24b00eebe, []int{0, 0} +} + +// This configuration allows executing raw containers in Flyte using the Flyte CoPilot system. +// Flyte CoPilot, eliminates the needs of flytekit or sdk inside the container. Any inputs required by the users container are side-loaded in the input_path +// Any outputs generated by the user container - within output_path are automatically uploaded. +// We are starting this as a plugin, but after the container within Pod ordering stabilizes, we can move this +// into the default task definition. +type CoPilot struct { + // File system path (start at root). This folder will contain all the inputs exploded to a separate file. + // Example, if the input interface needs (x: int, y: blob, z: multipart_blob) and the input path is "/var/flyte/inputs", then the file system will look like + // /var/flyte/inputs/inputs. .pb .json .yaml> -> Format as defined previously. The Blob and Multipart blob will reference local filesystem instead of remote locations + // /var/flyte/inputs/x -> X is a file that contains the value of x (integer) in string format + // /var/flyte/inputs/y -> Y is a file in Binary format + // /var/flyte/inputs/z/... -> Note Z itself is a directory + // More information about the protocol - refer to docs #TODO reference docs here + InputPath string `protobuf:"bytes,1,opt,name=input_path,json=inputPath,proto3" json:"input_path,omitempty"` + // File system path (start at root). This folder should contain all the outputs for the task as individual files and/or an error text file + OutputPath string `protobuf:"bytes,2,opt,name=output_path,json=outputPath,proto3" json:"output_path,omitempty"` + // In the inputs folder, there will be an additional summary/metadata file that contains references to all files or inlined primitive values. + // This format decides the actual encoding for the data. Refer to the encoding to understand the specifics of the contents and the encoding + Format CoPilot_MetadataFormat `protobuf:"varint,3,opt,name=format,proto3,enum=flyteidl.plugins.CoPilot_MetadataFormat" json:"format,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CoPilot) Reset() { *m = CoPilot{} } +func (m *CoPilot) String() string { return proto.CompactTextString(m) } +func (*CoPilot) ProtoMessage() {} +func (*CoPilot) Descriptor() ([]byte, []int) { + return fileDescriptor_aa9a2ab24b00eebe, []int{0} +} + +func (m *CoPilot) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CoPilot.Unmarshal(m, b) +} +func (m *CoPilot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CoPilot.Marshal(b, m, deterministic) +} +func (m *CoPilot) XXX_Merge(src proto.Message) { + xxx_messageInfo_CoPilot.Merge(m, src) +} +func (m *CoPilot) XXX_Size() int { + return xxx_messageInfo_CoPilot.Size(m) +} +func (m *CoPilot) XXX_DiscardUnknown() { + xxx_messageInfo_CoPilot.DiscardUnknown(m) +} + +var xxx_messageInfo_CoPilot proto.InternalMessageInfo + +func (m *CoPilot) GetInputPath() string { + if m != nil { + return m.InputPath + } + return "" +} + +func (m *CoPilot) GetOutputPath() string { + if m != nil { + return m.OutputPath + } + return "" +} + +func (m *CoPilot) GetFormat() CoPilot_MetadataFormat { + if m != nil { + return m.Format + } + return CoPilot_JSON +} + +func init() { + proto.RegisterEnum("flyteidl.plugins.CoPilot_MetadataFormat", CoPilot_MetadataFormat_name, CoPilot_MetadataFormat_value) + proto.RegisterType((*CoPilot)(nil), "flyteidl.plugins.CoPilot") +} + +func init() { + proto.RegisterFile("flyteidl/plugins/raw_container.proto", fileDescriptor_aa9a2ab24b00eebe) +} + +var fileDescriptor_aa9a2ab24b00eebe = []byte{ + // 239 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0x4d, 0x4b, 0xc3, 0x40, + 0x10, 0x86, 0xdd, 0xaa, 0xd5, 0x8c, 0x50, 0xc2, 0x9e, 0x7a, 0x11, 0x4b, 0xf1, 0x90, 0x8b, 0xbb, + 0x60, 0xf1, 0xee, 0x07, 0x78, 0x10, 0x6b, 0x42, 0xf4, 0xa2, 0x97, 0x32, 0x69, 0xf3, 0xb1, 0xb0, + 0xdd, 0x59, 0xe2, 0x04, 0xe9, 0x7f, 0xf3, 0xc7, 0x89, 0x6b, 0x2c, 0xb4, 0xb7, 0xe1, 0x7d, 0x9f, + 0xe1, 0x85, 0x07, 0x2e, 0x2b, 0xbb, 0xe1, 0xd2, 0xac, 0xac, 0xf6, 0xb6, 0xab, 0x8d, 0xfb, 0xd4, + 0x2d, 0x7e, 0x2d, 0x96, 0xe4, 0x18, 0x8d, 0x2b, 0x5b, 0xe5, 0x5b, 0x62, 0x92, 0xf1, 0x3f, 0xa5, + 0x7a, 0x6a, 0xfa, 0x2d, 0xe0, 0xe4, 0x81, 0x32, 0x63, 0x89, 0xe5, 0x39, 0x80, 0x71, 0xbe, 0xe3, + 0x85, 0x47, 0x6e, 0xc6, 0x62, 0x22, 0x92, 0x28, 0x8f, 0x42, 0x92, 0x21, 0x37, 0xf2, 0x02, 0xce, + 0xa8, 0xe3, 0x6d, 0x3f, 0x08, 0x3d, 0xfc, 0x45, 0x01, 0xb8, 0x85, 0x61, 0x45, 0xed, 0x1a, 0x79, + 0x7c, 0x38, 0x11, 0xc9, 0xe8, 0x3a, 0x51, 0xfb, 0x73, 0xaa, 0x9f, 0x52, 0xf3, 0x92, 0x71, 0x85, + 0x8c, 0x8f, 0x81, 0xcf, 0xfb, 0xbf, 0xa9, 0x86, 0xd1, 0x6e, 0x23, 0x4f, 0xe1, 0xe8, 0xe9, 0x35, + 0x7d, 0x89, 0x0f, 0x7e, 0xaf, 0xf7, 0xbb, 0xf9, 0x73, 0x2c, 0x64, 0x04, 0xc7, 0x59, 0x9e, 0xbe, + 0xa5, 0xf1, 0xe0, 0xfe, 0xe6, 0x63, 0x56, 0x1b, 0x6e, 0xba, 0x42, 0x2d, 0x69, 0xad, 0xed, 0xa6, + 0x62, 0xbd, 0x15, 0x51, 0x97, 0x4e, 0xfb, 0xe2, 0xaa, 0x26, 0xbd, 0xef, 0xa6, 0x18, 0x06, 0x1d, + 0xb3, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x35, 0x39, 0x82, 0xa5, 0x36, 0x01, 0x00, 0x00, +} diff --git a/flyteidl/gen/pb-go/flyteidl/plugins/raw_container.pb.validate.go b/flyteidl/gen/pb-go/flyteidl/plugins/raw_container.pb.validate.go new file mode 100644 index 00000000000..b164c64d9a2 --- /dev/null +++ b/flyteidl/gen/pb-go/flyteidl/plugins/raw_container.pb.validate.go @@ -0,0 +1,107 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: flyteidl/plugins/raw_container.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 _raw_container_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 CoPilot with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *CoPilot) Validate() error { + if m == nil { + return nil + } + + // no validation rules for InputPath + + // no validation rules for OutputPath + + // no validation rules for Format + + return nil +} + +// CoPilotValidationError is the validation error returned by CoPilot.Validate +// if the designated constraints aren't met. +type CoPilotValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CoPilotValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CoPilotValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CoPilotValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CoPilotValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CoPilotValidationError) ErrorName() string { return "CoPilotValidationError" } + +// Error satisfies the builtin error interface +func (e CoPilotValidationError) 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 %sCoPilot.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CoPilotValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CoPilotValidationError{} diff --git a/flyteidl/gen/pb-java/flyteidl/plugins/RawContainer.java b/flyteidl/gen/pb-java/flyteidl/plugins/RawContainer.java new file mode 100644 index 00000000000..c8e4a6ee4d1 --- /dev/null +++ b/flyteidl/gen/pb-java/flyteidl/plugins/RawContainer.java @@ -0,0 +1,1157 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/raw_container.proto + +package flyteidl.plugins; + +public final class RawContainer { + private RawContainer() {} + 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 CoPilotOrBuilder extends + // @@protoc_insertion_point(interface_extends:flyteidl.plugins.CoPilot) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * File system path (start at root). This folder will contain all the inputs exploded to a separate file. 
+     * Example, if the input interface needs (x: int, y: blob, z: multipart_blob) and the input path is "/var/flyte/inputs", then the file system will look like
+     * /var/flyte/inputs/inputs.<metadata format dependent -> .pb .json .yaml> -> Format as defined previously. The Blob and Multipart blob will reference local filesystem instead of remote locations 
+     * /var/flyte/inputs/x -> X is a file that contains the value of x (integer) in string format
+     * /var/flyte/inputs/y -> Y is a file in Binary format
+     * /var/flyte/inputs/z/... -> Note Z itself is a directory
+     * More information about the protocol - refer to docs #TODO reference docs here
+     * 
+ * + * string input_path = 1; + */ + java.lang.String getInputPath(); + /** + *
+     * File system path (start at root). This folder will contain all the inputs exploded to a separate file. 
+     * Example, if the input interface needs (x: int, y: blob, z: multipart_blob) and the input path is "/var/flyte/inputs", then the file system will look like
+     * /var/flyte/inputs/inputs.<metadata format dependent -> .pb .json .yaml> -> Format as defined previously. The Blob and Multipart blob will reference local filesystem instead of remote locations 
+     * /var/flyte/inputs/x -> X is a file that contains the value of x (integer) in string format
+     * /var/flyte/inputs/y -> Y is a file in Binary format
+     * /var/flyte/inputs/z/... -> Note Z itself is a directory
+     * More information about the protocol - refer to docs #TODO reference docs here
+     * 
+ * + * string input_path = 1; + */ + com.google.protobuf.ByteString + getInputPathBytes(); + + /** + *
+     * File system path (start at root). This folder should contain all the outputs for the task as individual files and/or an error text file
+     * 
+ * + * string output_path = 2; + */ + java.lang.String getOutputPath(); + /** + *
+     * File system path (start at root). This folder should contain all the outputs for the task as individual files and/or an error text file
+     * 
+ * + * string output_path = 2; + */ + com.google.protobuf.ByteString + getOutputPathBytes(); + + /** + *
+     * In the inputs folder, there will be an additional summary/metadata file that contains references to all files or inlined primitive values.
+     * This format decides the actual encoding for the data. Refer to the encoding to understand the specifics of the contents and the encoding
+     * 
+ * + * .flyteidl.plugins.CoPilot.MetadataFormat format = 3; + */ + int getFormatValue(); + /** + *
+     * In the inputs folder, there will be an additional summary/metadata file that contains references to all files or inlined primitive values.
+     * This format decides the actual encoding for the data. Refer to the encoding to understand the specifics of the contents and the encoding
+     * 
+ * + * .flyteidl.plugins.CoPilot.MetadataFormat format = 3; + */ + flyteidl.plugins.RawContainer.CoPilot.MetadataFormat getFormat(); + } + /** + *
+   * This configuration allows executing raw containers in Flyte using the Flyte CoPilot system.
+   * Flyte CoPilot, eliminates the needs of flytekit or sdk inside the container. Any inputs required by the users container are side-loaded in the input_path
+   * Any outputs generated by the user container - within output_path are automatically uploaded.
+   * We are starting this as a plugin, but after the container within Pod ordering stabilizes, we can move this
+   * into the default task definition.
+   * 
+ * + * Protobuf type {@code flyteidl.plugins.CoPilot} + */ + public static final class CoPilot extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:flyteidl.plugins.CoPilot) + CoPilotOrBuilder { + private static final long serialVersionUID = 0L; + // Use CoPilot.newBuilder() to construct. + private CoPilot(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CoPilot() { + inputPath_ = ""; + outputPath_ = ""; + format_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CoPilot( + 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(); + + inputPath_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + outputPath_ = s; + break; + } + case 24: { + int rawValue = input.readEnum(); + + format_ = 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.RawContainer.internal_static_flyteidl_plugins_CoPilot_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.RawContainer.internal_static_flyteidl_plugins_CoPilot_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.RawContainer.CoPilot.class, flyteidl.plugins.RawContainer.CoPilot.Builder.class); + } + + /** + *
+     * MetadataFormat decides the encoding format in which the input metadata should be made available to the containers. 
+     * If the user has access to the protocol buffer definitions, it is recommended to use the PROTO format.
+     * JSON and YAML do not need any protobuf definitions to read it
+     * All remote references in core.LiteralMap are replaced with local filesystem references (the data is downloaded to local filesystem)
+     * 
+ * + * Protobuf enum {@code flyteidl.plugins.CoPilot.MetadataFormat} + */ + public enum MetadataFormat + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+       * JSON / YAML are serialized represnetation of a map[string]primitive. primitive -> int, string, bool, double/float, bytes
+       * 
+ * + * JSON = 0; + */ + JSON(0), + /** + * YAML = 1; + */ + YAML(1), + /** + *
+       * Proto is a serialized binary of `core.LiteralMap` defined in flyteidl/core
+       * 
+ * + * PROTO = 2; + */ + PROTO(2), + UNRECOGNIZED(-1), + ; + + /** + *
+       * JSON / YAML are serialized represnetation of a map[string]primitive. primitive -> int, string, bool, double/float, bytes
+       * 
+ * + * JSON = 0; + */ + public static final int JSON_VALUE = 0; + /** + * YAML = 1; + */ + public static final int YAML_VALUE = 1; + /** + *
+       * Proto is a serialized binary of `core.LiteralMap` defined in flyteidl/core
+       * 
+ * + * PROTO = 2; + */ + public static final int PROTO_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 MetadataFormat valueOf(int value) { + return forNumber(value); + } + + public static MetadataFormat forNumber(int value) { + switch (value) { + case 0: return JSON; + case 1: return YAML; + case 2: return PROTO; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + MetadataFormat> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public MetadataFormat findValueByNumber(int number) { + return MetadataFormat.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.RawContainer.CoPilot.getDescriptor().getEnumTypes().get(0); + } + + private static final MetadataFormat[] VALUES = values(); + + public static MetadataFormat 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 MetadataFormat(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:flyteidl.plugins.CoPilot.MetadataFormat) + } + + public static final int INPUT_PATH_FIELD_NUMBER = 1; + private volatile java.lang.Object inputPath_; + /** + *
+     * File system path (start at root). This folder will contain all the inputs exploded to a separate file. 
+     * Example, if the input interface needs (x: int, y: blob, z: multipart_blob) and the input path is "/var/flyte/inputs", then the file system will look like
+     * /var/flyte/inputs/inputs.<metadata format dependent -> .pb .json .yaml> -> Format as defined previously. The Blob and Multipart blob will reference local filesystem instead of remote locations 
+     * /var/flyte/inputs/x -> X is a file that contains the value of x (integer) in string format
+     * /var/flyte/inputs/y -> Y is a file in Binary format
+     * /var/flyte/inputs/z/... -> Note Z itself is a directory
+     * More information about the protocol - refer to docs #TODO reference docs here
+     * 
+ * + * string input_path = 1; + */ + public java.lang.String getInputPath() { + java.lang.Object ref = inputPath_; + 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(); + inputPath_ = s; + return s; + } + } + /** + *
+     * File system path (start at root). This folder will contain all the inputs exploded to a separate file. 
+     * Example, if the input interface needs (x: int, y: blob, z: multipart_blob) and the input path is "/var/flyte/inputs", then the file system will look like
+     * /var/flyte/inputs/inputs.<metadata format dependent -> .pb .json .yaml> -> Format as defined previously. The Blob and Multipart blob will reference local filesystem instead of remote locations 
+     * /var/flyte/inputs/x -> X is a file that contains the value of x (integer) in string format
+     * /var/flyte/inputs/y -> Y is a file in Binary format
+     * /var/flyte/inputs/z/... -> Note Z itself is a directory
+     * More information about the protocol - refer to docs #TODO reference docs here
+     * 
+ * + * string input_path = 1; + */ + public com.google.protobuf.ByteString + getInputPathBytes() { + java.lang.Object ref = inputPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + inputPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OUTPUT_PATH_FIELD_NUMBER = 2; + private volatile java.lang.Object outputPath_; + /** + *
+     * File system path (start at root). This folder should contain all the outputs for the task as individual files and/or an error text file
+     * 
+ * + * string output_path = 2; + */ + public java.lang.String getOutputPath() { + java.lang.Object ref = outputPath_; + 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(); + outputPath_ = s; + return s; + } + } + /** + *
+     * File system path (start at root). This folder should contain all the outputs for the task as individual files and/or an error text file
+     * 
+ * + * string output_path = 2; + */ + public com.google.protobuf.ByteString + getOutputPathBytes() { + java.lang.Object ref = outputPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + outputPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORMAT_FIELD_NUMBER = 3; + private int format_; + /** + *
+     * In the inputs folder, there will be an additional summary/metadata file that contains references to all files or inlined primitive values.
+     * This format decides the actual encoding for the data. Refer to the encoding to understand the specifics of the contents and the encoding
+     * 
+ * + * .flyteidl.plugins.CoPilot.MetadataFormat format = 3; + */ + public int getFormatValue() { + return format_; + } + /** + *
+     * In the inputs folder, there will be an additional summary/metadata file that contains references to all files or inlined primitive values.
+     * This format decides the actual encoding for the data. Refer to the encoding to understand the specifics of the contents and the encoding
+     * 
+ * + * .flyteidl.plugins.CoPilot.MetadataFormat format = 3; + */ + public flyteidl.plugins.RawContainer.CoPilot.MetadataFormat getFormat() { + @SuppressWarnings("deprecation") + flyteidl.plugins.RawContainer.CoPilot.MetadataFormat result = flyteidl.plugins.RawContainer.CoPilot.MetadataFormat.valueOf(format_); + return result == null ? flyteidl.plugins.RawContainer.CoPilot.MetadataFormat.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 (!getInputPathBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, inputPath_); + } + if (!getOutputPathBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, outputPath_); + } + if (format_ != flyteidl.plugins.RawContainer.CoPilot.MetadataFormat.JSON.getNumber()) { + output.writeEnum(3, format_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getInputPathBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, inputPath_); + } + if (!getOutputPathBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, outputPath_); + } + if (format_ != flyteidl.plugins.RawContainer.CoPilot.MetadataFormat.JSON.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, format_); + } + 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.RawContainer.CoPilot)) { + return super.equals(obj); + } + flyteidl.plugins.RawContainer.CoPilot other = (flyteidl.plugins.RawContainer.CoPilot) obj; + + if (!getInputPath() + .equals(other.getInputPath())) return false; + if (!getOutputPath() + .equals(other.getOutputPath())) return false; + if (format_ != other.format_) 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) + INPUT_PATH_FIELD_NUMBER; + hash = (53 * hash) + getInputPath().hashCode(); + hash = (37 * hash) + OUTPUT_PATH_FIELD_NUMBER; + hash = (53 * hash) + getOutputPath().hashCode(); + hash = (37 * hash) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + format_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static flyteidl.plugins.RawContainer.CoPilot parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.RawContainer.CoPilot parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.RawContainer.CoPilot parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.RawContainer.CoPilot 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.RawContainer.CoPilot parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.RawContainer.CoPilot parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.RawContainer.CoPilot parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.RawContainer.CoPilot 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.RawContainer.CoPilot parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static flyteidl.plugins.RawContainer.CoPilot 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.RawContainer.CoPilot parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.RawContainer.CoPilot 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.RawContainer.CoPilot 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; + } + /** + *
+     * This configuration allows executing raw containers in Flyte using the Flyte CoPilot system.
+     * Flyte CoPilot, eliminates the needs of flytekit or sdk inside the container. Any inputs required by the users container are side-loaded in the input_path
+     * Any outputs generated by the user container - within output_path are automatically uploaded.
+     * We are starting this as a plugin, but after the container within Pod ordering stabilizes, we can move this
+     * into the default task definition.
+     * 
+ * + * Protobuf type {@code flyteidl.plugins.CoPilot} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:flyteidl.plugins.CoPilot) + flyteidl.plugins.RawContainer.CoPilotOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.RawContainer.internal_static_flyteidl_plugins_CoPilot_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.RawContainer.internal_static_flyteidl_plugins_CoPilot_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.RawContainer.CoPilot.class, flyteidl.plugins.RawContainer.CoPilot.Builder.class); + } + + // Construct using flyteidl.plugins.RawContainer.CoPilot.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(); + inputPath_ = ""; + + outputPath_ = ""; + + format_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return flyteidl.plugins.RawContainer.internal_static_flyteidl_plugins_CoPilot_descriptor; + } + + @java.lang.Override + public flyteidl.plugins.RawContainer.CoPilot getDefaultInstanceForType() { + return flyteidl.plugins.RawContainer.CoPilot.getDefaultInstance(); + } + + @java.lang.Override + public flyteidl.plugins.RawContainer.CoPilot build() { + flyteidl.plugins.RawContainer.CoPilot result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public flyteidl.plugins.RawContainer.CoPilot buildPartial() { + flyteidl.plugins.RawContainer.CoPilot result = new flyteidl.plugins.RawContainer.CoPilot(this); + result.inputPath_ = inputPath_; + result.outputPath_ = outputPath_; + result.format_ = format_; + 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.RawContainer.CoPilot) { + return mergeFrom((flyteidl.plugins.RawContainer.CoPilot)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(flyteidl.plugins.RawContainer.CoPilot other) { + if (other == flyteidl.plugins.RawContainer.CoPilot.getDefaultInstance()) return this; + if (!other.getInputPath().isEmpty()) { + inputPath_ = other.inputPath_; + onChanged(); + } + if (!other.getOutputPath().isEmpty()) { + outputPath_ = other.outputPath_; + onChanged(); + } + if (other.format_ != 0) { + setFormatValue(other.getFormatValue()); + } + 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.RawContainer.CoPilot parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (flyteidl.plugins.RawContainer.CoPilot) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object inputPath_ = ""; + /** + *
+       * File system path (start at root). This folder will contain all the inputs exploded to a separate file. 
+       * Example, if the input interface needs (x: int, y: blob, z: multipart_blob) and the input path is "/var/flyte/inputs", then the file system will look like
+       * /var/flyte/inputs/inputs.<metadata format dependent -> .pb .json .yaml> -> Format as defined previously. The Blob and Multipart blob will reference local filesystem instead of remote locations 
+       * /var/flyte/inputs/x -> X is a file that contains the value of x (integer) in string format
+       * /var/flyte/inputs/y -> Y is a file in Binary format
+       * /var/flyte/inputs/z/... -> Note Z itself is a directory
+       * More information about the protocol - refer to docs #TODO reference docs here
+       * 
+ * + * string input_path = 1; + */ + public java.lang.String getInputPath() { + java.lang.Object ref = inputPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + inputPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * File system path (start at root). This folder will contain all the inputs exploded to a separate file. 
+       * Example, if the input interface needs (x: int, y: blob, z: multipart_blob) and the input path is "/var/flyte/inputs", then the file system will look like
+       * /var/flyte/inputs/inputs.<metadata format dependent -> .pb .json .yaml> -> Format as defined previously. The Blob and Multipart blob will reference local filesystem instead of remote locations 
+       * /var/flyte/inputs/x -> X is a file that contains the value of x (integer) in string format
+       * /var/flyte/inputs/y -> Y is a file in Binary format
+       * /var/flyte/inputs/z/... -> Note Z itself is a directory
+       * More information about the protocol - refer to docs #TODO reference docs here
+       * 
+ * + * string input_path = 1; + */ + public com.google.protobuf.ByteString + getInputPathBytes() { + java.lang.Object ref = inputPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + inputPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * File system path (start at root). This folder will contain all the inputs exploded to a separate file. 
+       * Example, if the input interface needs (x: int, y: blob, z: multipart_blob) and the input path is "/var/flyte/inputs", then the file system will look like
+       * /var/flyte/inputs/inputs.<metadata format dependent -> .pb .json .yaml> -> Format as defined previously. The Blob and Multipart blob will reference local filesystem instead of remote locations 
+       * /var/flyte/inputs/x -> X is a file that contains the value of x (integer) in string format
+       * /var/flyte/inputs/y -> Y is a file in Binary format
+       * /var/flyte/inputs/z/... -> Note Z itself is a directory
+       * More information about the protocol - refer to docs #TODO reference docs here
+       * 
+ * + * string input_path = 1; + */ + public Builder setInputPath( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + inputPath_ = value; + onChanged(); + return this; + } + /** + *
+       * File system path (start at root). This folder will contain all the inputs exploded to a separate file. 
+       * Example, if the input interface needs (x: int, y: blob, z: multipart_blob) and the input path is "/var/flyte/inputs", then the file system will look like
+       * /var/flyte/inputs/inputs.<metadata format dependent -> .pb .json .yaml> -> Format as defined previously. The Blob and Multipart blob will reference local filesystem instead of remote locations 
+       * /var/flyte/inputs/x -> X is a file that contains the value of x (integer) in string format
+       * /var/flyte/inputs/y -> Y is a file in Binary format
+       * /var/flyte/inputs/z/... -> Note Z itself is a directory
+       * More information about the protocol - refer to docs #TODO reference docs here
+       * 
+ * + * string input_path = 1; + */ + public Builder clearInputPath() { + + inputPath_ = getDefaultInstance().getInputPath(); + onChanged(); + return this; + } + /** + *
+       * File system path (start at root). This folder will contain all the inputs exploded to a separate file. 
+       * Example, if the input interface needs (x: int, y: blob, z: multipart_blob) and the input path is "/var/flyte/inputs", then the file system will look like
+       * /var/flyte/inputs/inputs.<metadata format dependent -> .pb .json .yaml> -> Format as defined previously. The Blob and Multipart blob will reference local filesystem instead of remote locations 
+       * /var/flyte/inputs/x -> X is a file that contains the value of x (integer) in string format
+       * /var/flyte/inputs/y -> Y is a file in Binary format
+       * /var/flyte/inputs/z/... -> Note Z itself is a directory
+       * More information about the protocol - refer to docs #TODO reference docs here
+       * 
+ * + * string input_path = 1; + */ + public Builder setInputPathBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + inputPath_ = value; + onChanged(); + return this; + } + + private java.lang.Object outputPath_ = ""; + /** + *
+       * File system path (start at root). This folder should contain all the outputs for the task as individual files and/or an error text file
+       * 
+ * + * string output_path = 2; + */ + public java.lang.String getOutputPath() { + java.lang.Object ref = outputPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * File system path (start at root). This folder should contain all the outputs for the task as individual files and/or an error text file
+       * 
+ * + * string output_path = 2; + */ + public com.google.protobuf.ByteString + getOutputPathBytes() { + java.lang.Object ref = outputPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + outputPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * File system path (start at root). This folder should contain all the outputs for the task as individual files and/or an error text file
+       * 
+ * + * string output_path = 2; + */ + public Builder setOutputPath( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + outputPath_ = value; + onChanged(); + return this; + } + /** + *
+       * File system path (start at root). This folder should contain all the outputs for the task as individual files and/or an error text file
+       * 
+ * + * string output_path = 2; + */ + public Builder clearOutputPath() { + + outputPath_ = getDefaultInstance().getOutputPath(); + onChanged(); + return this; + } + /** + *
+       * File system path (start at root). This folder should contain all the outputs for the task as individual files and/or an error text file
+       * 
+ * + * string output_path = 2; + */ + public Builder setOutputPathBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + outputPath_ = value; + onChanged(); + return this; + } + + private int format_ = 0; + /** + *
+       * In the inputs folder, there will be an additional summary/metadata file that contains references to all files or inlined primitive values.
+       * This format decides the actual encoding for the data. Refer to the encoding to understand the specifics of the contents and the encoding
+       * 
+ * + * .flyteidl.plugins.CoPilot.MetadataFormat format = 3; + */ + public int getFormatValue() { + return format_; + } + /** + *
+       * In the inputs folder, there will be an additional summary/metadata file that contains references to all files or inlined primitive values.
+       * This format decides the actual encoding for the data. Refer to the encoding to understand the specifics of the contents and the encoding
+       * 
+ * + * .flyteidl.plugins.CoPilot.MetadataFormat format = 3; + */ + public Builder setFormatValue(int value) { + format_ = value; + onChanged(); + return this; + } + /** + *
+       * In the inputs folder, there will be an additional summary/metadata file that contains references to all files or inlined primitive values.
+       * This format decides the actual encoding for the data. Refer to the encoding to understand the specifics of the contents and the encoding
+       * 
+ * + * .flyteidl.plugins.CoPilot.MetadataFormat format = 3; + */ + public flyteidl.plugins.RawContainer.CoPilot.MetadataFormat getFormat() { + @SuppressWarnings("deprecation") + flyteidl.plugins.RawContainer.CoPilot.MetadataFormat result = flyteidl.plugins.RawContainer.CoPilot.MetadataFormat.valueOf(format_); + return result == null ? flyteidl.plugins.RawContainer.CoPilot.MetadataFormat.UNRECOGNIZED : result; + } + /** + *
+       * In the inputs folder, there will be an additional summary/metadata file that contains references to all files or inlined primitive values.
+       * This format decides the actual encoding for the data. Refer to the encoding to understand the specifics of the contents and the encoding
+       * 
+ * + * .flyteidl.plugins.CoPilot.MetadataFormat format = 3; + */ + public Builder setFormat(flyteidl.plugins.RawContainer.CoPilot.MetadataFormat value) { + if (value == null) { + throw new NullPointerException(); + } + + format_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       * In the inputs folder, there will be an additional summary/metadata file that contains references to all files or inlined primitive values.
+       * This format decides the actual encoding for the data. Refer to the encoding to understand the specifics of the contents and the encoding
+       * 
+ * + * .flyteidl.plugins.CoPilot.MetadataFormat format = 3; + */ + public Builder clearFormat() { + + format_ = 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.CoPilot) + } + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.CoPilot) + private static final flyteidl.plugins.RawContainer.CoPilot DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new flyteidl.plugins.RawContainer.CoPilot(); + } + + public static flyteidl.plugins.RawContainer.CoPilot getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CoPilot parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CoPilot(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.RawContainer.CoPilot getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_flyteidl_plugins_CoPilot_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_flyteidl_plugins_CoPilot_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/raw_container.proto\022\020" + + "flyteidl.plugins\"\235\001\n\007CoPilot\022\022\n\ninput_pa" + + "th\030\001 \001(\t\022\023\n\013output_path\030\002 \001(\t\0228\n\006format\030" + + "\003 \001(\0162(.flyteidl.plugins.CoPilot.Metadat" + + "aFormat\"/\n\016MetadataFormat\022\010\n\004JSON\020\000\022\010\n\004Y" + + "AML\020\001\022\t\n\005PROTO\020\002B5Z3github.com/lyft/flyt" + + "eidl/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_CoPilot_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_flyteidl_plugins_CoPilot_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_flyteidl_plugins_CoPilot_descriptor, + new java.lang.String[] { "InputPath", "OutputPath", "Format", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/flyteidl/gen/pb-protodoc/flyteidl/plugins/index.rst b/flyteidl/gen/pb-protodoc/flyteidl/plugins/index.rst index c2943c6d26e..359f3123f52 100644 --- a/flyteidl/gen/pb-protodoc/flyteidl/plugins/index.rst +++ b/flyteidl/gen/pb-protodoc/flyteidl/plugins/index.rst @@ -13,6 +13,7 @@ Plugins available in the Flyte system. array_job.proto presto.proto qubole.proto + raw_container.proto sidecar.proto spark.proto waitable.proto diff --git a/flyteidl/gen/pb-protodoc/flyteidl/plugins/raw_container.proto.rst b/flyteidl/gen/pb-protodoc/flyteidl/plugins/raw_container.proto.rst new file mode 100644 index 00000000000..a5702c11b31 --- /dev/null +++ b/flyteidl/gen/pb-protodoc/flyteidl/plugins/raw_container.proto.rst @@ -0,0 +1,81 @@ +.. _api_file_flyteidl/plugins/raw_container.proto: + +raw_container.proto +==================================== + +.. _api_msg_flyteidl.plugins.CoPilot: + +flyteidl.plugins.CoPilot +------------------------ + +`[flyteidl.plugins.CoPilot proto] `_ + +This configuration allows executing raw containers in Flyte using the Flyte CoPilot system. +Flyte CoPilot, eliminates the needs of flytekit or sdk inside the container. Any inputs required by the users container are side-loaded in the input_path +Any outputs generated by the user container - within output_path are automatically uploaded. +We are starting this as a plugin, but after the container within Pod ordering stabilizes, we can move this +into the default task definition. + +.. code-block:: json + + { + "input_path": "...", + "output_path": "...", + "format": "..." + } + +.. _api_field_flyteidl.plugins.CoPilot.input_path: + +input_path + (`string `_) File system path (start at root). This folder will contain all the inputs exploded to a separate file. + Example, if the input interface needs (x: int, y: blob, z: multipart_blob) and the input path is "/var/flyte/inputs", then the file system will look like + /var/flyte/inputs/inputs. .pb .json .yaml> -> Format as defined previously. The Blob and Multipart blob will reference local filesystem instead of remote locations + /var/flyte/inputs/x -> X is a file that contains the value of x (integer) in string format + /var/flyte/inputs/y -> Y is a file in Binary format + /var/flyte/inputs/z/... -> Note Z itself is a directory + More information about the protocol - refer to docs #TODO reference docs here + + +.. _api_field_flyteidl.plugins.CoPilot.output_path: + +output_path + (`string `_) File system path (start at root). This folder should contain all the outputs for the task as individual files and/or an error text file + + +.. _api_field_flyteidl.plugins.CoPilot.format: + +format + (:ref:`flyteidl.plugins.CoPilot.MetadataFormat `) In the inputs folder, there will be an additional summary/metadata file that contains references to all files or inlined primitive values. + This format decides the actual encoding for the data. Refer to the encoding to understand the specifics of the contents and the encoding + + + +.. _api_enum_flyteidl.plugins.CoPilot.MetadataFormat: + +Enum flyteidl.plugins.CoPilot.MetadataFormat +-------------------------------------------- + +`[flyteidl.plugins.CoPilot.MetadataFormat proto] `_ + +MetadataFormat decides the encoding format in which the input metadata should be made available to the containers. +If the user has access to the protocol buffer definitions, it is recommended to use the PROTO format. +JSON and YAML do not need any protobuf definitions to read it +All remote references in core.LiteralMap are replaced with local filesystem references (the data is downloaded to local filesystem) + +.. _api_enum_value_flyteidl.plugins.CoPilot.MetadataFormat.JSON: + +JSON + *(DEFAULT)* ⁣JSON / YAML are serialized represnetation of a map[string]primitive. primitive -> int, string, bool, double/float, bytes + + +.. _api_enum_value_flyteidl.plugins.CoPilot.MetadataFormat.YAML: + +YAML + ⁣ + +.. _api_enum_value_flyteidl.plugins.CoPilot.MetadataFormat.PROTO: + +PROTO + ⁣Proto is a serialized binary of `core.LiteralMap` defined in flyteidl/core + + diff --git a/flyteidl/gen/pb_python/flyteidl/plugins/raw_container_pb2.py b/flyteidl/gen/pb_python/flyteidl/plugins/raw_container_pb2.py new file mode 100644 index 00000000000..2aa8cb9494f --- /dev/null +++ b/flyteidl/gen/pb_python/flyteidl/plugins/raw_container_pb2.py @@ -0,0 +1,114 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: flyteidl/plugins/raw_container.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='flyteidl/plugins/raw_container.proto', + package='flyteidl.plugins', + syntax='proto3', + serialized_options=_b('Z3github.com/lyft/flyteidl/gen/pb-go/flyteidl/plugins'), + serialized_pb=_b('\n$flyteidl/plugins/raw_container.proto\x12\x10\x66lyteidl.plugins\"\x9d\x01\n\x07\x43oPilot\x12\x12\n\ninput_path\x18\x01 \x01(\t\x12\x13\n\x0boutput_path\x18\x02 \x01(\t\x12\x38\n\x06\x66ormat\x18\x03 \x01(\x0e\x32(.flyteidl.plugins.CoPilot.MetadataFormat\"/\n\x0eMetadataFormat\x12\x08\n\x04JSON\x10\x00\x12\x08\n\x04YAML\x10\x01\x12\t\n\x05PROTO\x10\x02\x42\x35Z3github.com/lyft/flyteidl/gen/pb-go/flyteidl/pluginsb\x06proto3') +) + + + +_COPILOT_METADATAFORMAT = _descriptor.EnumDescriptor( + name='MetadataFormat', + full_name='flyteidl.plugins.CoPilot.MetadataFormat', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='JSON', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='YAML', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='PROTO', index=2, number=2, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=169, + serialized_end=216, +) +_sym_db.RegisterEnumDescriptor(_COPILOT_METADATAFORMAT) + + +_COPILOT = _descriptor.Descriptor( + name='CoPilot', + full_name='flyteidl.plugins.CoPilot', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='input_path', full_name='flyteidl.plugins.CoPilot.input_path', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output_path', full_name='flyteidl.plugins.CoPilot.output_path', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='format', full_name='flyteidl.plugins.CoPilot.format', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _COPILOT_METADATAFORMAT, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=59, + serialized_end=216, +) + +_COPILOT.fields_by_name['format'].enum_type = _COPILOT_METADATAFORMAT +_COPILOT_METADATAFORMAT.containing_type = _COPILOT +DESCRIPTOR.message_types_by_name['CoPilot'] = _COPILOT +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +CoPilot = _reflection.GeneratedProtocolMessageType('CoPilot', (_message.Message,), dict( + DESCRIPTOR = _COPILOT, + __module__ = 'flyteidl.plugins.raw_container_pb2' + # @@protoc_insertion_point(class_scope:flyteidl.plugins.CoPilot) + )) +_sym_db.RegisterMessage(CoPilot) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/flyteidl/gen/pb_python/flyteidl/plugins/raw_container_pb2_grpc.py b/flyteidl/gen/pb_python/flyteidl/plugins/raw_container_pb2_grpc.py new file mode 100644 index 00000000000..a89435267cb --- /dev/null +++ b/flyteidl/gen/pb_python/flyteidl/plugins/raw_container_pb2_grpc.py @@ -0,0 +1,3 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + diff --git a/flyteidl/protos/flyteidl/plugins/raw_container.proto b/flyteidl/protos/flyteidl/plugins/raw_container.proto new file mode 100644 index 00000000000..094a912f5c9 --- /dev/null +++ b/flyteidl/protos/flyteidl/plugins/raw_container.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; + +package flyteidl.plugins; + +option go_package = "github.com/lyft/flyteidl/gen/pb-go/flyteidl/plugins"; + +// This configuration allows executing raw containers in Flyte using the Flyte CoPilot system. +// Flyte CoPilot, eliminates the needs of flytekit or sdk inside the container. Any inputs required by the users container are side-loaded in the input_path +// Any outputs generated by the user container - within output_path are automatically uploaded. +// We are starting this as a plugin, but after the container within Pod ordering stabilizes, we can move this +// into the default task definition. +message CoPilot { + // MetadataFormat decides the encoding format in which the input metadata should be made available to the containers. + // If the user has access to the protocol buffer definitions, it is recommended to use the PROTO format. + // JSON and YAML do not need any protobuf definitions to read it + // All remote references in core.LiteralMap are replaced with local filesystem references (the data is downloaded to local filesystem) + enum MetadataFormat { + // JSON / YAML are serialized represnetation of a map[string]primitive. primitive -> int, string, bool, double/float, bytes + JSON = 0; + YAML = 1; + // Proto is a serialized binary of `core.LiteralMap` defined in flyteidl/core + PROTO = 2; + } + // File system path (start at root). This folder will contain all the inputs exploded to a separate file. + // Example, if the input interface needs (x: int, y: blob, z: multipart_blob) and the input path is "/var/flyte/inputs", then the file system will look like + // /var/flyte/inputs/inputs. .pb .json .yaml> -> Format as defined previously. The Blob and Multipart blob will reference local filesystem instead of remote locations + // /var/flyte/inputs/x -> X is a file that contains the value of x (integer) in string format + // /var/flyte/inputs/y -> Y is a file in Binary format + // /var/flyte/inputs/z/... -> Note Z itself is a directory + // More information about the protocol - refer to docs #TODO reference docs here + string input_path = 1; + // File system path (start at root). This folder should contain all the outputs for the task as individual files and/or an error text file + string output_path = 2; + // In the inputs folder, there will be an additional summary/metadata file that contains references to all files or inlined primitive values. + // This format decides the actual encoding for the data. Refer to the encoding to understand the specifics of the contents and the encoding + MetadataFormat format = 3; +}