diff --git a/apiserver/pkg/application/application.go b/apiserver/pkg/application/application.go index 66e395e8d..212a2b7ff 100644 --- a/apiserver/pkg/application/application.go +++ b/apiserver/pkg/application/application.go @@ -987,7 +987,7 @@ func UploadIcon(ctx context.Context, client client.Client, icon, appName, namesp return "", err } - system, err := config.GetSystemDatasource(ctx, client) + system, err := config.GetSystemDatasource(ctx) if err != nil { return "", err } diff --git a/apiserver/pkg/chat/chat_docs.go b/apiserver/pkg/chat/chat_docs.go index 027b32420..e4674a224 100644 --- a/apiserver/pkg/chat/chat_docs.go +++ b/apiserver/pkg/chat/chat_docs.go @@ -206,7 +206,7 @@ func (cs *ChatServer) BuildConversationKnowledgeBase(ctx context.Context, req Co return err } // systemDatasource which stores the document - systemDatasource, err := config.GetSystemDatasource(ctx, cs.cli) + systemDatasource, err := config.GetSystemDatasource(ctx) if err != nil { return err } diff --git a/apiserver/pkg/chat/chat_server.go b/apiserver/pkg/chat/chat_server.go index 1600eae36..469963274 100644 --- a/apiserver/pkg/chat/chat_server.go +++ b/apiserver/pkg/chat/chat_server.go @@ -68,7 +68,7 @@ func (cs *ChatServer) Storage() storage.Storage { if cs.storage == nil { cs.once.Do(func() { ctx := context.TODO() - ds, err := pkgconfig.GetRelationalDatasource(ctx, cs.cli) + ds, err := pkgconfig.GetRelationalDatasourceWithClient(ctx, cs.cli) if err != nil || ds == nil { if err != nil { klog.Infof("get relational datasource failed: %s, use memory storage for chat", err.Error()) diff --git a/apiserver/pkg/common/common.go b/apiserver/pkg/common/common.go index fd0295004..c7de990db 100644 --- a/apiserver/pkg/common/common.go +++ b/apiserver/pkg/common/common.go @@ -62,7 +62,7 @@ var ( ) func SystemDatasourceOSS(ctx context.Context, mgrClient client.Client) (*datasource.OSS, error) { - systemDatasource, err := config.GetSystemDatasource(ctx, mgrClient) + systemDatasource, err := config.GetSystemDatasource(ctx) if err != nil { return nil, err } @@ -77,7 +77,7 @@ func SystemDatasourceOSS(ctx context.Context, mgrClient client.Client) (*datasou // Embedder and vectorstore are both required when generating a new embedding.That's why we call it a `EmbeddingSuit` func SystemEmbeddingSuite(ctx context.Context, cli client.Client) (*v1alpha1.Embedder, *v1alpha1.VectorStore, error) { // get the built-in system embedder - emd, err := config.GetEmbedder(ctx, cli) + emd, err := config.GetEmbedder(ctx) if err != nil { return nil, nil, err } @@ -86,7 +86,7 @@ func SystemEmbeddingSuite(ctx context.Context, cli client.Client) (*v1alpha1.Emb return nil, nil, err } // get the built-in system vectorstore - vs, err := config.GetVectorStore(ctx, cli) + vs, err := config.GetVectorStore(ctx) if err != nil { return nil, nil, err } @@ -99,8 +99,8 @@ func SystemEmbeddingSuite(ctx context.Context, cli client.Client) (*v1alpha1.Emb // GetAPIServer returns the api server url to access arcadia's worker // if external is true,then this func will return the external api server -func GetAPIServer(ctx context.Context, cli client.Client, external bool) (string, error) { - gateway, err := config.GetGateway(ctx, cli) +func GetAPIServer(ctx context.Context, _ client.Client, external bool) (string, error) { + gateway, err := config.GetGateway(ctx) if err != nil { return "", err } diff --git a/apiserver/pkg/knowledgebase/knowledgebase.go b/apiserver/pkg/knowledgebase/knowledgebase.go index 6c5be549c..08478e704 100644 --- a/apiserver/pkg/knowledgebase/knowledgebase.go +++ b/apiserver/pkg/knowledgebase/knowledgebase.go @@ -179,7 +179,7 @@ func knowledgebase2model(ctx context.Context, c client.Client, knowledgebase *v1 func CreateKnowledgeBase(ctx context.Context, c client.Client, input generated.CreateKnowledgeBaseInput) (*generated.KnowledgeBase, error) { var filegroups []v1alpha1.FileGroup var vectorstore v1alpha1.TypedObjectReference - vector, _ := config.GetVectorStore(ctx, c) + vector, _ := config.GetVectorStore(ctx) displayname, description, embedder := "", "", "" if input.DisplayName != nil { displayname = *input.DisplayName diff --git a/apiserver/pkg/ray/raycluster.go b/apiserver/pkg/ray/raycluster.go index 121b45429..b4be84686 100644 --- a/apiserver/pkg/ray/raycluster.go +++ b/apiserver/pkg/ray/raycluster.go @@ -27,7 +27,7 @@ import ( ) func ListRayClusters(ctx context.Context, c client.Client, input generated.ListCommonInput) (*generated.PaginatedResult, error) { - clusters, err := config.GetRayClusters(ctx, c) + clusters, err := config.GetRayClusters(ctx) if err != nil { return nil, err } diff --git a/controllers/app-node/retriever/rerank_retriever_controller.go b/controllers/app-node/retriever/rerank_retriever_controller.go index 91804a6fb..2767d134d 100644 --- a/controllers/app-node/retriever/rerank_retriever_controller.go +++ b/controllers/app-node/retriever/rerank_retriever_controller.go @@ -111,7 +111,7 @@ func (r *RerankRetrieverReconciler) reconcile(ctx context.Context, log logr.Logg } } if instance.Spec.Model == nil { - model, err := config.GetDefaultRerankModel(ctx, r.Client) + model, err := config.GetDefaultRerankModelWithClient(ctx, r.Client) if err != nil { instance.Status.SetConditions(instance.Status.ErrorCondition(fmt.Sprintf("no model provided. please set model in reranker or set system default reranking model in config :%s", err))...) return instance, ctrl.Result{RequeueAfter: 30 * time.Second}, err diff --git a/controllers/base/knowledgebase_controller.go b/controllers/base/knowledgebase_controller.go index 57d4c4b81..7df00ee34 100644 --- a/controllers/base/knowledgebase_controller.go +++ b/controllers/base/knowledgebase_controller.go @@ -403,7 +403,8 @@ func (r *KnowledgeBaseReconciler) reconcileFileGroup( kb *arcadiav1alpha1.KnowledgeBase, vectorStore *arcadiav1alpha1.VectorStore, embedder *arcadiav1alpha1.Embedder, - groupIndex, fileIndex int) (err error) { + groupIndex, fileIndex int, +) (err error) { defer func() { if err != nil { err = fmt.Errorf("failed to reconcile FileGroup: %w", err) @@ -436,7 +437,7 @@ func (r *KnowledgeBaseReconciler) reconcileFileGroup( if !versionedDataset.Status.IsReady() { return errDataSourceNotReady } - system, err := config.GetSystemDatasource(ctx, r.Client) + system, err := config.GetSystemDatasourceWithClient(ctx, r.Client) if err != nil { return err } diff --git a/controllers/base/model_controller.go b/controllers/base/model_controller.go index ce320fb96..2475f0e44 100644 --- a/controllers/base/model_controller.go +++ b/controllers/base/model_controller.go @@ -188,7 +188,7 @@ func (r *ModelReconciler) CheckModel(ctx context.Context, logger logr.Logger, in // otherwise we consider the model file for the trans-core service to be ready. if instance.Spec.Source == nil && (instance.Spec.HuggingFaceRepo == "" && instance.Spec.ModelScopeRepo == "") { logger.V(5).Info(fmt.Sprintf("model %s source is empty, check minio status.", instance.Name)) - system, err := config.GetSystemDatasource(ctx, r.Client) + system, err := config.GetSystemDatasourceWithClient(ctx, r.Client) if err != nil { return r.UpdateStatus(ctx, instance, err) } @@ -223,7 +223,7 @@ func (r *ModelReconciler) RemoveModel(ctx context.Context, logger logr.Logger, i var ds datasource.Datasource var info any - system, err := config.GetSystemDatasource(ctx, r.Client) + system, err := config.GetSystemDatasourceWithClient(ctx, r.Client) if err != nil { return r.UpdateStatus(ctx, instance, err) } diff --git a/controllers/base/namespace_controller.go b/controllers/base/namespace_controller.go index fec238eb7..0b89a99ec 100644 --- a/controllers/base/namespace_controller.go +++ b/controllers/base/namespace_controller.go @@ -140,7 +140,7 @@ func (r *NamespaceReconciler) SetupWithManager(mgr ctrl.Manager) error { } func (r *NamespaceReconciler) ossClient(ctx context.Context) (*datasource.OSS, error) { - systemDatasource, err := config.GetSystemDatasource(ctx, r.Client) + systemDatasource, err := config.GetSystemDatasourceWithClient(ctx, r.Client) if err != nil { klog.Errorf("get system datasource error %s", err) return nil, err diff --git a/controllers/base/versioneddataset_controller.go b/controllers/base/versioneddataset_controller.go index 259f34742..5847969f0 100644 --- a/controllers/base/versioneddataset_controller.go +++ b/controllers/base/versioneddataset_controller.go @@ -213,7 +213,7 @@ func (r *VersionedDatasetReconciler) preUpdate(ctx context.Context, logger logr. func (r *VersionedDatasetReconciler) checkStatus(ctx context.Context, logger logr.Logger, instance *v1alpha1.VersionedDataset) (bool, []v1alpha1.FileStatus, error) { // TODO: Currently, we think there is only one default minio environment, // so we get the minio client directly through the configuration. - systemDatasource, err := config.GetSystemDatasource(ctx, r.Client) + systemDatasource, err := config.GetSystemDatasourceWithClient(ctx, r.Client) if err != nil { logger.Error(err, "Failed to get system datasource") return false, nil, err @@ -233,7 +233,7 @@ func (r *VersionedDatasetReconciler) checkStatus(ctx context.Context, logger log } func (r *VersionedDatasetReconciler) removeBucketFiles(ctx context.Context, logger logr.Logger, instance *v1alpha1.VersionedDataset) error { - systemDatasource, err := config.GetSystemDatasource(ctx, r.Client) + systemDatasource, err := config.GetSystemDatasourceWithClient(ctx, r.Client) if err != nil { logger.Error(err, "Failed to get system datasource") return err diff --git a/controllers/base/worker_controller.go b/controllers/base/worker_controller.go index d852a6975..999d6aa62 100644 --- a/controllers/base/worker_controller.go +++ b/controllers/base/worker_controller.go @@ -202,7 +202,7 @@ func (r *WorkerReconciler) reconcile(ctx context.Context, logger logr.Logger, wo return worker, errors.Wrap(err, "model config datasource, but get it failed.") } } else { - datasource, err = config.GetSystemDatasource(ctx, r.Client) + datasource, err = config.GetSystemDatasourceWithClient(ctx, r.Client) if err != nil { return worker, errors.Wrap(err, "Failed to get system datasource") } diff --git a/controllers/evaluation/rag_controller.go b/controllers/evaluation/rag_controller.go index 77a351843..ef7328ed5 100644 --- a/controllers/evaluation/rag_controller.go +++ b/controllers/evaluation/rag_controller.go @@ -468,7 +468,7 @@ func (r *RAGReconciler) WhenJobChanged(job *batchv1.Job) { func (r *RAGReconciler) RemoveRAGFiles(ctx context.Context, rag *evaluationarcadiav1alpha1.RAG) { logger := log.FromContext(ctx, "RAG", rag.Name, "Namespace", rag.Namespace, "Action", "DeleteRAGFiles") - systemDatasource, err := config.GetSystemDatasource(ctx, r.Client) + systemDatasource, err := config.GetSystemDatasourceWithClient(ctx, r.Client) if err != nil { logger.Error(err, "failed to get system datasource") return diff --git a/pkg/appruntime/documentloader/documentloader.go b/pkg/appruntime/documentloader/documentloader.go index 99f607735..dd3283d0b 100644 --- a/pkg/appruntime/documentloader/documentloader.go +++ b/pkg/appruntime/documentloader/documentloader.go @@ -75,7 +75,7 @@ func (dl *DocumentLoader) Run(ctx context.Context, cli client.Client, args map[s if err := cli.Get(ctx, types.NamespacedName{Namespace: dl.RefNamespace(), Name: dl.Ref.Name}, dl.Instance); err != nil { return args, fmt.Errorf("can't find the documentloader in cluster: %w", err) } - system, err := config.GetSystemDatasource(ctx, cli) + system, err := config.GetSystemDatasource(ctx) if err != nil { return nil, err } diff --git a/pkg/arctl/eval.go b/pkg/arctl/eval.go index 933367d71..c37ca2619 100644 --- a/pkg/arctl/eval.go +++ b/pkg/arctl/eval.go @@ -259,7 +259,7 @@ var ( func SysatemDatasource(ctx context.Context, kubeClient client.Client) (*basev1alpha1.Datasource, error) { once.Do(func() { - systemDatasource, systemError = config.GetSystemDatasource(ctx, kubeClient) + systemDatasource, systemError = config.GetSystemDatasourceWithClient(ctx, kubeClient) }) return systemDatasource, systemError } diff --git a/pkg/config/config.go b/pkg/config/config.go index b82ea9d3b..2e8f06d42 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -26,6 +26,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" arcadiav1alpha1 "github.com/kubeagi/arcadia/api/base/v1alpha1" + pkgclient "github.com/kubeagi/arcadia/apiserver/pkg/client" "github.com/kubeagi/arcadia/pkg/datasource" "github.com/kubeagi/arcadia/pkg/utils" ) @@ -57,24 +58,32 @@ func getDatasource(ctx context.Context, ref arcadiav1alpha1.TypedObjectReference return source, err } -func GetSystemDatasource(ctx context.Context, c client.Client) (*arcadiav1alpha1.Datasource, error) { - config, err := GetConfig(ctx, c) +func GetSystemDatasourceWithClient(ctx context.Context, c client.Client) (*arcadiav1alpha1.Datasource, error) { + config, err := getConfig(ctx, c) if err != nil { return nil, err } return getDatasource(ctx, config.SystemDatasource, c) } -func GetRelationalDatasource(ctx context.Context, c client.Client) (*arcadiav1alpha1.Datasource, error) { - config, err := GetConfig(ctx, c) +func GetSystemDatasource(ctx context.Context) (*arcadiav1alpha1.Datasource, error) { + return GetSystemDatasourceWithClient(ctx, nil) +} + +func GetRelationalDatasourceWithClient(ctx context.Context, c client.Client) (*arcadiav1alpha1.Datasource, error) { + config, err := getConfig(ctx, c) if err != nil { return nil, err } return getDatasource(ctx, config.RelationalDatasource, c) } -func GetGateway(ctx context.Context, c client.Client) (*Gateway, error) { - config, err := GetConfig(ctx, c) +func GetRelationalDatasource(ctx context.Context) (*arcadiav1alpha1.Datasource, error) { + return GetRelationalDatasourceWithClient(ctx, nil) +} + +func GetGatewayWithClient(ctx context.Context, c client.Client) (*Gateway, error) { + config, err := getConfig(ctx, c) if err != nil { return nil, err } @@ -83,8 +92,18 @@ func GetGateway(ctx context.Context, c client.Client) (*Gateway, error) { } return config.Gateway, nil } +func GetGateway(ctx context.Context) (*Gateway, error) { + return GetGatewayWithClient(ctx, nil) +} -func GetConfig(ctx context.Context, c client.Client) (config *Config, err error) { +// if c is nil, use system client +func getConfig(ctx context.Context, c client.Client) (config *Config, err error) { + if c == nil { + c, err = pkgclient.GetClient(nil) + if err != nil { + return nil, err + } + } cmName := env.GetString(EnvConfigKey, EnvConfigDefaultValue) if cmName == "" { return nil, ErrNoConfigEnv @@ -104,9 +123,9 @@ func GetConfig(ctx context.Context, c client.Client) (config *Config, err error) return config, nil } -// GetEmbedder get the default embedder from config -func GetEmbedder(ctx context.Context, c client.Client) (*arcadiav1alpha1.TypedObjectReference, error) { - config, err := GetConfig(ctx, c) +// GetEmbedderWithClient get the default embedder from config +func GetEmbedderWithClient(ctx context.Context, c client.Client) (*arcadiav1alpha1.TypedObjectReference, error) { + config, err := getConfig(ctx, c) if err != nil { return nil, err } @@ -115,10 +134,13 @@ func GetEmbedder(ctx context.Context, c client.Client) (*arcadiav1alpha1.TypedOb } return config.Embedder, nil } +func GetEmbedder(ctx context.Context) (*arcadiav1alpha1.TypedObjectReference, error) { + return GetEmbedderWithClient(ctx, nil) +} -// GetVectorStore get the default vector store from config -func GetVectorStore(ctx context.Context, c client.Client) (*arcadiav1alpha1.TypedObjectReference, error) { - config, err := GetConfig(ctx, c) +// GetVectorStoreWithClient get the default vector store from config +func GetVectorStoreWithClient(ctx context.Context, c client.Client) (*arcadiav1alpha1.TypedObjectReference, error) { + config, err := getConfig(ctx, c) if err != nil { return nil, err } @@ -128,9 +150,14 @@ func GetVectorStore(ctx context.Context, c client.Client) (*arcadiav1alpha1.Type return config.VectorStore, nil } -// Get the configuration of streamlit tool -func GetStreamlit(ctx context.Context, c client.Client) (*Streamlit, error) { - config, err := GetConfig(ctx, c) +// GetVectorStore get the default vector store from config +func GetVectorStore(ctx context.Context) (*arcadiav1alpha1.TypedObjectReference, error) { + return GetVectorStoreWithClient(ctx, nil) +} + +// GetStreamlitWithClient Get the configuration of streamlit tool +func GetStreamlitWithClient(ctx context.Context, c client.Client) (*Streamlit, error) { + config, err := getConfig(ctx, c) if err != nil { return nil, err } @@ -140,9 +167,14 @@ func GetStreamlit(ctx context.Context, c client.Client) (*Streamlit, error) { return config.Streamlit, nil } -// Get the ray cluster that can be used a resource pool -func GetRayClusters(ctx context.Context, c client.Client) ([]RayCluster, error) { - config, err := GetConfig(ctx, c) +// Get the configuration of streamlit tool +func GetStreamlit(ctx context.Context) (*Streamlit, error) { + return GetStreamlitWithClient(ctx, nil) +} + +// GetRayClustersWithClient Get the ray cluster that can be used a resource pool +func GetRayClustersWithClient(ctx context.Context, c client.Client) ([]RayCluster, error) { + config, err := getConfig(ctx, c) if err != nil { return nil, err } @@ -152,9 +184,13 @@ func GetRayClusters(ctx context.Context, c client.Client) ([]RayCluster, error) return config.RayClusters, nil } -// GetDefaultRerankModel gets the default reranking model which is recommended by kubeagi -func GetDefaultRerankModel(ctx context.Context, c client.Client) (*arcadiav1alpha1.TypedObjectReference, error) { - config, err := GetConfig(ctx, c) +func GetRayClusters(ctx context.Context) ([]RayCluster, error) { + return GetRayClustersWithClient(ctx, nil) +} + +// GetDefaultRerankModelWithClient gets the default reranking model which is recommended by kubeagi +func GetDefaultRerankModelWithClient(ctx context.Context, c client.Client) (*arcadiav1alpha1.TypedObjectReference, error) { + config, err := getConfig(ctx, c) if err != nil { return nil, err } @@ -164,8 +200,13 @@ func GetDefaultRerankModel(ctx context.Context, c client.Client) (*arcadiav1alph return config.Rerank, nil } -func GetSystemDatasourceOSS(ctx context.Context, mgrClient client.Client) (*datasource.OSS, error) { - systemDatasource, err := GetSystemDatasource(ctx, mgrClient) +// GetDefaultRerankModel gets the default reranking model which is recommended by kubeagi +func GetDefaultRerankModel(ctx context.Context) (*arcadiav1alpha1.TypedObjectReference, error) { + return GetDefaultRerankModelWithClient(ctx, nil) +} + +func GetSystemDatasourceOSSWithClient(ctx context.Context, mgrClient client.Client) (*datasource.OSS, error) { + systemDatasource, err := GetSystemDatasourceWithClient(ctx, mgrClient) if err != nil { return nil, err } @@ -175,3 +216,7 @@ func GetSystemDatasourceOSS(ctx context.Context, mgrClient client.Client) (*data } return datasource.NewOSS(ctx, mgrClient, endpoint) } + +func GetSystemDatasourceOSS(ctx context.Context) (*datasource.OSS, error) { + return GetSystemDatasourceOSSWithClient(ctx, nil) +} diff --git a/pkg/evaluation/jobs.go b/pkg/evaluation/jobs.go index b51832ed7..cf581a2bc 100644 --- a/pkg/evaluation/jobs.go +++ b/pkg/evaluation/jobs.go @@ -58,7 +58,7 @@ func PhaseJobName(instance *evav1alpha1.RAG, phase evav1alpha1.RAGPhase) string } func systemEmbeddingSuite(ctx context.Context, mgrClient client.Client) (*v1alpha1.Embedder, error) { // get the built-in system embedder - emd, err := config.GetEmbedder(ctx, mgrClient) + emd, err := config.GetEmbedderWithClient(ctx, mgrClient) if err != nil { return nil, err } @@ -303,7 +303,7 @@ func JudgeJobGenerator(ctx context.Context, c client.Client) func(*evav1alpha1.R func UploadJobGenerator(ctx context.Context, client client.Client) func(*evav1alpha1.RAG) (*batchv1.Job, error) { return func(instance *evav1alpha1.RAG) (*batchv1.Job, error) { - datasource, err := config.GetSystemDatasource(ctx, client) + datasource, err := config.GetSystemDatasourceWithClient(ctx, client) if err != nil { return nil, err } diff --git a/pkg/langchainwrap/embedder.go b/pkg/langchainwrap/embedder.go index 2645f8630..9fbfc05ed 100644 --- a/pkg/langchainwrap/embedder.go +++ b/pkg/langchainwrap/embedder.go @@ -90,7 +90,7 @@ func GetLangchainEmbedder(ctx context.Context, e *v1alpha1.Embedder, c client.Cl return langchaingoembeddings.NewEmbedder(llm, opts...) } case v1alpha1.ProviderTypeWorker: - gateway, err := config.GetGateway(ctx, c) + gateway, err := config.GetGateway(ctx) if err != nil { return nil, err } diff --git a/pkg/langchainwrap/llm.go b/pkg/langchainwrap/llm.go index 12414fb89..a37a2b9bc 100644 --- a/pkg/langchainwrap/llm.go +++ b/pkg/langchainwrap/llm.go @@ -78,7 +78,7 @@ func GetLangchainLLM(ctx context.Context, llm *v1alpha1.LLM, c client.Client, mo return googleLLM, nil } case v1alpha1.ProviderTypeWorker: - gateway, err := config.GetGateway(ctx, c) + gateway, err := config.GetGateway(ctx) if err != nil { return nil, err } diff --git a/pkg/scheduler/scheduler.go b/pkg/scheduler/scheduler.go index 2335ef34d..b623606ee 100644 --- a/pkg/scheduler/scheduler.go +++ b/pkg/scheduler/scheduler.go @@ -49,7 +49,7 @@ func NewScheduler(ctx context.Context, c client.Client, instance *v1alpha1.Versi // TODO: Currently, we think there is only one default minio environment, // so we get the minio client directly through the configuration. - systemDatasource, err := config.GetSystemDatasource(ctx1, c) + systemDatasource, err := config.GetSystemDatasourceWithClient(ctx1, c) if err != nil { klog.Errorf("generate new scheduler error %s", err) cancel() diff --git a/pkg/streamlit/deployer.go b/pkg/streamlit/deployer.go index 78ea59258..b9111ec34 100644 --- a/pkg/streamlit/deployer.go +++ b/pkg/streamlit/deployer.go @@ -65,7 +65,7 @@ func (st *StreamlitDeployer) Install() error { namespace := st.namespace.Name // lookup streamlit image from config - streamlitConfig, err := config.GetStreamlit(st.ctx, st.client) + streamlitConfig, err := config.GetStreamlitWithClient(st.ctx, st.client) if err != nil { klog.Errorln("failed to get streamlit config", err) return err diff --git a/pkg/worker/runner.go b/pkg/worker/runner.go index d2c838d99..3bdf4b19c 100644 --- a/pkg/worker/runner.go +++ b/pkg/worker/runner.go @@ -88,7 +88,7 @@ func (runner *RunnerFastchat) Build(ctx context.Context, model *arcadiav1alpha1. if model == nil { return nil, errors.New("nil model") } - gw, err := config.GetGateway(ctx, runner.c) + gw, err := config.GetGatewayWithClient(ctx, runner.c) if err != nil { return nil, fmt.Errorf("failed to get arcadia config with %w", err) } @@ -188,7 +188,7 @@ func (runner *RunnerFastchatVLLM) Build(ctx context.Context, model *arcadiav1alp if model == nil { return nil, errors.New("nil model") } - gw, err := config.GetGateway(ctx, runner.c) + gw, err := config.GetGatewayWithClient(ctx, runner.c) if err != nil { return nil, fmt.Errorf("failed to get arcadia config with %w", err) } @@ -205,7 +205,7 @@ func (runner *RunnerFastchatVLLM) Build(ctx context.Context, model *arcadiav1alp // using existing ray cluster if envItem.Name == "RAY_CLUSTER_INDEX" { externalRayClusterIndex, _ := strconv.Atoi(envItem.Value) - rayClusters, err := config.GetRayClusters(ctx, runner.c) + rayClusters, err := config.GetRayClustersWithClient(ctx, runner.c) if err != nil || len(rayClusters) == 0 { return nil, fmt.Errorf("failed to find ray clusters: %s", err.Error()) }