common

package
v1.2.0-rc Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultTenant is the name of the cyclone default tenant, it's a default tenant created
	// when Cyclone start.
	DefaultTenant = "system"

	// TenantNamespacePrefix is the prefix of namespace which related to a specific tenant
	TenantNamespacePrefix = "cyclone-"

	// TenantPVCPrefix is the prefix of pvc which related to a specific tenant
	TenantPVCPrefix = "cyclone-pvc-"

	// DefaultPVCSize is the default size of pvc
	DefaultPVCSize = "5Gi"

	// SceneCICD is the label value used to indicate cyclone CI/CD scenario
	SceneCICD = "cicd"

	// SceneAI is the label value used to indicate cyclone AI scenario
	SceneAI = "ai"

	// CronTimerTrigger represents the trigger of workflowruns triggered by cron timer.
	CronTimerTrigger = "cron-timer"

	// QuotaCPULimit represents default value of 'limits.cpu'
	QuotaCPULimit = "2"
	// QuotaCPURequest represents default value of 'requests.cpu'
	QuotaCPURequest = "1"
	// QuotaMemoryLimit represents default value of 'limits.memory'
	QuotaMemoryLimit = "4Gi"
	// QuotaMemoryRequest represents default value of 'requests.memory'
	QuotaMemoryRequest = "2Gi"

	// SecretKeyIntegration is the key of the secret dada to indicate its value is about integration information.
	SecretKeyIntegration = "integration"

	// CachePrefixPath is the prefix path of acceleration caches
	CachePrefixPath = "caches"

	// DefaultCacheVolumeName is name of the default acceleration cache PV used by all workflow stages.
	DefaultCacheVolumeName = "default-cache-pv"

	// CacheCleanupContainerName is container name of the pod used to cleanup acceleration cache.
	CacheCleanupContainerName = "cache-cleaner"

	// CycloneHome is the home folder for Cyclone.
	CycloneHome = "/var/lib/cyclone"
)

Variables

This section is empty.

Functions

func CreateNamespace

func CreateNamespace(tenant string, client *kubernetes.Clientset) error

CreateNamespace creates a namespace

func CreateResourceQuota

func CreateResourceQuota(tenant *api.Tenant, namespace string, client *kubernetes.Clientset) error

CreateResourceQuota creates resource quota for tenant

func NamespaceTenant

func NamespaceTenant(n string) string

NamespaceTenant retrieves tenant from given namespace name.

func ParseResourceList

func ParseResourceList(resources map[core_v1.ResourceName]string) (map[core_v1.ResourceName]resource.Quantity, error)

ParseResourceList parse resouces from 'map[string]string' to 'ResourceList'

func ResourceQuotaName added in v1.2.0

func ResourceQuotaName(namespace string) string

ResourceQuotaName returns resource quota name according to the namespace. Currently the name of resource quota is the same as namespace.

func TenantNamespace

func TenantNamespace(tenant string) string

TenantNamespace gets namespace from given tenant name.

func TenantPVC

func TenantPVC(tenant string) string

TenantPVC returns pvc name related to the tenant

func UpdateResourceQuota

func UpdateResourceQuota(tenant *api.Tenant, namespace string, client *kubernetes.Clientset) error

UpdateResourceQuota updates resource quota for tenant

Types

This section is empty.

Jump to

Keyboard shortcuts

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