From 2903afa262a8e2961c97274f3c303ac579fc4996 Mon Sep 17 00:00:00 2001 From: Googler Date: Tue, 2 Apr 2024 10:09:26 -0700 Subject: [PATCH] docs(components): internal PiperOrigin-RevId: 621215497 --- .../proto/template_metadata.proto | 62 ++++++++- .../proto/template_metadata_pb2.py | 125 ++++++++++-------- 2 files changed, 134 insertions(+), 53 deletions(-) diff --git a/components/google-cloud/google_cloud_pipeline_components/proto/template_metadata.proto b/components/google-cloud/google_cloud_pipeline_components/proto/template_metadata.proto index 9757372a889..f1ffd3d71a4 100644 --- a/components/google-cloud/google_cloud_pipeline_components/proto/template_metadata.proto +++ b/components/google-cloud/google_cloud_pipeline_components/proto/template_metadata.proto @@ -8,6 +8,7 @@ option java_multiple_files = true; message TemplateMetadata { IOMetadata io_metadata = 1; + ValidationItems preflight_validations = 2; } message IOMetadata { @@ -41,7 +42,8 @@ message Section { message Input { // The name of the input. - // Corresponds to parameter/artifact name in ComponentSpec.input_definitions (https://github.com/kubeflow/pipelines/blob/066f229e27dc2ac8a58a03d7745d5471d718157c/api/v2alpha1/pipeline_spec.proto#L353-L357). + // Corresponds to parameter/artifact name in ComponentSpec.input_definitions + // (https://github.com/kubeflow/pipelines/blob/066f229e27dc2ac8a58a03d7745d5471d718157c/api/v2alpha1/pipeline_spec.proto#L353-L357). string name = 1; // The display name for the input. Typically a human-readable version of the // input parameter name. @@ -229,3 +231,61 @@ enum UriType { BIGQUERY_URI = 4; } // END: inner messages for top-level types + +// Describes the details of validation items. +message ValidationItems { + // Validation for Google Cloud Service Account. + repeated GoogleCloudServiceAccountValidation sa_validations = 1; + // Validation for Google Cloud Project Quota. + repeated GoogleCloudProjectQuotaValidation quota_validations = 2; + // Validation for Google Cloud Api Enablement. + repeated GoogleCloudApiEnablementValidation api_validations = 3; +} + +// Describes the details for Google Cloud Project Quota Validation. +message GoogleCloudProjectQuotaValidation { + // Required. Metric name of the quota. Example: "compute.googleapis.com/cpus" + string metric_name = 1; + // Required. Value of the quota demand. Example: 2 or 3.5 + // We will validate if the demand is under the limit or not. + oneof value { + // A signed 64-bit integer value. + int64 int64_value = 2; + // A double precision floating point value. + double double_value = 3; + } +} + +// Describes the details for Google Cloud Service Account Validation. +message GoogleCloudServiceAccountValidation { + // Required. Default principal email of the service account used for + // validation. Example: + // "{{$.pipeline_google_cloud_project_id}}-compute@developer.gserviceaccount.com" + // Use placeholder to specify the dynamic value like project id. + string default_principal_email = 1; + + // Optional. If specified, the principal email will be overridden based on the + // placeholder. Currently support two placeholders: 1. + // "{{$.pipeline_google_cloud_service_account}}"(actual value is from + // PipelineJob.service_account 2. + // "{{$.parameter.service_account}}"(actual value is from the input parameter + // of the component/pipeline). If the value doesn't exist or is empty, + // overriding won't happen. + string override_placeholder = 2; + + // Optional. Permission required to have for the service account. + // Pipeline service will check if provided SA has these permissions. + // Example: "aiplatform.metadataStores.get" + repeated string permissions = 3; + + // Optional. Roles need to be granted for the service account. + // The role names will occur in preflight validations' error message + // as an action item for users. + repeated string role_names = 4; +} + +// Describes the details of Google Cloud Api Enablement Validation. +message GoogleCloudApiEnablementValidation { + // Required. Service names of Google Cloud Api. + repeated string service_names = 1; +} diff --git a/components/google-cloud/google_cloud_pipeline_components/proto/template_metadata_pb2.py b/components/google-cloud/google_cloud_pipeline_components/proto/template_metadata_pb2.py index 2ad93bccdf6..bd327362e82 100755 --- a/components/google-cloud/google_cloud_pipeline_components/proto/template_metadata_pb2.py +++ b/components/google-cloud/google_cloud_pipeline_components/proto/template_metadata_pb2.py @@ -15,8 +15,9 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x13template_metadata.proto\x12\x11template_metadata\x1a\x1cgoogle/protobuf/struct.proto"F\n\x10TemplateMetadata\x12\x32\n\x0bio_metadata\x18\x01' - b' \x01(\x0b\x32\x1d.template_metadata.IOMetadata"L\n\nIOMetadata\x12&\n\x05pages\x18\x01' + b'\n\x13template_metadata.proto\x12\x11template_metadata\x1a\x1cgoogle/protobuf/struct.proto"\x89\x01\n\x10TemplateMetadata\x12\x32\n\x0bio_metadata\x18\x01' + b' \x01(\x0b\x32\x1d.template_metadata.IOMetadata\x12\x41\n\x15preflight_validations\x18\x02' + b' \x01(\x0b\x32".template_metadata.ValidationItems"L\n\nIOMetadata\x12&\n\x05pages\x18\x01' b' \x03(\x0b\x32\x17.template_metadata.Page\x12\x16\n\x0eschema_version\x18\x02' b' \x01(\t"W\n\x04Page\x12\x0c\n\x04name\x18\x01' b' \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02' @@ -24,11 +25,12 @@ b' \x03(\x0b\x32\x1a.template_metadata.Section"V\n\x07Section\x12\x0c\n\x04name\x18\x01' b' \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02' b' \x01(\t\x12(\n\x06inputs\x18\x03' - b' \x03(\x0b\x32\x18.template_metadata.Input"\x9a\x01\n\x05Input\x12\x14\n\x0c\x64isplay_name\x18\x01' - b' \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02' - b' \x01(\t\x12\x1b\n\x13\x64\x65\x66\x61ult_explanation\x18\x03' - b' \x01(\t\x12\x11\n\thelp_text\x18\x04' - b' \x01(\t\x12\x36\n\rsemantic_type\x18\x05' + b' \x03(\x0b\x32\x18.template_metadata.Input"\xa8\x01\n\x05Input\x12\x0c\n\x04name\x18\x01' + b' \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02' + b' \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03' + b' \x01(\t\x12\x1b\n\x13\x64\x65\x66\x61ult_explanation\x18\x04' + b' \x01(\t\x12\x11\n\thelp_text\x18\x05' + b' \x01(\t\x12\x36\n\rsemantic_type\x18\x06' b' \x01(\x0b\x32\x1f.template_metadata.SemanticType"\xf6\x02\n\x0cSemanticType\x12.\n\nfloat_type\x18\x01' b' \x01(\x0b\x32\x18.template_metadata.FloatH\x00\x12\x32\n\x0cinteger_type\x18\x02' b' \x01(\x0b\x32\x1a.template_metadata.IntegerH\x00\x12\x30\n\x0bstring_type\x18\x03' @@ -65,7 +67,18 @@ b' \x01(\x0b\x32\x1a.template_metadata.OptionsH\x00\x42\x08\n\x06values"U\n\x0bMachineType\x12\r\n\x03\x61ny\x18\x01' b' \x01(\x08H\x00\x12-\n\x07options\x18\x02' b' \x01(\x0b\x32\x1a.template_metadata.OptionsH\x00\x42\x08\n\x06values"1\n\x07Options\x12&\n\x06values\x18\x01' - b' \x03(\x0b\x32\x16.google.protobuf.Value*G\n\x04Size\x12\x0e\n\nSIZE_UNSET\x10\x00\x12\x0e\n\nSIZE_SMALL\x10\x01\x12\x0f\n\x0bSIZE_MEDIUM\x10\x02\x12\x0e\n\nSIZE_LARGE\x10\x03*\x82\x01\n\x0b\x43ontentType\x12\x11\n\rUNSET_CONTENT\x10\x00\x12\x10\n\x0cYAML_CONTENT\x10\x01\x12\x10\n\x0cJSON_CONTENT\x10\x02\x12\x14\n\x10MARKDOWN_CONTENT\x10\x03\x12\x10\n\x0cHTML_CONTENT\x10\x04\x12\x14\n\x10\x44\x41TETIME_CONTENT\x10\x05*a\n\x07UriType\x12\x0b\n\x07\x41NY_URI\x10\x00\x12\x0f\n\x0bGCS_ANY_URI\x10\x01\x12\x12\n\x0eGCS_BUCKET_URI\x10\x02\x12\x12\n\x0eGCS_OBJECT_URI\x10\x03\x12\x10\n\x0c\x42IGQUERY_URI\x10\x04\x42\x02P\x01\x62\x06proto3' + b' \x03(\x0b\x32\x16.google.protobuf.Value"\x82\x02\n\x0fValidationItems\x12N\n\x0esa_validations\x18\x01' + b' \x03(\x0b\x32\x36.template_metadata.GoogleCloudServiceAccountValidation\x12O\n\x11quota_validations\x18\x02' + b' \x03(\x0b\x32\x34.template_metadata.GoogleCloudProjectQuotaValidation\x12N\n\x0f\x61pi_validations\x18\x03' + b' \x03(\x0b\x32\x35.template_metadata.GoogleCloudApiEnablementValidation"p\n!GoogleCloudProjectQuotaValidation\x12\x13\n\x0bmetric_name\x18\x01' + b' \x01(\t\x12\x15\n\x0bint64_value\x18\x02' + b' \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x03' + b' \x01(\x01H\x00\x42\x07\n\x05value"\x8d\x01\n#GoogleCloudServiceAccountValidation\x12\x1f\n\x17\x64\x65\x66\x61ult_principal_email\x18\x01' + b' \x01(\t\x12\x1c\n\x14override_placeholder\x18\x02' + b' \x01(\t\x12\x13\n\x0bpermissions\x18\x03' + b' \x03(\t\x12\x12\n\nrole_names\x18\x04' + b' \x03(\t";\n"GoogleCloudApiEnablementValidation\x12\x15\n\rservice_names\x18\x01' + b' \x03(\t*G\n\x04Size\x12\x0e\n\nSIZE_UNSET\x10\x00\x12\x0e\n\nSIZE_SMALL\x10\x01\x12\x0f\n\x0bSIZE_MEDIUM\x10\x02\x12\x0e\n\nSIZE_LARGE\x10\x03*\x82\x01\n\x0b\x43ontentType\x12\x11\n\rUNSET_CONTENT\x10\x00\x12\x10\n\x0cYAML_CONTENT\x10\x01\x12\x10\n\x0cJSON_CONTENT\x10\x02\x12\x14\n\x10MARKDOWN_CONTENT\x10\x03\x12\x10\n\x0cHTML_CONTENT\x10\x04\x12\x14\n\x10\x44\x41TETIME_CONTENT\x10\x05*a\n\x07UriType\x12\x0b\n\x07\x41NY_URI\x10\x00\x12\x0f\n\x0bGCS_ANY_URI\x10\x01\x12\x12\n\x0eGCS_BUCKET_URI\x10\x02\x12\x12\n\x0eGCS_OBJECT_URI\x10\x03\x12\x10\n\x0c\x42IGQUERY_URI\x10\x04\x42\x02P\x01\x62\x06proto3' ) _globals = globals() @@ -78,48 +91,56 @@ if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'P\001' - _globals['_SIZE']._serialized_start = 2225 - _globals['_SIZE']._serialized_end = 2296 - _globals['_CONTENTTYPE']._serialized_start = 2299 - _globals['_CONTENTTYPE']._serialized_end = 2429 - _globals['_URITYPE']._serialized_start = 2431 - _globals['_URITYPE']._serialized_end = 2528 - _globals['_TEMPLATEMETADATA']._serialized_start = 163 - _globals['_TEMPLATEMETADATA']._serialized_end = 233 - _globals['_IOMETADATA']._serialized_start = 235 - _globals['_IOMETADATA']._serialized_end = 311 - _globals['_PAGE']._serialized_start = 313 - _globals['_PAGE']._serialized_end = 400 - _globals['_SECTION']._serialized_start = 402 - _globals['_SECTION']._serialized_end = 488 - _globals['_INPUT']._serialized_start = 491 - _globals['_INPUT']._serialized_end = 645 - _globals['_SEMANTICTYPE']._serialized_start = 648 - _globals['_SEMANTICTYPE']._serialized_end = 1022 - _globals['_FLOAT']._serialized_start = 1024 - _globals['_FLOAT']._serialized_end = 1083 - _globals['_INTEGER']._serialized_start = 1085 - _globals['_INTEGER']._serialized_end = 1146 - _globals['_STRING']._serialized_start = 1149 - _globals['_STRING']._serialized_end = 1315 - _globals['_BOOLEAN']._serialized_start = 1317 - _globals['_BOOLEAN']._serialized_end = 1326 - _globals['_LIST']._serialized_start = 1329 - _globals['_LIST']._serialized_end = 1495 - _globals['_STRUCT']._serialized_start = 1497 - _globals['_STRUCT']._serialized_end = 1505 - _globals['_ARTIFACT']._serialized_start = 1507 - _globals['_ARTIFACT']._serialized_end = 1584 - _globals['_FREEFORM']._serialized_start = 1587 - _globals['_FREEFORM']._serialized_end = 1731 - _globals['_SELECTONE']._serialized_start = 1734 - _globals['_SELECTONE']._serialized_end = 1924 - _globals['_SELECTMANY']._serialized_start = 1926 - _globals['_SELECTMANY']._serialized_end = 2001 - _globals['_LOCATION']._serialized_start = 2003 - _globals['_LOCATION']._serialized_end = 2085 - _globals['_MACHINETYPE']._serialized_start = 2087 - _globals['_MACHINETYPE']._serialized_end = 2172 - _globals['_OPTIONS']._serialized_start = 2174 - _globals['_OPTIONS']._serialized_end = 2223 + _globals['_SIZE']._serialized_start = 2887 + _globals['_SIZE']._serialized_end = 2958 + _globals['_CONTENTTYPE']._serialized_start = 2961 + _globals['_CONTENTTYPE']._serialized_end = 3091 + _globals['_URITYPE']._serialized_start = 3093 + _globals['_URITYPE']._serialized_end = 3190 + _globals['_TEMPLATEMETADATA']._serialized_start = 164 + _globals['_TEMPLATEMETADATA']._serialized_end = 301 + _globals['_IOMETADATA']._serialized_start = 303 + _globals['_IOMETADATA']._serialized_end = 379 + _globals['_PAGE']._serialized_start = 381 + _globals['_PAGE']._serialized_end = 468 + _globals['_SECTION']._serialized_start = 470 + _globals['_SECTION']._serialized_end = 556 + _globals['_INPUT']._serialized_start = 559 + _globals['_INPUT']._serialized_end = 727 + _globals['_SEMANTICTYPE']._serialized_start = 730 + _globals['_SEMANTICTYPE']._serialized_end = 1104 + _globals['_FLOAT']._serialized_start = 1106 + _globals['_FLOAT']._serialized_end = 1165 + _globals['_INTEGER']._serialized_start = 1167 + _globals['_INTEGER']._serialized_end = 1228 + _globals['_STRING']._serialized_start = 1231 + _globals['_STRING']._serialized_end = 1397 + _globals['_BOOLEAN']._serialized_start = 1399 + _globals['_BOOLEAN']._serialized_end = 1408 + _globals['_LIST']._serialized_start = 1411 + _globals['_LIST']._serialized_end = 1577 + _globals['_STRUCT']._serialized_start = 1579 + _globals['_STRUCT']._serialized_end = 1587 + _globals['_ARTIFACT']._serialized_start = 1589 + _globals['_ARTIFACT']._serialized_end = 1666 + _globals['_FREEFORM']._serialized_start = 1669 + _globals['_FREEFORM']._serialized_end = 1813 + _globals['_SELECTONE']._serialized_start = 1816 + _globals['_SELECTONE']._serialized_end = 2006 + _globals['_SELECTMANY']._serialized_start = 2008 + _globals['_SELECTMANY']._serialized_end = 2083 + _globals['_LOCATION']._serialized_start = 2085 + _globals['_LOCATION']._serialized_end = 2167 + _globals['_MACHINETYPE']._serialized_start = 2169 + _globals['_MACHINETYPE']._serialized_end = 2254 + _globals['_OPTIONS']._serialized_start = 2256 + _globals['_OPTIONS']._serialized_end = 2305 + _globals['_VALIDATIONITEMS']._serialized_start = 2308 + _globals['_VALIDATIONITEMS']._serialized_end = 2566 + _globals['_GOOGLECLOUDPROJECTQUOTAVALIDATION']._serialized_start = 2568 + _globals['_GOOGLECLOUDPROJECTQUOTAVALIDATION']._serialized_end = 2680 + _globals['_GOOGLECLOUDSERVICEACCOUNTVALIDATION']._serialized_start = 2683 + _globals['_GOOGLECLOUDSERVICEACCOUNTVALIDATION']._serialized_end = 2824 + _globals['_GOOGLECLOUDAPIENABLEMENTVALIDATION']._serialized_start = 2826 + _globals['_GOOGLECLOUDAPIENABLEMENTVALIDATION']._serialized_end = 2885 # @@protoc_insertion_point(module_scope)