cmds.secrets.lib.DistroContext: One SSH session per compile #183
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/feature/20261120-cmds-secrets-lib-distrocontext-one-ssh-session-per-compile"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The compile phase of a secrets deploy used to open a new SSH session per remote command and one file-listing round-trip per package; this PR holds the context and secret store open for the whole compile and batches the file listing into a single
pkg_paths()call, so the deploy establishes one connection and lists all package files in one round-trip.cmds.secrets.lib.DistroContext: Batch file listing code
The compile phase of a secrets deploy makes one SSH round-trip per package to list the package files. On a host with nine packages, that is nine round-trips.
Make
match_files()pass the whole name list topkg_paths()in one call: the distro backends already accept a list and issue a single file-listing command.cmds.secrets.lib.DistroContext: Hold ctx + store open
Each
run()call opens and closes the exec context, so a compile that issues one remote command at a time opened and closed the SSH connection for every command: a single deploy on dynamix opened around a hundred sessions and took several minutes.run()opens and closes through theFileContextreference counter, so holding the context (and the secret store) open for the whole compile turns the per-commandopen()/close()pairs into counter bumps, and the connection is established only once. This commit wraps the target listing and the per-target loop in anasync withon both, which drops the counter to zero at end of scope and closes the contexts.