kube

package
v0.0.0-...-a4c789b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllNamespaces

func AllNamespaces() (string, error)

AllNamespaces lists all the namespaces in the system.

func CreateNameSpace

func CreateNameSpace(courseName string) error

CreateNameSpace creates a new namespace which will contain all the dependencies of a Course.

func DeleteNameSpace

func DeleteNameSpace(courseName string) error

DeleteNameSpace deletes a namespace that represents a specific Course. Warning: This method will delete all the Course's objects and its dependencies from the system.

Types

type Container

type Container struct {
	Image    string
	Commands []string
}

Container contains the Base Docker Image and the Commands. These describe the task that has to be executed in the Container of a K8s Job object.

type K8s

type K8s struct {
	// contains filtered or unexported fields
}

K8s is an implementation of the Kube interface using K8s.

func (*K8s) KRun

func (k *K8s) KRun(ctx context.Context, task *Container, id string, courseName string, secretAg string) (string, error)

KRun implements the Kube Interface. This method creates a K8s Job and Secret Object. The Job object takes the task from the Autograder, and run it in a Docker Container. The Job Object will be created in the spesified NameSpace by the Parameter "courseName". Tasks can run in parallel. The method will not return before the Job is on completed status.

type KRunner

type KRunner interface {
	// Run should synchronously execute the described Container and return the output.
	KRun(context.Context, *Container, string, string, string) (string, error)
}

KRunner contains methods for configuring a K8s Job Object to run the user-provided code in isolation.

Jump to

Keyboard shortcuts

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