| 340 | |
| 341 | @dataclass |
| 342 | class Config(Serializable): |
| 343 | # Solution under the FLEX architecture, choose from 'GraphScope One', 'Interactive' or 'GraphScope Insight' |
| 344 | solution: str = "GraphScope One" |
| 345 | |
| 346 | # Launcher type, choose from 'hosts', 'k8s' or 'operator'. |
| 347 | launcher_type: str = "k8s" |
| 348 | |
| 349 | # Show log or not. |
| 350 | show_log: bool = False |
| 351 | # Log level, choose from 'info' or 'debug'. |
| 352 | log_level: str = "info" |
| 353 | |
| 354 | session: SessionConfig = field(default_factory=SessionConfig) |
| 355 | |
| 356 | # Coordinator configuration. |
| 357 | coordinator: CoordinatorConfig = field(default_factory=CoordinatorConfig) |
| 358 | # Vineyard configuration. |
| 359 | vineyard: VineyardConfig = field(default_factory=VineyardConfig) |
| 360 | # Interactive configuration. |
| 361 | interactive: InteractiveConfig = field(default_factory=InteractiveConfig) |
| 362 | |
| 363 | # Local cluster configuration. |
| 364 | hosts_launcher: HostsLauncherConfig = field(default_factory=HostsLauncherConfig) |
| 365 | |
| 366 | # Kubernetes cluster configuration. |
| 367 | kubernetes_launcher: KubernetesLauncherConfig = field( |
| 368 | default_factory=KubernetesLauncherConfig |
| 369 | ) |
| 370 | |
| 371 | # Launcher used in operator mode. |
| 372 | operator_launcher: OperatorLauncherConfig = field( |
| 373 | default_factory=OperatorLauncherConfig |
| 374 | ) |
| 375 | |
| 376 | def set_option(self, key, value): # noqa: C901 |
| 377 | """Forward set_option target to actual config fields""" |
| 378 | if key == "addr": |
| 379 | self.coordinator.endpoint = value |
| 380 | elif key == "mode": |
| 381 | self.session.execution_mode = value |
| 382 | elif key == "cluster_type": |
| 383 | self.launcher_type = value |
| 384 | elif key == "k8s_namespace": |
| 385 | self.kubernetes_launcher.namespace = value |
| 386 | elif key == "k8s_image_registry": |
| 387 | self.kubernetes_launcher.image.registry = value |
| 388 | elif key == "k8s_image_repository": |
| 389 | self.kubernetes_launcher.image.repository = value |
| 390 | elif key == "k8s_image_tag": |
| 391 | self.kubernetes_launcher.image.tag = value |
| 392 | elif key == "k8s_image_pull_policy": |
| 393 | self.kubernetes_launcher.image.pull_policy = value |
| 394 | elif key == "k8s_image_secrets": |
| 395 | self.kubernetes_launcher.image.pull_secrets = value |
| 396 | elif key == "k8s_coordinator_cpu": |
| 397 | self.coordinator.resource.set_cpu_request(value) |
| 398 | elif key == "k8s_coordinator_mem": |
| 399 | self.coordinator.resource.set_mem_request(value) |
no outgoing calls
no test coverage detected