|
- package schsdk
-
- import (
- "gitlink.org.cn/cloudream/common/pkgs/types"
- cdssdk "gitlink.org.cn/cloudream/common/sdks/storage"
- "gitlink.org.cn/cloudream/common/utils/serder"
- )
-
- const (
- Role = "role"
- RoleServer = "server"
- RoleClient = "client"
- )
-
- type AppInstanceID int64
-
- type ClientID string
-
- type AppSetInfo struct {
- Apps []AppInfo `json:"apps"`
- }
-
- type AppInfo interface {
- GetLocalJobID() string
- GetAppInstanceID() int64
- }
-
- var AppInfoTypeUnion = types.NewTypeUnion[AppInfo](
- (*FederatedLearningAppInfo)(nil),
- (*OtherAppInfo)(nil),
- )
-
- var _ = serder.UseTypeUnionInternallyTagged(&AppInfoTypeUnion, "type")
-
- type AppInfoBase struct {
- LocalJobID string `json:"localJobID"`
- AppInstanceID int64 `json:"appInstanceID"` // 应用实例ID
- }
-
- func (i *AppInfoBase) GetLocalJobID() string {
- return i.LocalJobID
- }
-
- func (i *AppInfoBase) GetAppInstanceID() int64 {
- return i.AppInstanceID
- }
-
- // FederatedLearningAppInfo 云际联邦学习应用信息
- type FederatedLearningAppInfo struct {
- serder.Metadata `union:"federatedLearning"`
- AppInfoBase
- Type string `json:"type"`
-
- AppInstanceID AppInstanceID `json:"appInstanceID"`
- Name string `json:"name"`
- Description string `json:"description"`
- ClientCount int `json:"clientCount"` //参与者人数
- ServerJobInfo AIJobInfo `json:"serverJobInfo"` //服务端作业信息
- ClientJobInfo AIJobInfo `json:"clientJobInfo"` //客户端作业信息
- Role string `json:"role"` //角色,server/client
- IsDataReturn bool `json:"isDataReturn"` //是否需要数据回源
- DatasetBindID cdssdk.ObjectID `json:"datasetBindID"` //数据集绑定ID
- ClientIDs []ClientID `json:"clientIDs"` //参与者ID列表
- JoinedCount int64 `json:"joinedCount"` //已经参与的人数
-
- //用于回显数据
- ClientDatasets []interface{} `json:"clientDatasets"` //数据集列表
- ServerDataDistribute interface{} `json:"serverDataDistribute"` //server数据分发信息
- ClientDataDistribute interface{} `json:"clientDataDistribute"` //client数据分发信息
- }
-
- type OtherAppInfo struct {
- serder.Metadata `union:"other"`
- AppInfoBase
- Type string `json:"type"`
- Name string `json:"name"`
- Description string `json:"description"`
- }
|