Documentation ¶
Index ¶
- Constants
- Variables
- func BuildNodeAffinity(nodePools []config.NodePool) *corev1.Affinity
- func CalculateHelperContainerResources(res corev1.ResourceRequirements, gpuResourceName string) corev1.ResourceRequirements
- func EvaluatePublicKey(sshURL string) (string, error)
- func ExtractHost(gitURL string) (string, error)
- func ExtractUserInfoFromToken(token string, config config.Claims) (*user.UserInfo, error)
- func NewClient(cache cache.Cache, config *rest.Config, options client.Options) (client.Client, error)
- func NewManager(opts ctrl.Options) (manager.Manager, error)
- func SetupLogger()
- func StreamLogs(k8sConfig *rest.Config, namespace string, podName string, containerName string, ...) error
- func TektonContainerName(stepName string) string
- func Unzip(src string, dest string) error
- func ZipDir(source, target string) error
- type Writer
Constants ¶
const (
LogFlushSize = 32
)
const PublicSSHKeyName = "ssh_known_hosts"
Variables ¶
var ( ErrMalformedJWT = errors.New("malformed JWT") ErrClaimExtraction = errors.New("claim extraction failed") )
Errors
var ( DefaultHelperLimits = corev1.ResourceList{ corev1.ResourceCPU: k8s_resource.MustParse("128m"), corev1.ResourceMemory: k8s_resource.MustParse("128Mi"), } EmptyHelperContainerRequestRes = corev1.ResourceList{ corev1.ResourceMemory: *k8s_resource.NewQuantity(0, k8s_resource.DecimalSI), corev1.ResourceCPU: *k8s_resource.NewQuantity(0, k8s_resource.DecimalSI), } )
var (
SSHURLRegexp = regexp.MustCompile(`(?P<Users>.+)@(?P<Host>[\w.]+)[/:].*`)
)
Functions ¶
func BuildNodeAffinity ¶
Build affinity that matches all nodes from nodePools list
func CalculateHelperContainerResources ¶
func CalculateHelperContainerResources( res corev1.ResourceRequirements, gpuResourceName string, ) corev1.ResourceRequirements
Resources of helper containers are copy of main trainer/packager resources, but limit doesn't contain GPU part and all requests res are zeroes. If core limit resources is nill then defaultHelperLimits will be used.
func EvaluatePublicKey ¶
TODO: Need to find a better solution. The best way is use standard library.
func ExtractHost ¶
TODO: Need to find a better solution. url.Parse can't find a host url.Parse with git+ssh://url does not evaluate a valid host.
func StreamLogs ¶
func StreamLogs( k8sConfig *rest.Config, namespace string, podName string, containerName string, writer Writer, follow bool, logFlushSize int64, ) error
Stream logs from the pod to the writer object k8sConfig - kubernetes config namespace - namespace where pod is located podName - kubernetes pod name containerName - container name of the pod writer - logs will be streamed into this writer follow - specify if the logs should be streamed logFlushSize - size of the flushed logs per chunk
func TektonContainerName ¶
Generate tekton container name base on the step name
Types ¶
Directories ¶
Path | Synopsis |
---|---|
model_registry
|
|
objectstorage
Package object_storage provides API to fetch model files and metadata from s3/azureblob/gcs with minimum requirements to model files.
|
Package object_storage provides API to fetch model files and metadata from s3/azureblob/gcs with minimum requirements to model files. |