common

package
v0.0.0-...-89e5b94 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 50

Documentation

Index

Constants

View Source
const (
	// LabelPortScope represents port usage scope. Its values may be Local, Domain, Cluster. Refer to PortScope for more details.
	LabelPortScope = "kuscia.secretflow/port-scope"
	// LabelPortName represents port name which defined in AppImage container port.
	LabelPortName = "kuscia.secretflow/port-name"

	LabelController                      = "kuscia.secretflow/controller"
	LabelGatewayProxy                    = "kuscia.secretflow/gateway-proxy"
	LabelLoadBalancer                    = "kuscia.secretflow/loadbalancer"
	LabelCommunicationRoleServer         = "kuscia.secretflow/communication-role-server"
	LabelCommunicationRoleClient         = "kuscia.secretflow/communication-role-client"
	LabelDomainName                      = "kuscia.secretflow/domain-name"
	LabelDomainAuth                      = "kuscia.secretflow/domain-auth"
	LabelNodeNamespace                   = "kuscia.secretflow/namespace"
	LabelDomainDeleted                   = "kuscia.secretflow/deleted"
	LabelDomainRole                      = "kuscia.secretflow/role"
	LabelInterConnProtocols              = "kuscia.secretflow/interconn-protocols"
	LabelResourceVersionUnderHostCluster = "kuscia.secretflow/resource-version-under-host-cluster"
	LabelTaskUnschedulable               = "kuscia.secretflow/task-unschedulable"
	LabelHasSynced                       = "kuscia.secretflow/has-synced"
	LabelDomainDataType                  = "kuscia.secretflow/domaindata-type"
	LabelDomainDataID                    = "kuscia.secretflow/domaindataid"
	LabelDomainDataVendor                = "kuscia.secretflow/domaindata-vendor"
	LabelDomainDataSourceType            = "kuscia.secretflow/domaindatasource-type"
	LabelDomainDataGrantVendor           = "kuscia.secretflow/domaindatagrant-vendor"
	LabelDomainDataGrantDomain           = "kuscia.secretflow/domaindatagrant-domain"

	// LabelInterConnProtocolType is a label to specify the interconn protocol type of job
	// For KusciaJob, it's only used for partner job
	LabelInterConnProtocolType = "kuscia.secretflow/interconn-protocol-type"
	LabelJobUID                = "kuscia.secretflow/job-uid"
	LabelTaskUID               = "kuscia.secretflow/task-uid"
	LabelTaskResourceGroupUID  = "kuscia.secretflow/task-resource-group-uid"

	LabelJobAutoApproval = "kuscia.secretflow/job-auto-approval"
	// LabelJobStage is a label to specify the current stage of job.
	LabelJobStage = "kuscia.secretflow/job-stage"
	// LabelJobStageTrigger is a label to specify who trigger the current stage of job.
	LabelJobStageTrigger = "kuscia.secretflow/job-stage-trigger"
	LabelJobStageVersion = "kuscia.secretflow/job-stage-version"

	LabelKusciaDeploymentAppType  = "kuscia.secretflow/app-type"
	LabelKusciaDeploymentUID      = "kuscia.secretflow/kd-uid"
	LabelKusciaDeploymentName     = "kuscia.secretflow/kd-name"
	LabelKubernetesDeploymentName = "kuscia.secretflow/deployment-name"
	LabelKusciaOwnerNamespace     = "kuscia.secretflow/owner_namespace"

	LabelNodeName        = "kuscia.secretflow/node"
	LabelPodUID          = "kuscia.secretflow/pod-uid"
	LabelOwnerReferences = "kuscia.secretflow/owner-references"

	LabelDomainRoutePartner = "kuscia.secertflow/domainroute-partner"
)

labels

