letify 2.10.5__tar.gz → 2.10.6__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.10.5 → letify-2.10.6}/PKG-INFO +1 -1
- {letify-2.10.5 → letify-2.10.6}/docs/SPEC.md +1 -1
- {letify-2.10.5 → letify-2.10.6}/letify/__init__.py +1 -1
- {letify-2.10.5 → letify-2.10.6}/letify/runtime/control.py +21 -7
- {letify-2.10.5 → letify-2.10.6}/letify-core/Cargo.lock +2 -2
- {letify-2.10.5 → letify-2.10.6}/letify-core/Cargo.toml +1 -1
- {letify-2.10.5 → letify-2.10.6}/letify-ext/package-lock.json +2 -2
- {letify-2.10.5 → letify-2.10.6}/letify-ext/package.json +1 -1
- {letify-2.10.5 → letify-2.10.6}/pyproject.toml +1 -1
- {letify-2.10.5 → letify-2.10.6}/tests/test_run_control.py +30 -0
- {letify-2.10.5 → letify-2.10.6}/.github/workflows/ci.yml +0 -0
- {letify-2.10.5 → letify-2.10.6}/.github/workflows/docs.yml +0 -0
- {letify-2.10.5 → letify-2.10.6}/.github/workflows/publish-crates.yml +0 -0
- {letify-2.10.5 → letify-2.10.6}/.github/workflows/publish.yml +0 -0
- {letify-2.10.5 → letify-2.10.6}/.github/workflows/reserve-crates.yml +0 -0
- {letify-2.10.5 → letify-2.10.6}/.gitignore +0 -0
- {letify-2.10.5 → letify-2.10.6}/.researchtree +0 -0
- {letify-2.10.5 → letify-2.10.6}/CLAUDE.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/LICENSE +0 -0
- {letify-2.10.5 → letify-2.10.6}/PROJECT.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/README.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/COMPONENT.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/INTENT.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/NETWORK.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/guide/01-getting-started.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/guide/02-providers.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/guide/03-execution-modes.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/guide/04-environments-and-data.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/guide/05-concurrency.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/guide/06-cost.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/guide/07-troubleshooting.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/guide/08-releasing.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/guide/README.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/guide/ko/01-/354/213/234/354/236/221/355/225/230/352/270/260.md" +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/guide/ko/02-/355/224/204/353/241/234/353/260/224/354/235/264/353/215/224.md" +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/guide/ko/03-/354/213/244/355/226/211-/353/260/251/354/213/235.md" +0 -0
- {letify-2.10.5 → letify-2.10.6}/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.10.5 → letify-2.10.6}/docs/guide/ko/05-/353/217/231/354/213/234-/354/213/244/355/226/211.md" +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/guide/ko/06-/353/271/204/354/232/251.md" +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/guide/ko/07-/353/254/270/354/240/234-/355/225/264/352/262/260.md" +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/guide/ko/08-/353/246/264/353/246/254/354/212/244.md" +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/guide/ko/README.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/locales/README_ko.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/docs/mkdocs.yml +0 -0
- {letify-2.10.5 → letify-2.10.6}/examples/README.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/examples/nvfp4-lora/.letify.example +0 -0
- {letify-2.10.5 → letify-2.10.6}/examples/nvfp4-lora/00_smoke.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/examples/nvfp4-lora/01_sweep.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/examples/nvfp4-lora/02_resume.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/examples/nvfp4-lora/03_watch.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/examples/nvfp4-lora/README.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/examples/nvfp4-lora/README_ko.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/examples/nvfp4-lora/common.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/examples/nvfp4-lora/recipe.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/cli.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/config/__init__.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/config/inventory.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/config/login.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/config/schema.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/config/secrets.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/config/writer.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/declare/__init__.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/declare/cache.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/declare/env.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/declare/exit.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/declare/function.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/declare/instance.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/declare/reduce.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/declare/replicas.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/errors.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/install.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/launcher.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/paths.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/protocol/__init__.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/protocol/codec.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/protocol/driver.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/protocol/handle.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/protocol/wire.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/protocol/worker.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/providers/__init__.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/providers/base.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/providers/colab.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/providers/colab_files.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/providers/colab_keepalive.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/providers/elice.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/providers/kaggle.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/providers/kaggle_adapter.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/providers/local.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/providers/modal.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/providers/modal_adapter.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/providers/naming.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/providers/shell.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/providers/tunnel.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/providers/usage.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/remoting/__init__.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/remoting/device/__init__.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/remoting/device/client.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/remoting/device/cuda.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/remoting/device/executor.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/remoting/device/frames.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/remoting/device/guard.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/remoting/device/tensor.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/remoting/device/trace.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/remoting/device/value.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/render.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/runtime/__init__.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/runtime/bootstrap.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/runtime/broker.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/runtime/channel.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/runtime/lease.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/runtime/pool.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/runtime/session.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/runtime/takeover.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/runtime/telemetry.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/runtime/workers.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/store/__init__.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/store/backends/__init__.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/store/backends/drive.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/store/backends/filesystem.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/store/backends/google_auth.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/store/backends/layout.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/store/backends/objects.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/store/cas.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/store/handoff.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/store/pathdata.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/store/sendorder.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/store/volume.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/stubs.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/tools.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/transport/__init__.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/transport/agent.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/transport/announce.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/transport/link.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/transport/nat.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/transport/pipeline.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/transport/portmap.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/transport/probe.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/transport/quic.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/transport/rendezvous.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/transport/setup.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/transport/sshopts.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify/transport/strategies.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-core/.gitignore +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-core/build.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-core/letify/Cargo.toml +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-core/letify/LICENSE +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-core/letify/README.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-core/letify/src/lib.rs +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-core/letify-quic/Cargo.toml +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-core/letify-quic/src/main.rs +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-core/rust-toolchain.toml +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-ext/.vscodeignore +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-ext/LICENSE +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-ext/README.md +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-ext/media/icon.svg +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-ext/src/cli.ts +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-ext/src/extension.ts +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-ext/src/history.ts +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-ext/src/model.ts +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-ext/src/poll.ts +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-ext/src/render.ts +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-ext/test/cli.test.ts +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-ext/test/manifest.test.ts +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-ext/test/model.test.ts +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-ext/test/regressions.test.ts +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify-ext/tsconfig.json +0 -0
- {letify-2.10.5 → letify-2.10.6}/letify_providers.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/scripts/sync-main.sh +0 -0
- {letify-2.10.5 → letify-2.10.6}/scripts/version.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/conftest.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/fake_kaggle_adapter.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/fake_modal_adapter.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_cli.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_cli_output.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_colab_keepalive.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_config.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_core.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_data.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_data_streaming.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_declare.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_device.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_device_compile.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_distributed.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_drive_handoff.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_drive_store.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_editor_sessions.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_elice.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_frames.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_install.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_kaggle.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_kaggle_cookie.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_kaggle_link.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_link_log.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_notebook.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_parallel_placement.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_paths.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_portmap.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_protocol.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_providers.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_punch_sockets.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_quic.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_remoting.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_render.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_run_takeover.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_runtime.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_shell_workers.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_ship.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_store.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_strategies.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_stubs.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_transport.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_tunnel_setup.py +0 -0
- {letify-2.10.5 → letify-2.10.6}/tests/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: letify
|
|
3
|
-
Version: 2.10.
|
|
3
|
+
Version: 2.10.6
|
|
4
4
|
Summary: Declarations that become infrastructure.
|
|
5
5
|
Project-URL: Homepage, https://github.com/DarkPyonix/letify
|
|
6
6
|
Project-URL: Documentation, https://github.com/DarkPyonix/letify/tree/main/docs
|
|
@@ -1063,7 +1063,7 @@ A call on a remote runtime is a program running somewhere else. On a laptop the
|
|
|
1063
1063
|
|
|
1064
1064
|
Every call on a runtime gets a run id, 12 lowercase hex characters, when it is sent. The owning process writes `~/.letify/runs/<run id>.json` before the call is sent and removes it when the call returns or raises. The record holds `run`, `function` (the qualified name), `runtime`, `provider` (the account alias), `started_at` (Unix seconds), `pid` (the owning process) and `socket`, the owner's control socket. The directory is created with mode 0700 and each file with mode 0600.
|
|
1065
1065
|
|
|
1066
|
-
Each owning process listens on one Unix socket, `~/.letify/runs/<pid>.sock`, created on the first call and removed at exit. A command reaches a run by reading its record and connecting to that socket; the owner forwards the request to the runtime over the call's own channel. When `~/.letify/runs/<pid>.sock` would exceed 100 bytes, the limit of a Unix socket path, the socket is created as `run-<pid>.sock` in the SSH control directory of [Declared filesystem paths](#declared-paths) instead, and `socket` in the record names
|
|
1066
|
+
Each owning process listens on one Unix socket, `~/.letify/runs/<pid>.sock`, created on the first call and removed at exit. A command reaches a run by reading its record and connecting to that socket; the owner forwards the request to the runtime over the call's own channel. When `~/.letify/runs/<pid>.sock` would exceed 100 bytes, below the limit of a Unix socket path (107 bytes on Linux, 103 on macOS), the socket is created as `run-<pid>.sock` in the SSH control directory of [Declared filesystem paths](#declared-paths) instead. When that path also exceeds 100 bytes, which happens with a deep `LETIFY_HOME` and no `XDG_RUNTIME_DIR`, the socket is created as `run-<h>-<pid>.sock` in `letify-<uid>` below the system temporary directory, where `<h>` is the first 12 hex characters of the SHA-256 of the preferred path. That directory is mode 0700, owned by the user, and not a symbolic link; it is refused otherwise. In every case `socket` in the record names the path actually bound, and the socket is removed at exit. A record whose `pid` no longer exists is stale: it is removed when read and the run is reported as not found. On Windows there is no control socket, and the commands below say so.
|
|
1067
1067
|
|
|
1068
1068
|
The request travels as one JSON object per line on the socket and the answer as one JSON object per line, so a tool that is not letify can drive it.
|
|
1069
1069
|
|
|
@@ -17,12 +17,14 @@ from __future__ import annotations
|
|
|
17
17
|
|
|
18
18
|
import atexit
|
|
19
19
|
import contextlib
|
|
20
|
+
import hashlib
|
|
20
21
|
import json
|
|
21
22
|
import os
|
|
22
23
|
import secrets
|
|
23
24
|
import socket
|
|
24
25
|
import stat
|
|
25
26
|
import sys
|
|
27
|
+
import tempfile
|
|
26
28
|
import threading
|
|
27
29
|
import time
|
|
28
30
|
from collections.abc import Iterator
|
|
@@ -65,21 +67,33 @@ def runs_directory() -> Path:
|
|
|
65
67
|
|
|
66
68
|
|
|
67
69
|
def socket_path(pid: int) -> Path:
|
|
68
|
-
"""Where the process ``pid`` listens
|
|
70
|
+
"""Where the process ``pid`` listens, at most ``SOCKET_LIMIT`` bytes long where it can be.
|
|
69
71
|
|
|
70
|
-
|
|
71
|
-
``
|
|
72
|
-
|
|
72
|
+
Spec "Controlling a running call": ``runs/<pid>.sock`` when that fits, else
|
|
73
|
+
``run-<pid>.sock`` in the SSH control directory, else ``run-<h>-<pid>.sock`` in a
|
|
74
|
+
private per-user directory below the system temporary directory, where ``<h>`` hashes
|
|
75
|
+
the preferred path so two state roots never share a name.
|
|
73
76
|
"""
|
|
74
77
|
preferred = runs_directory() / f"{pid}.sock"
|
|
75
78
|
if len(os.fsencode(preferred)) <= SOCKET_LIMIT:
|
|
76
79
|
return preferred
|
|
77
|
-
|
|
80
|
+
shared = paths.ssh_control_directory() / f"run-{pid}.sock"
|
|
81
|
+
if len(os.fsencode(shared)) <= SOCKET_LIMIT:
|
|
82
|
+
return shared
|
|
83
|
+
digest = hashlib.sha256(os.fsencode(preferred)).hexdigest()[:12]
|
|
84
|
+
name = f"run-{digest}-{pid}.sock"
|
|
85
|
+
return Path(tempfile.gettempdir()) / f"letify-{os.getuid()}" / name
|
|
78
86
|
|
|
79
87
|
|
|
80
88
|
def _private_directory(directory: Path) -> None:
|
|
81
|
-
directory.
|
|
82
|
-
|
|
89
|
+
"""Create ``directory`` mode 0700 and refuse a symbolic link or another user's directory."""
|
|
90
|
+
directory.mkdir(mode=0o700, parents=True, exist_ok=True)
|
|
91
|
+
info = directory.lstat()
|
|
92
|
+
if stat.S_ISLNK(info.st_mode) or not stat.S_ISDIR(info.st_mode):
|
|
93
|
+
raise OSError(f"{directory} is not a plain directory")
|
|
94
|
+
if info.st_uid != os.getuid():
|
|
95
|
+
raise OSError(f"{directory} is not owned by this user")
|
|
96
|
+
if stat.S_IMODE(info.st_mode) != 0o700:
|
|
83
97
|
directory.chmod(0o700)
|
|
84
98
|
|
|
85
99
|
|
|
@@ -138,11 +138,11 @@ dependencies = [
|
|
|
138
138
|
|
|
139
139
|
[[package]]
|
|
140
140
|
name = "letify"
|
|
141
|
-
version = "2.10.
|
|
141
|
+
version = "2.10.6"
|
|
142
142
|
|
|
143
143
|
[[package]]
|
|
144
144
|
name = "letify-quic"
|
|
145
|
-
version = "2.10.
|
|
145
|
+
version = "2.10.6"
|
|
146
146
|
dependencies = [
|
|
147
147
|
"quinn",
|
|
148
148
|
"rcgen",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "letify-status",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.6",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "letify-status",
|
|
9
|
-
"version": "2.10.
|
|
9
|
+
"version": "2.10.6",
|
|
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.10.
|
|
5
|
+
"version": "2.10.6",
|
|
6
6
|
"publisher": "darkpyonix",
|
|
7
7
|
"license": "SEE LICENSE IN LICENSE",
|
|
8
8
|
"repository": {
|
|
@@ -14,6 +14,7 @@ import json
|
|
|
14
14
|
import os
|
|
15
15
|
import shutil
|
|
16
16
|
import signal
|
|
17
|
+
import socket
|
|
17
18
|
import stat
|
|
18
19
|
import sys
|
|
19
20
|
import tempfile
|
|
@@ -714,3 +715,32 @@ def _alive(pid: int) -> bool:
|
|
|
714
715
|
def test_on_exit_outside_a_body_raises_unsupported_mode() -> None:
|
|
715
716
|
with pytest.raises(letify.UnsupportedMode, match="atexit"):
|
|
716
717
|
letify.on_exit(lambda: None)
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
def test_a_run_control_socket_binds_and_answers_under_a_deep_letify_home(
|
|
721
|
+
monkeypatch, tmp_path
|
|
722
|
+
) -> None:
|
|
723
|
+
deep = tmp_path / ("d" * 60) / ("e" * 60)
|
|
724
|
+
deep.mkdir(parents=True)
|
|
725
|
+
monkeypatch.setenv("LETIFY_HOME", str(deep))
|
|
726
|
+
monkeypatch.delenv("XDG_RUNTIME_DIR", raising=False)
|
|
727
|
+
natural = control.runs_directory() / f"{os.getpid()}.sock"
|
|
728
|
+
assert len(os.fsencode(natural)) > 107
|
|
729
|
+
assert len(os.fsencode(paths.ssh_control_directory() / f"run-{os.getpid()}.sock")) > 107
|
|
730
|
+
|
|
731
|
+
server = control._Server()
|
|
732
|
+
try:
|
|
733
|
+
assert len(os.fsencode(server.path)) <= 100
|
|
734
|
+
assert server.path.exists()
|
|
735
|
+
assert stat.S_IMODE(server.path.parent.stat().st_mode) == 0o700
|
|
736
|
+
assert control.socket_path(os.getpid()) == server.path
|
|
737
|
+
|
|
738
|
+
client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
|
739
|
+
try:
|
|
740
|
+
client.settimeout(5)
|
|
741
|
+
client.connect(str(server.path))
|
|
742
|
+
finally:
|
|
743
|
+
client.close()
|
|
744
|
+
finally:
|
|
745
|
+
server.close()
|
|
746
|
+
assert not server.path.exists()
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|