From 7eb754813b4436426ee0d47274e3033f7f8cd9c7 Mon Sep 17 00:00:00 2001 From: arik Date: Mon, 3 Jun 2024 18:31:58 +0300 Subject: [PATCH] update disk benchmark image (#1439) * update disk benchmark image * update disk utils image - new clean image --- playbooks/robusta_playbooks/disk_benchmark.py | 3 ++- .../robusta_playbooks/node_disk_analysis.py | 3 ++- src/robusta/api/__init__.py | 22 +++++++++---------- src/robusta/core/model/env_vars.py | 3 +++ 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/playbooks/robusta_playbooks/disk_benchmark.py b/playbooks/robusta_playbooks/disk_benchmark.py index 6f1495974..5279b7655 100644 --- a/playbooks/robusta_playbooks/disk_benchmark.py +++ b/playbooks/robusta_playbooks/disk_benchmark.py @@ -14,6 +14,7 @@ ) from robusta.api import ( + FIO_IMAGE, IMAGE_REGISTRY, INSTALLATION_NAMESPACE, ExecutionBaseEvent, @@ -64,7 +65,7 @@ def disk_benchmark(event: ExecutionBaseEvent, action_params: DiskBenchmarkParams try: pvc.createNamespacedPersistentVolumeClaim(action_params.namespace) pv_name = "robusta-benchmark-pv" - image = f"{IMAGE_REGISTRY}/robusta-fio-benchmark" + image = f"{IMAGE_REGISTRY}/{FIO_IMAGE}" name = "robusta-fio-disk-benchmark" mount_path = "/robusta/data" spec = PodSpec( diff --git a/playbooks/robusta_playbooks/node_disk_analysis.py b/playbooks/robusta_playbooks/node_disk_analysis.py index 9a5ffc5ba..f9c02b7a1 100644 --- a/playbooks/robusta_playbooks/node_disk_analysis.py +++ b/playbooks/robusta_playbooks/node_disk_analysis.py @@ -6,6 +6,7 @@ from hikaru.model.rel_1_26 import EnvVar, EnvVarSource, ObjectFieldSelector, PodList from robusta.api import ( + DISK_TOOLS_IMAGE, IMAGE_REGISTRY, BaseBlock, MarkdownBlock, @@ -67,7 +68,7 @@ def node_disk_analyzer(event: NodeEvent, params: DiskAnalyzerParams): # run disk-tools on node and parse its json output disk_info_str = RobustaPod.run_debugger_pod( node.metadata.name, - pod_image=f"{IMAGE_REGISTRY}/disk-tools:1.4", + pod_image=f"{IMAGE_REGISTRY}/{DISK_TOOLS_IMAGE}", env=[ EnvVar( name="CURRENT_POD_UID", diff --git a/src/robusta/api/__init__.py b/src/robusta/api/__init__.py index eb18f3e94..3d311f02a 100644 --- a/src/robusta/api/__init__.py +++ b/src/robusta/api/__init__.py @@ -22,6 +22,8 @@ GrafanaParams, LogEnricherParams, NamedRegexPattern, + OOMGraphEnricherParams, + OomKillParams, PodResourceGraphEnricherParams, PodRunningParams, ProcessParams, @@ -33,8 +35,6 @@ ResourceChartItemType, ResourceChartResourceType, ResourceGraphEnricherParams, - OOMGraphEnricherParams, - OomKillParams, TimedPrometheusParams, VideoEnricherParams, ) @@ -47,7 +47,9 @@ DEFAULT_TIMEZONE, DISCORD_TABLE_COLUMNS_LIMIT, DISCOVERY_PERIOD_SEC, + DISK_TOOLS_IMAGE, ENABLE_TELEMETRY, + FIO_IMAGE, FLOAT_PRECISION_LIMIT, GIT_MAX_RETRIES, GRAFANA_READ_TIMEOUT, @@ -107,15 +109,15 @@ from robusta.core.playbooks.actions_registry import Action, action from robusta.core.playbooks.common import get_event_timestamp, get_resource_events, get_resource_events_table from robusta.core.playbooks.container_playbook_utils import create_container_graph +from robusta.core.playbooks.crash_reporter import send_crash_report from robusta.core.playbooks.job_utils import CONTROLLER_UID, get_job_all_pods, get_job_latest_pod, get_job_selector from robusta.core.playbooks.node_playbook_utils import create_node_graph_enrichment from robusta.core.playbooks.pod_utils.crashloop_utils import get_crash_report_enrichments from robusta.core.playbooks.pod_utils.imagepull_utils import ( - get_image_pull_backoff_enrichment, get_image_pull_backoff_container_statuses, + get_image_pull_backoff_enrichment, ) from robusta.core.playbooks.pod_utils.pending_pod_utils import get_pending_pod_enrichment -from robusta.core.playbooks.crash_reporter import send_crash_report from robusta.core.playbooks.prometheus_enrichment_utils import ( XAxisLine, create_chart_from_prometheus_query, @@ -139,9 +141,9 @@ CallbackChoice, DividerBlock, Emojis, + EmptyFileBlock, Enrichment, FileBlock, - EmptyFileBlock, Filterable, Finding, FindingSeverity, @@ -149,21 +151,18 @@ FindingSubject, HeaderBlock, JsonBlock, + KRRScanReportBlock, KubernetesDiffBlock, KubernetesFieldsBlock, ListBlock, MarkdownBlock, + PopeyeScanReportBlock, PrometheusBlock, ScanReportBlock, - PopeyeScanReportBlock, - KRRScanReportBlock, ScanReportRow, TableBlock, VideoLink, ) - -from robusta.core.reporting.base import EnrichmentType -from robusta.core.reporting.blocks import GraphBlock from robusta.core.reporting.action_requests import ( ActionRequestBody, ExternalActionRequest, @@ -171,6 +170,8 @@ PartialAuth, sign_action_request, ) +from robusta.core.reporting.base import EnrichmentType +from robusta.core.reporting.blocks import GraphBlock from robusta.core.reporting.callbacks import ExternalActionRequestBuilder from robusta.core.reporting.consts import ( EnrichmentAnnotation, @@ -191,7 +192,6 @@ ScheduledJob, SchedulingInfo, ) -from robusta.core.playbooks.node_playbook_utils import create_node_graph_enrichment from robusta.core.sinks import SinkBase, SinkBaseParams, SinkConfigBase from robusta.core.sinks.kafka import KafkaSink, KafkaSinkConfigWrapper, KafkaSinkParams from robusta.core.triggers.helm_releases_triggers import HelmReleasesEvent, HelmReleasesTriggerEvent diff --git a/src/robusta/core/model/env_vars.py b/src/robusta/core/model/env_vars.py index c44100bf1..ba5d0229c 100644 --- a/src/robusta/core/model/env_vars.py +++ b/src/robusta/core/model/env_vars.py @@ -103,6 +103,9 @@ def load_bool(env_var, default: bool): IMAGE_REGISTRY = os.environ.get("IMAGE_REGISTRY", "us-central1-docker.pkg.dev/genuine-flight-317411/devel") +FIO_IMAGE = os.environ.get("FIO_IMAGE", "robusta-fio-benchmark:1.0") +DISK_TOOLS_IMAGE = os.environ.get("DISK_TOOLS_IMAGE", "disk-tools:1.5") + CLUSTER_DOMAIN = os.environ.get("CLUSTER_DOMAIN", "cluster.local") IS_OPENSHIFT = load_bool("IS_OPENSHIFT", False)