letify 2.11.1__tar.gz → 2.11.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.11.1 → letify-2.11.3}/.github/workflows/ci.yml +8 -0
- {letify-2.11.1 → letify-2.11.3}/PKG-INFO +1 -1
- {letify-2.11.1 → letify-2.11.3}/docs/SPEC.md +4 -2
- {letify-2.11.1 → letify-2.11.3}/letify/__init__.py +1 -1
- {letify-2.11.1 → letify-2.11.3}/letify/transport/linksignal.py +123 -11
- {letify-2.11.1 → letify-2.11.3}/letify-core/Cargo.lock +3 -3
- {letify-2.11.1 → letify-2.11.3}/letify-core/Cargo.toml +1 -1
- {letify-2.11.1 → letify-2.11.3}/letify-ext/package-lock.json +2 -2
- {letify-2.11.1 → letify-2.11.3}/letify-ext/package.json +1 -1
- {letify-2.11.1 → letify-2.11.3}/pyproject.toml +1 -1
- {letify-2.11.1 → letify-2.11.3}/tests/conftest.py +99 -4
- {letify-2.11.1 → letify-2.11.3}/tests/test_config.py +14 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_drive_store.py +1 -1
- {letify-2.11.1 → letify-2.11.3}/tests/test_link_signal.py +78 -0
- {letify-2.11.1 → letify-2.11.3}/.github/workflows/docs.yml +0 -0
- {letify-2.11.1 → letify-2.11.3}/.github/workflows/letify-link.yml +0 -0
- {letify-2.11.1 → letify-2.11.3}/.github/workflows/publish-crates.yml +0 -0
- {letify-2.11.1 → letify-2.11.3}/.github/workflows/publish.yml +0 -0
- {letify-2.11.1 → letify-2.11.3}/.github/workflows/reserve-crates.yml +0 -0
- {letify-2.11.1 → letify-2.11.3}/.gitignore +0 -0
- {letify-2.11.1 → letify-2.11.3}/.researchtree +0 -0
- {letify-2.11.1 → letify-2.11.3}/CLAUDE.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/LICENSE +0 -0
- {letify-2.11.1 → letify-2.11.3}/PROJECT.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/README.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/COMPONENT.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/INTENT.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/NETWORK.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/ROADMAP-3.0.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/guide/01-getting-started.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/guide/02-providers.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/guide/03-execution-modes.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/guide/04-environments-and-data.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/guide/05-concurrency.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/guide/06-cost.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/guide/07-troubleshooting.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/guide/08-releasing.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/guide/09-agent.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/guide/README.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/guide/ko/01-/354/213/234/354/236/221/355/225/230/352/270/260.md" +0 -0
- {letify-2.11.1 → letify-2.11.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.11.1 → letify-2.11.3}/docs/guide/ko/03-/354/213/244/355/226/211-/353/260/251/354/213/235.md" +0 -0
- {letify-2.11.1 → letify-2.11.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.11.1 → letify-2.11.3}/docs/guide/ko/05-/353/217/231/354/213/234-/354/213/244/355/226/211.md" +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/guide/ko/06-/353/271/204/354/232/251.md" +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/guide/ko/07-/353/254/270/354/240/234-/355/225/264/352/262/260.md" +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/guide/ko/08-/353/246/264/353/246/254/354/212/244.md" +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/guide/ko/09-/354/227/220/354/235/264/354/240/204/355/212/270.md" +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/guide/ko/README.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/locales/README_ko.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/docs/mkdocs.yml +0 -0
- {letify-2.11.1 → letify-2.11.3}/examples/README.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/examples/nvfp4-lora/.letify.example +0 -0
- {letify-2.11.1 → letify-2.11.3}/examples/nvfp4-lora/00_smoke.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/examples/nvfp4-lora/01_sweep.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/examples/nvfp4-lora/02_resume.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/examples/nvfp4-lora/03_watch.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/examples/nvfp4-lora/README.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/examples/nvfp4-lora/README_ko.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/examples/nvfp4-lora/common.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/examples/nvfp4-lora/recipe.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/cli.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/config/__init__.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/config/inventory.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/config/login.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/config/schema.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/config/secrets.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/config/writer.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/declare/__init__.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/declare/cache.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/declare/env.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/declare/exit.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/declare/function.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/declare/instance.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/declare/reduce.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/declare/replicas.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/errors.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/install.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/launcher.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/paths.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/protocol/__init__.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/protocol/codec.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/protocol/driver.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/protocol/handle.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/protocol/wire.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/protocol/worker.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/providers/__init__.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/providers/base.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/providers/colab.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/providers/colab_files.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/providers/colab_keepalive.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/providers/elice.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/providers/kaggle.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/providers/kaggle_adapter.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/providers/local.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/providers/modal.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/providers/modal_adapter.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/providers/naming.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/providers/shell.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/providers/tunnel.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/providers/usage.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/remoting/__init__.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/remoting/device/__init__.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/remoting/device/client.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/remoting/device/cuda.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/remoting/device/executor.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/remoting/device/frames.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/remoting/device/guard.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/remoting/device/tensor.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/remoting/device/trace.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/remoting/device/value.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/render.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/runtime/__init__.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/runtime/bootstrap.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/runtime/broker.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/runtime/channel.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/runtime/control.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/runtime/lease.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/runtime/pool.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/runtime/reattach.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/runtime/session.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/runtime/takeover.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/runtime/telemetry.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/runtime/workers.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/store/__init__.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/store/backends/__init__.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/store/backends/drive.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/store/backends/filesystem.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/store/backends/google_auth.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/store/backends/layout.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/store/backends/objects.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/store/cas.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/store/handoff.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/store/pathdata.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/store/sendorder.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/store/volume.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/stubs.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/tools.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/__init__.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/agent.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/announce.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/link.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/linkagent.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/linkchannel.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/linkd.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/linkmailbox.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/linkpump.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/linkshim.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/linkupload.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/linkwebsocket.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/nat.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/pipeline.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/portmap.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/probe.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/quic.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/rendezvous.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/setup.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/sshopts.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify/transport/strategies.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/.gitignore +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/build.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify/Cargo.toml +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify/LICENSE +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify/README.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify/src/lib.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/Cargo.toml +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/examples/bench.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/acceptor.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/bin/letify-link.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/config.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/error.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/frame.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/handshake.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/hysteresis.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/identity.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/keys.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/lib.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/observe.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/paths.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/plan.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/policing.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/punch.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/record.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/relay.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/rendezvous.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/replay.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/session.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/sidecar.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/stream.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/stun.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/tcp.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/trace.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/src/udp.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/acceptor.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/api.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/common/mod.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/diag_sim.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/fairness.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/gauge.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/handshake.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/hysteresis.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/keepalive.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/mobile.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/nat.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/paths.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/qad.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/rekey.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/relay.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/relay_pairing.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/rendezvous.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/reorder.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/replay.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/resume.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/revoke.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/session.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/sidecar.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/startup.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/subflows.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/trace.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/udp.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-link/tests/udp_bench.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-quic/Cargo.toml +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/letify-quic/src/main.rs +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-core/rust-toolchain.toml +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-ext/.vscodeignore +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-ext/LICENSE +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-ext/README.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-ext/media/icon.svg +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-ext/src/cli.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-ext/src/extension.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-ext/src/history.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-ext/src/model.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-ext/src/poll.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-ext/src/render.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-ext/test/cli.test.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-ext/test/manifest.test.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-ext/test/model.test.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-ext/test/regressions.test.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-ext/tsconfig.json +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/README.md +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/cloudflare.config.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/package-lock.json +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/package.json +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/src/auth.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/src/ed25519.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/src/handler.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/src/index.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/src/limiter.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/src/mailbox.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/src/objects.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/src/protocol.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/src/storage.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/test/auth.test.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/test/ed25519.test.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/test/helpers.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/test/interop.test.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/test/limiter.test.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/test/mailbox.test.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/test/objects.test.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/test/setup.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/test/worker.test.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/tsconfig.json +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify-signal/vitest.config.ts +0 -0
- {letify-2.11.1 → letify-2.11.3}/letify_providers.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/scripts/sync-main.sh +0 -0
- {letify-2.11.1 → letify-2.11.3}/scripts/version.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/fake_kaggle_adapter.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/fake_modal_adapter.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_cli.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_cli_output.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_colab_keepalive.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_core.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_data.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_data_in_place.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_data_streaming.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_declare.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_device.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_device_compile.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_distributed.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_drive_handoff.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_editor_sessions.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_elice.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_frames.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_install.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_kaggle.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_kaggle_cookie.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_kaggle_link.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_link_agent.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_link_channel.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_link_command_channel.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_link_exec.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_link_log.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_link_opt_in.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_link_upload.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_linkd.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_notebook.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_parallel_placement.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_paths.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_portmap.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_protocol.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_providers.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_punch_sockets.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_quic.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_remoting.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_render.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_run_control.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_run_reattach.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_run_takeover.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_runtime.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_shell_workers.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_ship.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_store.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_strategies.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_stubs.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_transport.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_tunnel_setup.py +0 -0
- {letify-2.11.1 → letify-2.11.3}/tests/test_version.py +0 -0
|
@@ -23,6 +23,14 @@ jobs:
|
|
|
23
23
|
run: uv run ruff check letify tests
|
|
24
24
|
- name: Test
|
|
25
25
|
run: uv run pytest -q
|
|
26
|
+
- name: Disk use
|
|
27
|
+
if: always()
|
|
28
|
+
run: |
|
|
29
|
+
df -h
|
|
30
|
+
df -i
|
|
31
|
+
quota -s 2>/dev/null || true
|
|
32
|
+
du -sh /tmp/pytest-of-* 2>/dev/null || true
|
|
33
|
+
du -k --max-depth=4 /tmp/pytest-of-* 2>/dev/null | sort -rn | head -15 || true
|
|
26
34
|
|
|
27
35
|
extension:
|
|
28
36
|
runs-on: ubuntu-latest
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: letify
|
|
3
|
-
Version: 2.11.
|
|
3
|
+
Version: 2.11.3
|
|
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
|
|
@@ -2251,6 +2251,8 @@ The service is the auxiliary rendezvous of [Rendezvous trait](#link-rendezvous).
|
|
|
2251
2251
|
|
|
2252
2252
|
**User-Agent.** Every request, the WebSocket handshake included, carries `User-Agent: letify/<version>`, because Cloudflare's Browser Integrity Check answers the Python default `Python-urllib/<version>` with 403 and error code 1010 before the request reaches the Worker.
|
|
2253
2253
|
|
|
2254
|
+
**Connections.** `SignalClient` keeps the HTTPS connections it opened and sends the next request on an idle one, so a connect pays the TCP and TLS set-up once and not once per request. A connection serves one request at a time: a long poll holds its connection until it returns, so a send made meanwhile takes another idle connection or opens one, and at most 4 idle connections are kept (`MAX_IDLE`). A connection is returned to the idle list only after its reply was read to the end and the service did not say `Connection: close`. A request that fails on a reused connection before any reply byte arrives (the service or a middlebox closed it while idle) is sent once more on a new connection, signed again with a new nonce, and a failure on a new connection is not retried. The client uses `http.client` from the standard library. When the environment names a proxy for the service's host, it sends through `urllib` with a new connection per request, because `http.client` does not use a proxy. The WebSocket of `/ws/<node>` is its own connection and is not part of this list. The error texts do not change.
|
|
2255
|
+
|
|
2254
2256
|
2. **Signed requests.** Every request except `/health` carries four headers: `X-Letify-Node` (the signer, 64 lowercase hex), `X-Letify-Time` (unix seconds, decimal), `X-Letify-Nonce` (32 lowercase hex, 16 random bytes) and `X-Letify-Signature` (128 lowercase hex). The signature is ed25519 by the signer's node key over these bytes, the sidecar's `sign` with domain `letify-signal v1`:
|
|
2255
2257
|
|
|
2256
2258
|
```
|
|
@@ -2277,7 +2279,7 @@ The service is the auxiliary rendezvous of [Rendezvous trait](#link-rendezvous).
|
|
|
2277
2279
|
- The service sees the lines. They hold node ids, candidate addresses, NAT types, the shim port and the letify version, and never a secret, a token or a key, so reading them gives an observer what the service already sees in the request addresses. Content is signed, not encrypted. The session that follows is the Noise session of [Session](#link-session).
|
|
2278
2280
|
- **The receiving agent never executes a command that the line supplies.** The agent is the program on the address-less machine that listens on its mailbox. It accepts a config line only from a node in its own list of paired nodes. Of the config line it takes `version`, `wait_s` (clamped to 1 to 600) and `resume_s` (clamped to 1 to 3600) and nothing else: `binary`, `python`, `bootstrap`, `relay`, `worker_command`, `relay_command`, `allow` and `bind` are ignored if present, and a test pins it. The agent builds the shim configuration from its own configuration: the `letify-link` binary it was installed with, its own Python, the worker and relay programs of its own installed letify, `allow` set to the verified sender and `bind` set to its own. Of the lines after the config, it passes to the shim only `rendezvous`, `punch` and `handover`, with the node they name set to the verified sender, and answers `ping` itself; any other `op` is dropped. An attacker who holds the paired node's key can start a worker on the machine, which is what pairing grants, and no one else can start anything.
|
|
2279
2281
|
7. **No sources in the config line.** The 4 KiB cap leaves no room for `linkchannel.bootstrap_source` and `relay_program()`, and the agent must not run what it is sent. A signalled bootstrap therefore sends this config line and no more: `{"op":"config","version":"<letify version>","wait_s":<int>,"resume_s":<int>}`. `SignalBootstrap` reduces the config line `connect_over` writes to this one. The agent runs the worker and relay programs of its own installed letify. The `ready` line the agent forwards carries `version`, the agent's letify version. The two sides refuse to go on when the versions differ: the agent answers the config line with `{"event":"error","error":"letify version mismatch: client <a>, agent <b>"}`, and the local side turns a `ready` line whose `version` differs from its own into the same error. The reason reaches the user in the connect failure, as every infrastructure failure of [Sidecar interface](#link-sidecar) does.
|
|
2280
|
-
8. **Failure.** A service that does not answer, answers with a code above, or whose mailbox the agent never reads fails the bootstrap with the reason: `the signalling service ...`, or `the agent <node> did not answer in <s> s`. `SignalBootstrap.start` sends
|
|
2282
|
+
8. **Failure.** A service that does not answer, answers with a code above, or whose mailbox the agent never reads fails the bootstrap with the reason: `the signalling service ...`, or `the agent <node> did not answer in <s> s`. `SignalBootstrap.start` sends three `ping` lines before the shim config. The first only warms the connections, because it pays the TCP and TLS set-up of the send and the poll connection once, and its time is discarded. The larger of the round trips of the other two becomes `rtt_s` and so the lead of the punch, as for `MailboxBootstrap`. A ping that is not answered in `ping_timeout_s` fails the bootstrap, the first one included. No mailbox failure falls back to another bootstrap: the account's own order of bootstraps decides, as the [Rendezvous trait](#link-rendezvous) says.
|
|
2281
2283
|
|
|
2282
2284
|
#### Agent and pairing <!-- id: link-agent -->
|
|
2283
2285
|
|
|
@@ -2457,7 +2459,7 @@ The sidecar is a binary named `letify-link`, built for each wheel and installed
|
|
|
2457
2459
|
- **The worker command.** The shim starts each stream's worker and relay with the interpreter the account names. The provider's `remote_command` wrapper applies to them as it does to the ssh command of a worker: the local side passes the shim the complete shell command for a worker (`worker_command`) and the prefix of one for a relay (`relay_command`, to which the shim appends the quoted door path), each already wrapped by `remote_command`. Colab's wrapper sets `LD_LIBRARY_PATH` to the driver library directory, so a worker reached through the mailbox sees the GPU. Kaggle's wrapper sets `LD_LIBRARY_PATH` to the value the kernel reports, as it does for a worker over ssh. With neither key the shim runs the interpreter directly, as item 7 says.
|
|
2458
2460
|
- **No fallback.** A failed connect raises `ProviderUnavailable` with the reason. A Colab account that sets both `channel = "exec"` and `link = "letify-link"` is refused by name, because the two ask for different channels. A Kaggle account that sets `link = "letify-link"` does not fall back to the kernel bridge as an account without it does, because the account asked for the session.
|
|
2459
2461
|
- **After the hand-over.** The mailbox ends once the shim says `handed_over`. The command channel keeps serving what it served before (a Colab keep-alive, a Kaggle kernel bridge), and `Colab.link()` and `Kaggle.link()` return the session's measurements with no ssh command: asking such a link for an ssh command raises `RuntimeFailure`.
|
|
2460
|
-
9. **Bootstrap over the signalling service.** `letify/transport/linksignal.py` carries the `Bootstrap` of item 7 over the mailbox of [Signalling service](#link-signal). It uses the sidecar's `sign` and `verify` and adds no Python dependency. `SignalClient(daemon, base_url)` signs and sends `POST /send/<to>` and long polls `GET /recv/<own id>`, with `
|
|
2462
|
+
9. **Bootstrap over the signalling service.** `letify/transport/linksignal.py` carries the `Bootstrap` of item 7 over the mailbox of [Signalling service](#link-signal). It uses the sidecar's `sign` and `verify` and adds no Python dependency. `SignalClient(daemon, base_url)` signs and sends `POST /send/<to>` and long polls `GET /recv/<own id>`, with `http.client` from the standard library on kept connections (Signalling service item 1, Connections). `SignalBootstrap(client, peer)` implements `send_line`, `recv_line`, `stderr_text`, `close` and `rtt_s`: each line is put in a signed envelope for the node `peer`, and each envelope received is verified as the Signalling service trust model lists, so a line that arrives unsigned, wrongly signed, stale, replayed or for another node is dropped and counted in `stderr_text`. A line whose envelope would pass 4096 bytes raises `OSError` naming the size and the cap, and is not split. The first line `connect_over` writes (the config line) is reduced to the lean config of Signalling service item 7. `SignalAgent` is the program on the address-less machine: it holds its own configuration (the `letify-link` binary, the Python, the paired node ids), reads its mailbox, runs `linkshim.py` for a paired node that sends a valid config line, and relays the shim's lines back in envelopes. The mailbox identity is the node key that signs the requests and envelopes of each side. On the local side it is the key file `connect_over` uses for its own sidecar, so the envelope's `from` is the node id the shim allows. The shim's sidecar has a throwaway key of its own, and its node id reaches the local side in the agent's signed `ready` line, which is how the local side learns whom to open the session with. A start that fails (the agent does not answer a ping in 30 s, the service is down) raises `ProviderUnavailable` with the reason from `connect_over`. Pairing and the persistent agent process are in [Agent and pairing](#link-agent); `SignalAgent` serves one paired node and its installation is not part of this item.
|
|
2461
2463
|
10. **Trace.** The sidecar writes a diagnostic trace only when asked. `LETIFY_LINK_TRACE=PATH` makes it append one JSON object per line to `PATH` for every open session, every `LETIFY_LINK_TRACE_MS` milliseconds (default 1000, at least 50). A binary built with `LETIFY_LINK_TRACE_DEFAULT=PATH` in its build environment uses `PATH` when `LETIFY_LINK_TRACE` is unset, which is how a binary that a bootstrap uploads to a remote machine is traced without an environment there. Without either the sidecar writes nothing and spawns no task. A binary built with `LETIFY_LINK_TRACE_MS_DEFAULT` does the same for the interval. A line holds `t_ms` (since the sidecar started), `unix_ms` (the wall clock), `session`, `cpu_ms` (user plus system time of the process, from `/proc/self/stat`, absent where that file is), the session's `unacked_bytes`, `reinjected` and `reorder_peak`, and `subflows`, one object per subflow with `id`, `sent`, `received`, `acked`, `inflight`, `window`, `bulk_cap`, `srtt_ms`, `delivery_rate` and, for a UDP path, `cwnd`, `lost` and `sent_packets`. Each subflow object also holds `kind` (`"tcp"`, `"udp"` or `"relay"`, from the path manager's `PathKinds` when the session has one, otherwise `"udp"` for a subflow that has a congestion gauge and `"tcp"` for one that has none), `gauged` (true when the subflow's transport reports congestion statistics, so `cwnd` and `lost` are absent exactly when `gauged` is false or no reading was taken yet), `window_limit` (the subflow's current window limit in bytes, between the configured window and `subflow_window_ceiling`) and `min_rtt_ms` (the lowest write to subflow ack time, `null` before the first). A UDP path gets a gauge whether the session received it directly or behind a `BoxTransport`, which is the form a punched candidate takes. The trace also writes an event line, which has `event` instead of `subflows`, when a subflow closes (`"event": "subflow_closed"` with `subflow`, `kind` and `reason`) and when the session fails (`"event": "session_failed"` with `reason`, the text `fail()` recorded). The reason of a closed subflow is `dead timeout: ...` when no record arrived for three keepalive intervals, `transport error: ...` when a read or write on the transport failed, `closed by caller` when `close_subflow` or `resume_now` dropped it (the path manager does so when it moves), and `session failed` when the session failed. An event line is written at the next sampling tick after the event and once only. The trace changes no behaviour of the session.
|
|
2462
2464
|
|
|
2463
2465
|
### Reverse SSH <!-- id: reverse-ssh -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""A letify-link bootstrap carried over the signalling service's mailbox.
|
|
2
2
|
|
|
3
|
-
Owns talking to the signalling service (signed requests
|
|
4
|
-
WebSocket watch of a standing wait), the signed envelope that
|
|
3
|
+
Owns talking to the signalling service (signed requests on kept HTTP connections, the short
|
|
4
|
+
long poll of a connect, the WebSocket watch of a standing wait), the signed envelope that
|
|
5
5
|
wraps every bootstrap line, ``SignalBootstrap`` (the ``Bootstrap`` of ``linkchannel.py`` over
|
|
6
6
|
that mailbox) and ``SignalAgent`` (the program on the address-less machine that serves a paired
|
|
7
7
|
node's bootstrap). It does not own the service (``letify-signal/``), signing (the sidecar's
|
|
@@ -14,6 +14,7 @@ from __future__ import annotations
|
|
|
14
14
|
import base64
|
|
15
15
|
import contextlib
|
|
16
16
|
import hashlib
|
|
17
|
+
import http.client
|
|
17
18
|
import json
|
|
18
19
|
import queue
|
|
19
20
|
import re
|
|
@@ -48,13 +49,17 @@ MAX_WAIT_S = 600
|
|
|
48
49
|
MAX_RESUME_S = 3600
|
|
49
50
|
DEFAULT_WAIT_S = 120
|
|
50
51
|
DEFAULT_RESUME_S = 30
|
|
51
|
-
#: Pings sent before the shim config
|
|
52
|
-
PINGS =
|
|
52
|
+
#: Pings sent before the shim config.
|
|
53
|
+
PINGS = 3
|
|
54
|
+
#: Pings sent and not timed: the first pays the one-time TCP and TLS set-up of both connections.
|
|
55
|
+
WARM_PINGS = 1
|
|
53
56
|
#: The ops of a bootstrap line that the agent passes to the shim.
|
|
54
57
|
SHIM_OPS = ("rendezvous", "punch", "handover")
|
|
55
58
|
#: Bounds of the WebSocket keepalive, in seconds. See ``linkwebsocket``.
|
|
56
59
|
WS_PING_S = linkwebsocket.PING_S
|
|
57
60
|
WS_PONG_S = linkwebsocket.PONG_S
|
|
61
|
+
#: Idle HTTP connections a client keeps. Spec "Signalling service" item 1, "Connections".
|
|
62
|
+
MAX_IDLE = 4
|
|
58
63
|
#: Transient failures of the long poll a bootstrap rides out before it gives up.
|
|
59
64
|
POLL_RETRIES = 3
|
|
60
65
|
|
|
@@ -100,6 +105,25 @@ def _user_agent() -> str:
|
|
|
100
105
|
return f"letify/{__version__}"
|
|
101
106
|
|
|
102
107
|
|
|
108
|
+
def _proxied(url: str) -> bool:
|
|
109
|
+
"""Whether the environment sends a request for ``url`` through a proxy."""
|
|
110
|
+
parts = urllib.parse.urlsplit(url)
|
|
111
|
+
host = parts.hostname or ""
|
|
112
|
+
if host in ("127.0.0.1", "localhost", "::1"):
|
|
113
|
+
return False
|
|
114
|
+
return parts.scheme in urllib.request.getproxies() and not urllib.request.proxy_bypass(host)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
#: Failures of a reused connection that mean the service had already closed it.
|
|
118
|
+
_STALE = (
|
|
119
|
+
http.client.RemoteDisconnected,
|
|
120
|
+
http.client.CannotSendRequest,
|
|
121
|
+
ConnectionResetError,
|
|
122
|
+
ConnectionAbortedError,
|
|
123
|
+
BrokenPipeError,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
|
|
103
127
|
def _opener(url: str) -> urllib.request.OpenerDirector:
|
|
104
128
|
"""An opener that never sends a loopback request through a proxy."""
|
|
105
129
|
host = urllib.parse.urlsplit(url).hostname or ""
|
|
@@ -126,6 +150,19 @@ class SignalClient:
|
|
|
126
150
|
self._nonce = nonce or (lambda: secrets.token_hex(16))
|
|
127
151
|
self._timeout = timeout
|
|
128
152
|
self._opener = _opener(self.base_url)
|
|
153
|
+
parts = urllib.parse.urlsplit(self.base_url)
|
|
154
|
+
self._scheme = parts.scheme
|
|
155
|
+
self._netloc = parts.netloc
|
|
156
|
+
self._proxied = _proxied(self.base_url)
|
|
157
|
+
self._idle: list[http.client.HTTPConnection] = []
|
|
158
|
+
self._idle_lock = threading.Lock()
|
|
159
|
+
|
|
160
|
+
def close(self) -> None:
|
|
161
|
+
"""Close the idle connections. A later request opens a new one."""
|
|
162
|
+
with self._idle_lock:
|
|
163
|
+
idle, self._idle = self._idle, []
|
|
164
|
+
for connection in idle:
|
|
165
|
+
connection.close()
|
|
129
166
|
|
|
130
167
|
@property
|
|
131
168
|
def node_id(self) -> str:
|
|
@@ -146,6 +183,54 @@ class SignalClient:
|
|
|
146
183
|
"X-Letify-Signature": signature.hex(),
|
|
147
184
|
}
|
|
148
185
|
|
|
186
|
+
def _take(self) -> tuple[http.client.HTTPConnection, bool]:
|
|
187
|
+
"""An idle connection and True, or a new one and False."""
|
|
188
|
+
with self._idle_lock:
|
|
189
|
+
if self._idle:
|
|
190
|
+
return self._idle.pop(), True
|
|
191
|
+
factory = (
|
|
192
|
+
http.client.HTTPSConnection if self._scheme == "https" else http.client.HTTPConnection
|
|
193
|
+
)
|
|
194
|
+
return factory(self._netloc), False
|
|
195
|
+
|
|
196
|
+
def _give_back(self, connection: http.client.HTTPConnection) -> None:
|
|
197
|
+
with self._idle_lock:
|
|
198
|
+
if len(self._idle) < MAX_IDLE:
|
|
199
|
+
self._idle.append(connection)
|
|
200
|
+
return
|
|
201
|
+
connection.close()
|
|
202
|
+
|
|
203
|
+
def _exchange(
|
|
204
|
+
self, method: str, target: str, body: bytes, timeout: float, signer_id: str | None
|
|
205
|
+
) -> tuple[int, Any, bytes]:
|
|
206
|
+
"""One request on a kept connection: status, headers and the whole reply body."""
|
|
207
|
+
for _ in range(2):
|
|
208
|
+
connection, reused = self._take()
|
|
209
|
+
headers = self._headers(method, target, body, signer_id)
|
|
210
|
+
connection.timeout = timeout
|
|
211
|
+
if connection.sock is not None:
|
|
212
|
+
connection.sock.settimeout(timeout)
|
|
213
|
+
try:
|
|
214
|
+
connection.request(
|
|
215
|
+
method, target, body=body if method == "POST" else None, headers=headers
|
|
216
|
+
)
|
|
217
|
+
response = connection.getresponse()
|
|
218
|
+
data = response.read()
|
|
219
|
+
except _STALE:
|
|
220
|
+
connection.close()
|
|
221
|
+
if reused:
|
|
222
|
+
continue
|
|
223
|
+
raise
|
|
224
|
+
except BaseException:
|
|
225
|
+
connection.close()
|
|
226
|
+
raise
|
|
227
|
+
if response.will_close:
|
|
228
|
+
connection.close()
|
|
229
|
+
else:
|
|
230
|
+
self._give_back(connection)
|
|
231
|
+
return response.status, response.headers, data
|
|
232
|
+
raise AssertionError("unreachable") # pragma: no cover
|
|
233
|
+
|
|
149
234
|
def _request(
|
|
150
235
|
self,
|
|
151
236
|
method: str,
|
|
@@ -155,6 +240,33 @@ class SignalClient:
|
|
|
155
240
|
timeout: float,
|
|
156
241
|
signer_id: str | None = None,
|
|
157
242
|
) -> dict[str, Any]:
|
|
243
|
+
if self._proxied:
|
|
244
|
+
return self._request_urllib(method, target, body, timeout, signer_id)
|
|
245
|
+
try:
|
|
246
|
+
status, headers, data = self._exchange(method, target, body, timeout, signer_id)
|
|
247
|
+
if status >= 400:
|
|
248
|
+
code = "unknown"
|
|
249
|
+
with contextlib.suppress(ValueError, OSError, AttributeError):
|
|
250
|
+
code = str(json.loads(data).get("error", code))
|
|
251
|
+
raise self._refused(status, code, headers.get("Retry-After"))
|
|
252
|
+
return json.loads(data) # type: ignore[no-any-return]
|
|
253
|
+
except SignalError:
|
|
254
|
+
raise
|
|
255
|
+
except (http.client.HTTPException, TimeoutError, OSError, ValueError) as error:
|
|
256
|
+
reason = getattr(error, "reason", error)
|
|
257
|
+
raise SignalError(f"the signalling service did not answer: {reason}") from error
|
|
258
|
+
|
|
259
|
+
@staticmethod
|
|
260
|
+
def _refused(status: int, code: str, retry: str | None) -> SignalError:
|
|
261
|
+
return SignalError(
|
|
262
|
+
f"the signalling service refused the request: {code} (HTTP {status}"
|
|
263
|
+
+ (f", retry in {retry} s)" if retry else ")")
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
def _request_urllib(
|
|
267
|
+
self, method: str, target: str, body: bytes, timeout: float, signer_id: str | None
|
|
268
|
+
) -> dict[str, Any]:
|
|
269
|
+
"""The request through ``urllib``, with a new connection, for a proxied service."""
|
|
158
270
|
headers = self._headers(method, target, body, signer_id)
|
|
159
271
|
request = urllib.request.Request(
|
|
160
272
|
self.base_url + target, data=body if method == "POST" else None, method=method
|
|
@@ -168,11 +280,7 @@ class SignalClient:
|
|
|
168
280
|
code = "unknown"
|
|
169
281
|
with contextlib.suppress(ValueError, OSError):
|
|
170
282
|
code = str(json.loads(error.read()).get("error", code))
|
|
171
|
-
|
|
172
|
-
raise SignalError(
|
|
173
|
-
f"the signalling service refused the request: {code} (HTTP {error.code}"
|
|
174
|
-
+ (f", retry in {retry} s)" if retry else ")")
|
|
175
|
-
) from error
|
|
283
|
+
raise self._refused(error.code, code, error.headers.get("Retry-After")) from error
|
|
176
284
|
except (urllib.error.URLError, TimeoutError, OSError, ValueError) as error:
|
|
177
285
|
reason = getattr(error, "reason", error)
|
|
178
286
|
raise SignalError(f"the signalling service did not answer: {reason}") from error
|
|
@@ -474,7 +582,10 @@ class SignalBootstrap:
|
|
|
474
582
|
self._thread.start()
|
|
475
583
|
|
|
476
584
|
def start(self) -> None:
|
|
477
|
-
"""Start reading, ping the agent
|
|
585
|
+
"""Start reading, ping the agent to measure the round trip on warm connections, or raise.
|
|
586
|
+
|
|
587
|
+
Spec "Signalling service" item 8. The first ping warms the connections and is not timed.
|
|
588
|
+
"""
|
|
478
589
|
self.listen_only()
|
|
479
590
|
samples: list[float] = []
|
|
480
591
|
for number in range(1, PINGS + 1):
|
|
@@ -488,7 +599,8 @@ class SignalBootstrap:
|
|
|
488
599
|
f"the agent {self._peer[:12]} did not answer in {self._ping_timeout_s:.0f} s"
|
|
489
600
|
+ (f": {self.stderr_text()}" if self._notes else "")
|
|
490
601
|
)
|
|
491
|
-
|
|
602
|
+
if number > WARM_PINGS:
|
|
603
|
+
samples.append(time.monotonic() - began)
|
|
492
604
|
self.rtt_s = max(samples)
|
|
493
605
|
|
|
494
606
|
def _note(self, text: str) -> None:
|
|
@@ -396,11 +396,11 @@ dependencies = [
|
|
|
396
396
|
|
|
397
397
|
[[package]]
|
|
398
398
|
name = "letify"
|
|
399
|
-
version = "2.11.
|
|
399
|
+
version = "2.11.3"
|
|
400
400
|
|
|
401
401
|
[[package]]
|
|
402
402
|
name = "letify-link"
|
|
403
|
-
version = "2.11.
|
|
403
|
+
version = "2.11.3"
|
|
404
404
|
dependencies = [
|
|
405
405
|
"ed25519-dalek",
|
|
406
406
|
"getrandom 0.2.17",
|
|
@@ -416,7 +416,7 @@ dependencies = [
|
|
|
416
416
|
|
|
417
417
|
[[package]]
|
|
418
418
|
name = "letify-quic"
|
|
419
|
-
version = "2.11.
|
|
419
|
+
version = "2.11.3"
|
|
420
420
|
dependencies = [
|
|
421
421
|
"quinn",
|
|
422
422
|
"rcgen",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "letify-status",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "letify-status",
|
|
9
|
-
"version": "2.11.
|
|
9
|
+
"version": "2.11.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.11.
|
|
5
|
+
"version": "2.11.3",
|
|
6
6
|
"publisher": "darkpyonix",
|
|
7
7
|
"license": "SEE LICENSE IN LICENSE",
|
|
8
8
|
"repository": {
|
|
@@ -79,6 +79,33 @@ def launcher_from(config_file):
|
|
|
79
79
|
return build
|
|
80
80
|
|
|
81
81
|
|
|
82
|
+
@pytest.fixture(autouse=True)
|
|
83
|
+
def private_letify_home(monkeypatch, tmp_path: Path) -> Path:
|
|
84
|
+
"""Give every test an empty home directory, so no test sees the machine's own ~/.letify.
|
|
85
|
+
|
|
86
|
+
Without this a test reads the accounts, tools and ``drive_login`` of the machine that
|
|
87
|
+
runs it. An ephemeral sync then publishes its environment archive to the developer's
|
|
88
|
+
real Drive, and a later run restores what an earlier one left. Only ``Path.home`` moves,
|
|
89
|
+
not the HOME variable, so subprocesses such as uv keep the real cache and interpreters.
|
|
90
|
+
The home is per test because the runs, leases and caches under it are state that tests
|
|
91
|
+
must not hand to one another. A test that patches ``Path.home`` or sets ``LETIFY_HOME``
|
|
92
|
+
itself overrides this, because its patch is applied after this fixture's. A test that
|
|
93
|
+
sets the HOME variable gets that directory back, as ``Path.home`` would give it.
|
|
94
|
+
"""
|
|
95
|
+
real = os.environ.get("HOME")
|
|
96
|
+
home = tmp_path / "private-home"
|
|
97
|
+
home.mkdir()
|
|
98
|
+
monkeypatch.delenv("LETIFY_HOME", raising=False)
|
|
99
|
+
monkeypatch.delenv("LETIFY_CONFIG", raising=False)
|
|
100
|
+
|
|
101
|
+
def private(cls: type[Path]) -> Path:
|
|
102
|
+
current = os.environ.get("HOME")
|
|
103
|
+
return Path(current) if current != real else home
|
|
104
|
+
|
|
105
|
+
monkeypatch.setattr(Path, "home", classmethod(private))
|
|
106
|
+
return home
|
|
107
|
+
|
|
108
|
+
|
|
82
109
|
@pytest.fixture
|
|
83
110
|
def isolated_home(monkeypatch, tmp_path: Path) -> Path:
|
|
84
111
|
"""Point Path.home, "~" expansion and the working directory at empty directories.
|
|
@@ -154,13 +181,31 @@ class NoBlake3Local(Local):
|
|
|
154
181
|
return PersistentChannel([sys.executable, "-u", "-c", hide + BOOTSTRAP], name=runtime.name)
|
|
155
182
|
|
|
156
183
|
|
|
184
|
+
#: Seconds every test sync takes at least, see ``uv_project``.
|
|
185
|
+
SYNC_FLOOR_S = 1.0
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
@pytest.fixture(scope="session")
|
|
189
|
+
def shared_uv_dirs(tmp_path_factory: pytest.TempPathFactory) -> dict[str, str]:
|
|
190
|
+
"""One uv cache and one managed-Python directory for every sync a test worker runs.
|
|
191
|
+
|
|
192
|
+
The runtime points uv at a cache and a Python directory under its own root, so each
|
|
193
|
+
test that syncs would otherwise download and unpack a whole CPython (about 108 MB) and
|
|
194
|
+
start a cold cache, which filled the CI runner's disk quota. One directory per xdist
|
|
195
|
+
worker bounds the total at the worker count times one interpreter.
|
|
196
|
+
"""
|
|
197
|
+
root = tmp_path_factory.mktemp("shared-uv")
|
|
198
|
+
return {"UV_CACHE_DIR": str(root / "cache"), "UV_PYTHON_INSTALL_DIR": str(root / "python")}
|
|
199
|
+
|
|
200
|
+
|
|
157
201
|
@pytest.fixture
|
|
158
|
-
def uv_project(tmp_path: Path, monkeypatch) -> Path:
|
|
202
|
+
def uv_project(tmp_path: Path, monkeypatch, shared_uv_dirs: dict[str, str]) -> Path:
|
|
159
203
|
"""A tiny uv project that depends on this checkout of letify, locked with the real uv.
|
|
160
204
|
|
|
161
205
|
The working directory moves into it, so a default ``Env()`` names its ``uv.lock``. The
|
|
162
206
|
runtime's project root moves under the test's temporary directory, so a sync through
|
|
163
|
-
PreparingLocal never writes into the developer's home.
|
|
207
|
+
PreparingLocal never writes into the developer's home. The sync shares one uv cache
|
|
208
|
+
and one Python directory with every other test on the worker, see ``shared_uv_dirs``.
|
|
164
209
|
"""
|
|
165
210
|
import shutil
|
|
166
211
|
|
|
@@ -187,6 +232,30 @@ def uv_project(tmp_path: Path, monkeypatch) -> Path:
|
|
|
187
232
|
if locked.returncode != 0: # pragma: no cover - only a machine with a cold uv cache
|
|
188
233
|
subprocess.run([uv, "lock"], cwd=project, capture_output=True, check=True)
|
|
189
234
|
monkeypatch.chdir(project)
|
|
235
|
+
real_sync_source = bootstrap.sync_source
|
|
236
|
+
marker = "_letify_command = [_letify_uv] +"
|
|
237
|
+
|
|
238
|
+
def shared_sync_source(*args: Any, **kwargs: Any) -> str:
|
|
239
|
+
# Replace the directories the runtime chose with links to the shared ones just
|
|
240
|
+
# before the sync runs, so the script and the paths it names are the ones
|
|
241
|
+
# production uses and only where the bytes land differs.
|
|
242
|
+
source = real_sync_source(*args, **kwargs)
|
|
243
|
+
link = (
|
|
244
|
+
f"for _k, _shared in {shared_uv_dirs!r}.items():\n"
|
|
245
|
+
" _d = _letify_uv_env.get(_k)\n"
|
|
246
|
+
" if _d and not os.path.lexists(_d):\n"
|
|
247
|
+
" os.makedirs(_shared, exist_ok=True)\n"
|
|
248
|
+
" os.makedirs(os.path.dirname(_d), exist_ok=True)\n"
|
|
249
|
+
" os.symlink(_shared, _d)\n"
|
|
250
|
+
# A warm shared cache can sync in a few milliseconds, which no remote runtime
|
|
251
|
+
# does. Tests that weigh a restore against the recorded build need the build to
|
|
252
|
+
# take a measurable time, as a cold sync on a runtime does.
|
|
253
|
+
f"__import__('time').sleep({SYNC_FLOOR_S})\n"
|
|
254
|
+
)
|
|
255
|
+
assert marker in source
|
|
256
|
+
return source.replace(marker, link + marker, 1)
|
|
257
|
+
|
|
258
|
+
monkeypatch.setattr(bootstrap, "sync_source", shared_sync_source)
|
|
190
259
|
monkeypatch.setattr(bootstrap, "DEFAULT_WORKSPACE_ROOT", str(tmp_path / "runtime-workspace"))
|
|
191
260
|
# The automatic environment archive store lives under the user's own ~/.letify, so
|
|
192
261
|
# without this an archive a previous run published is found and a test that expects a
|
|
@@ -1278,8 +1347,11 @@ class FakeDriveServer:
|
|
|
1278
1347
|
if len(session["body"]) >= session["size"]:
|
|
1279
1348
|
identifier = self._new_id()
|
|
1280
1349
|
self.files[identifier] = {
|
|
1281
|
-
**session["meta"],
|
|
1282
|
-
"
|
|
1350
|
+
**session["meta"],
|
|
1351
|
+
"id": identifier,
|
|
1352
|
+
"content": session["body"],
|
|
1353
|
+
"folder": False,
|
|
1354
|
+
"trashed": False,
|
|
1283
1355
|
}
|
|
1284
1356
|
session["id"] = identifier
|
|
1285
1357
|
if glitch == "drop-after-store":
|
|
@@ -2375,9 +2447,21 @@ class FakeSignalService:
|
|
|
2375
2447
|
self.answer_pings = True
|
|
2376
2448
|
#: Set by ``close``, so a WebSocket still in its handshake is cut once it registers.
|
|
2377
2449
|
self._closed = False
|
|
2450
|
+
#: TCP connections accepted, and the ones still open (for ``drop_connections``).
|
|
2451
|
+
self.connections = 0
|
|
2452
|
+
self._open: list[Any] = []
|
|
2378
2453
|
service = self
|
|
2379
2454
|
|
|
2380
2455
|
class Handler(http.server.BaseHTTPRequestHandler):
|
|
2456
|
+
# Keep-alive, as the Cloudflare edge serves it.
|
|
2457
|
+
protocol_version = "HTTP/1.1"
|
|
2458
|
+
|
|
2459
|
+
def setup(self) -> None:
|
|
2460
|
+
super().setup()
|
|
2461
|
+
with service._cond:
|
|
2462
|
+
service.connections += 1
|
|
2463
|
+
service._open.append(self.connection)
|
|
2464
|
+
|
|
2381
2465
|
def log_message(self, *args: Any) -> None:
|
|
2382
2466
|
pass
|
|
2383
2467
|
|
|
@@ -2396,9 +2480,20 @@ class FakeSignalService:
|
|
|
2396
2480
|
with self._cond:
|
|
2397
2481
|
self._closed = True
|
|
2398
2482
|
self.drop_sockets()
|
|
2483
|
+
# A keep-alive connection outlives server shutdown in its handler thread; a
|
|
2484
|
+
# service that is gone answers on none of them.
|
|
2485
|
+
self.drop_connections()
|
|
2399
2486
|
self._server.shutdown()
|
|
2400
2487
|
self._server.server_close()
|
|
2401
2488
|
|
|
2489
|
+
def drop_connections(self) -> None:
|
|
2490
|
+
"""Close every open HTTP connection from the server side, as an idle timeout does."""
|
|
2491
|
+
with self._cond:
|
|
2492
|
+
open_now, self._open = self._open, []
|
|
2493
|
+
for conn in open_now:
|
|
2494
|
+
with contextlib.suppress(OSError):
|
|
2495
|
+
conn.shutdown(socket.SHUT_RDWR)
|
|
2496
|
+
|
|
2402
2497
|
def drop_sockets(self) -> None:
|
|
2403
2498
|
"""Cut every open WebSocket without a close frame, as a network failure does."""
|
|
2404
2499
|
with self._cond:
|
|
@@ -505,3 +505,17 @@ def test_a_project_file_that_sets_a_workspace_is_refused(home_file, config_file)
|
|
|
505
505
|
project = config_file('[lab]\nworkspace = "/workspace/me"\n')
|
|
506
506
|
with pytest.raises(letify.ConfigError, match=r"workspace.*home"):
|
|
507
507
|
load(project)
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
def test_the_suite_cannot_reach_the_machines_own_letify_home() -> None:
|
|
511
|
+
# Spec "Materializing into a runtime": the environment archive goes to the Drive the
|
|
512
|
+
# machine configuration names. A test must never see that configuration, or an
|
|
513
|
+
# ephemeral sync publishes to a real account and a later run restores what an earlier
|
|
514
|
+
# one left there.
|
|
515
|
+
from letify import paths
|
|
516
|
+
from letify.config import drive_settings
|
|
517
|
+
|
|
518
|
+
assert paths.letify_root() == Path.home() / ".letify"
|
|
519
|
+
assert not list(Path.home().iterdir())
|
|
520
|
+
assert not paths.config_path().exists()
|
|
521
|
+
assert drive_settings() is None
|
|
@@ -426,7 +426,7 @@ def test_a_restore_records_its_seconds_beside_the_build(
|
|
|
426
426
|
finally:
|
|
427
427
|
second.shutdown()
|
|
428
428
|
seconds, size, restore = fake_drive.refs()[build_name].split()
|
|
429
|
-
assert float(seconds)
|
|
429
|
+
assert float(seconds) >= 1.0 and int(size) > 0
|
|
430
430
|
assert float(restore) >= 0
|
|
431
431
|
|
|
432
432
|
|
|
@@ -834,3 +834,81 @@ def test_a_closed_bootstrap_whose_sidecar_is_gone_ends_its_reader_quietly() -> N
|
|
|
834
834
|
bootstrap = linksignal.SignalBootstrap(Gone(), "ab" * 32, version="1")
|
|
835
835
|
bootstrap._loop()
|
|
836
836
|
assert bootstrap.recv_line() is None
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
# -- the kept connection ------------------------------------------------------------------
|
|
840
|
+
# Spec "Signalling service" item 1, "Connections".
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
def test_requests_one_after_another_share_one_connection(signal_service, daemons) -> None:
|
|
844
|
+
a, b = daemons("a"), daemons("b")
|
|
845
|
+
sender = linksignal.SignalClient(a, signal_service.url)
|
|
846
|
+
receiver = linksignal.SignalClient(b, signal_service.url)
|
|
847
|
+
for number in range(5):
|
|
848
|
+
sender.send(b.node_id, f"m{number}".encode())
|
|
849
|
+
assert [m.body for m in drain(receiver, 5)] == [f"m{n}".encode() for n in range(5)]
|
|
850
|
+
assert signal_service.connections == 2 # one per client, not one per request
|
|
851
|
+
|
|
852
|
+
|
|
853
|
+
def test_a_send_during_a_long_poll_does_not_wait_for_it(signal_service, daemons) -> None:
|
|
854
|
+
a, b = daemons("a"), daemons("b")
|
|
855
|
+
sender = linksignal.SignalClient(a, signal_service.url)
|
|
856
|
+
receiver = linksignal.SignalClient(b, signal_service.url)
|
|
857
|
+
polled: list[float] = []
|
|
858
|
+
poll = threading.Thread(
|
|
859
|
+
target=lambda: polled.append(receiver.recv(0, wait_s=5)[1]), daemon=True
|
|
860
|
+
)
|
|
861
|
+
poll.start()
|
|
862
|
+
time.sleep(0.3)
|
|
863
|
+
started = time.monotonic()
|
|
864
|
+
receiver.send(a.node_id, b"while polling")
|
|
865
|
+
assert time.monotonic() - started < 2.0
|
|
866
|
+
sender.send(b.node_id, b"wake")
|
|
867
|
+
poll.join(5)
|
|
868
|
+
assert polled
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
def test_a_request_on_a_connection_the_service_closed_is_sent_again(
|
|
872
|
+
signal_service, daemons
|
|
873
|
+
) -> None:
|
|
874
|
+
a, b = daemons("a"), daemons("b")
|
|
875
|
+
sender = linksignal.SignalClient(a, signal_service.url)
|
|
876
|
+
sender.send(b.node_id, b"first")
|
|
877
|
+
signal_service.drop_connections()
|
|
878
|
+
sender.send(b.node_id, b"second")
|
|
879
|
+
receiver = linksignal.SignalClient(b, signal_service.url)
|
|
880
|
+
assert [m.body for m in drain(receiver, 2)] == [b"first", b"second"]
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
def test_a_failure_on_a_new_connection_is_not_retried(daemons) -> None:
|
|
884
|
+
a = daemons("a")
|
|
885
|
+
client = linksignal.SignalClient(a, "http://127.0.0.1:9")
|
|
886
|
+
with pytest.raises(linksignal.SignalError, match="did not answer"):
|
|
887
|
+
client.send("0" * 64, b"x")
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
class _SlowFirstPing(linksignal.SignalBootstrap):
|
|
891
|
+
"""A bootstrap whose agent answers the first ping late, as a cold connection does."""
|
|
892
|
+
|
|
893
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
894
|
+
super().__init__(*args, **kwargs)
|
|
895
|
+
self.sent: list[int] = []
|
|
896
|
+
|
|
897
|
+
def listen_only(self) -> None:
|
|
898
|
+
pass
|
|
899
|
+
|
|
900
|
+
def _send_json(self, line: dict[str, Any]) -> None:
|
|
901
|
+
number = int(line["id"])
|
|
902
|
+
self.sent.append(number)
|
|
903
|
+
delay = 0.4 if number == 1 else 0.02
|
|
904
|
+
threading.Timer(delay, self._pongs[number].set).start()
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
def test_the_round_trip_is_measured_on_warm_connections_not_on_the_first_ping(
|
|
908
|
+
signal_service, daemons
|
|
909
|
+
) -> None:
|
|
910
|
+
client = linksignal.SignalClient(daemons("a"), signal_service.url)
|
|
911
|
+
bootstrap = _SlowFirstPing(client, daemons("b").node_id)
|
|
912
|
+
bootstrap.start()
|
|
913
|
+
assert bootstrap.sent == [1, 2, 3]
|
|
914
|
+
assert bootstrap.rtt_s is not None and bootstrap.rtt_s < 0.2
|
|
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
|