service

package
v0.0.0-...-a23f117 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FATEFlowConnectionInfo

type FATEFlowConnectionInfo struct {
	// Host address
	Host string `json:"host"`
	// Port is the port number
	Port uint `json:"port"`
	// Https is whether https is enabled
	Https bool `json:"https"`
}

FATEFlowConnectionInfo represent connection info to a fate flow service

type FMLManagerConnectionInfo

type FMLManagerConnectionInfo struct {
	// Endpoint address starting with "http" or "https"
	Endpoint string `json:"endpoint"`
	//ServerName is used by Site Portal to verify FML Manager's certificate
	ServerName string `json:"server_name"`
}

FMLManagerConnectionInfo contains connection settings for the fml manager

type GenerateJobConfRequest

type GenerateJobConfRequest struct {
	JobConf JobSubmissionRequest `json:"job_conf"`
	DagJson JobRawDagJson        `json:"dag_json"`
}

GenerateJobConfRequest contains 2 parts of the information: 1. the info of the job, like the participants. 2. the info of each job component's configuration, such as what penalty function an algorithm use.

type IntersectionJobResultInfo

type IntersectionJobResultInfo struct {
	Header          []string        `json:"header"`
	Data            [][]interface{} `json:"data"`
	IntersectNumber int             `json:"intersect_number"`
	IntersectRate   float64         `json:"intersect_rate"`
}

IntersectionJobResultInfo contains PSI job result data

type JobAlgorithmConf

type JobAlgorithmConf struct {
	ValidationEnabled      bool                    `json:"training_validation_enabled"`
	ValidationSizePercent  uint                    `json:"training_validation_percent"`
	ModelName              string                  `json:"training_model_name"`
	AlgorithmType          entity.JobAlgorithmType `json:"training_algorithm_type"`
	AlgorithmComponentName string                  `json:"algorithm_component_name"`
	ComponentsToDeploy     []string                `json:"training_component_list_to_deploy"`
	ModelUUID              string                  `json:"predicting_model_uuid"`
	EvaluateComponentName  string                  `json:"evaluate_component_name"`
}

JobAlgorithmConf is the algorithm configuration for a job

type JobApp

type JobApp struct {
	SiteRepo        repo.SiteRepository
	JobRepo         repo.JobRepository
	ParticipantRepo repo.JobParticipantRepository
	ProjectRepo     repo.ProjectRepository
	ProjectDataRepo repo.ProjectDataRepository
	ModelRepo       repo.ModelRepository
}

JobApp provides interface for job related API handling routines

func (*JobApp) Approve

func (app *JobApp) Approve(uuid string) error

Approve approves the job

func (*JobApp) DeleteJob

func (app *JobApp) DeleteJob(jobUUID string) error

DeleteJob mark the job status as deleted

func (*JobApp) GenerateConfFromDag

func (app *JobApp) GenerateConfFromDag(
	username string, generateJobConfRequest *GenerateJobConfRequest) (string, error)

GenerateConfFromDag returns a map, which represents the configuration of each fate job component.

func (*JobApp) GenerateConfig

func (app *JobApp) GenerateConfig(username string, request *JobSubmissionRequest) (*JobConf, error)

GenerateConfig returns the job configuration content based on the job info

func (*JobApp) GenerateDslFromDag

func (app *JobApp) GenerateDslFromDag(rawJson string) (string, error)

GenerateDslFromDag returns a json string, which is the DSL configuration which can be consumed by fateflow. The input is the raw json string which represent the DAG the user has draw on UI.

func (*JobApp) GeneratePredictingJobParticipants

func (app *JobApp) GeneratePredictingJobParticipants(modelUUID string) ([]JobParticipantInfoBase, error)

GeneratePredictingJobParticipants returns a list of participants that should be used in a predicting job

func (*JobApp) GetDataResultDownloadRequest

func (app *JobApp) GetDataResultDownloadRequest(uuid string) (*http.Request, error)

GetDataResultDownloadRequest returns a request object to be used to download the result data

func (*JobApp) GetJobDetail

func (app *JobApp) GetJobDetail(uuid string) (*JobDetail, error)

GetJobDetail returns the detail info of a job

func (*JobApp) List

func (app *JobApp) List(projectUUID string) ([]JobListItemBase, error)

List returns a list of jobs in the specified project

func (*JobApp) LoadJobComponents

func (app *JobApp) LoadJobComponents() string

LoadJobComponents returns s json string, UI can use this json to populate the FML components, so that a user can drag the components to define a job. The json contains the default configs for each component.

func (*JobApp) ProcessJobResponse

func (app *JobApp) ProcessJobResponse(uuid string, context *JobApprovalContext) error

ProcessJobResponse handles job approval response

func (*JobApp) ProcessJobStatusUpdate

func (app *JobApp) ProcessJobStatusUpdate(uuid string, context *JobStatusUpdateContext) error

ProcessJobStatusUpdate handles job status update requests

func (*JobApp) ProcessNewRemoteJob

func (app *JobApp) ProcessNewRemoteJob(request *RemoteJobCreationRequest) error

ProcessNewRemoteJob processes the remote job creation request

func (*JobApp) Refresh

func (app *JobApp) Refresh(uuid string) error

Refresh checks the latest job status

func (*JobApp) Reject

func (app *JobApp) Reject(uuid string) error

Reject rejects the job

func (*JobApp) SubmitJob

func (app *JobApp) SubmitJob(username string, request *JobSubmissionRequest) (*JobListItemBase, error)

SubmitJob creates the job

type JobApprovalContext

type JobApprovalContext struct {
	SiteUUID string `json:"site_uuid"`
	Approved bool   `json:"approved"`
}

JobApprovalContext is the context used for a job approval response

type JobConf

type JobConf struct {
	ConfJson string `json:"conf_json"`
	DSLJson  string `json:"dsl_json"`
}

JobConf is the configuration content for a FATE job

type JobData

type JobData struct {
	JobDataBase
	Name                 string                      `json:"name"`
	Description          string                      `json:"description"`
	ProvidingSiteUUID    string                      `json:"providing_site_uuid"`
	ProvidingSiteName    string                      `json:"providing_site_name"`
	ProvidingSitePartyID uint                        `json:"providing_site_party_id"`
	IsLocal              bool                        `json:"is_local"`
	Status               entity.JobParticipantStatus `json:"site_status"`
	StatusStr            string                      `json:"site_status_str"`
}

JobData contains detailed info of a data used in a job

type JobDataBase

type JobDataBase struct {
	DataUUID  string `json:"data_uuid"`
	LabelName string `json:"label_name"`
}

JobDataBase is the basic info of a job data

type JobDetail

type JobDetail struct {
	JobListItemBase
	InitiatorData JobData       `json:"initiator_data"`
	OtherData     []JobData     `json:"other_site_data"`
	StatusMsg     string        `json:"status_message"`
	ResultInfo    JobResultInfo `json:"result_info"`
	JobConf
	JobAlgorithmConf
}

JobDetail contains detailed info of a job, including the result and status message

type JobInfoBase

type JobInfoBase struct {
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Type        entity.JobType `json:"type"`
	ProjectUUID string         `json:"project_uuid"`
}

JobInfoBase contains the basic info of a job

type JobListItemBase

type JobListItemBase struct {
	JobInfoBase
	UUID                  string           `json:"uuid"`
	Status                entity.JobStatus `json:"status"`
	StatusStr             string           `json:"status_str"`
	CreationTime          time.Time        `json:"creation_time"`
	FinishTime            time.Time        `json:"finish_time"`
	InitiatingSiteUUID    string           `json:"initiating_site_uuid"`
	InitiatingSiteName    string           `json:"initiating_site_name"`
	InitiatingSitePartyID uint             `json:"initiating_site_party_id"`
	PendingOnThisSite     bool             `json:"pending_on_this_site"`
	FATEJobID             string           `json:"fate_job_id"`
	FATEJobStatus         string           `json:"fate_job_status"`
	FATEModelName         string           `json:"fate_model_name"`
	IsInitiator           bool             `json:"is_initiator"`
	Username              string           `json:"username"`
}

JobListItemBase contains info of a job for displaying in a list view

type JobParticipantInfoBase

type JobParticipantInfoBase struct {
	SiteUUID    string `json:"site_uuid"`
	SiteName    string `json:"site_name"`
	SitePartyID uint   `json:"site_party_id"`
}

JobParticipantInfoBase contains basic information of a job participant

type JobRawDagJson

type JobRawDagJson struct {
	RawJson string `json:"raw_json"`
}

JobRawDagJson describes the DAG the user draw, also contains the configuration of each job component

type JobResultInfo

type JobResultInfo struct {
	IntersectionResult IntersectionJobResultInfo `json:"intersection_result"`
	TrainingResult     map[string]string         `json:"training_result"`
	PredictingResult   PredictingJobResultInfo   `json:"predicting_result"`
}

JobResultInfo contains result information for all types of jobs

type JobStatusUpdateContext

type JobStatusUpdateContext struct {
	Status               entity.JobStatus                       `json:"status"`
	StatusMessage        string                                 `json:"status_message"`
	FATEJobID            string                                 `json:"fate_job_id"`
	FATEJobStatus        string                                 `json:"fate_job_status"`
	FATEModelID          string                                 `json:"fate_model_id"`
	FATEModelVersion     string                                 `json:"fate_model_version"`
	ParticipantStatusMap map[string]entity.JobParticipantStatus `json:"participant_status_map"`
}

JobStatusUpdateContext is the context used for updating a job status

type JobSubmissionRequest

type JobSubmissionRequest struct {
	JobConf
	JobInfoBase
	InitiatorData JobDataBase   `json:"initiator_data"`
	OtherData     []JobDataBase `json:"other_site_data"`
	JobAlgorithmConf
}

JobSubmissionRequest is the request for creating a job

type LocalDataApp

type LocalDataApp struct {
	LocalDataRepo   repo.LocalDataRepository
	SiteRepo        repo.SiteRepository
	ProjectRepo     repo.ProjectRepository
	ProjectDataRepo repo.ProjectDataRepository
}

LocalDataApp provides local data management services

func (*LocalDataApp) AssociateFlowTable

func (s *LocalDataApp) AssociateFlowTable(request *LocalDataAssociateRequest) (string, error)

AssociateFlowTable creates a local data record associated with existing flow table

func (*LocalDataApp) DeleteData

func (s *LocalDataApp) DeleteData(uuid string) error

DeleteData deletes the specified data

func (*LocalDataApp) Get

func (s *LocalDataApp) Get(uuid string) (*LocalDataDetail, error)

Get returns the detailed information of a data record

func (*LocalDataApp) GetColumns

func (s *LocalDataApp) GetColumns(uuid string) ([]string, error)

GetColumns returns a list of headers of the current data

func (*LocalDataApp) GetDataDownloadRequest

func (s *LocalDataApp) GetDataDownloadRequest(uuid string) (*http.Request, error)

GetDataDownloadRequest returns a request object to be used to download the table data

func (*LocalDataApp) GetFilePath

func (s *LocalDataApp) GetFilePath(uuid string) (string, error)

GetFilePath returns absolute file path of the stored local data file

func (*LocalDataApp) List

func (s *LocalDataApp) List() ([]LocalDataListItem, error)

List return the list of data uploaded historically

func (*LocalDataApp) UpdateIDMetaInfo

func (s *LocalDataApp) UpdateIDMetaInfo(uuid string, req *LocalDataIDMetaInfoUpdateRequest) error

func (*LocalDataApp) Upload

func (s *LocalDataApp) Upload(request *LocalDataUploadRequest) (string, error)

Upload loads FATE flow connection info and calls into local data domain object to upload the data into the FATE system

type LocalDataAssociateRequest

type LocalDataAssociateRequest struct {
	Name           string `json:"name"`
	Description    string `json:"description"`
	TableNamespace string `json:"table_namespace"`
	TableName      string `json:"table_name"`
}

LocalDataAssociateRequest contains basic local data association request information

type LocalDataDetail

type LocalDataDetail struct {
	LocalDataListItem
	Description string                  `json:"description"`
	TableName   string                  `json:"table_name"`
	Filename    string                  `json:"filename"`
	IDMetaInfo  *valueobject.IDMetaInfo `json:"id_meta_info"`
	Features    []string                `json:"features_array"`
	Preview     string                  `json:"preview_array"`
	NotUploaded bool                    `json:"not_uploaded_locally"`
}

LocalDataDetail contains local data details

type LocalDataIDMetaInfoUpdateRequest

type LocalDataIDMetaInfoUpdateRequest struct {
	*valueobject.IDMetaInfo
}

LocalDataIDMetaInfoUpdateRequest contains basic upload request information

type LocalDataListItem

type LocalDataListItem struct {
	Name            string                 `json:"name"`
	DataID          string                 `json:"data_id"`
	CreationTime    time.Time              `json:"creation_time"`
	SampleSize      uint64                 `json:"sample_size"`
	FeatureSize     int                    `json:"feature_size"`
	UploadJobStatus entity.UploadJobStatus `json:"upload_job_status"`
}

