Skip to content

Commit e4b8d95

Browse files
committed
Merge remote-tracking branch 'origin/main' into security-marks-assets-v2
Merge remote into local branch.
2 parents d06981b + 21a9c85 commit e4b8d95

File tree

186 files changed

+14463
-1764
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+14463
-1764
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,17 @@
4949
# DEE Platform Ops (DEEPO)
5050
/errorreporting @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers
5151
/monitoring @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers
52-
/opencensus @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers
53-
/trace @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers
5452

5553
# Cloud SDK Databases & Data Analytics teams
5654
# ---* Cloud Native DB
57-
/bigtable @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers @GoogleCloudPlatform/cloud-native-db-dpes
55+
/bigtable @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers @GoogleCloudPlatform/cloud-native-db-dpes @GoogleCloudPlatform/bigtable-eng
5856
/memorystore @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers
5957
/spanner @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers @GoogleCloudPlatform/api-spanner-java
6058
# ---* Cloud Storage
6159
/storage @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers @GoogleCloudPlatform/cloud-storage-dpes
6260
/storage-transfer @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers @GoogleCloudPlatform/cloud-storage-dpes
6361
# ---* Infra DB
64-
/cloud-sql @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers @GoogleCloudPlatform/infra-db-sdk
62+
/cloud-sql @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers @GoogleCloudPlatform/cloud-sql-connectors
6563

6664
# Data & AI
6765
/aiplatform @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers @GoogleCloudPlatform/text-embedding
@@ -81,7 +79,7 @@
8179
/speech @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers
8280
/talent @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers
8381
/texttospeech @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers
84-
/translate @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers
82+
/translate @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers @GoogleCloudPlatform/cloud-ml-translate-dev
8583
/video @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers
8684
/vision @GoogleCloudPlatform/java-samples-reviewers @yoshi-approver @GoogleCloudPlatform/cloud-samples-reviewers
8785

.github/blunderbuss.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ assign_issues_by:
3838
- labels:
3939
- 'api: cloudsql'
4040
to:
41-
- GoogleCloudPlatform/infra-db-sdk
41+
- GoogleCloudPlatform/cloud-sql-connectors
4242
- labels:
4343
- 'api: spanner'
4444
to:
@@ -115,7 +115,7 @@ assign_prs_by:
115115
- labels:
116116
- 'api: cloudsql'
117117
to:
118-
- GoogleCloudPlatform/infra-db-sdk
118+
- GoogleCloudPlatform/cloud-sql-connectors
119119
- labels:
120120
- 'api: spanner'
121121
to:

.github/renovate.json5

