陈博文 5 days ago
commit 4f1e59dcd2

@ -148,3 +148,16 @@ spec:
type: NodePort type: NodePort
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: hami-webui-clusterrolebinding-nsz4n
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: 'system:controller:node-controller'
subjects:
- kind: ServiceAccount
name: hami-webui
namespace: kube-system

@ -61,7 +61,7 @@ message ContainerReply {
string end_time = 11; string end_time = 11;
string pod_uid = 12; string pod_uid = 12;
string node_uid = 13; string node_uid = 13;
repeated string resource_pool = 14; repeated string resource_pools = 14;
string flavor = 15; string flavor = 15;
string priority = 16; string priority = 16;
string namespace = 17; string namespace = 17;

@ -62,7 +62,8 @@ service ResourcePool {
rpc GetDetail (ResourcePoolDetailRequest) returns (ResourcePoolDetailResponse) { rpc GetDetail (ResourcePoolDetailRequest) returns (ResourcePoolDetailResponse) {
option (google.api.http) = { option (google.api.http) = {
post: "/v1/resource/pool/detail" post: "/v1/resource/pool/detail",
body: "*"
}; };
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "资源池详情"; summary: "资源池详情";

@ -97,7 +97,7 @@ func (s *ContainerService) GetAllContainers(ctx context.Context, req *pb.GetAllC
return nil, err return nil, err
} }
containerReply.ResourcePool = resourcePoolNames containerReply.ResourcePools = resourcePoolNames
resourcePoolName, err := database.Get("big_model_resource_pool_name") resourcePoolName, err := database.Get("big_model_resource_pool_name")
if err != nil { if err != nil {
return nil, err return nil, err

@ -3,150 +3,50 @@
openapi: 3.0.3 openapi: 3.0.3
info: info:
title: ResourcePool API title: Container API
version: 0.0.1 version: 0.0.1
paths: paths:
/v1/available/nodes: /v1/container:
get: get:
tags: tags:
- ResourcePool - Container
operationId: ResourcePool_GetAvailableNodes operationId: Container_GetContainer
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/AvailableNodesResponse'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v1/resource/pool/create:
post:
tags:
- ResourcePool
operationId: ResourcePool_Create
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ResourcePoolCreateRequest'
required: true
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/BaseResponse'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v1/resource/pool/delete:
post:
tags:
- ResourcePool
operationId: ResourcePool_Delete
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ResourcePoolDeleteRequest'
required: true
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/BaseResponse'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v1/resource/pool/detail:
post:
tags:
- ResourcePool
operationId: ResourcePool_GetDetail
parameters: parameters:
- name: poolId - name: name
in: query in: query
schema: schema:
type: string type: string
responses: - name: podUid
"200": in: query
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ResourcePoolDetailResponse'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v1/resource/pool/list:
get:
tags:
- ResourcePool
operationId: ResourcePool_List
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ResourcePoolListResponse'
default:
description: Default error response
content:
application/json:
schema: schema:
$ref: '#/components/schemas/Status' type: string
/v1/resource/pool/removeNode: - name: deviceId
post: in: query
tags:
- ResourcePool
operationId: ResourcePool_RemoveNode
requestBody:
content:
application/json:
schema: schema:
$ref: '#/components/schemas/RemoveNodeRequest' type: string
required: true
responses: responses:
"200": "200":
description: OK description: OK
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/BaseResponse' $ref: '#/components/schemas/ContainerReply'
default: default:
description: Default error response description: Default error response
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Status' $ref: '#/components/schemas/Status'
/v1/resource/pool/update: /v1/containers:
post: post:
tags: tags:
- ResourcePool - Container
operationId: ResourcePool_Update operationId: Container_GetAllContainers
requestBody: requestBody:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ResourcePoolUpdateRequest' $ref: '#/components/schemas/GetAllContainersReq'
required: true required: true
responses: responses:
"200": "200":
@ -154,7 +54,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/BaseResponse' $ref: '#/components/schemas/ContainersReply'
default: default:
description: Default error response description: Default error response
content: content:
@ -163,177 +63,114 @@ paths:
$ref: '#/components/schemas/Status' $ref: '#/components/schemas/Status'
components: components:
schemas: schemas:
AvailableNodesInfo: ContainerReply:
type: object
properties:
nodeName:
type: string
cpuCores:
type: string
gpuNum:
type: string
gpuMemory:
type: string
totalMemory:
type: string
diskSize:
type: string
nodeIp:
type: string
AvailableNodesResponse:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/AvailableNodesInfo'
BaseResponse:
type: object type: object
properties: properties:
code: name:
type: integer
format: int32
message:
type: string type: string
data: status:
type: object
GoogleProtobufAny:
type: object
properties:
'@type':
type: string type: string
description: The type of the serialized message. appName:
additionalProperties: true
description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.
Nodes:
type: object
properties:
nodeIp:
type: string type: string
nodeName: nodeName:
type: string type: string
PoolNodeReply: allocatedDevices:
type: object
properties:
ip:
type: string
isSchedulable:
type: boolean
isReady:
type: boolean
type:
type: array
items:
type: string
vgpuUsed:
type: integer type: integer
format: int32 format: int32
vgpuTotal: allocatedCores:
type: integer type: integer
format: int32 format: int32
coreUsed: allocatedMem:
type: integer type: integer
format: int32 format: int32
coreTotal: type:
type: string type: string
memoryUsed: createTime:
type: string type: string
memoryTotal: startTime:
type: string type: string
uid: endTime:
type: string type: string
name: podUid:
type: string type: string
cardCnt: nodeUid:
type: integer
format: int32
osImage:
type: string type: string
operatingSystem: resourcePools:
type: array
items:
type: string type: string
kernelVersion: flavor:
type: string type: string
containerRuntimeVersion: priority:
type: string type: string
kubeletVersion: namespace:
type: string type: string
kubeProxyVersion: deviceIds:
type: array
items:
type: string type: string
architecture: podName:
type: string type: string
creationTimestamp: taskType:
type: string type: string
diskSize: shixunName:
type: string type: string
nodeId: role:
type: string type: string
RemoveNodeRequest: username:
type: object
properties:
nodeId:
type: string type: string
ResourcePoolCreateRequest: ContainersReply:
type: object type: object
properties: properties:
poolName: items:
type: string
nodes:
type: array type: array
items: items:
$ref: '#/components/schemas/Nodes' $ref: '#/components/schemas/ContainerReply'
ResourcePoolDeleteRequest: GetAllContainersReq:
type: object
properties:
poolId:
type: string
ResourcePoolDetailResponse:
type: object type: object
properties: properties:
list: filters:
type: array $ref: '#/components/schemas/GetAllContainersReq_Filters'
items: pageSize:
$ref: '#/components/schemas/PoolNodeReply' $ref: '#/components/schemas/GetAllContainersReq_PageSize'
ResourcePoolListData: GetAllContainersReq_Filters:
type: object type: object
properties: properties:
poolId: name:
type: string
poolName:
type: string type: string
cpuCores: nodeName:
type: string type: string
nodeNum: status:
type: string type: string
gpuNum: deviceId:
type: string type: string
availableMemory: nodeUid:
type: string type: string
totalMemory: resourceGroup:
type: string type: string
diskSize: priority:
type: string type: string
nodeList: GetAllContainersReq_PageSize:
type: array
items:
$ref: '#/components/schemas/Nodes'
ResourcePoolListResponse:
type: object type: object
properties: properties:
data: pageSize:
type: array type: integer
items: format: int32
$ref: '#/components/schemas/ResourcePoolListData' pageNo:
ResourcePoolUpdateRequest: type: integer
format: int32
sort:
type: string
sortField:
type: string
GoogleProtobufAny:
type: object type: object
properties: properties:
poolId: '@type':
type: string
poolName:
type: string type: string
nodes: description: The type of the serialized message.
type: array additionalProperties: true
items: description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.
$ref: '#/components/schemas/Nodes'
Status: Status:
type: object type: object
properties: properties:
@ -351,4 +188,4 @@ components:
description: A list of messages that carry the error details. There is a common set of message types for APIs to use. description: A list of messages that carry the error details. There is a common set of message types for APIs to use.
description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).' description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).'
tags: tags:
- name: ResourcePool - name: Container

Loading…
Cancel
Save