letify 2.5.2__tar.gz → 2.5.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {letify-2.5.2 → letify-2.5.3}/PKG-INFO +1 -1
- {letify-2.5.2 → letify-2.5.3}/docs/SPEC.md +14 -1
- {letify-2.5.2 → letify-2.5.3}/letify/__init__.py +1 -1
- {letify-2.5.2 → letify-2.5.3}/letify/cli.py +47 -2
- {letify-2.5.2 → letify-2.5.3}/letify/protocol/worker.py +35 -0
- {letify-2.5.2 → letify-2.5.3}/letify/store/pathdata.py +48 -4
- {letify-2.5.2 → letify-2.5.3}/letify-core/Cargo.lock +3 -3
- {letify-2.5.2 → letify-2.5.3}/letify-core/Cargo.toml +1 -1
- {letify-2.5.2 → letify-2.5.3}/letify-ext/package-lock.json +2 -2
- {letify-2.5.2 → letify-2.5.3}/letify-ext/package.json +1 -1
- {letify-2.5.2 → letify-2.5.3}/pyproject.toml +1 -1
- {letify-2.5.2 → letify-2.5.3}/tests/test_cli.py +58 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_data.py +46 -5
- {letify-2.5.2 → letify-2.5.3}/tests/test_data_streaming.py +90 -0
- {letify-2.5.2 → letify-2.5.3}/.github/workflows/ci.yml +0 -0
- {letify-2.5.2 → letify-2.5.3}/.github/workflows/docs.yml +0 -0
- {letify-2.5.2 → letify-2.5.3}/.github/workflows/publish.yml +0 -0
- {letify-2.5.2 → letify-2.5.3}/.gitignore +0 -0
- {letify-2.5.2 → letify-2.5.3}/.researchtree +0 -0
- {letify-2.5.2 → letify-2.5.3}/CLAUDE.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/LICENSE +0 -0
- {letify-2.5.2 → letify-2.5.3}/PROJECT.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/README.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/COMPONENT.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/INTENT.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/NETWORK.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/01-getting-started.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/02-providers.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/03-execution-modes.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/04-environments-and-data.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/05-concurrency.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/06-cost.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/07-troubleshooting.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/08-releasing.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/README.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/ko/01-/354/213/234/354/236/221/355/225/230/352/270/260.md" +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/ko/02-/355/224/204/353/241/234/353/260/224/354/235/264/353/215/224.md" +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/ko/03-/354/213/244/355/226/211-/353/260/251/354/213/235.md" +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/ko/04-/355/231/230/352/262/275/352/263/274-/353/215/260/354/235/264/355/204/260.md" +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/ko/05-/353/217/231/354/213/234-/354/213/244/355/226/211.md" +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/ko/06-/353/271/204/354/232/251.md" +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/ko/07-/353/254/270/354/240/234-/355/225/264/352/262/260.md" +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/ko/08-/353/246/264/353/246/254/354/212/244.md" +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/guide/ko/README.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/locales/README_ko.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/docs/mkdocs.yml +0 -0
- {letify-2.5.2 → letify-2.5.3}/examples/README.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/examples/nvfp4-lora/.letify.example +0 -0
- {letify-2.5.2 → letify-2.5.3}/examples/nvfp4-lora/00_smoke.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/examples/nvfp4-lora/01_sweep.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/examples/nvfp4-lora/02_resume.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/examples/nvfp4-lora/03_watch.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/examples/nvfp4-lora/README.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/examples/nvfp4-lora/README_ko.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/examples/nvfp4-lora/common.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/examples/nvfp4-lora/recipe.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/config/__init__.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/config/inventory.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/config/login.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/config/schema.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/config/secrets.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/config/writer.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/declare/__init__.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/declare/cache.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/declare/env.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/declare/function.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/declare/instance.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/declare/reduce.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/declare/replicas.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/errors.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/install.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/launcher.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/paths.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/protocol/__init__.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/protocol/codec.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/protocol/driver.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/protocol/handle.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/protocol/wire.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/providers/__init__.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/providers/base.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/providers/colab.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/providers/colab_files.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/providers/colab_keepalive.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/providers/elice.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/providers/kaggle.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/providers/kaggle_adapter.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/providers/local.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/providers/modal.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/providers/modal_adapter.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/providers/naming.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/providers/shell.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/providers/tunnel.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/providers/usage.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/remoting/__init__.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/remoting/capability.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/remoting/device/__init__.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/remoting/device/client.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/remoting/device/cuda.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/remoting/device/executor.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/remoting/device/frames.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/remoting/device/guard.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/remoting/device/tensor.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/remoting/device/trace.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/remoting/device/value.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/remoting/loader.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/remoting/probe.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/render.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/runtime/__init__.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/runtime/bootstrap.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/runtime/broker.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/runtime/channel.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/runtime/lease.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/runtime/pool.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/runtime/session.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/runtime/telemetry.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/store/__init__.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/store/backends/__init__.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/store/backends/filesystem.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/store/backends/google_auth.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/store/backends/layout.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/store/backends/objects.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/store/cas.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/store/sendorder.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/store/volume.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/stubs.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/tools.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/transport/__init__.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/transport/agent.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/transport/announce.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/transport/link.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/transport/nat.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/transport/pipeline.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/transport/portmap.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/transport/probe.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/transport/quic.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/transport/rendezvous.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/transport/setup.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/transport/sshopts.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify/transport/strategies.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/.gitignore +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/build.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/letify-agent/Cargo.toml +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/letify-agent/src/driver.rs +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/letify-agent/src/main.rs +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/letify-driver/Cargo.toml +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/letify-driver/src/client.rs +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/letify-driver/src/exports.rs +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/letify-driver/src/image.rs +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/letify-driver/src/lib.rs +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/letify-driver/src/status.rs +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/letify-driver/src/table.rs +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/letify-quic/Cargo.toml +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/letify-quic/src/main.rs +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/letify-wire/Cargo.toml +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/letify-wire/src/lib.rs +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/letify-wire/tests/throughput.rs +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-core/rust-toolchain.toml +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-ext/.vscodeignore +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-ext/LICENSE +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-ext/README.md +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-ext/media/icon.svg +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-ext/src/cli.ts +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-ext/src/extension.ts +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-ext/src/history.ts +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-ext/src/model.ts +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-ext/src/poll.ts +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-ext/src/render.ts +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-ext/test/cli.test.ts +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-ext/test/manifest.test.ts +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-ext/test/model.test.ts +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-ext/test/regressions.test.ts +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify-ext/tsconfig.json +0 -0
- {letify-2.5.2 → letify-2.5.3}/letify_providers.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/scripts/sync-main.sh +0 -0
- {letify-2.5.2 → letify-2.5.3}/scripts/version.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/conftest.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/fake_kaggle_adapter.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/fake_modal_adapter.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_cli_output.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_colab_keepalive.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_config.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_core.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_declare.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_device.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_distributed.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_editor_sessions.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_elice.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_frames.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_install.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_kaggle.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_kaggle_cookie.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_kaggle_link.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_link_log.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_notebook.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_parallel_placement.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_paths.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_portmap.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_protocol.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_providers.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_quic.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_remoting.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_render.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_runtime.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_ship.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_store.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_strategies.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_stubs.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_transport.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_tunnel_setup.py +0 -0
- {letify-2.5.2 → letify-2.5.3}/tests/test_version.py +0 -0
|
@@ -1098,6 +1098,15 @@ A detected path that exists is an input. A detected directory and a detected pat
|
|
|
1098
1098
|
|
|
1099
1099
|
Any other path is pickled unchanged, so the body receives the local path as it was. Only `os.PathLike` objects are detected. A string that happens to name a local file is left alone, because no rule tells a path from any other string.
|
|
1100
1100
|
|
|
1101
|
+
One other path is refused rather than pickled unchanged: an `os.PathLike` naming a file or directory that exists on this machine and lies outside every allowed root. Passing it on leaves the body reading a path that is not there, which fails as `FileNotFoundError` on the runtime and names neither the cause nor the rule, and on a runtime where something does sit at that path it reads the wrong bytes instead. So the call raises `ValueError` before it is sent:
|
|
1102
|
+
|
|
1103
|
+
```
|
|
1104
|
+
<path> is outside the roots letify may send data from. The project root is <root>. Add its
|
|
1105
|
+
directory to [tool.letify] data_roots in <root>/pyproject.toml, or move the file inside the root.
|
|
1106
|
+
```
|
|
1107
|
+
|
|
1108
|
+
A path that exists here and is inside a root is data; a path that does not exist here is a runtime path and still travels unchanged, because that is how a body is told where to write.
|
|
1109
|
+
|
|
1101
1110
|
A directory is walked without following symbolic links to directories. Regular files and symbolic links to regular files are included. Entries named `.git`, `.venv` and `__pycache__` are skipped.
|
|
1102
1111
|
|
|
1103
1112
|
#### Digests and the digest cache <!-- id: project-data-digests -->
|
|
@@ -1290,6 +1299,10 @@ A call that detected data prints one line on standard error:
|
|
|
1290
1299
|
|
|
1291
1300
|
The line is printed when the call has at least one input file, after the call's outcome is known, because what was sent during the call is not known before then. Sizes are in MiB with one decimal. `<the bucket>` is named when the bytes come from the bucket. `before the call` counts the first wave of The send order and the first wave, `during it` counts what the background sender delivered while the call ran, and the rate covers both. `first access waited` is the wall clock time in which at least one reader was blocked on a blob that had not arrived, and it is `0.0` when the send order was right.
|
|
1292
1301
|
|
|
1302
|
+
`already on` counts the blobs the runtime answered `data_have` with, not what is left after subtracting what was sent. The two differ whenever a blob was neither already there nor fully sent, and subtracting reports such a blob as having been there all along, which is the opposite of what happened. A blob the background sender was still carrying when the call returned is one of those, so the line ends with `, <files> files <size> dropped when the call ended` whenever there is one, and omits that clause when there is none. A dropped blob is not a failure: the call is over and its bytes are no longer needed, which is why the sender is cancelled. It is reported because a line that accounts for every detected file except the dropped ones cannot be read.
|
|
1303
|
+
|
|
1304
|
+
Cancelling the sender removes the partial file of a blob it was writing, in the runtime's blob cache as well as a parallel put's staged ranges. A full sized partial left behind counts against the cache budget and is never completed, because the digest it would be sealed under is only written when every range has arrived.
|
|
1305
|
+
|
|
1293
1306
|
A call with an output location that returned prints a second line after the write-back:
|
|
1294
1307
|
|
|
1295
1308
|
`letify: data wrote back <files> files <size> in <seconds> s (<rate> MiB/s), <files> files <size> during the call, <files> files <size> already on the client`
|
|
@@ -1356,7 +1369,7 @@ Sizes are in MiB with one decimal and `<budget>` in GiB with one decimal.
|
|
|
1356
1369
|
|
|
1357
1370
|
`letify cache` shows the client digest cache, every local tree letify owns with its file count and size, and each provider's runtime file blob cache. `letify cache clear <target>` (or `letify cache clean <target>`) empties what is safe to clean. Credentials and configuration are never cleaned.
|
|
1358
1371
|
|
|
1359
|
-
`letify cache` first removes every digest cache entry whose file no longer exists, then prints the digest cache's entry count and how many were removed. It measures every local directory under `~/.letify`: `cache` (including digest cache, filesystem stores, and redirected CLI homes), `tools` (installed binaries), `tmp` (temporary session files), `ssh` (multiplexing control sockets), `runtime` (local provider workspace), and `accounts` (credentials, marked non-cleanable). For each provider in the configuration whose runtime disk persists between sessions
|
|
1372
|
+
`letify cache` first removes every digest cache entry whose file no longer exists, then prints the digest cache's entry count and how many were removed. It measures every local directory under `~/.letify`: `cache` (including digest cache, filesystem stores, and redirected CLI homes), `tools` (installed binaries), `tmp` (temporary session files), `ssh` (multiplexing control sockets), `runtime` (local provider workspace), and `accounts` (credentials, marked non-cleanable). For each provider in the configuration whose runtime disk persists between sessions and already has a session running, it asks the worker with one `data_cache` request and prints the alias, the blob count, the total size and the budget. It starts a session only where starting one bills nothing, which is a provider whose runtime is this machine: a command that shows what is there must not create what is billed, and a configuration naming several providers would bill for all of them at once to print a listing. A provider with no session running is listed with `no session running`, and a provider whose runtime disk does not persist with `not kept between sessions`. Clearing a named provider still starts a session, because there the user named the provider and asked for the work. `--json` prints the same records under `digests`, `local` and `providers`.
|
|
1360
1373
|
|
|
1361
1374
|
`letify cache clear <target>` (or `letify cache clean <target>`) clears caches:
|
|
1362
1375
|
1. When `<target>` is a provider alias, it sends `data_cache` with `clear` set to that runtime. The worker removes committed blobs whose link count is 1, and the command prints `<alias>: removed <files> files <size>`.
|
|
@@ -322,8 +322,41 @@ def _setup_tool(args: argparse.Namespace) -> int:
|
|
|
322
322
|
return 0
|
|
323
323
|
|
|
324
324
|
|
|
325
|
+
def _running_runtime(let: Launcher, alias: str):
|
|
326
|
+
"""A session this process already holds on that provider, or None.
|
|
327
|
+
|
|
328
|
+
Spec "The cache command": the listing asks only what is already running, because a
|
|
329
|
+
session it started would bill for the listing.
|
|
330
|
+
"""
|
|
331
|
+
for runtime in let.pool.live:
|
|
332
|
+
if getattr(runtime.provider, "alias", None) == alias:
|
|
333
|
+
return runtime
|
|
334
|
+
return None
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
def _data_cache_reply(let: Launcher, runtime, clear: bool) -> dict:
|
|
338
|
+
"""One ``data_cache`` request to a session that is already up."""
|
|
339
|
+
from .store import pathdata
|
|
340
|
+
|
|
341
|
+
provider = runtime.provider
|
|
342
|
+
root = (runtime.workspace or provider.workspace_root).rstrip("/")
|
|
343
|
+
return runtime.request(
|
|
344
|
+
{
|
|
345
|
+
"op": "data_cache",
|
|
346
|
+
"dir": f"{root}/data/blobs",
|
|
347
|
+
"budget": pathdata.budget_bytes(provider),
|
|
348
|
+
"clear": clear,
|
|
349
|
+
},
|
|
350
|
+
timeout=600,
|
|
351
|
+
)
|
|
352
|
+
|
|
353
|
+
|
|
325
354
|
def _data_cache_request(let: Launcher, alias: str, clear: bool) -> dict:
|
|
326
|
-
"""Ask a session on the provider's first instance about its file blob cache.
|
|
355
|
+
"""Ask a session on the provider's first instance about its file blob cache.
|
|
356
|
+
|
|
357
|
+
This starts one when none is running, so only a named provider reaches it. Spec "The
|
|
358
|
+
cache command".
|
|
359
|
+
"""
|
|
327
360
|
from .declare import Env
|
|
328
361
|
from .store import pathdata
|
|
329
362
|
|
|
@@ -462,7 +495,16 @@ def _cache(let: Launcher, args: argparse.Namespace) -> int:
|
|
|
462
495
|
if not provider.persistent:
|
|
463
496
|
records.append({"alias": alias, "kept": False})
|
|
464
497
|
continue
|
|
465
|
-
|
|
498
|
+
# Spec "The cache command": a listing bills nothing, so it starts a session
|
|
499
|
+
# only where starting one is free, and otherwise asks one that is already up.
|
|
500
|
+
if provider.kind == "local":
|
|
501
|
+
result = _data_cache_request(let, alias, False)
|
|
502
|
+
else:
|
|
503
|
+
runtime = _running_runtime(let, alias)
|
|
504
|
+
if runtime is None:
|
|
505
|
+
records.append({"alias": alias, "kept": True, "running": False})
|
|
506
|
+
continue
|
|
507
|
+
result = _data_cache_reply(let, runtime, False)
|
|
466
508
|
except LetifyError as exc:
|
|
467
509
|
records.append({"alias": alias, "unavailable": str(exc)})
|
|
468
510
|
continue
|
|
@@ -470,6 +512,7 @@ def _cache(let: Launcher, args: argparse.Namespace) -> int:
|
|
|
470
512
|
{
|
|
471
513
|
"alias": alias,
|
|
472
514
|
"kept": True,
|
|
515
|
+
"running": True,
|
|
473
516
|
"files": result["files"],
|
|
474
517
|
"bytes": result["bytes"],
|
|
475
518
|
"budget": result["budget"],
|
|
@@ -498,6 +541,8 @@ def _cache(let: Launcher, args: argparse.Namespace) -> int:
|
|
|
498
541
|
rows.append([row["alias"], f"unavailable: {row['unavailable']}", "", ""])
|
|
499
542
|
elif not row["kept"]:
|
|
500
543
|
rows.append([row["alias"], "not kept between sessions", "", ""])
|
|
544
|
+
elif not row.get("running"):
|
|
545
|
+
rows.append([row["alias"], "no session running", "", ""])
|
|
501
546
|
else:
|
|
502
547
|
rows.append(
|
|
503
548
|
[
|
|
@@ -855,6 +855,40 @@ def _parallel_partial(root, digest):
|
|
|
855
855
|
return "%s%s.parallel" % (_data_file(root, digest), _DATA_PARTIAL)
|
|
856
856
|
|
|
857
857
|
|
|
858
|
+
def _op_data_drop(request):
|
|
859
|
+
"""Remove the partials of a blob nobody is going to finish.
|
|
860
|
+
|
|
861
|
+
Spec "Data log line": a sender cancelled when the call ended leaves a partial that no
|
|
862
|
+
later request completes, because the digest it would be sealed under is written only
|
|
863
|
+
once every piece has arrived. A single put's partial is invisible to the budget scan,
|
|
864
|
+
so without this it stays for the life of the runtime.
|
|
865
|
+
"""
|
|
866
|
+
digest = request["digest"]
|
|
867
|
+
final = _data_file(request["dir"], digest)
|
|
868
|
+
open_handle = _DATA_OPEN.pop(digest, None)
|
|
869
|
+
if open_handle is not None:
|
|
870
|
+
try:
|
|
871
|
+
open_handle[0].close()
|
|
872
|
+
except OSError:
|
|
873
|
+
pass
|
|
874
|
+
removed = 0
|
|
875
|
+
directory = os.path.dirname(final)
|
|
876
|
+
name = os.path.basename(final)
|
|
877
|
+
try:
|
|
878
|
+
entries = os.listdir(directory)
|
|
879
|
+
except OSError:
|
|
880
|
+
entries = []
|
|
881
|
+
for entry in entries:
|
|
882
|
+
if entry == name or not entry.startswith(name + "."):
|
|
883
|
+
continue
|
|
884
|
+
try:
|
|
885
|
+
os.remove(os.path.join(directory, entry))
|
|
886
|
+
removed += 1
|
|
887
|
+
except OSError:
|
|
888
|
+
pass
|
|
889
|
+
return {"ok": True, "value": removed}
|
|
890
|
+
|
|
891
|
+
|
|
858
892
|
def _op_data_begin(request):
|
|
859
893
|
"""Make the file parallel senders will fill, of the size it will end up.
|
|
860
894
|
|
|
@@ -2254,6 +2288,7 @@ _OPS = {
|
|
|
2254
2288
|
"data_have": _op_data_have,
|
|
2255
2289
|
"data_put": _op_data_put,
|
|
2256
2290
|
"data_begin": _op_data_begin,
|
|
2291
|
+
"data_drop": _op_data_drop,
|
|
2257
2292
|
"data_put_at": _op_data_put_at,
|
|
2258
2293
|
"data_seal": _op_data_seal,
|
|
2259
2294
|
"data_pull": _op_data_pull,
|
|
@@ -370,6 +370,17 @@ class Collector:
|
|
|
370
370
|
if resolved == project or resolved in project.parents:
|
|
371
371
|
return None
|
|
372
372
|
if not any(_inside(resolved, root) for root in roots):
|
|
373
|
+
if info is not None:
|
|
374
|
+
# Spec "Where the bytes come from": a file that exists here and cannot be
|
|
375
|
+
# sent would travel as a path the body cannot read, which fails on the
|
|
376
|
+
# runtime naming neither the cause nor this rule, or reads the wrong bytes
|
|
377
|
+
# where something does sit at that path.
|
|
378
|
+
raise ValueError(
|
|
379
|
+
f"{resolved} is outside the roots letify may send data from. The "
|
|
380
|
+
f"project root is {project}. Add its directory to [tool.letify] "
|
|
381
|
+
f"data_roots in {project}/pyproject.toml, or move the file inside "
|
|
382
|
+
f"the root."
|
|
383
|
+
)
|
|
373
384
|
return None
|
|
374
385
|
index = len(self.placed)
|
|
375
386
|
placed = Placed(resolved, f"{self.call_dir}/{index}/{resolved.name}", is_dir)
|
|
@@ -601,6 +612,9 @@ class Stream:
|
|
|
601
612
|
self.runtime = runtime
|
|
602
613
|
self.blobs = blobs
|
|
603
614
|
self.plan = plan
|
|
615
|
+
#: Digests whose send finished. ``_sent`` holds the ones it began, so a blob the
|
|
616
|
+
#: sender was carrying when the call ended is in one and not the other.
|
|
617
|
+
self.done: set[str] = set()
|
|
604
618
|
self.before_files = self.before_bytes = 0
|
|
605
619
|
self.during_files = self.during_bytes = 0
|
|
606
620
|
self.before_seconds = self.during_seconds = 0.0
|
|
@@ -703,6 +717,22 @@ class Stream:
|
|
|
703
717
|
if (thread is None or not thread.is_alive()) and self._pipeline is not None:
|
|
704
718
|
self._pipeline.close()
|
|
705
719
|
self._pipeline = None
|
|
720
|
+
self._drop_partials()
|
|
721
|
+
|
|
722
|
+
def _drop_partials(self) -> None:
|
|
723
|
+
"""Remove the partial of every blob the sender was carrying. Spec "Data log line"."""
|
|
724
|
+
for digest in self.dropped:
|
|
725
|
+
try:
|
|
726
|
+
_worker(self.runtime, {"op": "data_drop", "dir": self.blobs, "digest": digest})
|
|
727
|
+
except (RuntimeFailure, RemoteError):
|
|
728
|
+
# The runtime is going away, which removes the partial with it.
|
|
729
|
+
return
|
|
730
|
+
|
|
731
|
+
@property
|
|
732
|
+
def dropped(self) -> list[str]:
|
|
733
|
+
"""Blobs that were neither already on the runtime nor fully sent."""
|
|
734
|
+
with self._lock:
|
|
735
|
+
return [digest for digest in self.plan.missing if digest not in self.done]
|
|
706
736
|
|
|
707
737
|
# -- the stream ---------------------------------------------------------------
|
|
708
738
|
|
|
@@ -760,6 +790,8 @@ class Stream:
|
|
|
760
790
|
if not uploaded:
|
|
761
791
|
return
|
|
762
792
|
files, total = self.plan.weight(digest)
|
|
793
|
+
with self._lock:
|
|
794
|
+
self.done.add(digest)
|
|
763
795
|
if self._thread is None:
|
|
764
796
|
self.before_files += files
|
|
765
797
|
self.before_bytes += total
|
|
@@ -780,19 +812,31 @@ class Stream:
|
|
|
780
812
|
|
|
781
813
|
stats = stats or {}
|
|
782
814
|
plan = self.plan
|
|
783
|
-
sent_files = self.before_files + self.during_files
|
|
784
815
|
sent_bytes = self.before_bytes + self.during_bytes
|
|
785
816
|
seconds = self.before_seconds + self.during_seconds
|
|
786
817
|
rate = sent_bytes / (1 << 20) / seconds if seconds > 0 else 0.0
|
|
787
|
-
|
|
818
|
+
# Spec "Data log line": counted from what the runtime answered data_have with,
|
|
819
|
+
# because subtracting what was sent reports a blob that was neither as having
|
|
820
|
+
# been there all along.
|
|
821
|
+
missing_weight = [plan.weight(digest) for digest in plan.missing]
|
|
822
|
+
already_files = plan.detected_files - sum(files for files, _b in missing_weight)
|
|
823
|
+
already_bytes = plan.detected_bytes - sum(total for _f, total in missing_weight)
|
|
824
|
+
dropped_weight = [plan.weight(digest) for digest in self.dropped]
|
|
825
|
+
dropped_files = sum(files for files, _b in dropped_weight)
|
|
826
|
+
dropped_bytes = sum(total for _f, total in dropped_weight)
|
|
827
|
+
line = (
|
|
788
828
|
f"data {plan.detected_files} files {_mib(plan.detected_bytes)} detected, "
|
|
789
|
-
f"{
|
|
790
|
-
f"{_mib(plan.detected_bytes - sent_bytes)} already on {plan.where}, "
|
|
829
|
+
f"{already_files} files {_mib(already_bytes)} already on {plan.where}, "
|
|
791
830
|
f"sent {self.before_files} files {_mib(self.before_bytes)} before the call in "
|
|
792
831
|
f"{self.before_seconds:.1f} s, {self.during_files} files "
|
|
793
832
|
f"{_mib(self.during_bytes)} during it in {self.during_seconds:.1f} s "
|
|
794
833
|
f"({rate:.1f} MiB/s), first access waited {float(stats.get('seconds', 0.0)):.1f} s"
|
|
795
834
|
)
|
|
835
|
+
if dropped_files:
|
|
836
|
+
line += (
|
|
837
|
+
f", {dropped_files} files {_mib(dropped_bytes)} dropped when the call ended"
|
|
838
|
+
)
|
|
839
|
+
install.log(line)
|
|
796
840
|
if stats.get("files"):
|
|
797
841
|
install.log(
|
|
798
842
|
f"data waited for {stats['files']} files {_mib(int(stats.get('bytes', 0)))} "
|
|
@@ -138,7 +138,7 @@ dependencies = [
|
|
|
138
138
|
|
|
139
139
|
[[package]]
|
|
140
140
|
name = "letify-agent"
|
|
141
|
-
version = "2.5.
|
|
141
|
+
version = "2.5.3"
|
|
142
142
|
dependencies = [
|
|
143
143
|
"letify-wire",
|
|
144
144
|
"libloading",
|
|
@@ -146,7 +146,7 @@ dependencies = [
|
|
|
146
146
|
|
|
147
147
|
[[package]]
|
|
148
148
|
name = "letify-driver"
|
|
149
|
-
version = "2.5.
|
|
149
|
+
version = "2.5.3"
|
|
150
150
|
dependencies = [
|
|
151
151
|
"letify-wire",
|
|
152
152
|
]
|
|
@@ -164,7 +164,7 @@ dependencies = [
|
|
|
164
164
|
|
|
165
165
|
[[package]]
|
|
166
166
|
name = "letify-wire"
|
|
167
|
-
version = "2.5.
|
|
167
|
+
version = "2.5.3"
|
|
168
168
|
|
|
169
169
|
[[package]]
|
|
170
170
|
name = "libc"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "letify-status",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "letify-status",
|
|
9
|
-
"version": "2.5.
|
|
9
|
+
"version": "2.5.3",
|
|
10
10
|
"license": "SEE LICENSE IN LICENSE",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@types/node": "^18.19.0",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "letify-status",
|
|
3
3
|
"displayName": "letify Status",
|
|
4
4
|
"description": "letify quota and GPU activity in the status bar, read from the letify CLI.",
|
|
5
|
-
"version": "2.5.
|
|
5
|
+
"version": "2.5.3",
|
|
6
6
|
"publisher": "darkpyonix",
|
|
7
7
|
"license": "SEE LICENSE IN LICENSE",
|
|
8
8
|
"repository": {
|
|
@@ -1606,3 +1606,61 @@ def test_stop_orphans_exits_one_when_a_delete_failed(isolated_home, capsys, monk
|
|
|
1606
1606
|
)
|
|
1607
1607
|
assert main(["stop", "--orphans", "-y"]) == 1
|
|
1608
1608
|
assert "refused" in capsys.readouterr().out
|
|
1609
|
+
|
|
1610
|
+
|
|
1611
|
+
def test_the_cache_listing_starts_no_session(isolated_home, monkeypatch, capsys) -> None:
|
|
1612
|
+
"""Spec "The cache command": a command that shows what is there starts nothing.
|
|
1613
|
+
|
|
1614
|
+
KICT ran `letify cache` and it booted a Modal CPU session, which then failed its own
|
|
1615
|
+
uv sync. A configuration naming several persistent providers would bill for all of
|
|
1616
|
+
them to print a listing.
|
|
1617
|
+
"""
|
|
1618
|
+
import letify
|
|
1619
|
+
from letify.cli import main
|
|
1620
|
+
from letify.runtime import pool
|
|
1621
|
+
|
|
1622
|
+
(isolated_home / ".letify" / "config.toml").write_text(
|
|
1623
|
+
'[lab]\nkind = "shell"\naddress = "gpu.example.edu"\npersistent = true\n',
|
|
1624
|
+
encoding="utf-8",
|
|
1625
|
+
)
|
|
1626
|
+
started: list[str] = []
|
|
1627
|
+
|
|
1628
|
+
real = pool.RuntimePool.acquire
|
|
1629
|
+
|
|
1630
|
+
def watch(self, instance, env, volumes=(), **kwargs):
|
|
1631
|
+
provider = instance.provider
|
|
1632
|
+
started.append(provider.alias)
|
|
1633
|
+
assert provider.kind == "local", f"the listing started a billed session on {provider.alias}"
|
|
1634
|
+
return real(self, instance, env, volumes, **kwargs)
|
|
1635
|
+
|
|
1636
|
+
monkeypatch.setattr(pool.RuntimePool, "acquire", watch)
|
|
1637
|
+
assert main(["cache", "--json"]) == 0
|
|
1638
|
+
assert all(alias == "local" for alias in started), started
|
|
1639
|
+
out = capsys.readouterr().out
|
|
1640
|
+
assert "providers" in out
|
|
1641
|
+
assert letify # the import is what makes the launcher reachable in this process
|
|
1642
|
+
|
|
1643
|
+
|
|
1644
|
+
def test_the_cache_listing_says_a_provider_has_no_session_running(
|
|
1645
|
+
isolated_home, capsys
|
|
1646
|
+
) -> None:
|
|
1647
|
+
"""Spec "The cache command": a provider with no session is named, not skipped."""
|
|
1648
|
+
import json
|
|
1649
|
+
|
|
1650
|
+
from letify.cli import main
|
|
1651
|
+
|
|
1652
|
+
(isolated_home / ".letify" / "config.toml").write_text(
|
|
1653
|
+
'[lab]\nkind = "shell"\naddress = "gpu.example.edu"\npersistent = true\n',
|
|
1654
|
+
encoding="utf-8",
|
|
1655
|
+
)
|
|
1656
|
+
assert main(["cache", "--json"]) == 0
|
|
1657
|
+
record = json.loads(capsys.readouterr().out)
|
|
1658
|
+
remote = [
|
|
1659
|
+
row
|
|
1660
|
+
for row in record["providers"]
|
|
1661
|
+
if row.get("kept") and row["alias"] != "local"
|
|
1662
|
+
]
|
|
1663
|
+
assert remote, "no billed persistent provider in the fixture, so this pins nothing"
|
|
1664
|
+
for row in remote:
|
|
1665
|
+
assert row.get("running") is False, row
|
|
1666
|
+
assert "files" not in row, row
|
|
@@ -106,9 +106,12 @@ def test_a_path_that_does_not_exist_outside_the_roots_is_left_as_a_plain_path(
|
|
|
106
106
|
assert not absent.exists()
|
|
107
107
|
|
|
108
108
|
|
|
109
|
-
def
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
def test_a_file_outside_the_allowed_roots_is_refused(let, cpu, project, tmp_path) -> None:
|
|
110
|
+
"""Spec "Where the bytes come from": it used to travel as a plain path.
|
|
111
|
+
|
|
112
|
+
The body then read a path that is not on the runtime, which failed there as a
|
|
113
|
+
FileNotFoundError naming neither the cause nor the rule. KICT hit that twice.
|
|
114
|
+
"""
|
|
112
115
|
outside = tmp_path / "elsewhere.txt"
|
|
113
116
|
outside.write_text("not project data", encoding="utf-8")
|
|
114
117
|
|
|
@@ -116,8 +119,9 @@ def test_a_path_outside_the_allowed_roots_is_left_as_a_plain_path(
|
|
|
116
119
|
def where(path: Path) -> str:
|
|
117
120
|
return str(path)
|
|
118
121
|
|
|
119
|
-
|
|
120
|
-
|
|
122
|
+
with pytest.raises(ValueError) as failure:
|
|
123
|
+
where(outside)
|
|
124
|
+
assert "outside the roots letify may send data from" in str(failure.value)
|
|
121
125
|
|
|
122
126
|
|
|
123
127
|
def test_a_data_root_named_in_pyproject_is_allowed(let, cpu, project, tmp_path) -> None:
|
|
@@ -780,3 +784,40 @@ def test_blobs_a_write_back_adds_keep_the_cache_within_its_budget(
|
|
|
780
784
|
root = _blobs_root()
|
|
781
785
|
assert sum(p.stat().st_size for p in root.glob("*/*")) <= 20 << 10
|
|
782
786
|
assert len(evictions(capsys.readouterr().err)) == 1
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
def test_a_file_outside_the_allowed_roots_is_refused_rather_than_sent_as_a_path(
|
|
790
|
+
let, cpu, project, tmp_path
|
|
791
|
+
) -> None:
|
|
792
|
+
"""Spec "Where the bytes come from": passing it on leaves the body reading nothing.
|
|
793
|
+
|
|
794
|
+
KICT hit this twice on Kaggle: a shard outside the project root travelled as a plain
|
|
795
|
+
path and the call died on the runtime with FileNotFoundError naming only the file.
|
|
796
|
+
"""
|
|
797
|
+
outside = tmp_path / "outside" / "shard.pt"
|
|
798
|
+
outside.parent.mkdir(parents=True, exist_ok=True)
|
|
799
|
+
outside.write_bytes(b"x" * 4096)
|
|
800
|
+
|
|
801
|
+
@let.function(device=cpu, host="remote")
|
|
802
|
+
def read(path) -> int:
|
|
803
|
+
import os
|
|
804
|
+
|
|
805
|
+
return os.path.getsize(path)
|
|
806
|
+
|
|
807
|
+
with pytest.raises(ValueError) as failure:
|
|
808
|
+
read(path=outside)
|
|
809
|
+
message = str(failure.value)
|
|
810
|
+
assert str(outside) in message
|
|
811
|
+
assert "data_roots" in message
|
|
812
|
+
assert "outside the roots letify may send data from" in message
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
def test_a_path_that_does_not_exist_here_still_travels_unchanged(let, cpu, project) -> None:
|
|
816
|
+
"""Spec "Where the bytes come from": that is how a body is told where to write."""
|
|
817
|
+
|
|
818
|
+
@let.function(device=cpu, host="remote")
|
|
819
|
+
def name(path) -> str:
|
|
820
|
+
return str(path)
|
|
821
|
+
|
|
822
|
+
target = Path("/not/on/this/machine/out.pt")
|
|
823
|
+
assert name(path=target) == str(target)
|
|
@@ -1551,3 +1551,93 @@ def test_a_blob_whose_bytes_are_unchanged_survives_a_new_mtime(launcher_from, pr
|
|
|
1551
1551
|
with redirect_stderr(captured):
|
|
1552
1552
|
assert touches(target)[1] == 1 << 12
|
|
1553
1553
|
assert "data cache dropped" not in captured.getvalue()
|
|
1554
|
+
|
|
1555
|
+
|
|
1556
|
+
def test_a_blob_the_sender_was_still_carrying_is_reported_as_dropped(
|
|
1557
|
+
let, cpu, project, capsys, monkeypatch
|
|
1558
|
+
) -> None:
|
|
1559
|
+
"""Spec "Data log line": subtracting reports it as having been there all along.
|
|
1560
|
+
|
|
1561
|
+
KICT chased this for an afternoon on Kaggle. A 1707 MiB shard was over the first wave
|
|
1562
|
+
budget, so it went to the background sender; the body only stat'ed it, which the
|
|
1563
|
+
observation patch answers from the manifest without waiting; the call returned and the
|
|
1564
|
+
sender was cancelled before the blob was sealed. The line then read "1707 MiB already
|
|
1565
|
+
on the runtime, sent 0", which says the opposite of what happened.
|
|
1566
|
+
"""
|
|
1567
|
+
from letify.store import pathdata
|
|
1568
|
+
|
|
1569
|
+
big = project / "big.bin"
|
|
1570
|
+
big.write_bytes(b"z" * (3 << 20))
|
|
1571
|
+
|
|
1572
|
+
# The wave takes nothing, so the one blob goes to the background sender, and the
|
|
1573
|
+
# sender is held until the call has returned and cancelled it.
|
|
1574
|
+
monkeypatch.setattr(pathdata, "FIRST_WAVE_MIB", 0.0)
|
|
1575
|
+
monkeypatch.setattr(pathdata, "FIRST_WAVE_FILES", 0)
|
|
1576
|
+
holding = threading.Event()
|
|
1577
|
+
real_send = pathdata.Stream._send
|
|
1578
|
+
|
|
1579
|
+
def slow(self, digest, meter):
|
|
1580
|
+
holding.wait(timeout=10)
|
|
1581
|
+
return real_send(self, digest, meter)
|
|
1582
|
+
|
|
1583
|
+
monkeypatch.setattr(pathdata.Stream, "_send", slow)
|
|
1584
|
+
|
|
1585
|
+
@let.function(device=cpu, host=letify.remote)
|
|
1586
|
+
def peek(path) -> int:
|
|
1587
|
+
import os
|
|
1588
|
+
|
|
1589
|
+
return os.path.getsize(str(path))
|
|
1590
|
+
|
|
1591
|
+
try:
|
|
1592
|
+
peek(path=big)
|
|
1593
|
+
finally:
|
|
1594
|
+
holding.set()
|
|
1595
|
+
lines = [
|
|
1596
|
+
text
|
|
1597
|
+
for text in capsys.readouterr().err.splitlines()
|
|
1598
|
+
if text.startswith("letify: data ") and not text.startswith("letify: data wrote back ")
|
|
1599
|
+
]
|
|
1600
|
+
assert lines
|
|
1601
|
+
line = lines[0]
|
|
1602
|
+
assert "0 files 0.0 MiB already on the runtime" in line, line
|
|
1603
|
+
assert "dropped when the call ended" in line, line
|
|
1604
|
+
|
|
1605
|
+
|
|
1606
|
+
def test_a_cancelled_send_leaves_no_partial_in_the_blob_cache(
|
|
1607
|
+
let, cpu, project, capsys, monkeypatch
|
|
1608
|
+
) -> None:
|
|
1609
|
+
"""Spec "Data log line": a full sized partial counts against the budget forever."""
|
|
1610
|
+
from letify.store import pathdata
|
|
1611
|
+
|
|
1612
|
+
big = project / "big2.bin"
|
|
1613
|
+
big.write_bytes(b"y" * (3 << 20))
|
|
1614
|
+
monkeypatch.setattr(pathdata, "FIRST_WAVE_MIB", 0.0)
|
|
1615
|
+
monkeypatch.setattr(pathdata, "FIRST_WAVE_FILES", 0)
|
|
1616
|
+
holding = threading.Event()
|
|
1617
|
+
real_send = pathdata.Stream._send
|
|
1618
|
+
|
|
1619
|
+
def slow(self, digest, meter):
|
|
1620
|
+
holding.wait(timeout=10)
|
|
1621
|
+
return real_send(self, digest, meter)
|
|
1622
|
+
|
|
1623
|
+
monkeypatch.setattr(pathdata.Stream, "_send", slow)
|
|
1624
|
+
|
|
1625
|
+
@let.function(device=cpu, host=letify.remote)
|
|
1626
|
+
def peek(path) -> list[str]:
|
|
1627
|
+
import os
|
|
1628
|
+
|
|
1629
|
+
root = os.path.join(os.path.dirname(os.path.dirname(str(path))), "..", "blobs")
|
|
1630
|
+
root = os.path.normpath(root)
|
|
1631
|
+
found = []
|
|
1632
|
+
for directory, _dirs, names in os.walk(root):
|
|
1633
|
+
found.extend(os.path.join(directory, name) for name in names)
|
|
1634
|
+
return found
|
|
1635
|
+
|
|
1636
|
+
try:
|
|
1637
|
+
peek(path=big)
|
|
1638
|
+
finally:
|
|
1639
|
+
holding.set()
|
|
1640
|
+
time.sleep(1.0)
|
|
1641
|
+
root = Path.home() / ".letify" / "runtime" / "data" / "blobs"
|
|
1642
|
+
leftovers = [p for p in root.rglob("*") if p.is_file() and ".letify-" in p.name]
|
|
1643
|
+
assert leftovers == [], leftovers
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{letify-2.5.2 → letify-2.5.3}/docs/guide/ko/01-/354/213/234/354/236/221/355/225/230/352/270/260.md"
RENAMED
|
File without changes
|
|
File without changes
|
{letify-2.5.2 → letify-2.5.3}/docs/guide/ko/03-/354/213/244/355/226/211-/353/260/251/354/213/235.md"
RENAMED
|
File without changes
|
|
File without changes
|
{letify-2.5.2 → letify-2.5.3}/docs/guide/ko/05-/353/217/231/354/213/234-/354/213/244/355/226/211.md"
RENAMED
|
File without changes
|
|
File without changes
|
{letify-2.5.2 → letify-2.5.3}/docs/guide/ko/07-/353/254/270/354/240/234-/355/225/264/352/262/260.md"
RENAMED
|
File without changes
|