Skip to content

Commit 8ed4763

Browse files
committed
Update aiplatform go lib version
1 parent a01bd11 commit 8ed4763

File tree

6 files changed

+47
-17
lines changed

6 files changed

+47
-17
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toolchain go1.23.4
77
replace github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp => ./mockgcp
88

99
require (
10-
cloud.google.com/go/aiplatform v1.74.0
10+
cloud.google.com/go/aiplatform v1.78.0
1111
cloud.google.com/go/alloydb v1.14.0
1212
cloud.google.com/go/apikeys v1.1.12
1313
cloud.google.com/go/apphub v0.2.3
@@ -94,7 +94,7 @@ require (
9494
google.golang.org/api v0.224.0
9595
google.golang.org/genproto v0.0.0-20250303144028-a0af3efb3deb
9696
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb
97-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250227231956-55c901821b1e
97+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb
9898
google.golang.org/grpc v1.71.0
9999
google.golang.org/protobuf v1.36.5
100100
gopkg.in/dnaeon/go-vcr.v3 v3.2.0

go.sum

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/controller/direct/colab/runtimetemplate_controller.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@ func (m *runtimeTemplateModel) client(ctx context.Context, projectID, location s
6868

6969
endpoint := fmt.Sprintf("https://%s-aiplatform.googleapis.com", location)
7070
opts = append(opts, option.WithEndpoint(endpoint))
71-
// Setting the logger to debug level is the only way to figure out the error details.
72-
//lvl := new(slog.LevelVar)
73-
//lvl.Set(slog.LevelDebug)
74-
//logger := slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{
75-
// Level: lvl,
76-
//}))
77-
//opts = append(opts, option.WithLogger(logger))
7871
gcpClient, err := gcp.NewNotebookRESTClient(ctx, opts...)
7972
if err != nil {
8073
return nil, fmt.Errorf("building colabruntimetemplate client: %w", err)
@@ -204,7 +197,6 @@ func (a *runtimeTemplateAdapter) Create(ctx context.Context, createOp *directbas
204197
NotebookRuntimeTemplate: desiredPb,
205198
NotebookRuntimeTemplateId: a.id.ID(),
206199
}
207-
// Note: The returned error doesn't contain any error message details.
208200
op, err := a.gcpClient.CreateNotebookRuntimeTemplate(ctx, req)
209201
if err != nil {
210202
return fmt.Errorf("creating colabruntimetemplate %s: %w", a.id.String(), err)
@@ -271,8 +263,8 @@ func (a *runtimeTemplateAdapter) Update(ctx context.Context, updateOp *directbas
271263
UpdateMask: updateMask,
272264
NotebookRuntimeTemplate: desiredPb,
273265
}
274-
// Note: There doesn't seem to be any update mask allowed by the API.
275-
// Note: The returned error doesn't contain any error message details.
266+
// Currently, the only allowed update mask path is
267+
// "encryption_spec.kms_key_name".
276268
updated, err := a.gcpClient.UpdateNotebookRuntimeTemplate(ctx, req)
277269
if err != nil {
278270
return fmt.Errorf("updating colabruntimetemplate %s: %w", a.id.String(), err)

pkg/controller/direct/colab/runtimetemplate_fuzzer.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ func colabRuntimeTemplateFuzzer() fuzztesting.KRMFuzzer {
3535

3636
f.UnimplementedFields.Insert(".name") // special field
3737
f.UnimplementedFields.Insert(".is_default") // deprecated field
38-
// "software_config" field is unsupported in third_party because we use an
38+
// The following fields are unsupported in third_party because we use an
3939
// old googleapis version. Automation tools don't know this field.
4040
// However, it is supported in the version of cloud.google.com/go/aiplatform
4141
// we define in go.mod.
4242
f.UnimplementedFields.Insert(".software_config")
43+
f.UnimplementedFields.Insert(".machine_spec.multihost_gpu_node_count")
4344

4445
f.SpecFields.Insert(".display_name")
4546
f.SpecFields.Insert(".description")

pkg/test/resourcefixture/testdata/basic/colab/v1alpha1/colabruntimetemplate/basiccolabruntimetemplate/create.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ spec:
1414
name: computenetwork-${uniqueId}
1515
subnetworkRef:
1616
name: computesubnetwork-${uniqueId}
17+
# The only updatable field is encryptionSpec.kmsKeyRef, but setting the field
18+
# triggers a quota issue so update can't be tested.
19+
# encryptionSpec:
20+
# kmsKeyRef:
21+
# name: kmscryptokey-1-${uniqueId}

pkg/test/resourcefixture/testdata/basic/colab/v1alpha1/colabruntimetemplate/basiccolabruntimetemplate/dependencies.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,35 @@ spec:
2424
region: us-central1
2525
networkRef:
2626
name: computenetwork-${uniqueId}
27+
#---
28+
#apiVersion: iam.cnrm.cloud.google.com/v1beta1
29+
#kind: IAMPolicyMember
30+
#metadata:
31+
# name: iampolicymember-${uniqueId}
32+
#spec:
33+
# member: serviceAccount:service-${projectNumber}@gcp-sa-aiplatform.iam.gserviceaccount.com
34+
# role: roles/cloudkms.cryptoKeyEncrypterDecrypter # required by cloud run service agent to access KMS keys
35+
# resourceRef:
36+
# apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
37+
# kind: Project
38+
# external: projects/${projectId}
39+
#---
40+
#apiVersion: kms.cnrm.cloud.google.com/v1beta1
41+
#kind: KMSKeyRing
42+
#metadata:
43+
# annotations:
44+
# cnrm.cloud.google.com/project-id: ${projectId}
45+
# name: kmskeyring-${uniqueId}
46+
#spec:
47+
# location: us-central1
48+
#---
49+
#apiVersion: kms.cnrm.cloud.google.com/v1beta1
50+
#kind: KMSCryptoKey
51+
#metadata:
52+
# annotations:
53+
# cnrm.cloud.google.com/project-id: ${projectId}
54+
# name: kmscryptokey-1-${uniqueId}
55+
#spec:
56+
# keyRingRef:
57+
# name: kmskeyring-${uniqueId}
58+
# purpose: ENCRYPT_DECRYPT

0 commit comments

Comments
 (0)