View Source
const (
	PluginNameCertIssuance  = "cert-issuance"
	PluginNameConfigRender  = "config-render"
	PluginNameImageSecurity = "image-security"
	PluginNameEnvImport     = "env-import"
)
View Source
const (
	KusciaSchedulerName        = "kuscia-scheduler"
	KusciaCrossDomain          = "cross-domain"
	JobCustomFieldsLabelPrefix = "kuscia.job.custom-fields/"
	ReceiverServiceName        = "receiver"
)
View Source
const (
	InitiatorAnnotationKey              = "kuscia.secretflow/initiator"
	SelfClusterAsInitiatorAnnotationKey = "kuscia.secretflow/self-cluster-as-initiator"

	// InterConnKusciaPartyAnnotationKey is a annotation which has parties interconnected with kuscia protocol,
	// the value is a series of domain id join with '_', such as alice_bob_carol .
	InterConnKusciaPartyAnnotationKey = "kuscia.secretflow/interconn-kuscia-parties"

	// InterConnBFIAPartyAnnotationKey is a annotation which has parties interconnected with bfia protocol,
	// the value is a series of domain id join with '_', such as alice_bob_carol .
	InterConnBFIAPartyAnnotationKey = "kuscia.secretflow/interconn-bfia-parties"

	InitiatorMasterDomainAnnotationKey   = "kuscia.secretflow/initiator-master-domain"
	InterConnSelfPartyAnnotationKey      = "kuscia.secretflow/interconn-self-parties"
	KusciaPartyMasterDomainAnnotationKey = "kuscia.secretflow/party-master-domain"

	TaskSummaryResourceVersionAnnotationKey = "kuscia.secretflow/tasksummary-resource-version"

	JobIDAnnotationKey             = "kuscia.secretflow/job-id"
	TaskIDAnnotationKey            = "kuscia.secretflow/task-id"
	TaskAliasAnnotationKey         = "kuscia.secretflow/task-alias"
	TaskResourceGroupAnnotationKey = "kuscia.secretflow/task-resource-group"

	AccessDomainAnnotationKey = "kuscia.secretflow/access-domain"
	ProtocolAnnotationKey     = "kuscia.secretflow/protocol"
	ReadyTimeAnnotationKey    = "kuscia.secretflow/ready-time"

	ConfigTemplateVolumesAnnotationKey = "kuscia.secretflow/config-template-volumes"

	TaskResourceReservingTimestampAnnotationKey = "kuscia.secretflow/taskresource-reserving-timestamp"

	ComponentSpecAnnotationKey  = "kuscia.secretflow/component-spec"
	AllocatedPortsAnnotationKey = "kuscia.secretflow/allocated-ports"
	ImageIDAnnotationKey        = "kuscia.secretflow/image-id"
)

annotations

View Source
const (
	EnvTaskID              = "TASK_ID"
	EnvServingID           = "SERVING_ID"
	EnvInputConfig         = "INPUT_CONFIG"
	EnvClusterDefine       = "CLUSTER_DEFINE"
	EnvTaskInputConfig     = "TASK_INPUT_CONFIG"
	EnvTaskClusterDefine   = "TASK_CLUSTER_DEFINE"
	EnvAllocatedPorts      = "ALLOCATED_PORTS"
	EnvServerCertFile      = "SERVER_CERT_FILE"
	EnvServerKeyFile       = "SERVER_PRIVATE_KEY_FILE"
	EnvClientCertFile      = "CLIENT_CERT_FILE"
	EnvClientKeyFile       = "CLIENT_PRIVATE_KEY_FILE"
	EnvTrustedCAFile       = "TRUSTED_CA_FILE"
	EnvDomainID            = "KUSCIA_DOMAIN_ID"
	EnvPortNumber          = "KUSCIA_PORT_%s_NUMBER"
	EnvKusciaAPIProtocol   = "KUSCIA_API_PROTOCOL"
	EnvKusciaAPIToken      = "KUSCIA_API_TOKEN"
	EnvKusciaDomainKeyData = "KUSCIA_DOMAIN_KEY_DATA"
)

Environment variables issued to the pod.

