Skip to content

Commit 8cab94b

Browse files
committed
Add GCS native client
1 parent 7b1d2d1 commit 8cab94b

File tree

6 files changed

+216
-89
lines changed

6 files changed

+216
-89
lines changed

historyserver/go.mod

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ module github.com/ray-project/kuberay/historyserver
33
go 1.25.0
44

55
require (
6+
cloud.google.com/go/storage v1.59.1
67
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0
78
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1
89
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.4
9-
cloud.google.com/go/storage v1.59.1
1010
github.com/alibabacloud-go/tea v1.3.11
1111
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible
1212
github.com/aliyun/credentials-go v1.4.7
@@ -97,36 +97,8 @@ require (
9797
cloud.google.com/go/compute/metadata v0.9.0 // indirect
9898
cloud.google.com/go/iam v1.5.3 // indirect
9999
cloud.google.com/go/monitoring v1.24.3 // indirect
100-
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 // indirect
101-
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.54.0 // indirect
102-
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.54.0 // indirect
103-
github.com/cncf/xds/go v0.0.0-20251022180443-0feb69152e9f // indirect
104-
github.com/envoyproxy/go-control-plane/envoy v1.35.0 // indirect
105-
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
106-
github.com/felixge/httpsnoop v1.0.4 // indirect
107-
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
108-
github.com/go-logr/stdr v1.2.2 // indirect
109-
github.com/google/s2a-go v0.1.9 // indirect
110-
github.com/googleapis/enterprise-certificate-proxy v0.3.11 // indirect
111-
github.com/googleapis/gax-go/v2 v2.16.0 // indirect
112100
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect
113101
github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 // indirect
114-
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
115-
github.com/kylelemons/godebug v1.1.0 // indirect
116-
github.com/moby/spdystream v0.5.0 // indirect
117-
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
118-
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
119-
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
120-
golang.org/x/crypto v0.45.0 // indirect
121-
golang.org/x/mod v0.29.0 // indirect
122-
golang.org/x/tools v0.38.0 // indirect
123-
cel.dev/expr v0.24.0 // indirect
124-
cloud.google.com/go v0.123.0 // indirect
125-
cloud.google.com/go/auth v0.18.0 // indirect
126-
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
127-
cloud.google.com/go/compute/metadata v0.9.0 // indirect
128-
cloud.google.com/go/iam v1.5.3 // indirect
129-
cloud.google.com/go/monitoring v1.24.3 // indirect
130102
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 // indirect
131103
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.54.0 // indirect
132104
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.54.0 // indirect
@@ -136,14 +108,16 @@ require (
136108
github.com/felixge/httpsnoop v1.0.4 // indirect
137109
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
138110
github.com/go-logr/stdr v1.2.2 // indirect
111+
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
139112
github.com/google/s2a-go v0.1.9 // indirect
140113
github.com/googleapis/enterprise-certificate-proxy v0.3.11 // indirect
141114
github.com/googleapis/gax-go/v2 v2.16.0 // indirect
115+
github.com/kylelemons/godebug v1.1.0 // indirect
142116
github.com/moby/spdystream v0.5.0 // indirect
117+
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
143118
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
144119
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
145120
github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect
146-
github.com/stretchr/testify v1.11.1 // indirect
147121
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
148122
go.opentelemetry.io/contrib/detectors/gcp v1.38.0 // indirect
149123
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect

historyserver/go.sum

Lines changed: 16 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package gcs
2+
3+
import (
4+
"os"
5+
6+
"github.com/ray-project/kuberay/historyserver/pkg/collector/types"
7+
)
8+
9+
const DefaultGCSBucket = "ray-historyserver"
10+
11+
type config struct {
12+
Bucket string
13+
types.RayCollectorConfig
14+
}
15+
16+
func getGCSDefaultBucketName() string {
17+
bucket := os.Getenv("GCS_BUCKET")
18+
if bucket == "" {
19+
return DefaultGCSBucket
20+
}
21+
return bucket
22+
}
23+
24+
func (c *config) completeCollectorConfig(rcc *types.RayCollectorConfig, jd map[string]interface{}) {
25+
c.RayCollectorConfig = *rcc
26+
c.Bucket = getGCSDefaultBucketName()
27+
if len(jd) != 0 {
28+
if bucket, ok := jd["gcsBucket"]; ok {
29+
c.Bucket = bucket.(string)
30+
}
31+
}
32+
}
33+
34+
func (c *config) completeHistoryServerConfig(rcc *types.RayHistoryServerConfig, jd map[string]interface{}) {
35+
c.RayCollectorConfig = types.RayCollectorConfig{
36+
RootDir: rcc.RootDir,
37+
}
38+
c.Bucket = getGCSDefaultBucketName()
39+
if len(jd) != 0 {
40+
if bucket, ok := jd["gcsBucket"]; ok {
41+
c.Bucket = bucket.(string)
42+
}
43+
}
44+
}

0 commit comments

Comments
 (0)