Singularity installation

Singularity installation#

Singularity can be used to run device-metrics-exporter in a cluster environment through SLURM. The steps to achieve this are detailed below.

Installation#

The Device Metrics Exporter container is hosted on Docker Hub at rocm/device-metrics-exporter.

  • Convert Docker Image to Singularity SIF: Create a file named Singularity.def with the following content:

    bootstrap: docker
    From: rocm/device-metrics-exporter:v1.5.0
    
    %post
        chmod +x /home/amd/tools/entrypoint.sh
    
    %startscript
        # This script runs when the container is started with 'singularity run'
        exec /home/amd/tools/entrypoint.sh
    
  • Build the Singularity Image:

    sudo singularity build device_metrics_exporter.sif Singularity.def
    
  • Run the Singularity Container:

    sudo singularity instance start \
    --writable-tmpfs \
    --bind ./config:/etc/metrics \
    --bind /var/run/exporter/:/var/run/exporter/ \
    device-metrics-exporter-numa-fixed.sif metrics-exporter
    
  • Confirm metrics are accessible:

curl http://localhost:5000/metrics

Keypoints#

  • Run the singularity container with sudo to ensure proper device access and logging.

  • Bind mount /config, /var/run/exporter, for correct operation.

Custom metrics#

For information about custom metrics, see Standalone Container for instructions.