Skip to content

fix(runspec): support art://name/file URIs without version specifier#301

Open
andrewwhitecdw wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
andrewwhitecdw:fix-artifact-uri-file-path
Open

fix(runspec): support art://name/file URIs without version specifier#301
andrewwhitecdw wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
andrewwhitecdw:fix-artifact-uri-file-path

Conversation

@andrewwhitecdw

Copy link
Copy Markdown
Contributor

Problem

ArtifactFileSystem documents this URI form:

art://name/path/to/file  (implies latest)

But when no :version specifier is present, _parse_uri treats the entire path (including the file part) as the artifact name:

fs._parse_uri("art://my-dataset/train.json")
# -> ('my-dataset/train.json', None, '')   # name swallows the file path

Since the resulting name contains /, _resolve() routes it to the W&B full-path resolver, so opening a file from a local registry artifact fails (e.g. UsageError: No API key configured).

Fix

In the no-version branch, split the first segment off as the artifact name when it exists in the local registry; otherwise keep the whole path as the artifact reference (preserving W&B entity/project/name paths without a version).

fs._parse_uri("art://my-dataset/train.json")   # ('my-dataset', None, 'train.json')
fs._parse_uri("art://my-dataset:v1/train.json") # ('my-dataset', 1, 'train.json')   (unchanged)
fs._parse_uri("art://my-dataset")               # ('my-dataset', None, '')          (unchanged)
fs._parse_uri("art://entity/project/name")      # ('entity/project/name', None, '') (unchanged)

Testing

  • Verified all forms above plus end-to-end fs._open("art://my-dataset/train.json") against a local fsspec registry
  • pytest tests/nemo_runspec -k "filesystem or artifact or registry" — 34 passed
  • Full tests/nemo_runspec — 186 passed, 3 pre-existing failures on main (unrelated data_mover/lepton tests)

The documented 'art://name/path/to/file (implies latest)' form was parsed
with the entire path (including the file part) as the artifact name, so a
local artifact like art://my-dataset/train.json was routed to the W&B
full-path resolver and failed. In the no-version branch, split the first
segment off as the artifact name when it exists in the local registry;
otherwise keep the whole path as the artifact reference (e.g. W&B
entity/project/name).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant