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.


Installation & Setup

1. Install or Run

You can run dmtri directly or install it as a tool:

Run without installing (via uvx)

uvx dmtri <command>

Install as a global tool

# Using uv (recommended)
uv tool install dmtri

# Using pip
pip install dmtri

2. Configure

Once installed, set up your local configuration directory:

dmtri init

This creates a config folder (e.g., ~/.config/dmtri/ on Linux) with a template hosts.ini and all standard playbooks.

Edit your Inventory

Use nano (or any text editor) to fill in your EIDA server details:

nano ~/.config/dmtri/hosts.ini

Verify Connectivity

Check if your servers are reachable:

dmtri doctor

Usage

Run Refresh Jobs

Trigger refresh playbooks across your nodes:

dmtri refresh --network HL --station ATH --starttime 2024-01-01

Track Job Status

Monitor the status of asynchronous jobs:

dmtri track

Fix Inconsistencies

Automatically repair the inconsistencies found in an eida-consistency report. A report lists streams where the availability view and dataselect disagree; dmtri fix reads that report and, for each affected stream, re-runs the WFCatalog collector and rebuilds the availability view for the exact time window.

Point it at a report file or URL:

dmtri fix https://eida-oculus.orfeus-eu.org/consistency/NOA/2026/NOA_2026-06-07_140510.json

Fix only specific entries from the report (by their index):

dmtri fix report.json --index 2 --index 16

After a fix, the availability service keeps cached answers for ~20 minutes, so a stream may still look unfixed for a short while. Re-check once the cache expires — this only verifies, it changes nothing:

dmtri fix --verify-only report.json

Prerequisite: the eida-consistency CLI

dmtri fix reads the report through eida-consistency (version 0.5.1 or newer, for its explore --json output). If it isn't already on the machine, install it any one of these ways:

uv tool install eida-consistency     # recommended — puts it on your PATH
pipx install eida-consistency
pip install eida-consistency

You don't strictly have to install it: if uv is present, dmtri fix will run it on demand via uvx eida-consistency. And if it's installed somewhere off your PATH, point dmtri at it:

export DMTRI_EIDA_CONSISTENCY='/full/path/to/eida-consistency'

If it's missing (or too old), dmtri fix stops before touching anything and prints the exact install/upgrade command to run.


Customization

Local Playbooks

dmtri init copies all playbooks to your config directory. You can edit them to change automation logic:

# Location: ~/.config/dmtri/playbooks/
nano ~/.config/dmtri/playbooks/refresh/availability_refresh.yml

dmtri prioritizes these local playbooks over the bundled defaults.

Inventory Overrides

Override the inventory at runtime:

dmtri doctor --inventory ./my_custom_hosts.ini

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.2.tar.gz (73.1 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.2-py3-none-any.whl (77.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dmtri-0.1.2.tar.gz
  • Upload date:
  • Size: 73.1 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.2.tar.gz
Algorithm Hash digest
SHA256 5a4032ebe7808f6226d7200d27724ae01c769f47adc25fc8866b3d6d804cbe3d
MD5 0cde01ff16a8da6f8bf12cc15dbab3e4
BLAKE2b-256 79525914bf870f99801511a9f118ba6eab8e0bbf0d1e3e135b094ed0d6156b60

See more details on using hashes here.

Provenance

The following attestation bundles were made for dmtri-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: dmtri-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 77.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1272ed1d845a279fe963e63ae9d540a1c48a2c4da10847a7e611f6ae87d27e64
MD5 4796e7bcf953d4e64572ace7c190005a
BLAKE2b-256 32717c57bcc353cf965a8d63a4295899e17eab6cee80b49218866de6fe97b529

See more details on using hashes here.

Provenance

The following attestation bundles were made for dmtri-0.1.2-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