LocalDataListItem is an item describing a data record

type LocalDataUploadRequest

type LocalDataUploadRequest struct {
	Name        string `form:"name"`
	Description string `form:"description"`
	FileHeader  *multipart.FileHeader
}

LocalDataUploadRequest contains basic upload request information

type LoginInfo

type LoginInfo struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

LoginInfo represents fields related with login

type ModelApp

type ModelApp struct {
	ModelRepo           repo.ModelRepository
	ModelDeploymentRepo repo.ModelDeploymentRepository
	SiteRepo            repo.SiteRepository
	ProjectRepo         repo.ProjectRepository
}

ModelApp provides interfaces for model management APIs

func (*ModelApp) Create

func (app *ModelApp) Create(request *ModelCreationRequest) error

Create creates the model

func (*ModelApp) Delete

func (app *ModelApp) Delete(modelUUID string) error

Delete deletes the specified model

func (*ModelApp) Get

func (app *ModelApp) Get(modelUUID string) (*ModelDetail, error)

Get returns detailed info of a model

func (*ModelApp) GetSupportedDeploymentTypes

func (app *ModelApp) GetSupportedDeploymentTypes(modelUUID string) ([]entity.ModelDeploymentType, error)

GetSupportedDeploymentTypes gets the supported deployment types this model can use

func (*ModelApp) List

func (app *ModelApp) List(projectUUID string) ([]ModelListItem, error)

List returns model list of the current site or of the specified project

func (*ModelApp) Publish

Publish publishes the model to an online serving system

type ModelCreationRequest

type ModelCreationRequest struct {
	ModelInfoBase
	Evaluation             valueobject.ModelEvaluation   `json:"evaluation"`
	ComponentAlgorithmType entity.ComponentAlgorithmType `json:"algorithm_type"`
}

ModelCreationRequest is the request struct for creating a model

type ModelDetail

type ModelDetail struct {
	ModelListItem
	Evaluation valueobject.ModelEvaluation `json:"evaluation"`
}

ModelDetail adds the evaluation info

type ModelInfoBase

type ModelInfoBase struct {
	Name          string    `json:"name"`
	UUID          string    `json:"uuid"`
	ModelID       string    `json:"model_id"`
	ModelVersion  string    `json:"model_version"`
	ComponentName string    `json:"component_name"`
	CreateTime    time.Time `json:"create_time"`
	ProjectUUID   string    `json:"project_uuid"`
	JobUUID       string    `json:"job_uuid"`
	JobName       string    `json:"job_name"`
	Role          string    `json:"role"`
	PartyID       uint      `json:"party_id"`
}

ModelInfoBase contains the basic info of a model

type ModelListItem

type ModelListItem struct {
	ModelInfoBase
	ProjectName   string `json:"project_name"`
	ComponentName string `json:"component_name"`
}

ModelListItem contains info necessary to show models in a list

type PredictingJobResultInfo

type PredictingJobResultInfo struct {
	Header []string        `json:"header"`
	Data   [][]interface{} `json:"data"`
	Count  int             `json:"count"`
}

PredictingJobResultInfo contains predicting job result data

type ProjectApp

type ProjectApp struct {
	ProjectRepo        repo.ProjectRepository
	ParticipantRepo    repo.ProjectParticipantRepository
	SiteRepo           repo.SiteRepository
	InvitationRepo     repo.ProjectInvitationRepository
	ProjectDataRepo    repo.ProjectDataRepository
	LocalDataRepo      repo.LocalDataRepository
	JobApp             *JobApp
	ProjectSyncService *service.ProjectSyncService
}

ProjectApp provides interfaces for project management related APIs

func (*ProjectApp) CloseProject

func (app *ProjectApp) CloseProject(projectUUID string) error

CloseProject closes the managed project

func (*ProjectApp) CreateDataAssociation

func (app *ProjectApp) CreateDataAssociation(projectUUID string, request *ProjectDataAssociationRequest) error

CreateDataAssociation associates local data into the specified project

func (*ProjectApp) CreateLocalProject

func (app *ProjectApp) CreateLocalProject(req *ProjectCreationRequest, username string) error

CreateLocalProject creates a project locally

func (*ProjectApp) CreateRemoteProjectDataAssociation

func (app *ProjectApp) CreateRemoteProjectDataAssociation(projectUUID string, dataList []entity.ProjectData) error

