forked from pinks/eris
feat: show worker GPU
This commit is contained in:
parent
f678324889
commit
556f1a4182
|
@ -55,6 +55,7 @@ async function getWorkerData(workerInstance: Model<WorkerInstance>): Promise<Wor
|
||||||
id: workerInstance.id,
|
id: workerInstance.id,
|
||||||
key: workerInstance.value.key,
|
key: workerInstance.value.key,
|
||||||
name: workerInstance.value.name,
|
name: workerInstance.value.name,
|
||||||
|
gpu: workerInstance.value.gpu,
|
||||||
lastError: workerInstance.value.lastError,
|
lastError: workerInstance.value.lastError,
|
||||||
lastOnlineTime: workerInstance.value.lastOnlineTime,
|
lastOnlineTime: workerInstance.value.lastOnlineTime,
|
||||||
isActive: activeGenerationWorkers.get(workerInstance.id)?.isProcessing ?? false,
|
isActive: activeGenerationWorkers.get(workerInstance.id)?.isProcessing ?? false,
|
||||||
|
|
|
@ -79,6 +79,27 @@ export async function processGenerationQueue() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await workerSdClient.GET("/internal/sysinfo", {
|
||||||
|
params: {
|
||||||
|
query: {
|
||||||
|
attachment: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
signal: AbortSignal.timeout(10_000),
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
if (!response.data) {
|
||||||
|
throw new SdError("Failed to get worker sysinfo", response.response, response.error);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @ts-ignore there is no schema for /internal/sysinfo endpoint response
|
||||||
|
const nvidiaGPUModels = response.data["Torch env info"].nvidia_gpu_models ?? null;
|
||||||
|
|
||||||
|
if (nvidiaGPUModels !== null) {
|
||||||
|
workerInstance.update({ gpu: nvidiaGPUModels });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// create worker
|
// create worker
|
||||||
const newWorker = generationQueue.createWorker(async ({ state }, updateJob) => {
|
const newWorker = generationQueue.createWorker(async ({ state }, updateJob) => {
|
||||||
await processGenerationJob(state, updateJob, workerInstance.id);
|
await processGenerationJob(state, updateJob, workerInstance.id);
|
||||||
|
|
|
@ -9,6 +9,7 @@ export const workerInstanceSchema = {
|
||||||
key: { type: "string" },
|
key: { type: "string" },
|
||||||
// used for display
|
// used for display
|
||||||
name: { type: ["string", "null"] },
|
name: { type: ["string", "null"] },
|
||||||
|
gpu: { type: ["string", "null"] },
|
||||||
sdUrl: { type: "string" },
|
sdUrl: { type: "string" },
|
||||||
sdAuth: {
|
sdAuth: {
|
||||||
type: ["object", "null"],
|
type: ["object", "null"],
|
||||||
|
|
|
@ -204,9 +204,12 @@ function WorkerListItem(props: {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li className="flex flex-col gap-2 rounded-md bg-zinc-100 dark:bg-zinc-800 p-2">
|
<li className="flex flex-col gap-2 rounded-md bg-zinc-100 dark:bg-zinc-800 p-2">
|
||||||
<p className="font-bold">
|
<div class="clearfix">
|
||||||
{worker.name ?? worker.key}
|
<span className="font-bold">
|
||||||
</p>
|
{worker.name ?? worker.key}
|
||||||
|
</span>
|
||||||
|
<span className="text-zinc-400 float-right">{worker.gpu}</span>
|
||||||
|
</div>
|
||||||
{worker.isActive ? <p>✅ Active</p> : (
|
{worker.isActive ? <p>✅ Active</p> : (
|
||||||
<>
|
<>
|
||||||
<p>
|
<p>
|
||||||
|
|
Loading…
Reference in New Issue