Skip to content

Commit 0757a2a

Browse files
authored
Merge branch 'main' into pre-commit-ci-update-config
2 parents 2bfea2a + 45d74ae commit 0757a2a

12 files changed

Lines changed: 558 additions & 3 deletions
29.4 KB
Binary file not shown.

ocp_resources/evalhub.py

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md
2+
3+
4+
from typing import Any
5+
6+
from ocp_resources.resource import NamespacedResource
7+
8+
9+
class EvalHub(NamespacedResource):
10+
"""
11+
EvalHub is the Schema for the evalhubs API
12+
"""
13+
14+
api_group: str = NamespacedResource.ApiGroup.TRUSTYAI_OPENDATAHUB_IO
15+
16+
def __init__(
17+
self,
18+
collections: list[Any] | None = None,
19+
database: dict[str, Any] | None = None,
20+
env: list[Any] | None = None,
21+
otel: dict[str, Any] | None = None,
22+
providers: list[Any] | None = None,
23+
replicas: int | None = None,
24+
**kwargs: Any,
25+
) -> None:
26+
r"""
27+
Args:
28+
collections (list[Any]): Collections is the list of OOTB collection names to mount into the
29+
deployment. Each name must match a collection-name label on a
30+
ConfigMap in the operator namespace.
31+
32+
database (dict[str, Any]): Database configuration for persistent storage. This field is required:
33+
the operator will not start the service without an explicit
34+
database configuration. Set type to "postgresql" with a secret
35+
reference, or "sqlite" for lightweight/development deployments.
36+
37+
env (list[Any]): Environment variables for the eval-hub container
38+
39+
otel (dict[str, Any]): OpenTelemetry configuration for observability. When set, the operator
40+
includes OTEL settings in the generated config. When omitted, the
41+
service uses its defaults (OTEL disabled).
42+
43+
providers (list[Any]): Providers is the list of OOTB provider names to mount into the
44+
deployment. Each name must match a provider-name label on a
45+
ConfigMap in the operator namespace.
46+
47+
replicas (int): Number of replicas for the eval-hub deployment
48+
49+
"""
50+
super().__init__(**kwargs)
51+
52+
self.collections = collections
53+
self.database = database
54+
self.env = env
55+
self.otel = otel
56+
self.providers = providers
57+
self.replicas = replicas
58+
59+
def to_dict(self) -> None:
60+
61+
super().to_dict()
62+
63+
if not self.kind_dict and not self.yaml_file:
64+
self.res["spec"] = {}
65+
_spec = self.res["spec"]
66+
67+
if self.collections is not None:
68+
_spec["collections"] = self.collections
69+
70+
if self.database is not None:
71+
_spec["database"] = self.database
72+
73+
if self.env is not None:
74+
_spec["env"] = self.env
75+
76+
if self.otel is not None:
77+
_spec["otel"] = self.otel
78+
79+
if self.providers is not None:
80+
_spec["providers"] = self.providers
81+
82+
if self.replicas is not None:
83+
_spec["replicas"] = self.replicas
84+
85+
# End of generated code

ocp_resources/guardrails_orchestrator.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md
22

3+
34
from typing import Any
45

56
from ocp_resources.exceptions import MissingRequiredArgumentError
@@ -16,29 +17,43 @@ class GuardrailsOrchestrator(NamespacedResource):
1617
def __init__(
1718
self,
1819
auto_config: dict[str, Any] | None = None,
20+
custom_detectors_config: str | None = None,
21+
disable_orchestrator: bool | None = None,
1922
enable_built_in_detectors: bool | None = None,
2023
enable_guardrails_gateway: bool | None = None,
24+
env: list[Any] | None = None,
2125
guardrails_gateway_config: str | None = None,
2226
log_level: str | None = None,
2327
orchestrator_config: str | None = None,
2428
otel_exporter: dict[str, Any] | None = None,
2529
replicas: int | None = None,
30+
tls_secrets: list[Any] | None = None,
2631
**kwargs: Any,
2732
) -> None:
2833
r"""
2934
Args:
3035
auto_config (dict[str, Any]): Settings governing the automatic configuration of the orchestrator.
3136
Replaces `OrchestratorConfig`.
3237
38+
custom_detectors_config (str): Name of configmap containing user-defined Python detectors. This is
39+
only used if EnableBuiltInDetectors is true
40+
41+
disable_orchestrator (bool): Boolean flag to disable the orchestrator container, if running the
42+
built-in detectors in standalone mode
43+
3344
enable_built_in_detectors (bool): Boolean flag to enable/disable built-in detectors
3445
3546
enable_guardrails_gateway (bool): Boolean flag to enable/disable the guardrails sidecar gateway
3647
48+
env (list[Any]): Define environment variables. These will be added to the orchestrator,
49+
gateway, and built-in detector pods.
50+
3751
guardrails_gateway_config (str): Name of the configmap containing guadrails sidecar gateway arguments
3852
3953
log_level (str): Set log level in the orchestrator deployment
4054
41-
orchestrator_config (str): Name of configmap containing generator,detector,and chunker arguments
55+
orchestrator_config (str): Name of configmap containing generator, detector, and chunker
56+
arguments
4257
4358
otel_exporter (dict[str, Any]): List of orchestrator enviroment variables for configuring the OTLP
4459
exporter
@@ -47,19 +62,27 @@ def __init__(
4762
Run "make" to regenerate code after modifying this file Number of
4863
replicas
4964
65+
tls_secrets (list[Any]): Define TLS secrets to be mounted to the orchestrator. Secrets will be
66+
mounted at /etc/tls/$SECRET_NAME
67+
5068
"""
5169
super().__init__(**kwargs)
5270

