gpu

package
v0.0.0-...-cebacf7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package gpu hosts `olares-cli settings gpu`. Mirrors the SPA's Settings -> GPU page (devices, mode, per-app assignment). Backed by user-service's gpu.controller.ts which proxies HAMI; all responses wrapped with returnSucceed/returnError.

Note: this is the profile-based settings surface that mirrors the SPA. The kubeconfig-based "olares-cli gpu" tree is a separate, lower-level command for cluster admins; the two should not be confused.

Package gpu implements the `olares-cli settings gpu` subtree (Settings -> GPU). Backed by user-service's gpu.controller.ts. There's also a top-level `olares-cli gpu` tree from earlier work that talks via kubeconfig — this one is the profile-based settings surface that mirrors the Settings UI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGPUCommand

func NewGPUCommand(f *cmdutil.Factory) *cobra.Command

NewGPUCommand returns the `settings gpu` parent: list devices and per-app GPU assignments. Mutating verbs (mode set, assign, unassign, bulk-assign) are out of scope for now.

func NewListCommand

func NewListCommand(f *cmdutil.Factory) *cobra.Command

`olares-cli settings gpu list`

Backed by user-service's /api/gpu/list, which proxies HAMI. The body is a BFL envelope around an array of GPUInfo:

{
  "nodeName": "...", "id": "...", "type": "...",
  "count": 1, "devmem": 12288, "devcore": 80,
  "mode": "exclusive" | "shared",
  "sharemode": "...",
  "health": true,
  "memoryAllocated": 0, "memoryAvailable": 0,
  "apps": [{"appName": "...", "memory": <int>}],
}

Types

type Doer

type Doer interface {
	DoJSON(ctx context.Context, method, path string, body, out interface{}) error
}

type Format

type Format string
const (
	FormatTable Format = "table"
	FormatJSON  Format = "json"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL