Skip to content

Commit

Permalink
Merge pull request #126 from NTIA/ssd-device-name-from-env
Browse files Browse the repository at this point in the history
Get SSD device name from environment variable
  • Loading branch information
jhazentia authored Dec 17, 2024
2 parents 495b7fb + b0ab054 commit b9dfec9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
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}")

0 comments on commit b9dfec9

Please sign in to comment.