Skip to main content

CLI tool for triggering datacenter metadata updates

Project description

dmtri

Run Tests Coverage

dmtri is a command-line tool designed to trigger metadata and data refresh simulations across EIDA nodes using Ansible automation.


  • seedpsd
  • wfcatalog
  • availability

It uses .dmtri_jobs.json per host to track async job state and integrates with uv and ansible for CLI automation.


Quick Start

You can use dmtri in two ways, depending on your preference:

Option 1: Using uvx

You can run commands using:

uvx dmtri <command> [options]

Option 2: Global (Tool-based) — Ideal for global CLI use

uv tool install dmtri

This makes dmtri available globally:

dmtri <command> [options]

You can update it any time using:

uv tool upgrade dmtri

2. Configure inventory

Edit the file: src/inventory/hosts.ini

Example:

[seedpsd_nodes]
<SEEDPSD_HOST> ansible_user=<USER> ansible_ssh_pass="<PASSWORD>" ansible_connection=ssh ansible_become=false ansible_ssh_common_args='-o StrictHostKeyChecking=no'

[seedpsd_nodes:vars]
seedpsd_dir=/home/<USER>/seedpsd

[wf_catalogue]
<WFCATALOG_HOST> ansible_user=<USER> ansible_ssh_pass="<PASSWORD>" ansible_connection=ssh ansible_become=false ansible_ssh_common_args='-o StrictHostKeyChecking=no'

[wf_catalogue:vars]
collector_dir=/home/<USER>/Programs/wfcatalogue<VERSION>/wfcatalog/collector2

[ws_availability]
<AVAILABILITY_HOST> ansible_user=<USER> ansible_ssh_pass="<PASSWORD>" ansible_connection=ssh ansible_become=false ansible_ssh_common_args='-o StrictHostKeyChecking=no'

[ws_availability:vars]
availability_dir=/home/<USER>/Programs/ws-availability<VERSION>/views
mongo_user=<MONGO_USERNAME>
mongo_pass=<MONGO_PASSWORD>
mongo_authdb=<MONGO_DATABASE>

3. Run example jobs

By default, this command runs all refresh playbooks (seedpsd, wfcatalog, and availability):

uv run dmtri refresh -e "network=HL station=ATH starttime=2024-01-01T00:00:00 endtime=2024-01-02T00:00:00"

4. Track jobs across hosts

uv run dmtri track

Shows per-host job status:

Job ID: j123... Type: seedpsd  Station: ATH  Status: ✅ Finished
Job ID: manual-... Type: availability  Status: ✅ Manual (not tracked)

5. Troubleshooting with dmtri doctor

Check SSH connectivity to your configured hosts using:

uv run dmtri doctor

This uses the Ansible ping module to test access to all servers in your inventory.

Options

  • --verbose — Show full output from each host

Example

uv run dmtri doctor --verbose

If no response is received, ensure:

  • You're connected to the VPN (if applicable)
  • SSH access is configured correctly in your inventory file
  • Host IPs and credentials are reachable and valid

Operation Details

dmtri supports two main operations for both metadata and data: refresh and clean. These affect the following components:

🔄 Refresh

  • Metadata

    • seedpsd: Scans for new metadata.
    • availability: Refreshes the view in MongoDB.
  • Data

    • Identifies data files in the archive for the specified epoch (by NSLC and time range).
      • seedpsd: Recalculates seedPSD for new files.
      • wfcatalog: Runs the collector on new data files.

🧹 Clean

  • Metadata

    • seedpsd: Removes the metadata entries.
    • availability: Refreshes the view in MongoDB.
  • Data

    • Identifies data files in the archive for the specified epoch.
      • seedpsd: Removes associated seedPSD data (via CLI).
      • wfcatalog: Removes files using the --delete option in the collector.

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

dmtri-0.1.0.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dmtri-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file dmtri-0.1.0.tar.gz.

File metadata

  • Download URL: dmtri-0.1.0.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for dmtri-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c6536134e1e6d3f1b10fca2cdc4fceba0eb9a944c6908f14bb51c1240da279a4
MD5 0af7560e7005a641c27531e972c7e1c4
BLAKE2b-256 0745d8c4c754c5ef6b3f90530bc52b76508e38c432ebf4a6630868040d2867da

See more details on using hashes here.

Provenance

The following attestation bundles were made for dmtri-0.1.0.tar.gz:

Publisher: publish.yml on EIDA/dmtri

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dmtri-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dmtri-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for dmtri-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0b53316d2c6abe9b79f8bd4cd899bea7f49761ad190031bb6a9ca0bcce8f388
MD5 343e1290750a9f89bc6380be0cfc3440
BLAKE2b-256 15247c48c4a229f64b01f5ab426e218abb0443228c92c0c08d917549d9d9e345

See more details on using hashes here.

Provenance

The following attestation bundles were made for dmtri-0.1.0-py3-none-any.whl:

Publisher: publish.yml on EIDA/dmtri

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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