View Source
const (
	KusciaSourceKey      = "kuscia.secretflow/clusterdomainroute-source"
	KusciaDestinationKey = "kuscia.secretflow/clusterdomainroute-destination"
)
View Source
const (
	// PodIdentityGroupInternal means the pod is created locally. The pod may be a static pod.
	PodIdentityGroupInternal = "internal"
	// PodIdentityGroupExternal means the pod is created remotely, usually apiserver.
	PodIdentityGroupExternal = "external"

	True  = "true"
	False = "false"
)
View Source
const (
	DefaultDataSourceID          = "default-data-source"
	DefaultDataProxyDataSourceID = "default-dp-data-source"

	DefaultDomainDataVendor = "manual"
	DomainDataVendorGrant   = "grant"
)
View Source
const (
	DomainDataSourceTypeLocalFS        = "localfs"
	DomainDataSourceTypeOSS            = "oss"
	DomainDataSourceTypeMysql          = "mysql"
	DefaultDomainDataSourceLocalFSPath = "var/storage/data"
)
View Source
const (
	RunModeMaster   = "master"
	RunModeAutonomy = "autonomy"
	RunModeLite     = "lite"
)
View Source
const (
	DefaultSecretBackendName = "default"
	DefaultSecretBackendType = "mem"
)
View Source
const (
	CertPrefix   = "var/certs/"
	LogPrefix    = "var/logs/"
	StdoutPrefix = "var/stdout/"
	TmpPrefix    = "var/tmp/"
	ConfPrefix   = "etc/conf/"
)
View Source
const (
	DeployTokenUsedState   = "used"
	DeployTokenUnusedState = "unused"
)
View Source
const DomainCsrExtensionID = "1.2.3.4"
View Source
const (
	GatewayLiveTimeout = 3 * time.Minute
)
View Source
const (
	KusciaTaintTolerationKey = "kuscia.secretflow/agent"
)

Variables

This section is empty.

Functions

func ArrowSchema2DataMeshColumns

func ArrowSchema2DataMeshColumns(schema *arrow.Schema) ([]*pbv1alpha1.DataColumn, error)

func Convert2ArrowColumnType

func Convert2ArrowColumnType(colType string) arrow.DataType

func Convert2DataMeshColumnType

func Convert2DataMeshColumnType(colType arrow.DataType) string

func Convert2KubeColumn

func Convert2KubeColumn(cols []*pbv1alpha1.DataColumn) []k8sv1alpha1.DataColumn

func Convert2KubeFileFormat

func Convert2KubeFileFormat(format pbv1alpha1.FileFormat) string

func Convert2KubePartition

func Convert2KubePartition(partition *pbv1alpha1.Partition) *k8sv1alpha1.Partition

func Convert2PbColumn

func Convert2PbColumn(cols []k8sv1alpha1.DataColumn) []*pbv1alpha1.DataColumn

func Convert2PbFileFormat

func Convert2PbFileFormat(format string) pbv1alpha1.FileFormat

func Convert2PbPartition

func Convert2PbPartition(partition *k8sv1alpha1.Partition) (pbPartition *pbv1alpha1.Partition)

func CopySameMemberTypeStruct

func CopySameMemberTypeStruct(dst, src interface{}) error

func GenDomainDataID

func GenDomainDataID(dataName string) (dataID string)

func GenDomainRouteName

func GenDomainRouteName(src, dest string) string

func GenerateClusterName

func GenerateClusterName(source, dest, portName string) string

func MergeDomainData

func MergeDomainData(originalDomainData, modifiedDomainData *v1alpha1.DomainData) (patchBytes, originalJSON, modifiedJSON []byte, err error)

func MergeDomainDataSource

func MergeDomainDataSource(originalDomainDataSource, modifiedDomainDataSource *v1alpha1.DomainDataSource) (patchBytes, originalJSON,
	modifiedJSON []byte, err error)

Types

type CommunicationProtocol

type CommunicationProtocol string

type KusciaDeploymentAppType

type KusciaDeploymentAppType string
const (
	ServingApp KusciaDeploymentAppType = "serving"
	SCQLApp    KusciaDeploymentAppType = "scql"
)

type LoadBalancerType

type LoadBalancerType string
const (
	DomainRouteLoadBalancer LoadBalancerType = "domainroute"
)

type Protocol

type Protocol string
const (
	NOTLS Protocol = "NOTLS"
	TLS   Protocol = "TLS"
	MTLS  Protocol = "MTLS"
)

func (*Protocol) UnmarshalYAML

func (protocol *Protocol) UnmarshalYAML(unmarshal func(interface{}) error) error

yaml profile conversion for Protocol

type RunModeType

type RunModeType = string

Jump to

Keyboard shortcuts

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