Skip to content

Commit 8b2788f

Browse files
authored
Merge pull request #36 from dmaniloff/token-as-secret-and-redacted
refactor: rename pipelines_token to pipelines_api_token to get logs redacted && use SecretStr.
2 parents 2c60a92 + 010f438 commit 8b2788f

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

distribution/run-remote.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ providers:
2121
namespace: ${env.KUBEFLOW_NAMESPACE}
2222
llama_stack_url: ${env.KUBEFLOW_LLAMA_STACK_URL}
2323
base_image: ${env.KUBEFLOW_BASE_IMAGE}
24-
pipelines_token: ${env.KUBEFLOW_PIPELINES_TOKEN:=}
24+
pipelines_api_token: ${env.KUBEFLOW_PIPELINES_TOKEN:=}
2525
datasetio:
2626
- provider_id: localfs
2727
provider_type: inline::localfs

docs/modules/ROOT/pages/remote-provider.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ eval:
213213
namespace: ${env.KUBEFLOW_NAMESPACE}
214214
llama_stack_url: ${env.KUBEFLOW_LLAMA_STACK_URL}
215215
base_image: ${env.KUBEFLOW_BASE_IMAGE}
216-
pipelines_token: ${env.KUBEFLOW_PIPELINES_TOKEN:=}
216+
pipelines_api_token: ${env.KUBEFLOW_PIPELINES_TOKEN:=}
217217
----
218218

219219
To run with the sample distribution:

src/llama_stack_provider_ragas/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from llama_stack.schema_utils import json_schema_type
2-
from pydantic import BaseModel, Field
2+
from pydantic import BaseModel, Field, SecretStr
33

44

55
class RagasConfig(BaseModel):
@@ -112,7 +112,7 @@ class KubeflowConfig(BaseModel):
112112
default=None,
113113
)
114114

115-
pipelines_token: str | None = Field(
115+
pipelines_api_token: SecretStr | None = Field(
116116
description=(
117117
"Kubeflow Pipelines token with access to submit pipelines. "
118118
"If not provided via env var, the token will be read from the local kubeconfig file."

src/llama_stack_provider_ragas/remote/ragas_remote_eval.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,11 @@ def kfp_client(self):
109109
return self._kfp_client
110110

111111
def _get_kfp_token(self) -> str:
112-
if self.config.kubeflow_config.pipelines_token:
112+
if self.config.kubeflow_config.pipelines_api_token:
113113
logger.info("Using KUBEFLOW_PIPELINES_TOKEN from config")
114-
return self.config.kubeflow_config.pipelines_token
114+
return str(
115+
self.config.kubeflow_config.pipelines_api_token.get_secret_value()
116+
)
115117

116118
try:
117119
from .kubeflow.utils import _load_kube_config

0 commit comments

Comments
 (0)