setup: every finish mark is written with a warning on a read-only folder (#570)
The PR guarded the mark of a whole shard; mark() itself now warns and goes on, so the SHA-256 result of a verified Unsloth shard and the shared-shard link on a --gguf-dir share do not stop setup either. The step is repeated on the next run.
This commit is contained in:
1 parent
762e58b5b2
commit
3c6456a2e6
2 files changed
+14
-1
No files matched your search
@@ -317,7 +317,12 @@ def done(path: Path) -> bool:
|
||||
|
||||
|
||||
def mark(path: Path, text=""):
|
||||
path.with_name(path.name + ".done").write_text(text or time.strftime("%Y-%m-%d %H:%M"), encoding="utf-8")
|
||||
"""Write the finish mark. A folder that cannot be written (--gguf-dir on a read-only share, #570) only costs the
|
||||
mark: setup says so and goes on (the step is repeated on the next run), it does not stop."""
|
||||
try:
|
||||
path.with_name(path.name + ".done").write_text(text or time.strftime("%Y-%m-%d %H:%M"), encoding="utf-8")
|
||||
except OSError as e:
|
||||
warn(f"the finish mark of {path.name} cannot be written ({e}): the next run does this step again")
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------------------------ the PC
|
||||
|
||||
@@ -176,6 +176,14 @@ class ReadOnlyGgufDir(unittest.TestCase):
|
||||
self.assertIn("is whole but its finish mark cannot be written", out)
|
||||
|
||||
|
||||
def test_mark_itself_never_stops_on_a_read_only_folder(self):
|
||||
"""#570: every finish mark (the SHA-256 result of a verified shard too), not only the one for a whole shard."""
|
||||
with tempfile.TemporaryDirectory() as tmp, mock.patch.object(Path, "write_text",
|
||||
side_effect=PermissionError(13, "read-only")):
|
||||
setup.mark(Path(tmp) / "x.gguf", "sha256 abc") # no exception
|
||||
self.assertFalse(setup.done(Path(tmp) / "x.gguf"))
|
||||
|
||||
|
||||
class ExperimentalSm60(unittest.TestCase):
|
||||
"""#295: Pascal (6.x) and Volta (7.0) only with STRATA_EXPERIMENTAL_SM60=1, built with -DSTRATA_EXPERIMENTAL_SM60=ON
|
||||
and a CUDA 12.x toolkit; nothing changes without the variable."""
|
||||
|
||||
Reference in new issue
Block a user