refactor: finalize dataset directory before media initialization

Open
#1,056 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start with ArtifactStorage.validate_folder_names() and DatasetBuilder.build() to trace when the dataset name is cached, resume decisions are made, and media storage is initialized. Review the regression tests for fresh runs, resume outcomes, concurrent allocation, image paths, and previews; done means the finalized path is used consistently while those behaviors remain covered.

Written by the indexing model from the issue text.

Description

task
Priority Level

Low

Task Summary

Finalize the dataset directory after the resume decision and before initializing media storage. Give each run one final path so normal generation does not need to rewrite the cached dataset name or refresh media paths afterward.

Technical Details & Implementation Plan
  • Defer media storage initialization until the dataset directory is finalized.
  • Keep fresh-directory allocation atomic, including collisions on the base and timestamped names.
  • Preserve compatible resume, incompatible IF_POSSIBLE fallback, completed-run short-circuits, and previews that do not create dataset directories.
  • Simplify cached-name invalidation and media-path refresh where the revised lifecycle makes them unnecessary.
  • Cover fresh runs, resume decisions, concurrent allocation, image paths, and previews with regression tests.
Investigation / Context

Requested in Nabin's review comment, following the collision fix in #1051 for #1050.

ArtifactStorage.validate_folder_names() currently initializes MediaStorage using base_dataset_path, which resolves and caches the dataset name during construction. DatasetBuilder.build() later decides whether to resume or start fresh. Fresh-directory allocation can change the chosen name, requiring a cache rewrite and refresh_media_storage_path().

Dependencies

Follow-up to #1051. This refactor does not block that bug fix.

Dominant language
Python
Stars
2.4k
Forks
258
Avg merge
4d 20m
Merged PRs (30d)
32

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA-NeMo/DataDesigner

All issues in NVIDIA-NeMo/DataDesigner

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.