Skip to content

Commit

Permalink
Merge pull request GoogleCloudPlatform#1459 from jingyih/add_google_v…
Browse files Browse the repository at this point in the history
…ertex_ai_index

Promote VertexAIIndex v1alpha1 to v1beta1
  • Loading branch information
google-oss-prow[bot] authored May 3, 2024
2 parents c22041b + 477ab37 commit 07ed46d
Show file tree
Hide file tree
Showing 31 changed files with 1,531 additions and 505 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Replace ${PROJECT_NUMBER?} below with your desired project number.
apiVersion: iam.cnrm.cloud.google.com/v1beta1
kind: IAMPolicyMember
metadata:
name: vertexaiindex-dep
spec:
member: serviceAccount:service-${PROJECT_NUMBER?}@gcp-sa-aiplatform.iam.gserviceaccount.com
role: roles/storage.admin # required by vertex AI service agent to access test data
resourceRef:
apiVersion: storage.cnrm.cloud.google.com/v1beta1
kind: StorageBucket
external: ${KCC_VERTEX_AI_INDEX_TEST_BUCKET?}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: vertexai.cnrm.cloud.google.com/v1beta1
kind: VertexAIIndex
metadata:
labels:
label-one: "value-one"
name: vertexaiindex-sample
spec:
displayName: "vertex AI index"
region: us-central1
description: "an example vertex AI index"
metadata:
# Replace ${KCC_VERTEX_AI_INDEX_TEST_DATA_URI?} with the Cloud Storage
# directory path to the files for inserting, updating or deleting the
# contents of the Matching Engine Index. For example,
# "gs://my-test-bucket/contents"
contentsDeltaUri: ${KCC_VERTEX_AI_INDEX_TEST_DATA_URI?}
config:
dimensions: 2
approximateNeighborsCount: 150
shardSize: "SHARD_SIZE_SMALL"
distanceMeasureType: "DOT_PRODUCT_DISTANCE"
algorithmConfig:
treeAhConfig:
leafNodeEmbeddingCount: 500
leafNodesToSearchPercent: 7
indexUpdateMethod: "BATCH_UPDATE"
projectRef:
# Replace ${PROJECT_ID?} with your project ID.
external: ${PROJECT_ID?}
31 changes: 31 additions & 0 deletions config/servicemappings/vertexai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,34 @@ spec:
group: compute.cnrm.cloud.google.com
version: v1beta1
kind: ComputeNetwork
- name: google_vertex_ai_index
kind: VertexAIIndex
idTemplate: "projects/{{project}}/locations/{{region}}/indexes/{{name}}"
idTemplateCanBeUsedToMatchResourceName: false
resourceAvailableInAssetInventory: false
v1alpha1ToV1beta1: true
storageVersion: v1alpha1
metadataMapping:
labels: labels
serverGeneratedIDField: name
resourceID:
targetField: name
mutableButUnreadableFields:
- metadata.contents_delta_uri # b/325303123#comment15
hierarchicalReferences:
- type: project
key: projectRef
resourceReferences:
- tfField: project
key: projectRef
description: |-
The project that this resource belongs to.
gvk:
kind: Project
version: v1beta1
group: resourcemanager.cnrm.cloud.google.com
ignoredFields:
- update_time
- etag
- deployed_indexes
- metadata.is_complete_overwrite # this field is set to true in Terraform patch when metadata.contents_delta_uri is set
2 changes: 2 additions & 0 deletions config/tests/samples/create/samples.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ func newSubstitutionVariables(t *testing.T, project testgcp.GCPProject) map[stri
subs["${DLP_TEST_BUCKET?}"] = testgcp.GetDLPTestBucket(t)
subs["${ATTACHED_CLUSTER_NAME?}"] = testgcp.TestAttachedClusterName.Get()
subs["${KCC_ATTACHED_CLUSTER_TEST_PROJECT?}"] = testgcp.TestKCCAttachedClusterProject.Get()
subs["${KCC_VERTEX_AI_INDEX_TEST_BUCKET?}"] = testgcp.TestKCCVertexAIIndexBucket.Get()
subs["${KCC_VERTEX_AI_INDEX_TEST_DATA_URI?}"] = testgcp.TestKCCVertexAIIndexDataURI.Get()
return subs
}

Expand Down
6 changes: 0 additions & 6 deletions pkg/clients/generated/apis/vertexai/v1alpha1/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 07ed46d

Please sign in to comment.