server

package module
v0.0.0-...-e39673c Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: NCSA Imports: 47 Imported by: 1

README

Server

Config Options

server:
  number_of_workers: 2
	disable_rai_docker_namespace_protection: true | false
  rlimit_file_soft: 50000
  rlimit_file_hard: 50000

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Config = &serverConfig{
		done: make(chan struct{}),
	}

	DefaultRLimitFileSoft uint64 = 500000
	DefaultRLimitFileHard uint64 = 500000
)
View Source
var (
	DefaultContainerBuildDirectory  = "/build"
	DefaultContainerSourceDirectory = "/src"
)
View Source
var (
	DefaultUploadExpiration = func() time.Time {
		return time.Now().AddDate(0, 6, 0)
	}
)

Functions

This section is empty.

Types

type Dispatcher

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

func StartDispatcher

func StartDispatcher(numWorkers int64) *Dispatcher

func (*Dispatcher) Stop

func (d *Dispatcher) Stop()

type Option

type Option func(*Options)

func ClientAppName

func ClientAppName(s string) Option

func ClientUploadBucketName

func ClientUploadBucketName(s string) Option

func ClientUploadDestinationDirectory

func ClientUploadDestinationDirectory(s string) Option

func ContainerBuildDirectory

func ContainerBuildDirectory(s string) Option

func ContainerSourceDirectory

func ContainerSourceDirectory(s string) Option

func GPUAffinity

func GPUAffinity(n int) Option

func JobQueueName

func JobQueueName(s string) Option

func NumWorkers

func NumWorkers(n int) Option

func OnClose

func OnClose(f func()) Option

OnClose ...

func OnWorkerClose

func OnWorkerClose(f func()) Option

OnWorkerClose ...

func Stderr

func Stderr(s io.WriteCloser) Option

func Stdout

func Stdout(s io.WriteCloser) Option

func TimeLimit

func TimeLimit(d time.Duration) Option

type Options

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

type Server

type Server struct {
	ID string

	// BeforeShutdown is an optional callback function that is called
	// before the server is closed.
	BeforeShutdown func()

	// AfterShutdown is an optional callback function that is called
	// after the server is closed.
	AfterShutdown func()
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) Connect

func (s *Server) Connect() error

func (*Server) Disconnect

func (s *Server) Disconnect() error

type WorkRequest

type WorkRequest struct {
	*model.JobRequest
	// contains filtered or unexported fields
}

func NewWorkerRequest

func NewWorkerRequest(job *model.JobRequest, serverOpts Options) (*WorkRequest, error)

NewWorkerRequest ...

func (*WorkRequest) Close

func (w *WorkRequest) Close() error

func (*WorkRequest) Start

func (w *WorkRequest) Start() error

type Worker

type Worker struct {
	ID          string
	Work        chan *WorkRequest
	WorkerQueue chan chan *WorkRequest
	QuitChan    chan bool
}

func NewWorker

func NewWorker(id int64, workerQueue chan chan *WorkRequest) *Worker

func (*Worker) Start

func (w *Worker) Start()

func (*Worker) Stop

func (w *Worker) Stop()

Jump to

Keyboard shortcuts

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