diff options
| author | Stefan Boberg <[email protected]> | 2026-04-05 11:58:15 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2026-04-05 11:58:15 +0200 |
| commit | c008abdb7efbce793115348adf2bcd91774432ee (patch) | |
| tree | 627b2dfa4e1eb6201402cc95eb57e4f2aa05db69 /src/zenhorde/include | |
| parent | add WriteCompressedFile RPC for compressed file transfers to HordeAgent (diff) | |
| download | zen-c008abdb7efbce793115348adf2bcd91774432ee.tar.xz zen-c008abdb7efbce793115348adf2bcd91774432ee.zip | |
add compressed file upload path gated on ComputeProtocol version
When the Horde server reports ComputeProtocol >= CompressedFileTransfer (v3),
the provisioner uploads binaries individually via WriteCompressedFile with
IoHash caching instead of the legacy bundle protocol. This avoids the
bundle packaging overhead and enables instant cache hits for unchanged files.
Diffstat (limited to 'src/zenhorde/include')
| -rw-r--r-- | src/zenhorde/include/zenhorde/hordeclient.h | 21 | ||||
| -rw-r--r-- | src/zenhorde/include/zenhorde/hordeconfig.h | 10 | ||||
| -rw-r--r-- | src/zenhorde/include/zenhorde/hordeprovisioner.h | 9 |
3 files changed, 29 insertions, 11 deletions
diff --git a/src/zenhorde/include/zenhorde/hordeclient.h b/src/zenhorde/include/zenhorde/hordeclient.h index 201d68b83..98cc8f099 100644 --- a/src/zenhorde/include/zenhorde/hordeclient.h +++ b/src/zenhorde/include/zenhorde/hordeclient.h @@ -35,16 +35,17 @@ struct PortInfo */ struct MachineInfo { - std::string Ip; - ConnectionMode Mode = ConnectionMode::Direct; - std::string ConnectionAddress; ///< Relay/tunnel address (used when Mode != Direct) - uint16_t Port = 0; - uint16_t LogicalCores = 0; - Encryption EncryptionMode = Encryption::None; - uint8_t Nonce[NonceSize] = {}; ///< 64-byte nonce sent during TCP handshake - uint8_t Key[KeySize] = {}; ///< 32-byte AES key (when EncryptionMode == AES) - bool IsWindows = false; - std::string LeaseId; + std::string Ip; + ConnectionMode Mode = ConnectionMode::Direct; + std::string ConnectionAddress; ///< Relay/tunnel address (used when Mode != Direct) + uint16_t Port = 0; + uint16_t LogicalCores = 0; + Encryption EncryptionMode = Encryption::None; + uint8_t Nonce[NonceSize] = {}; ///< 64-byte nonce sent during TCP handshake + uint8_t Key[KeySize] = {}; ///< 32-byte AES key (when EncryptionMode == AES) + bool IsWindows = false; + std::string LeaseId; + ComputeProtocol Protocol = ComputeProtocol::Initial; std::map<std::string, PortInfo> Ports; diff --git a/src/zenhorde/include/zenhorde/hordeconfig.h b/src/zenhorde/include/zenhorde/hordeconfig.h index dd70f9832..abc5f938c 100644 --- a/src/zenhorde/include/zenhorde/hordeconfig.h +++ b/src/zenhorde/include/zenhorde/hordeconfig.h @@ -8,6 +8,16 @@ namespace zen::horde { +/** Protocol version for the Horde compute transport. + * Both sides learn this from the Horde server's ComputeTask — it is never exchanged on the wire. */ +enum class ComputeProtocol : int +{ + Unknown = 0, + Initial = 1, + NewCpuEnvVars = 2, + CompressedFileTransfer = 3, +}; + /** Transport connection mode for Horde compute agents. */ enum class ConnectionMode { diff --git a/src/zenhorde/include/zenhorde/hordeprovisioner.h b/src/zenhorde/include/zenhorde/hordeprovisioner.h index 4e2e63bbd..909d6d528 100644 --- a/src/zenhorde/include/zenhorde/hordeprovisioner.h +++ b/src/zenhorde/include/zenhorde/hordeprovisioner.h @@ -87,7 +87,14 @@ private: std::unique_ptr<HordeClient> m_HordeClient; - std::mutex m_BundleLock; + struct BinaryFileEntry + { + std::filesystem::path Path; + bool Optional; + }; + + std::mutex m_BundleLock; + std::vector<BinaryFileEntry> m_BinaryFiles; ///< Files to upload (populated once, guarded by m_BundleLock) std::vector<std::pair<std::string, std::filesystem::path>> m_Bundles; ///< (locator, bundleDir) pairs bool m_BundlesCreated = false; |