Lines changed: 92 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,142 +1,136 @@
1-
// find legacy configuration at https://github.com/GoogleCloudPlatform/java-docs-samples/blob/91792d4da53a12f96032f4556815f7d91f27257b/renovate.json
21
{
3-
"extends": [
4-
"config:recommended",
5-
":approveMajorUpdates",
6-
"schedule:earlyMondays",
7-
":ignoreUnstable",
2+
extends: [
3+
'config:recommended',
4+
':approveMajorUpdates',
5+
'schedule:earlyMondays',
6+
':ignoreUnstable',
87
],
9-
"labels": [
10-
"dependencies",
11-
"automerge"
8+
labels: [
9+
'dependencies',
10+
'automerge',
1211
],
13-
"minimumReleaseAge": "7 days",
14-
"dependencyDashboardLabels": [
15-
"type: process",
12+
minimumReleaseAge: '7 days',
13+
dependencyDashboardLabels: [
14+
'type: process',
1615
],
17-
// discontinue upgrades for java8 code samples
18-
"ignorePaths": ["**/*java8*/**", "**/*java-8*/**"],
19-
"packageRules": [
16+
ignorePaths: [
17+
'**/*java8*/**',
18+
'**/*java-8*/**',
19+
],
20+
packageRules: [
2021
{
21-
"matchCategories": [
22-
"java"
22+
matchCategories: [
23+
'java',
24+
],
25+
addLabels: [
26+
'lang: java',
2327
],
24-
"addLabels": [
25-
"lang: java"
26-
]
2728
},
28-
// TODO: check if auto-merge rules will work at all
2929
{
30-
"matchUpdateTypes": [
31-
"minor",
32-
"patch",
33-
"digest",
34-
"lockFileMaintenance"
30+
matchUpdateTypes: [
31+
'minor',
32+
'patch',
33+
'digest',
34+
'lockFileMaintenance',
3535
],
36-
"automerge": true
36+
automerge: true,
3737
},
3838
{
39-
"matchDepTypes": [
40-
"devDependencies"
39+
matchDepTypes: [
40+
'devDependencies',
4141
],
42-
"automerge": true
42+
automerge: true,
4343
},
44-
// group all Dockerfile dependencies
4544
{
46-
"matchCategories": [
47-
"docker"
48-
],
49-
"matchUpdateTypes": [
50-
"minor",
51-
"patch",
52-
"digest",
53-
"lockFileMaintenance"
54-
],
55-
"groupName": "docker",
56-
"pinDigests": true,
57-
"automerge": true
45+
matchCategories: [
46+
'docker',
47+
],
48+
matchUpdateTypes: [
49+
'minor',
50+
'patch',
51+
'digest',
52+
'lockFileMaintenance',
53+
],
54+
groupName: 'docker',
55+
pinDigests: true,
56+
automerge: true,
5857
},
59-
// group all terraform dependencies for google providers
6058
{
61-
"matchCategories": [
62-
"terraform"
59+
matchCategories: [
60+
'terraform',
61+
],
62+
matchDepTypes: [
63+
'provider',
64+
'required_provider',
6365
],
64-
"matchDepTypes": [
65-
"provider",
66-
"required_provider"
66+
groupName: 'Terraform Google providers',
67+
matchPackageNames: [
68+
'/^google/',
6769
],
68-
"matchPackagePatterns": "^google",
69-
"groupName": "Terraform Google providers",
7070
},
71-
// *** Java dependency rules:
72-
// group *ALL* Java dependencies
7371
{
74-
"matchCategories": [
75-
"java"
72+
matchCategories: [
73+
'java',
7674
],
77-
"matchUpdateTypes": [
78-
"minor",
79-
"patch",
80-
"digest",
81-
"lockFileMaintenance"
75+
matchUpdateTypes: [
76+
'minor',
77+
'patch',
78+
'digest',
79+
'lockFileMaintenance',
8280
],
83-
"groupName": "java",
84-
"automerge": true
81+
groupName: 'java',
82+
automerge: true,
8583
},
86-
// do not allow Spring Boot 3 upgrades yet
8784
{
88-
"matchCategories": [
89-
"java"
85+
matchCategories: [
86+
'java',
9087
],
91-
"matchPackagePatterns": [
92-
"org.springframework.boot"
88+
matchCurrentVersion: '>=2.0.0, <3.0.0',
89+
allowedVersions: '<3',
90+
groupName: 'Spring Boot upgrades for v2',
91+
description: '@akitsch: Spring Boot V3 requires Java 17',
92+
matchPackageNames: [
93+
'/org.springframework.boot/',
9394
],
94-
"matchCurrentVersion": ">=2.0.0, <3.0.0",
95-
"allowedVersions": "<3",
96-
"groupName": "Spring Boot upgrades for v2",
97-
"description": "@akitsch: Spring Boot V3 requires Java 17"
9895
},
99-
// limit micronaut upgrades for versions <= 4
10096
{
101-
"matchPackagePatterns": [
102-
"^io.micronaut"
97+
groupName: 'Micronaut packages',
98+
allowedVersions: '<4',
99+
matchFileNames: [
100+
'appengine-java11/**',
101+
'flexible/java-11/**',
103102
],
104-
"groupName": "Micronaut packages",
105-
"allowedVersions": "<4",
106-
"matchPaths": [
107-
"appengine-java11/**",
108-
"flexible/java-11/**"
103+
description: '@akitsch: Micronaut V4 requires Java 17',
104+
matchPackageNames: [
105+
'/^io.micronaut/',
109106
],
110-
"description": "@akitsch: Micronaut V4 requires Java 17"
111107
},
112-
// disable Scala dependency upgrades
113108
{
114-
"matchPackagePatterns": [
115-
"scala"
109+
enabled: false,
110+
matchPackageNames: [
111+
'/scala/',
116112
],
117-
"enabled": false
118113
},
119114
{
120-
"matchPackagePatterns": [
121-
"^jackson-module-scala"
115+
enabled: false,
116+
matchPackageNames: [
117+
'/^jackson-module-scala/',
122118
],
123-
"enabled": false
124119
},
125-
// disable SQL Spark dependency upgrades
126120
{
127-
"matchPackagePatterns": [
128-
"^spark-sql"
121+
enabled: false,
122+
matchPackageNames: [
123+
'/^spark-sql/',
129124
],
130-
"enabled": false
131125
},
132126
{},
133127
],
134-
"rebaseWhen": "behind-base-branch",
135-
"semanticCommits": "enabled",
136-
"vulnerabilityAlerts": {
137-
"labels": [
138-
"type:security"
128+
rebaseWhen: 'behind-base-branch',
129+
semanticCommits: 'enabled',
130+
vulnerabilityAlerts: {
131+
labels: [
132+
'type:security',
139133
],
140-
"minimumReleaseAge": null
134+
minimumReleaseAge: null,
141135
},
142-
}
136+
}

.kokoro/tests/run_prptst_tests.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,4 @@ else
9090
echo -e "\n Testing completed.\n"
9191
fi
9292

93-
# If this is a periodic build, send the test log to the FlakyBot except for Java 8
94-
# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot.
95-
if [[ $JAVA_VERSION != "1.8" && $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then
96-
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
97-
$KOKORO_GFILE_DIR/linux_amd64/flakybot
98-
fi
99-
10093
exit $RTN

.kokoro/tests/run_test_java.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,4 @@ if [[ "$file" == *"run/"* && ("$file" != *"run/filesystem"* && "$file" != *"run/
9696
fi
9797
fi
9898

99-
# If this is a periodic build, send the test log to the FlakyBot except for Java 8
100-
# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot.
101-
if [[ $JAVA_VERSION != "1.8" && $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then
102-
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
103-
$KOKORO_GFILE_DIR/linux_amd64/flakybot
104-
fi
105-
10699
exit $RTN
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package aiplatform.vectorsearch;
18+
19+
// [START aiplatform_sdk_vector_search_create_index_sample]
20+
21+
import com.google.cloud.aiplatform.v1.CreateIndexRequest;
22+
import com.google.cloud.aiplatform.v1.Index;
23+
import com.google.cloud.aiplatform.v1.Index.IndexUpdateMethod;
24+
import com.google.cloud.aiplatform.v1.IndexServiceClient;
25+
import com.google.cloud.aiplatform.v1.IndexServiceSettings;
26+
import com.google.cloud.aiplatform.v1.LocationName;
27+
import com.google.protobuf.Value;
28+
import com.google.protobuf.util.JsonFormat;
29+
import java.util.concurrent.TimeUnit;
30+
31+
public class CreateIndexSample {
32+
33+
public static void main(String[] args) throws Exception {
34+
// TODO(developer): Replace these variables before running the sample.
35+
String project = "YOUR_PROJECT_ID";
36+
String location = "YOUR_LOCATION";
37+
String displayName = "YOUR_INDEX_DISPLAY_NAME";
38+
String contentsDeltaUri = "gs://YOUR_BUCKET/";
39+
String metadataJson =
40+
String.format(
41+
"{\n"
42+
+ " \"contentsDeltaUri\": \"%s\",\n"
43+
+ " \"config\": {\n"
44+
+ " \"dimensions\": 100,\n"
45+
+ " \"approximateNeighborsCount\": 150,\n"
46+
+ " \"distanceMeasureType\": \"DOT_PRODUCT_DISTANCE\",\n"
47+
+ " \"shardSize\": \"SHARD_SIZE_MEDIUM\",\n"
48+
+ " \"algorithm_config\": {\n"
49+
+ " \"treeAhConfig\": {\n"
50+
+ " \"leafNodeEmbeddingCount\": 5000,\n"
51+
+ " \"fractionLeafNodesToSearch\": 0.03\n"
52+
+ " }\n"
53+
+ " }\n"
54+
+ " }\n"
55+
+ "}",
56+
contentsDeltaUri);
57+
58+
createIndexSample(project, location, displayName, metadataJson);
59+
}
60+
61+
public static Index createIndexSample(
62+
String project, String location, String displayName, String metadataJson) throws Exception {
63+
// Initialize client that will be used to send requests. This client only needs to be created
64+
// once, and can be reused for multiple requests.
65+
try (IndexServiceClient indexServiceClient =
66+
IndexServiceClient.create(
67+
IndexServiceSettings.newBuilder()
68+
.setEndpoint(location + "-aiplatform.googleapis.com:443")
69+
.build())) {
70+
Value.Builder metadataBuilder = Value.newBuilder();
71+
JsonFormat.parser().merge(metadataJson, metadataBuilder);
72+
73+
CreateIndexRequest request =
74+
CreateIndexRequest.newBuilder()
75+
.setParent(LocationName.of(project, location).toString())
76+
.setIndex(
77+
Index.newBuilder()
78+
.setDisplayName(displayName)
79+
.setMetadata(metadataBuilder)
80+
.setIndexUpdateMethod(IndexUpdateMethod.BATCH_UPDATE))
81+
.build();
82+
83+
return indexServiceClient.createIndexAsync(request).get(5, TimeUnit.MINUTES);
84+
}
85+
}
86+
}
87+
88+
// [END aiplatform_sdk_vector_search_create_index_sample]

0 commit comments

Comments
 (0)