CreateRemoteProjectDataAssociation adds the passed remote data association to the specified project

func (*ProjectApp) CreateRemoteProjectParticipants

func (app *ProjectApp) CreateRemoteProjectParticipants(projectUUID string, participants []entity.ProjectParticipant) error

CreateRemoteProjectParticipants processes a list of participants to create from FML manager for a remote project

func (*ProjectApp) DismissRemoteProjectDataAssociation

func (app *ProjectApp) DismissRemoteProjectDataAssociation(projectUUID string, dataUUIDList []string) error

DismissRemoteProjectDataAssociation removes the data from the specified project

func (*ProjectApp) EnsureProjectIsOpen

func (app *ProjectApp) EnsureProjectIsOpen(projectUUID string) error

EnsureProjectIsOpen returns error if the project is not in a "opened" status. This function can be used in other call-sites before start changing project resources.

func (*ProjectApp) GetProject

func (app *ProjectApp) GetProject(uuid string) (*ProjectInfo, error)

GetProject returns detailed info of a project

func (*ProjectApp) InviteParticipant

func (app *ProjectApp) InviteParticipant(uuid string, targetSite *ProjectParticipantBase) error

InviteParticipant invites certain participant to join current project

func (*ProjectApp) JoinOrRejectProject

func (app *ProjectApp) JoinOrRejectProject(uuid string, join bool) error

JoinOrRejectProject joins or refuses to join a pending project

func (*ProjectApp) LeaveProject

func (app *ProjectApp) LeaveProject(projectUUID string) error

LeaveProject removes the current site from the specified project

func (*ProjectApp) List

func (app *ProjectApp) List() (*ProjectList, error)

List returns all projects this site joined or pending on this site

func (*ProjectApp) ListData

func (app *ProjectApp) ListData(projectUUID, participantUUID string) ([]ProjectData, error)

ListData returns a list of data, local and remote, of the specified project

func (*ProjectApp) ListLocalData

func (app *ProjectApp) ListLocalData(projectUUID string) ([]ProjectData, error)

ListLocalData returns a list of local data that haven't been associated into the specified project

func (*ProjectApp) ListParticipant

func (app *ProjectApp) ListParticipant(uuid string, all bool) ([]ProjectParticipant, error)

ListParticipant returns participants of a site or all participant registered in FML manager

func (*ProjectApp) LoadSite

func (app *ProjectApp) LoadSite() (*entity.Site, error)

LoadSite is a helper function to return site entity object

func (*ProjectApp) ProcessInvitation

func (app *ProjectApp) ProcessInvitation(req *ProjectInvitationRequest) error

ProcessInvitation processes the invitation from FML manager

func (*ProjectApp) ProcessInvitationResponse

func (app *ProjectApp) ProcessInvitationResponse(uuid string, accepted bool) error

ProcessInvitationResponse handles the invitation response

func (*ProjectApp) ProcessInvitationRevocation

func (app *ProjectApp) ProcessInvitationRevocation(uuid string) error

ProcessInvitationRevocation handles the invitation revocation

func (*ProjectApp) ProcessParticipantDismissal

func (app *ProjectApp) ProcessParticipantDismissal(projectUUID string, siteUUID string) error

ProcessParticipantDismissal processes participant dismissal event

func (*ProjectApp) ProcessParticipantInfoUpdate

func (app *ProjectApp) ProcessParticipantInfoUpdate(participant *ProjectParticipantBase) error

ProcessParticipantInfoUpdate processes participant info update event by updating impacted repo records

func (*ProjectApp) ProcessParticipantLeaving

func (app *ProjectApp) ProcessParticipantLeaving(projectUUID string, siteUUID string) error

ProcessParticipantLeaving processes participant leaving event by updating the repo record

func (*ProjectApp) ProcessParticipantUnregistration

func (app *ProjectApp) ProcessParticipantUnregistration(siteUUID string) error

ProcessParticipantUnregistration processes participant unregistration event if siteUUID is empty the current site uuid will be used

func (*ProjectApp) ProcessProjectClosing

func (app *ProjectApp) ProcessProjectClosing(projectUUID string) error

ProcessProjectClosing processes project closing event

func (*ProjectApp) RemoveDataAssociation

func (app *ProjectApp) RemoveDataAssociation(projectUUID, dataUUID string) error

RemoveDataAssociation dismisses the local data association

func (*ProjectApp) RemoveProjectParticipants

