The toolbox project contains shared code libraries and utilities used across the crucible family of subprojects. Nearly every benchmark, tool, and core component depends on toolbox.
Consumer projects access toolbox via the TOOLBOX_HOME environment variable:
# Bash
source "${TOOLBOX_HOME}/bash/library/bench-base"
# Python
sys.path.append(os.path.join(os.environ['TOOLBOX_HOME'], 'python'))
from toolbox.json import load_json_filelibrary/bench-base— Shared benchmark shell functions: error handling (exit_error), diagnostic dumps (dump_runtime), software prerequisite validation, CPU scheduler balance control (cgroup v1 and v2), clocksource validation
Python modules under the toolbox package:
json.py— JSON file loading with optional LZMA decompression, schema validationjsonsettings.py— Dot-notation JSON queriesmetrics.py— Time-series metric recording with sample consolidation (deprecated, usecdm_metrics.py)cdm_metrics.py— Thread-safe CDM metric logging classlogging.py— Logging setup with VERBOSE level and configurable formatfileio.py— File I/O with automatic XZ compression/decompressionroadblock.py— Roadblock synchronization wrapperrun.py— Shell command execution with output capturesystem_cpu_topology.py— CPU topology discovery from sysfs with NUMA, SMT, and die awareness
Scripts in bin/ provide command-line access to library functions:
cpumask.py— Convert between CPU list, bitmask, and hexmask formatsget-cpu-range.py— Convert comma-separated CPU list to range notationget-cpus-ordered.py— Order CPUs by topology (NUMA, SMT handling)get-json-settings.py— Extract values from JSON files using dot-notation queriesjson-validator.py— Validate JSON files against schemastimestamper.py— Prefix stdin lines with UTC timestamps
workshop.json declares Python dependencies that are installed into the crucible controller container image at build time. Perl CPAN modules are retained for backwards compatibility with prior supported releases that still include Perl code.