pier

package
v1.0.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2017 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const GefImageTag = "gef"

GefImageTag tag for all images created by the GEF

View Source
const GefSrvLabelPrefix = "eudat.gef.service."

GefSrvLabelPrefix is the prefix identifying GEF related labels

View Source
const InternalImagePrefix = "internal_"

InternalImagePrefix prefix for internal images

View Source
const ServiceImagePrefix = "service_"

ServiceImagePrefix prefix for GEF service images

Variables

View Source
var JobTimeOutAndRemovalError = "Job execution timeout exceeded and container removal failed"
View Source
var JobTimeOutError = "Job execution timeout exceeded"

Functions

func NewServiceFromImage

func NewServiceFromImage(image dckr.Image) db.Service

NewServiceFromImage extracts metadata and creates a valid GEF service

Types

type Pier

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

Pier is a master struct for gef-docker abstractions

func NewPier

func NewPier(dataBase *db.Db, tmpDir string, timeOuts def.TimeoutConfig) (*Pier, error)

NewPier creates a new pier with all the needed setup

func (*Pier) BuildService

func (p *Pier) BuildService(userID int64, buildDir string) (db.Service, error)

BuildService builds a services based on the content of the provided folder

func (*Pier) DownStreamContainerFile

func (p *Pier) DownStreamContainerFile(volumeID string, fileLocation string, limits def.LimitConfig, timeouts def.TimeoutConfig, w http.ResponseWriter) error

DownStreamContainerFile exported

func (*Pier) ImportImage

func (p *Pier) ImportImage(userID int64, imageFilePath string) (db.Service, error)

ImportImage installs a docker tar file as a docker image

func (*Pier) InitiateSwarmMode

func (p *Pier) InitiateSwarmMode(listenAddr string, advertiseAddr string) (string, error)

InitiateSwarmMode switches a node to the Swarm Mode

func (*Pier) LeaveIfInSwarmMode

func (p *Pier) LeaveIfInSwarmMode() error

LeaveIfInSwarmMode deactivates the Swarm Mode, if it was on

func (*Pier) ListFiles

func (p *Pier) ListFiles(volumeID db.VolumeID, filePath string, limits def.LimitConfig, timeouts def.TimeoutConfig) ([]VolumeItem, error)

ListFiles exported

func (*Pier) RemoveJob

func (p *Pier) RemoveJob(userID int64, jobID db.JobID) (db.Job, error)

RemoveJob removes a job by ID

func (*Pier) RunService

func (p *Pier) RunService(userID int64, id db.ServiceID, inputPID string, limits def.LimitConfig, timeouts def.TimeoutConfig) (db.Job, error)

RunService exported

func (*Pier) SetDockerConnection

func (p *Pier) SetDockerConnection(config def.DockerConfig, internalServicesFolder string) error

SetDockerConnection instantiates the docker client and sets the pier's docker connection

func (*Pier) WaitAndRemoveVolume

func (p *Pier) WaitAndRemoveVolume(id dckr.VolumeID) error

RemoveVolumeInUse removes a volume that may seem to be in use

type VolumeItem

type VolumeItem struct {
	Name       string       `json:"name"`
	Size       int64        `json:"size"`
	Modified   time.Time    `json:"modified"`
	IsFolder   bool         `json:"isFolder"`
	Path       string       `json:"path"`
	FolderTree []VolumeItem `json:"folderTree"`
}

VolumeItem describes a folder content

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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