config

package
v0.0.0-...-ebe581b Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitCliConfig

func InitCliConfig(configPath string) error

InitCliConfig parses client configuration file. if cli's configuration file is not existed, use executor's configuration file.

func InitConfig

func InitConfig(configPath string) error

InitConfig parses configuration file

Types

type ExecutorBlockchainConf

type ExecutorBlockchainConf struct {
	Type   string
	Xchain *XchainConf
	Fabric *FabricConf
}

ExecutorBlockchainConf defines the configuration required to invoke blockchain contracts

func GetCliConf

func GetCliConf() *ExecutorBlockchainConf

GetCliConf returns blockchain configuration of the executor

type ExecutorConf

type ExecutorConf struct {
	Name            string // executor node name
	ListenAddress   string // the port on which the executor node is listening
	PublicAddress   string // local grpc host
	PrivateKey      string // private key
	PaddleFLAddress string
	PaddleFLRole    int
	KeyPath         string            // key path, include private key and public key
	HttpServer      *HttpServerConf   // include executor node's httpserver configuration
	Mode            *ExecutorModeConf // the task execution type
	Mpc             *ExecutorMpcConf
	Storage         *ExecutorStorageConf // model storage and prediction results storage
	Blockchain      *ExecutorBlockchainConf
}

ExecutorConf defines the configuration info required for excutor node startup, and convert it to a struct by parsing 'conf/config.toml'.

func GetExecutorConf

func GetExecutorConf() *ExecutorConf

GetExecutorConf returns all configuration of the executor

type ExecutorModeConf

type ExecutorModeConf struct {
	Type string
	Self *XuperDBConf
}

ExecutorModeConf defines the task execution type, such as proxy-execution or self-execution. "Self" is suitable for the executor node and the dataOwner node are the same organization and execute by themselves, and the executor node can download sample files from the dataOwner node without permission application.

type ExecutorMpcConf

type ExecutorMpcConf struct {
	TrainTaskLimit   int
	PredictTaskLimit int
	RpcTimeout       int // rpc request timeout between executor nodes
	TaskLimitTime    int
}

ExecutorMpcConf defines the features of the mpc process

type ExecutorStorageConf

type ExecutorStorageConf struct {
	Type                       string
	LocalModelStoragePath      string
	LocalEvaluationStoragePath string
	LiveEvaluationStoragePath  string // live evaluation results storage path
	XuperDB                    *XuperDBConf
	Local                      *PredictLocalConf
}

ExecutorStorageConf defines the storage used by the executor, include model storage and prediction results storage, and evaluation storage and live evaluation storage. the prediction results storage support 'XuperDB' and 'Local' two storage mode.

type FabricConf

type FabricConf struct {
	ConfigFile string
	ChannelID  string
	Chaincode  string
	UserName   string
	OrgName    string
}

type HttpServerConf

type HttpServerConf struct {
	Switch      string
	HttpAddress string
	HttpPort    string
	AllowCros   bool
}

HttpServerConf defines the configuration required to start the executor node's httpserver 'AllowCros' decides whether to allow cross-domain requests, the default is false

type Log

type Log struct {
	Level string
	Path  string
}

Log defines the storage path of the logs generated by the executor node at runtime

func GetLogConf

func GetLogConf() *Log

GetLogConf returns log configuration of the executor

type PredictLocalConf

type PredictLocalConf struct {
	LocalPredictStoragePath string
}

PredictLocalConf defines the local path of prediction results storage

type XchainConf

type XchainConf struct {
	Mnemonic        string
	ContractName    string
	ContractAccount string
	ChainAddress    string
	ChainName       string
}

type XuperDBConf

type XuperDBConf struct {
	PrivateKey string
	Host       string
	KeyPath    string
	NameSpace  string
	ExpireTime int64
}

XuperDBConf defines the XuperDB's endpoint, used to upload or download files

Jump to

Keyboard shortcuts

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