func (app *ProjectApp) RemoveProjectParticipants(projectUUID string, siteUUID string) error

RemoveProjectParticipants removes joined participant or revoke invitation

func (*ProjectApp) SyncProject

func (app *ProjectApp) SyncProject() error

SyncProject sync remote projects related to current site

func (*ProjectApp) SyncProjectData

func (app *ProjectApp) SyncProjectData(projectUUID string) error

SyncProjectData sync data association status of a project from the fml manager

func (*ProjectApp) SyncProjectParticipant

func (app *ProjectApp) SyncProjectParticipant(projectUUID string) error

SyncProjectParticipant sync participant status of a project from the fml manager

func (*ProjectApp) ToggleAutoApprovalStatus

func (app *ProjectApp) ToggleAutoApprovalStatus(uuid string, status *ProjectAutoApprovalStatus) error

ToggleAutoApprovalStatus changes the project's auto-approval status

type ProjectAutoApprovalStatus

type ProjectAutoApprovalStatus struct {
	Enabled bool `json:"enabled"`
}

ProjectAutoApprovalStatus is a container for holding the auto-approval status value

type ProjectCreationRequest

type ProjectCreationRequest struct {
	Name                string `json:"name"`
	Description         string `json:"description"`
	AutoApprovalEnabled bool   `json:"auto_approval_enabled"`
}

ProjectCreationRequest is the request for creating a new local project

type ProjectData

type ProjectData struct {
	Name                 string    `json:"name"`
	Description          string    `json:"description"`
	DataID               string    `json:"data_id"`
	CreationTime         time.Time `json:"creation_time"`
	UpdatedTime          time.Time `json:"update_time"`
	ProvidingSiteUUID    string    `json:"providing_site_uuid"`
	ProvidingSiteName    string    `json:"providing_site_name"`
	ProvidingSitePartyID uint      `json:"providing_site_party_id"`
	IsLocal              bool      `json:"is_local"`
}

ProjectData contains information of an associated project data

type ProjectDataAssociationRequest

type ProjectDataAssociationRequest struct {
	Name     string `json:"name"`
	DataUUID string `json:"data_id"`
}

ProjectDataAssociationRequest is the request to associate a local data to a project

type ProjectInfo

type ProjectInfo struct {
	ProjectListItemBase
	AutoApprovalEnabled bool `json:"auto_approval_enabled"`
}

ProjectInfo is the detailed project info

type ProjectInvitationRequest

type ProjectInvitationRequest struct {
	UUID                       string    `json:"uuid"`
	SiteUUID                   string    `json:"site_uuid"`
	SitePartyID                uint      `json:"site_party_id"`
	ProjectUUID                string    `json:"project_uuid"`
	ProjectName                string    `json:"project_name"`
	ProjectDescription         string    `json:"project_description"`
	ProjectAutoApprovalEnabled bool      `json:"project_auto_approval_enabled"`
	ProjectManager             string    `json:"project_manager"`
	ProjectManagingSiteName    string    `json:"project_managing_site_name"`
	ProjectManagingSitePartyID uint      `json:"project_managing_site_party_id"`
	ProjectManagingSiteUUID    string    `json:"project_managing_site_uuid"`
	ProjectCreationTime        time.Time `json:"project_creation_time"`
}

ProjectInvitationRequest is the request a site received for joining a project

type ProjectList

type ProjectList struct {
	JoinedProject  []ProjectListItem       `json:"joined_projects"`
	PendingProject []ProjectListItemBase   `json:"invited_projects"`
	ClosedProject  []ProjectListItemClosed `json:"closed_projects"`
}

ProjectList contains joined projects and pending projects

type ProjectListItem

type ProjectListItem struct {
	ProjectListItemBase
	ParticipantsNum int64 `json:"participants_num"`
	LocalDataNum    int64 `json:"local_data_num"`
	RemoteDataNum   int64 `json:"remote_data_num"`
	RunningJobNum   int64 `json:"running_job_num"`
	SuccessJobNum   int64 `json:"success_job_num"`
	PendingJobExist bool  `json:"pending_job_exist"`
}

ProjectListItem contains basic info of a project plus data & job statistics

type ProjectListItemBase

type ProjectListItemBase struct {
	Name                string    `json:"name"`
	Description         string    `json:"description"`
	UUID                string    `json:"uuid"`
	CreationTime        time.Time `json:"creation_time"`
	Manager             string    `json:"manager"`
	ManagingSiteName    string    `json:"managing_site_name"`
	ManagingSitePartyID uint      `json:"managing_site_party_id"`
	ManagedByThisSite   bool      `json:"managed_by_this_site"`
}

