Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get SSD device name from environment variable #126

Merged
merged 5 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ repos:
- id: black
types: [file, python]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.42.0
rev: v0.43.0
hooks:
- id: markdownlint
types: [file, markdown]
Expand Down
2 changes: 1 addition & 1 deletion scos_actions/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "11.0.0"
__version__ = "11.1.0"
7 changes: 4 additions & 3 deletions scos_actions/actions/acquire_sea_data_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
ntia_sensor,
)
from scos_actions.metadata.structs.capture import CaptureSegment
from scos_actions.settings import SCOS_SENSOR_GIT_TAG
from scos_actions.settings import SCOS_SENSOR_GIT_TAG, SSD_DEVICE
from scos_actions.signal_processing.apd import get_apd
from scos_actions.signal_processing.fft import (
get_fft,
Expand Down Expand Up @@ -712,7 +712,8 @@ def capture_diagnostics(
Various CPU metrics make assumptions about the system: only
Intel CPUs are supported.

Disk health check assumes the SSD is ``/dev/nvme0n1`` and
Disk health check collects SMART diagnostics on the
SSD specified by the `SSD_DEVICE` environment variable. This
requires the Docker container to have the required privileges
or capabilities and device passthrough. For more information,
see ``scos_actions.hardware.utils.get_disk_smart_data()``.
Expand Down Expand Up @@ -790,7 +791,7 @@ def capture_diagnostics(
except:
logger.warning("Failed to get SCOS uptime")
try: # SSD SMART data
smart_data = get_disk_smart_data("/dev/nvme0n1")
smart_data = get_disk_smart_data(SSD_DEVICE)
cpu_diag["ssd_smart_data"] = ntia_diagnostics.SsdSmartData(**smart_data)
except:
logger.warning("Failed to get SSD SMART data")
Expand Down
3 changes: 3 additions & 0 deletions scos_actions/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@
logger.debug(f"scos-actions: PRESELECTOR_MODULE:{PRESELECTOR_MODULE}")
PRESELECTOR_CLASS = env("PRESELECTOR_CLASS", default=None)
logger.debug(f"scos-actions: PRESELECTOR_CLASS:{PRESELECTOR_CLASS}")

SSD_DEVICE = env("SSD_DEVICE", default="/dev/nvme0n1")
logger.debug(f"scos-actions: SSD-DEVICE:{SSD_DEVICE}")