mirror of
https://github.com/hanzo-cpp/sdk.git
synced 2026-11-20 19:55:32 +00:00
The projection these were generated from was a month old and predated the compute migration, so every one of them described /v1/visor — which the API serves at zero paths now. That is why a hand-written console client and a generated one had drifted the same way at the same time. No /v1/visor path survives here. The word still appears as a source-plane value and inside gvisor and supervisor, which are not this rename.
300 lines
9.8 KiB
C++
300 lines
9.8 KiB
C++
/**
|
|
* Hanzo Cloud API
|
|
* The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
|
*
|
|
* The version of the OpenAPI document: v1
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI-Generator 7.14.0.
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
/*
|
|
* ByoWorker.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_MODEL_ByoWorker_H_
|
|
#define HANZO_MODEL_ByoWorker_H_
|
|
|
|
#include <boost/optional.hpp>
|
|
|
|
#include "hanzo/ModelBase.h"
|
|
|
|
#include "hanzo/model/EngineAdvertisement.h"
|
|
#include "hanzo/model/ByoGPU.h"
|
|
#include <cpprest/details/basic_types.h>
|
|
#include <vector>
|
|
|
|
namespace hanzo {
|
|
namespace model {
|
|
|
|
class EngineAdvertisement;
|
|
class ByoGPU;
|
|
|
|
|
|
class ByoWorker
|
|
: public ModelBase
|
|
{
|
|
public:
|
|
ByoWorker();
|
|
virtual ~ByoWorker();
|
|
|
|
/////////////////////////////////////////////
|
|
/// ModelBase overrides
|
|
|
|
void validate() override;
|
|
|
|
web::json::value toJson() const override;
|
|
bool fromJson(const web::json::value& json) override;
|
|
|
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
|
|
|
|
/////////////////////////////////////////////
|
|
/// ByoWorker members
|
|
|
|
|
|
/// <summary>
|
|
/// Arch/CPUs/Memory are the connecting host's static CPU spec, mirrored from the registration: Arch is runtime.GOARCH (amd64 | arm64), Memory is total RAM in BYTES — the same fields a code-linked run-target carries, so the /v1/compute/fleet board renders a linked node's arch + cores + RAM like any other unit.
|
|
/// </summary>
|
|
utility::string_t getArch() const;
|
|
bool archIsSet() const;
|
|
void unsetArch();
|
|
void setArch(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Capabilities is what this worker offers the org: \"studio.render\" when the node can render, \"engine.serve\" when it serves a model endpoint. A node advertises one only once it can honour it, so an absent list means a node that has dialed in but is not ready to serve any of them yet.
|
|
/// </summary>
|
|
std::vector<utility::string_t> getCapabilities() const;
|
|
bool capabilitiesIsSet() const;
|
|
void unsetCapabilities();
|
|
void setCapabilities(const std::vector<utility::string_t>& value);
|
|
|
|
/// <summary>
|
|
/// CPUModel is the processor as the host names it (\"Apple M3 Max\"), for display.
|
|
/// </summary>
|
|
utility::string_t getCpuModel() const;
|
|
bool cpuModelIsSet() const;
|
|
void unsetCpuModel();
|
|
void setCpuModel(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// CPUs is the host's logical core count.
|
|
/// </summary>
|
|
int64_t getCpus() const;
|
|
bool cpusIsSet() const;
|
|
void unsetCpus();
|
|
void setCpus(int64_t value);
|
|
|
|
/// <summary>
|
|
/// Cuda is the host's CUDA toolkit version. NVIDIA hosts report it.
|
|
/// </summary>
|
|
utility::string_t getCuda() const;
|
|
bool cudaIsSet() const;
|
|
void unsetCuda();
|
|
void setCuda(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Driver is the host's NVIDIA kernel driver version — distinct from Cuda, and the one that bounds which CUDA versions can run on this box.
|
|
/// </summary>
|
|
utility::string_t getDriver() const;
|
|
bool driverIsSet() const;
|
|
void unsetDriver();
|
|
void setDriver(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Engine is the hanzo-engine model server this node runs, when it runs one (`hanzo link --serve-engine`). Absent means the node takes jobs but serves no model endpoint.
|
|
/// </summary>
|
|
std::shared_ptr<EngineAdvertisement> getEngine() const;
|
|
bool engineIsSet() const;
|
|
void unsetEngine();
|
|
void setEngine(const std::shared_ptr<EngineAdvertisement>& value);
|
|
|
|
/// <summary>
|
|
/// FirstSeen is when this node first dialed in, RFC 3339 — the start of its presence record, which `hanzo unlink` ends.
|
|
/// </summary>
|
|
utility::string_t getFirstSeen() const;
|
|
bool firstSeenIsSet() const;
|
|
void unsetFirstSeen();
|
|
void setFirstSeen(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// GPUs are the accelerators the host found on itself. Empty is a real answer: a CPU-only machine can dial in and take non-GPU work.
|
|
/// </summary>
|
|
std::vector<std::shared_ptr<ByoGPU>> getGpus() const;
|
|
bool gpusIsSet() const;
|
|
void unsetGpus();
|
|
void setGpus(const std::vector<std::shared_ptr<ByoGPU>>& value);
|
|
|
|
/// <summary>
|
|
/// Hip is the host's HIP runtime version, the AMD counterpart to Cuda.
|
|
/// </summary>
|
|
utility::string_t getHip() const;
|
|
bool hipIsSet() const;
|
|
void unsetHip();
|
|
void setHip(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Hostname is what the host calls itself. It equals ID for any hostname already in the [a-z0-9-] alphabet, and differs when sanitizing had to change it.
|
|
/// </summary>
|
|
utility::string_t getHostname() const;
|
|
bool hostnameIsSet() const;
|
|
void unsetHostname();
|
|
void setHostname(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// ID is the node's id in the fleet — the sanitized hostname it registered under, which is also the `unit` its samples and its gpu-jobs lane key on. This is the id to use everywhere else on the compute surface.
|
|
/// </summary>
|
|
utility::string_t getId() const;
|
|
bool idIsSet() const;
|
|
void unsetId();
|
|
void setId(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// JobQueue is the tasks NAMESPACE this worker claims render jobs out of — \"gpu-jobs\" unless `hanzo link` was pointed at another. Within it, a job aimed at this node alone rides the task-queue value \"gpu:<id>\".
|
|
/// </summary>
|
|
utility::string_t getJobQueue() const;
|
|
bool jobQueueIsSet() const;
|
|
void unsetJobQueue();
|
|
void setJobQueue(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// LastHeartbeat is the most recent beat this node sent, RFC 3339. It is what Status is computed from, so a reader can check the judgement.
|
|
/// </summary>
|
|
utility::string_t getLastHeartbeat() const;
|
|
bool lastHeartbeatIsSet() const;
|
|
void unsetLastHeartbeat();
|
|
void setLastHeartbeat(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Location is always \"on-prem\" — a machine that dialed in has no cloud region, and inventing one would put it somewhere it is not.
|
|
/// </summary>
|
|
utility::string_t getLocation() const;
|
|
bool locationIsSet() const;
|
|
void unsetLocation();
|
|
void setLocation(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Memory is the host's total RAM in BYTES.
|
|
/// </summary>
|
|
int64_t getMemory() const;
|
|
bool memoryIsSet() const;
|
|
void unsetMemory();
|
|
void setMemory(int64_t value);
|
|
|
|
/// <summary>
|
|
/// Os is the host's operating system: linux, darwin or windows.
|
|
/// </summary>
|
|
utility::string_t getOs() const;
|
|
bool osIsSet() const;
|
|
void unsetOs();
|
|
void setOs(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Provider is always \"byo\": this machine is the operator's, not one Hanzo provisioned. It exists so a fold into the machines/GPUs pages says which rows are rented and which are the customer's own.
|
|
/// </summary>
|
|
utility::string_t getProvider() const;
|
|
bool providerIsSet() const;
|
|
void unsetProvider();
|
|
void setProvider(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Rocm is the host's ROCm version. AMD hosts report it; empty otherwise.
|
|
/// </summary>
|
|
utility::string_t getRocm() const;
|
|
bool rocmIsSet() const;
|
|
void unsetRocm();
|
|
void setRocm(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Status is \"online\" when the last heartbeat landed within 90s, else \"offline\" — so it is a fact about heartbeat freshness, not about the box being powered on. A worker that has never beaten reads offline.
|
|
/// </summary>
|
|
utility::string_t getStatus() const;
|
|
bool statusIsSet() const;
|
|
void unsetStatus();
|
|
void setStatus(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Version is the `hanzo` CLI version running on the node. It is what to check when a worker is missing a field a newer registration reports.
|
|
/// </summary>
|
|
utility::string_t getVersion() const;
|
|
bool versionIsSet() const;
|
|
void unsetVersion();
|
|
void setVersion(const utility::string_t& value);
|
|
|
|
|
|
protected:
|
|
utility::string_t m_Arch;
|
|
bool m_ArchIsSet;
|
|
|
|
std::vector<utility::string_t> m_Capabilities;
|
|
bool m_CapabilitiesIsSet;
|
|
|
|
utility::string_t m_CpuModel;
|
|
bool m_CpuModelIsSet;
|
|
|
|
int64_t m_Cpus;
|
|
bool m_CpusIsSet;
|
|
|
|
utility::string_t m_Cuda;
|
|
bool m_CudaIsSet;
|
|
|
|
utility::string_t m_Driver;
|
|
bool m_DriverIsSet;
|
|
|
|
std::shared_ptr<EngineAdvertisement> m_Engine;
|
|
bool m_EngineIsSet;
|
|
|
|
utility::string_t m_FirstSeen;
|
|
bool m_FirstSeenIsSet;
|
|
|
|
std::vector<std::shared_ptr<ByoGPU>> m_Gpus;
|
|
bool m_GpusIsSet;
|
|
|
|
utility::string_t m_Hip;
|
|
bool m_HipIsSet;
|
|
|
|
utility::string_t m_Hostname;
|
|
bool m_HostnameIsSet;
|
|
|
|
utility::string_t m_Id;
|
|
bool m_IdIsSet;
|
|
|
|
utility::string_t m_JobQueue;
|
|
bool m_JobQueueIsSet;
|
|
|
|
utility::string_t m_LastHeartbeat;
|
|
bool m_LastHeartbeatIsSet;
|
|
|
|
utility::string_t m_Location;
|
|
bool m_LocationIsSet;
|
|
|
|
int64_t m_Memory;
|
|
bool m_MemoryIsSet;
|
|
|
|
utility::string_t m_Os;
|
|
bool m_OsIsSet;
|
|
|
|
utility::string_t m_Provider;
|
|
bool m_ProviderIsSet;
|
|
|
|
utility::string_t m_Rocm;
|
|
bool m_RocmIsSet;
|
|
|
|
utility::string_t m_Status;
|
|
bool m_StatusIsSet;
|
|
|
|
utility::string_t m_Version;
|
|
bool m_VersionIsSet;
|
|
|
|
};
|
|
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_MODEL_ByoWorker_H_ */
|