Skip to main content

Export rocm-smi metrics as prometheus metrics

Project description

rocm-smi-exporter

Export rocm-smi metrics as prometheus metrics

Deployment

The rocm-smi-exporter is built and uploaded to pypi. It is then deployed on the host as a systemd service.

Build and upload pypi package

cd deployment

# Create virtual env
python -m venv .venv
source .venv/bin/activate

pip install -r requirements.txt
python -m build ..

# You'll need to enter your Pypi API token
python3 -m twine upload --repository pypi ../dist/*

# Deactivate virtual env
deactivate

Create systemd service

To create systemd service to running the above pip module. The host must have systemd installed.

# Need to install the module as root in order for the systemd to pick up.
sudo pip install lamini-rocm-smi-exporter

# Copy systemd service definition file.
sudo cp lamini-rocm-smi-exporter.service /etc/systemd/system/

# Always reloading configs, see:
# https://unix.stackexchange.com/a/740098
sudo systemctl daemon-reload

# Enable and start the service so the service can be started after system (re)boot.
sudo systemctl enable lamini-rocm-smi-exporter.service
sudo systemctl status lamini-rocm-smi-exporter.service

image

sudo systemctl start lamini-rocm-smi-exporter.service
sudo systemctl status lamini-rocm-smi-exporter.service

image

Stop and remove systemd service

# Stop the service
sudo systemctl stop lamini-rocm-smi-exporter.service

# Verify that the service is stopped
sudo systemctl status lamini-rocm-smi-exporter.service

image

# Disable the service
sudo systemctl disable lamini-rocm-smi-exporter.service

# Verify that the service is disabled
sudo systemctl status lamini-rocm-smi-exporter.service

image

# Remove service definition file
sudo rm /etc/systemd/system/lamini-rocm-smi-exporter.service

Pants build

Pants uses explicit BUILD files to track source files' dependencies and builds.

Pants is hermetic, means that the entire build environment is specified in pants.toml, which is copied from example-python.

Extra

  • Add args to systemd service
    • The python code accepts --port and other arguments
    • If needed, set its value when launching systemd service

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lamini_rocm_smi_exporter-0.0.1a4.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file lamini_rocm_smi_exporter-0.0.1a4.tar.gz.

File metadata

File hashes

Hashes for lamini_rocm_smi_exporter-0.0.1a4.tar.gz
Algorithm Hash digest
SHA256 f77eb2caee115a47ca74e260953090408b477f5525ceef4d1a9ed1cc544bc4fe
MD5 bff62d1824df1312789554bb02c19475
BLAKE2b-256 e300dc3c2c07c624edc5103ecfb27c5ce67419c18c6da680bb1ee535c98c8180

See more details on using hashes here.

Provenance

File details

Details for the file lamini_rocm_smi_exporter-0.0.1a4-py3-none-any.whl.

File metadata

File hashes

Hashes for lamini_rocm_smi_exporter-0.0.1a4-py3-none-any.whl
Algorithm Hash digest
SHA256 0c5b0f147bded91c85f210042eba0a6797eff56bfef0cd4e9304fee9e159cb9e
MD5 3181c05d08759a3879fc479d0d6235a0
BLAKE2b-256 542dfa298a2e3d9c2a20f784909b3c0c7b4cec996ded3d24c5470dad70210433

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page