Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup: remove unused initConnectionTimeout for RayClient in apiserver #2399

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions apiserver/pkg/client/cluster.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package client

import (
"time"

klog "k8s.io/klog/v2"
"k8s.io/klog/v2"

"github.com/ray-project/kuberay/apiserver/pkg/util"
"sigs.k8s.io/controller-runtime/pkg/client/config"
Expand All @@ -24,7 +22,7 @@ func (cc RayClusterClient) RayClusterClient(namespace string) rayv1.RayClusterIn
return cc.client.RayClusters(namespace)
}

func NewRayClusterClientOrFatal(initConnectionTimeout time.Duration, options util.ClientOptions) ClusterClientInterface {
func NewRayClusterClientOrFatal(options util.ClientOptions) ClusterClientInterface {
cfg, err := config.GetConfig()
if err != nil {
klog.Fatalf("Failed to create RayCluster client. Error: %v", err)
Expand Down
6 changes: 2 additions & 4 deletions apiserver/pkg/client/job.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package client

import (
"time"

klog "k8s.io/klog/v2"
"k8s.io/klog/v2"

"github.com/ray-project/kuberay/apiserver/pkg/util"
"sigs.k8s.io/controller-runtime/pkg/client/config"
Expand All @@ -24,7 +22,7 @@ func (cc RayJobClient) RayJobClient(namespace string) rayv1.RayJobInterface {
return cc.client.RayJobs(namespace)
}

func NewRayJobClientOrFatal(initConnectionTimeout time.Duration, options util.ClientOptions) JobClientInterface {
func NewRayJobClientOrFatal(options util.ClientOptions) JobClientInterface {
cfg, err := config.GetConfig()
if err != nil {
klog.Fatalf("Failed to create RayCluster client. Error: %v", err)
Expand Down
6 changes: 2 additions & 4 deletions apiserver/pkg/client/kubernetes.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package client

import (
"time"

klog "k8s.io/klog/v2"
"k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/client/config"

"github.com/ray-project/kuberay/apiserver/pkg/util"
Expand Down Expand Up @@ -39,7 +37,7 @@ func (c *KubernetesClient) NamespaceClient() v1.NamespaceInterface {
}

// CreateKubernetesCoreOrFatal creates a new client for the Kubernetes pod.
func CreateKubernetesCoreOrFatal(initConnectionTimeout time.Duration, options util.ClientOptions) KubernetesClientInterface {
func CreateKubernetesCoreOrFatal(options util.ClientOptions) KubernetesClientInterface {
cfg, err := config.GetConfig()
if err != nil {
klog.Fatalf("Failed to create TokenReview client. Error: %v", err)
Expand Down
6 changes: 2 additions & 4 deletions apiserver/pkg/client/service.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package client

import (
"time"

klog "k8s.io/klog/v2"
"k8s.io/klog/v2"

"github.com/ray-project/kuberay/apiserver/pkg/util"
"sigs.k8s.io/controller-runtime/pkg/client/config"
Expand All @@ -24,7 +22,7 @@ func (cc RayServiceClient) RayServiceClient(namespace string) rayv1.RayServiceIn
return cc.client.RayServices(namespace)
}

func NewRayServiceClientOrFatal(initConnectionTimeout time.Duration, options util.ClientOptions) ServiceClientInterface {
func NewRayServiceClientOrFatal(options util.ClientOptions) ServiceClientInterface {
cfg, err := config.GetConfig()
if err != nil {
klog.Fatalf("Failed to create RayService client. Error: %v", err)
Expand Down
13 changes: 5 additions & 8 deletions apiserver/pkg/manager/client_manager.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package manager

import (
"time"

"github.com/ray-project/kuberay/apiserver/pkg/client"
"github.com/ray-project/kuberay/apiserver/pkg/util"
klog "k8s.io/klog/v2"
"k8s.io/klog/v2"
)

type ClientManagerInterface interface {
Expand Down Expand Up @@ -52,7 +50,6 @@ func (c *ClientManager) init() {
klog.Info("Initializing client manager")

// configure configs
initConnectionTimeout := 15 * time.Second
defaultKubernetesClientConfig := util.ClientOptions{
QPS: 5,
Burst: 10,
Expand All @@ -63,10 +60,10 @@ func (c *ClientManager) init() {

// TODO: Potentially, we may need storage layer clients to help persist the data.
// 2. kubernetes client initialization
c.clusterClient = client.NewRayClusterClientOrFatal(initConnectionTimeout, defaultKubernetesClientConfig)
c.jobClient = client.NewRayJobClientOrFatal(initConnectionTimeout, defaultKubernetesClientConfig)
c.serviceClient = client.NewRayServiceClientOrFatal(initConnectionTimeout, defaultKubernetesClientConfig)
c.kubernetesClient = client.CreateKubernetesCoreOrFatal(initConnectionTimeout, defaultKubernetesClientConfig)
c.clusterClient = client.NewRayClusterClientOrFatal(defaultKubernetesClientConfig)
c.jobClient = client.NewRayJobClientOrFatal(defaultKubernetesClientConfig)
c.serviceClient = client.NewRayServiceClientOrFatal(defaultKubernetesClientConfig)
c.kubernetesClient = client.CreateKubernetesCoreOrFatal(defaultKubernetesClientConfig)

klog.Infof("Client manager initialized successfully")
}
Expand Down
Loading