From 472e73b5c974a7a6af548fba2315cf6a6424ebaf Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 11 Nov 2021 04:47:41 -0800 Subject: [PATCH] feat: Adds support for `google.protobuf.Value` pipeline parameters in the `parameter_values` field (#218) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Adds support for `google.protobuf.Value` pipeline parameters in the `parameter_values` field PiperOrigin-RevId: 406492661 Source-Link: https://github.com/googleapis/googleapis/commit/972abb65603bdcc28483b303cd0a8c983a2032ba Source-Link: https://github.com/googleapis/googleapis-gen/commit/b6774aa3b61d05bf9f10aa9af8d62311273d35a9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjY3NzRhYTNiNjFkMDViZjlmMTBhYTlhZjhkNjIzMTEyNzNkMzVhOSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Takashi Matsuo --- .../aiplatform/v1beta1/pipeline_job.proto | 13 ++-- .../protos/protos.d.ts | 6 ++ .../google-cloud-aiplatform/protos/protos.js | 66 ++++++++++++++++++- .../protos/protos.json | 10 ++- 4 files changed, 89 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto index d4bea027dfa..0b4e77a444c 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto @@ -50,10 +50,10 @@ message PipelineJob { // The runtime config of a PipelineJob. message RuntimeConfig { - // The runtime parameters of the PipelineJob. The parameters will be - // passed into [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1beta1.PipelineJob.pipeline_spec] to replace the placeholders - // at runtime. - map parameters = 1; + // Deprecated. Use [RuntimeConfig.parameter_values] instead. The runtime + // parameters of the PipelineJob. The parameters will be passed into + // [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1beta1.PipelineJob.pipeline_spec] to replace the placeholders at runtime. + map parameters = 1 [deprecated = true]; // Required. A path in a Cloud Storage bucket, which will be treated as the root // output directory of the pipeline. It is used by the system to @@ -63,6 +63,11 @@ message PipelineJob { // pipeline must have the `storage.objects.get` and `storage.objects.create` // permissions for this bucket. string gcs_output_directory = 2 [(google.api.field_behavior) = REQUIRED]; + + // The runtime parameters of the PipelineJob. The parameters will be + // passed into [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1beta1.PipelineJob.pipeline_spec] to replace the placeholders + // at runtime. + map parameter_values = 3; } // Output only. The resource name of the PipelineJob. diff --git a/packages/google-cloud-aiplatform/protos/protos.d.ts b/packages/google-cloud-aiplatform/protos/protos.d.ts index 5a11cf9ccb4..cc1c2f2af17 100644 --- a/packages/google-cloud-aiplatform/protos/protos.d.ts +++ b/packages/google-cloud-aiplatform/protos/protos.d.ts @@ -95671,6 +95671,9 @@ export namespace google { /** RuntimeConfig gcsOutputDirectory */ gcsOutputDirectory?: (string|null); + + /** RuntimeConfig parameterValues */ + parameterValues?: ({ [k: string]: google.protobuf.IValue }|null); } /** Represents a RuntimeConfig. */ @@ -95688,6 +95691,9 @@ export namespace google { /** RuntimeConfig gcsOutputDirectory. */ public gcsOutputDirectory: string; + /** RuntimeConfig parameterValues. */ + public parameterValues: { [k: string]: google.protobuf.IValue }; + /** * Creates a new RuntimeConfig instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-aiplatform/protos/protos.js b/packages/google-cloud-aiplatform/protos/protos.js index 6d47ccdd63f..579389eb920 100644 --- a/packages/google-cloud-aiplatform/protos/protos.js +++ b/packages/google-cloud-aiplatform/protos/protos.js @@ -228897,6 +228897,7 @@ * @interface IRuntimeConfig * @property {Object.|null} [parameters] RuntimeConfig parameters * @property {string|null} [gcsOutputDirectory] RuntimeConfig gcsOutputDirectory + * @property {Object.|null} [parameterValues] RuntimeConfig parameterValues */ /** @@ -228909,6 +228910,7 @@ */ function RuntimeConfig(properties) { this.parameters = {}; + this.parameterValues = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -228931,6 +228933,14 @@ */ RuntimeConfig.prototype.gcsOutputDirectory = ""; + /** + * RuntimeConfig parameterValues. + * @member {Object.} parameterValues + * @memberof google.cloud.aiplatform.v1beta1.PipelineJob.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.parameterValues = $util.emptyObject; + /** * Creates a new RuntimeConfig instance using the specified properties. * @function create @@ -228962,6 +228972,11 @@ } if (message.gcsOutputDirectory != null && Object.hasOwnProperty.call(message, "gcsOutputDirectory")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsOutputDirectory); + if (message.parameterValues != null && Object.hasOwnProperty.call(message, "parameterValues")) + for (var keys = Object.keys(message.parameterValues), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.parameterValues[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; @@ -229021,6 +229036,28 @@ case 2: message.gcsOutputDirectory = reader.string(); break; + case 3: + if (message.parameterValues === $util.emptyObject) + message.parameterValues = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.parameterValues[key] = value; + break; default: reader.skipType(tag & 7); break; @@ -229069,6 +229106,16 @@ if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) if (!$util.isString(message.gcsOutputDirectory)) return "gcsOutputDirectory: string expected"; + if (message.parameterValues != null && message.hasOwnProperty("parameterValues")) { + if (!$util.isObject(message.parameterValues)) + return "parameterValues: object expected"; + var key = Object.keys(message.parameterValues); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.parameterValues[key[i]]); + if (error) + return "parameterValues." + error; + } + } return null; }; @@ -229096,6 +229143,16 @@ } if (object.gcsOutputDirectory != null) message.gcsOutputDirectory = String(object.gcsOutputDirectory); + if (object.parameterValues) { + if (typeof object.parameterValues !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.PipelineJob.RuntimeConfig.parameterValues: object expected"); + message.parameterValues = {}; + for (var keys = Object.keys(object.parameterValues), i = 0; i < keys.length; ++i) { + if (typeof object.parameterValues[keys[i]] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.PipelineJob.RuntimeConfig.parameterValues: object expected"); + message.parameterValues[keys[i]] = $root.google.protobuf.Value.fromObject(object.parameterValues[keys[i]]); + } + } return message; }; @@ -229112,8 +229169,10 @@ if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) + if (options.objects || options.defaults) { object.parameters = {}; + object.parameterValues = {}; + } if (options.defaults) object.gcsOutputDirectory = ""; var keys2; @@ -229124,6 +229183,11 @@ } if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) object.gcsOutputDirectory = message.gcsOutputDirectory; + if (message.parameterValues && (keys2 = Object.keys(message.parameterValues)).length) { + object.parameterValues = {}; + for (var j = 0; j < keys2.length; ++j) + object.parameterValues[keys2[j]] = $root.google.protobuf.Value.toObject(message.parameterValues[keys2[j]], options); + } return object; }; diff --git a/packages/google-cloud-aiplatform/protos/protos.json b/packages/google-cloud-aiplatform/protos/protos.json index 7ba734822e6..3ebae7805ca 100644 --- a/packages/google-cloud-aiplatform/protos/protos.json +++ b/packages/google-cloud-aiplatform/protos/protos.json @@ -26117,7 +26117,10 @@ "parameters": { "keyType": "string", "type": "Value", - "id": 1 + "id": 1, + "options": { + "deprecated": true + } }, "gcsOutputDirectory": { "type": "string", @@ -26125,6 +26128,11 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "parameterValues": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 3 } } }