libetcd

package
v0.0.0-...-2a1f405 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRuncConfig

func GenerateRuncConfig(containerName string, hostname string, rootfs string) *configs.Config

! Assemble and return a libcontainer config.

  • @param string pseudo-random name of container
  • @param string given hostname
  • @param string rootfs *
  • @return configs.Config libcontainer config

func StartEtcdServerBackgroundProcess

func StartEtcdServerBackgroundProcess(namespace string) error

! Function to start etcd in the background.

  • @param string namespace *
  • @return error error message, if any

Types

type Element

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

The element definition, which are individuals in the queue.

type EtcdInstance

type EtcdInstance struct {

	// Client pointer to the server itself.
	Client *clientv3.Client

	// List of current processes.
	ProcessesList map[int64]*Process
	// contains filtered or unexported fields
}

Etcd instance structure, which holds a pointer to the client and nodes.

func CreateEtcdInstance

func CreateEtcdInstance(namespace string, rootfs string) (inst *EtcdInstance,
	err error)

! Creates a new EtcdInstance and returns a pointer to it.

  • @param string network namespace
  • @param string rootfs path *
  • @return EtcdInstance pointer to the obj
  • error message of the error, nil if none

func (*EtcdInstance) AddToGlobalQueue

func (inst *EtcdInstance) AddToGlobalQueue(j Job) (int64, error)

! Add a job to the scheduler queue.

  • @param Job given job *
  • @return int64 Uuid
  • @return error error message, if any

func (*EtcdInstance) InitNode

func (inst *EtcdInstance) InitNode() (chan bool, error)

! Initialize the nodes.

  • @return chan newly initialized node comm channel
  • @return error error message, if any

func (*EtcdInstance) ObtainProcess

func (inst *EtcdInstance) ObtainProcess(Uuid int64) (p *Process, err error)

! Grab the process from the global list of processes.

  • @param int64 process Uuid *
  • @return Process the process information
  • @return error error message, if any

func (*EtcdInstance) QueueJobOnNode

func (inst *EtcdInstance) QueueJobOnNode(hostID string, j *Job) error

! Hand the job off to the job list of a node.

  • @param string host id
  • @param Job given job to add to node

func (*EtcdInstance) StartProcess

func (inst *EtcdInstance) StartProcess(j Job) (p Process, err error)

! Function to start a process, as per the global rootfs.

  • @param Job given job
  • @param string rootfs *
  • @return Process newly generated process
  • @return error error message, if any

func (*EtcdInstance) StopProcess

func (inst *EtcdInstance) StopProcess(p Process) error

! Function to stop a process, as per the global rootfs.

  • @param Process given process to stop *
  • @return error error message, if any

type Job

Jobs are merely gRPC obj refs.

type Node

type Node struct {
	HostName string
	HostID   string
}

The node definition.

type Process

type Process struct {

	// Id generated via lcluster
	Uuid int64

	Proc *libcontainer.Process
	// contains filtered or unexported fields
}

The process definition.

type Scheduler

type Scheduler struct {

	// holds the current queue
	Queue []*Element
}

The scheduler definition, which holds the queue.

Jump to

Keyboard shortcuts

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