Skip to content

Commit

Permalink
Fix docker-daemon url parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanluoyc committed May 11, 2024
1 parent 315c373 commit 30f5585
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lxm3/singularity/uri.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

# is_valid returns whether or not the given source is valid
def is_valid(source: str) -> tuple[bool, Optional[str]]:
u = source.split(":", 2)
u = source.split(":", 1)

if len(u) != 2:
return False, f"invalid uri {source}"
Expand Down
7 changes: 7 additions & 0 deletions tests/singularity_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ def test_build_image_from_daemon(self):
filename = singularity.uri.filename(build_spec, "sif")
self.assertEqual(filename, "jax-cuda_latest.sif")

# Test without //
build_spec = "docker-daemon:jax-cuda:latest"
transport, ref = singularity.uri.split(build_spec)
self.assertEqual(transport, "docker-daemon")
filename = singularity.uri.filename(build_spec, "sif")
self.assertEqual(filename, "jax-cuda_latest.sif")


if __name__ == "__main__":
absltest.main()

0 comments on commit 30f5585

Please sign in to comment.