pier

package
v1.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2018 License: GPL-2.0 Imports: 16 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(connectionID db.ConnectionID, 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, pierConfig def.PierConfig, tmpDir string, timeOuts def.TimeoutConfig) (*Pier, error)

NewPier creates a new pier with all the needed setup

func (*Pier) AddDockerConnection

func (p *Pier) AddDockerConnection(userID int64, config def.DockerConfig) (db.ConnectionID, error)

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

func (*Pier) BuildService

func (p *Pier) BuildService(connectionID db.ConnectionID, 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) GetConnections

func (p *Pier) GetConnections() (map[db.ConnectionID]def.DockerConfig, error)

GetConnections returns all docker connections

func (*Pier) ImportImage

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

ImportImage installs a docker tar file as a docker image

func (*Pier) InitiateSwarmMode

func (p *Pier) InitiateSwarmMode(connectionID db.ConnectionID, listenAddr string, advertiseAddr string) (string, error)

InitiateSwarmMode switches a node to the Swarm Mode

func (*Pier) LeaveIfInSwarmMode

func (p *Pier) LeaveIfInSwarmMode(connectionID db.ConnectionID) 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, inputSrc []string, limits def.LimitConfig, timeouts def.TimeoutConfig) (db.Job, error)

RunService exported

func (*Pier) StartServiceBuildFromFile

func (p *Pier) StartServiceBuildFromFile(buildID string, buildDir string, connectionID db.ConnectionID, userID int64)

StartServiceBuildFromFile builds an image from a Dockerfile

func (*Pier) StartServiceBuildFromTar

func (p *Pier) StartServiceBuildFromTar(buildID string, buildDir string, connectionID db.ConnectionID, userID int64, imageFileName string)

StartServiceBuildFromTar imports an existing image from a tar archive

func (*Pier) UploadFileIntoVolume

func (p *Pier) UploadFileIntoVolume(volumeID string, srcFileLocation string, dstFileName string, limits def.LimitConfig, timeouts def.TimeoutConfig) error

UploadFileIntoVolume exported

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