5371
self.auto_config = auto_config
72+
self.custom_detectors_config = custom_detectors_config
73+
self.disable_orchestrator = disable_orchestrator
5474
self.enable_built_in_detectors = enable_built_in_detectors
5575
self.enable_guardrails_gateway = enable_guardrails_gateway
76+
self.env = env
5677
self.guardrails_gateway_config = guardrails_gateway_config
5778
self.log_level = log_level
5879
self.orchestrator_config = orchestrator_config
5980
self.otel_exporter = otel_exporter
6081
self.replicas = replicas
82+
self.tls_secrets = tls_secrets
6183

6284
def to_dict(self) -> None:
85+
6386
super().to_dict()
6487

6588
if not self.kind_dict and not self.yaml_file:
@@ -74,12 +97,21 @@ def to_dict(self) -> None:
7497
if self.auto_config is not None:
7598
_spec["autoConfig"] = self.auto_config
7699

100+
if self.custom_detectors_config is not None:
101+
_spec["customDetectorsConfig"] = self.custom_detectors_config
102+
103+
if self.disable_orchestrator is not None:
104+
_spec["disableOrchestrator"] = self.disable_orchestrator
105+
77106
if self.enable_built_in_detectors is not None:
78107
_spec["enableBuiltInDetectors"] = self.enable_built_in_detectors
79108

80109
if self.enable_guardrails_gateway is not None:
81110
_spec["enableGuardrailsGateway"] = self.enable_guardrails_gateway
82111

112+
if self.env is not None:
113+
_spec["env"] = self.env
114+
83115
if self.guardrails_gateway_config is not None:
84116
_spec["guardrailsGatewayConfig"] = self.guardrails_gateway_config
85117

@@ -92,4 +124,7 @@ def to_dict(self) -> None:
92124
if self.otel_exporter is not None:
93125
_spec["otelExporter"] = self.otel_exporter
94126

127+
if self.tls_secrets is not None:
128+
_spec["tlsSecrets"] = self.tls_secrets
129+
95130
# End of generated code

ocp_resources/llama_stack_distribution.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,28 @@ class LlamaStackDistribution(NamespacedResource):
1616

1717
def __init__(
1818
self,
19+
network: dict[str, Any] | None = None,
1920
replicas: int | None = None,
2021
server: dict[str, Any] | None = None,
2122
**kwargs: Any,
2223
) -> None:
2324
r"""
2425
Args:
26+
network (dict[str, Any]): Network defines network access controls for the LlamaStack service
27+
2528
replicas (int): No field description from API
2629
2730
server (dict[str, Any]): ServerSpec defines the desired state of llama server.
2831
2932
"""
3033
super().__init__(**kwargs)
3134

35+
self.network = network
3236
self.replicas = replicas
3337
self.server = server
3438

3539
def to_dict(self) -> None:
40+
3641
super().to_dict()
3742

3843
if not self.kind_dict and not self.yaml_file:
@@ -44,6 +49,9 @@ def to_dict(self) -> None:
4449

4550
_spec["server"] = self.server
4651

52+
if self.network is not None:
53+
_spec["network"] = self.network
54+
4755
if self.replicas is not None:
4856
_spec["replicas"] = self.replicas
4957

ocp_resources/lm_eval_job.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def __init__(
9898
self.task_list = task_list
9999

100100
def to_dict(self) -> None:
101+
101102
super().to_dict()
102103

103104
if not self.kind_dict and not self.yaml_file:

0 commit comments

Comments
 (0)