Skip to main content

Enhanced DVC with advanced MLOps commands and features.

Project description

DVC MLOps Enhanced Commands Documentation

This project extends DVC with wrapper functions for experiment tracking, dataset management, metrics comparison, and tagging, making DVC more like Git for ML workflows.


Key Enhancements Overview

  • Dual push history system:

    • Internal log: .dvc/push_history.json (versioned, changes with checkout)
    • External/global log: configurable (default: dvc_push_history_global.json in project root), append-only, never changes with checkout
    • Logs are strictly separated: no syncing, deduplication, or cross-reading between them
  • Configurable global log path:

    • The global log is now in the project directory (dvc_push_history_global.json) for better portability.
  • Universal --internal flag:

    • All major commands (logs, exp-list, dataset-list, metrics-diff) accept --internal to switch between global and internal logs
  • Tag filtering and visibility:

    • Use --tag TAG [TAG ...] with dvc logs to filter by one or more tags
    • When --tag is used, outputs only commit hashes and matching tag names (one per line), suppressing the table
    • Tags are always shown in log summaries
  • Strict log separation:

    • Internal and external logs are never merged, deduplicated, or cross-read
    • Each log is updated independently on push

1. dvc logs

Show the history of DVC pushes, including commit info, artifacts, experiment name, metrics, and tags.

Usage:

dvc logs [-n N] [--dataset DATASET] [--show-all] [--internal] [--tag TAG [TAG ...]]
  • -n N, --number N: Show the last N pushes (default: all)
  • --dataset DATASET: Filter logs by dataset name
  • --show-all: Show all available information (wider table)
  • --internal: Show only the internal (repo) push history for the current commit/branch
  • --tag TAG [TAG ...]: Filter logs by one or more tag names; outputs only commit hashes and tags (e.g., commit_hash tag_name)

Tip: To filter experiments by tag, use dvc logs --tag TAGNAME to get commit hashes for that tag.


2. dvc exp-list

List all experiments and their metrics from push history.

Usage:

dvc exp-list [--internal]
  • Lists experiments with metrics from the push history.
  • Use --internal to show only the internal (repo) log.

3. dvc tag

Tag a specific commit in the push history.

Usage:

dvc tag <tag-name> <commit-hash>
  • Example: dvc tag v1.0 1234abc
  • Tags can be viewed in all dvc logs output and filtered with --tag.

4. dvc metrics-diff

Show the difference in metrics between two commits.

Usage:

dvc metrics-diff <commit1> <commit2> [--internal]
  • Example: dvc metrics-diff 1234abc 5678def
  • Shows the value of each metric in both commits.
  • Use --internal to show only the internal (repo) log.

Tip: To compare metrics for a specific tag, first run dvc logs --tag TAGNAME to get the commit hash, then use that hash in dvc metrics-diff.


5. dvc dataset-list

List all datasets tracked in the push history.

Usage:

dvc dataset-list [--internal]
  • Lists all unique dataset names/paths found in the push history.
  • Use --internal to show only the internal (repo) log.

Example Workflow

# Add and track a dataset
dvc add data/sample.txt

# Commit and push as usual (your custom push logic will record extra info)
git add data/sample.txt.dvc .gitignore
git commit -m "Add sample dataset"
dvc push

# Tag a commit
dvc tag v1.0 <commit-hash>

# List experiments
dvc exp-list

# List datasets
dvc dataset-list

# Show metrics difference between two commits
dvc metrics-diff <commit1> <commit2>

# Show push logs with all details
dvc logs --show-all


# Filter logs by multiple tags
dvc logs --tag v1.0 v2.0

Dependencies

  • rich: For table display (optional, falls back to plain text)

Install with:

pip install rich

Manual Global Log Path Configuration

The global log is now stored in the project directory as dvc_push_history_global.json for better portability. If you need to change it, edit the code in dvc/repo/logs.py.


Notes

  • Pushes are now recorded in two places:
    • .dvc/push_history.json (internal, versioned, changes with checkout)
    • dvc_push_history_global.json (global, in project root, append-only)
  • By default, all commands use the global file for a complete history, but you can use --internal to see only the current repo state.
  • All commands work on the push history and are designed for MLOps workflows.
  • Internal and external logs are strictly separated and never merged or deduplicated.
  • Ignored files (per .dvcignore) are filtered out from push history to avoid unwanted entries.

For help or issues, visit https://dvc.org/support

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

dvc_custom_wrapper-0.1.0.tar.gz (352.6 kB view details)

Uploaded Source

Built Distribution

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

dvc_custom_wrapper-0.1.0-py3-none-any.whl (468.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dvc_custom_wrapper-0.1.0.tar.gz
  • Upload date:
  • Size: 352.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for dvc_custom_wrapper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 82b0f5ddafa5cb773ecd5c1cfa94ae79cec305087b41d62a83d54806496c1757
MD5 4e643b96b265cc5c5f31fe1bb593a276
BLAKE2b-256 bf12cf6b986651f5776785a1d1ebcc3bba2d9b2a49171f8c10f485e9f9999d79

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dvc_custom_wrapper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 289cd0b1a3892f4f5aff536729b6121fb8d0fd2818db47629db070e0318a8e2f
MD5 0bcee4edc357d53ecd11df9c9de07d34
BLAKE2b-256 3338029c5a1095c46c01844509b2dc84e1d41027a36cde60329825a47e064215

See more details on using hashes here.

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