ProjectListItemBase contains basic info of a project

type ProjectListItemClosed

type ProjectListItemClosed struct {
	ProjectListItemBase
	ClosingStatus string `json:"closing_status"`
}

ProjectListItemClosed is a closed project

type ProjectParticipant

type ProjectParticipant struct {
	ProjectParticipantBase
	CreationTime  time.Time                       `json:"creation_time"`
	Status        entity.ProjectParticipantStatus `json:"status"`
	IsCurrentSite bool                            `json:"is_current_site"`
}

ProjectParticipant contains info of a project participant

type ProjectParticipantBase

type ProjectParticipantBase struct {
	UUID        string `json:"uuid"`
	PartyID     uint   `json:"party_id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

ProjectParticipantBase contains the basic info of a participant

type ProjectResourceSyncRequest

type ProjectResourceSyncRequest struct {
	ProjectUUID string `json:"project_uuid"`
}

ProjectResourceSyncRequest is the request to sync certain project resource

type PublicUser

type PublicUser struct {
	Name string `json:"name"`
	ID   uint   `json:"id"`
	UUID string `json:"uuid"`
	valueobject.UserPermissionInfo
}

PublicUser represents a user info viewable to the public

type PwdChangeInfo

type PwdChangeInfo struct {
	CurPassword string `json:"cur_password"`
	NewPassword string `json:"new_password"`
}

PwdChangeInfo represents fields related with login

type RemoteJobCreationRequest

type RemoteJobCreationRequest struct {
	JobSubmissionRequest
	Username string `json:"username"`
	UUID     string `json:"uuid"`
}

RemoteJobCreationRequest is a request for creating a record of a job that is initiated by other sites

type SiteApp

type SiteApp struct {
	// SiteRepo is the repository for persisting site info
	SiteRepo repo.SiteRepository
}

SiteApp provide functions to manage the site

func (*SiteApp) GetSite

func (app *SiteApp) GetSite() (*entity.Site, error)

GetSite returns the site information

func (*SiteApp) RegisterToFMLManager

func (app *SiteApp) RegisterToFMLManager(connectionInfo *FMLManagerConnectionInfo) error

RegisterToFMLManager connects to fml manager and register the current site

func (*SiteApp) TestFATEFlowConnection

func (app *SiteApp) TestFATEFlowConnection(connectionInfo *FATEFlowConnectionInfo) error

TestFATEFlowConnection tests the connection to fate flow service

func (*SiteApp) TestKubeflowConnection

func (app *SiteApp) TestKubeflowConnection(connectionInfo *valueobject.KubeflowConfig) error

TestKubeflowConnection tests the connection to Kubernetes and if it has KFServing installed

func (*SiteApp) UnregisterFromFMLManager

func (app *SiteApp) UnregisterFromFMLManager() error

UnregisterFromFMLManager connects to fml manager and unregister the current site

func (*SiteApp) UpdateSite

func (app *SiteApp) UpdateSite(updatedSiteInfo *entity.Site) error

UpdateSite updates the site info

type TrainingJobResultInfo

type TrainingJobResultInfo struct {
	EvaluationInfo map[string]string `json:"evaluation_info"`
}

TrainingJobResultInfo is a key-value map containing the trained model evaluation info

type UserApp

type UserApp struct {
	UserRepo repo.UserRepository
}

UserApp provides user management service

func (*UserApp) CheckAccess

func (app *UserApp) CheckAccess(publicUser *PublicUser) error

CheckAccess validates if the user can access site portal

func (*UserApp) GetUsers

func (app *UserApp) GetUsers() ([]PublicUser, error)

GetUsers returns all the available users as a list of PublicUser

func (*UserApp) Login

func (app *UserApp) Login(info *LoginInfo) (*PublicUser, error)

Login validates the loginInfo and returns a publicUser object on success

func (*UserApp) UpdateUserPassword

func (app *UserApp) UpdateUserPassword(userId int, info *PwdChangeInfo) error

UpdateUserPassword changes a user's password

func (*UserApp) UpdateUserPermission

func (app *UserApp) UpdateUserPermission(publicUser *PublicUser) error

UpdateUserPermission changes a user's valueobject.UserPermissionInfo

Jump to

Keyboard shortcuts

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