falco

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: MIT Imports: 10 Imported by: 0

README

Falco - FaaS-based large-scale Computing

About

Library to implement custom FaaS-based massive parallel processing piplines.

Build With
  • go 1.14
Usage

Getting Started

Prerequisites
Examples

Roadmap

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Acknowledgements

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVCollector

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

func (*CSVCollector) Add

func (c *CSVCollector) Add(data Measurement)

func (*CSVCollector) Print

func (c *CSVCollector) Print()

func (*CSVCollector) Write

func (c *CSVCollector) Write(outputfile string) error

type Context

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

func NewContext

func NewContext(name string) *Context

func (*Context) Bool

func (r *Context) Bool(name string) bool

func (*Context) Duration

func (r *Context) Duration(name string, defaultValue time.Duration) time.Duration

func (*Context) Int

func (r *Context) Int(name string, defaultValue int) int

func (*Context) IsSet

func (r *Context) IsSet(name string) bool

func (*Context) Name

func (r *Context) Name() string

func (*Context) NewBoolOption

func (r *Context) NewBoolOption(name string, value bool)

func (*Context) NewDurationOption

func (r *Context) NewDurationOption(name string, value time.Duration)

func (*Context) NewIntOption

func (r *Context) NewIntOption(name string, value int)

func (*Context) NewSliceOption

func (r *Context) NewSliceOption(name string, value []string)

func (*Context) NewStingOption

func (r *Context) NewStingOption(name, value string)

func (*Context) PrefixMap

func (r *Context) PrefixMap(prefix string) map[string]string

func (*Context) Slice

func (r *Context) Slice(name string) []string

func (*Context) String

func (r *Context) String(name, defaultValue string) string

func (*Context) ToMap

func (r *Context) ToMap() map[string]string

type Deployable

type Deployable interface {
	Payload() string
	Context() *Context
	Runtime() string
}

type Deployment

type Deployment interface {
	ID() string
}

type ExecutionStrategy

type ExecutionStrategy interface {
	Execute(*Job, Submittable, ResultCollector) error
}

type InvocableOptions

type InvocableOptions interface {
	Apply()
}

type InvocationPayload

type InvocationPayload interface {
	//uniuqe task IID (can be used to assosiate returned invocations to submitted invocations)
	ID() string
	//the time this payload was send
	SubmittedAt() time.Time
	//the latancy between the sumitted time and the time Done was called
	Latancy() time.Duration

	//if this payload is processed, e.g. we know it failed, or we have a result
	IsCompleted() bool
	//any error that occured with this paylaod
	Error() error
	//sets stubmission time and counts the number or resubmissions
	Submitted() int8
	//retuns the number of sumissions to a platfrom
	GetNumberOfSubmissions() int8
	//sets an error
	SetError(err error)

	//the runitme used to generate this invocation
	Runtime() Runtime
	//Set completed to true and stores compleation time
	Done()

	//writer.Add(payload.Runtime().MakeFailure(payload.ID(),payload.Error().Error(),payload.SubmittedAt()))
	WriteError(writer ResultCollector)
	//is called if a task gets resubmitted (due to error or because it seamed to straggle)
	MarkAsResubmitted()
}

type Invokable

type Invokable interface {
	//Invoke a makeDeploymentPayload directly
	Invoke(Deployment, InvocationPayload, ResultCollector) error
}

type Job

type Job struct {
	Context Context
	//
	Deployment Deployment

	Tasks []InvocationPayload
	// contains filtered or unexported fields
}

func NewJob

func NewJob(ctx context.Context, tasks []InvocationPayload,
	requestsPerSeconds int, monitor ProgressMonitor) *Job

func (*Job) AsParentContext

func (j *Job) AsParentContext() context.Context

func (*Job) Cancel

func (j *Job) Cancel()

func (*Job) Canceled

func (j *Job) Canceled() <-chan struct{}

func (*Job) Done

func (j *Job) Done(payloadID string)

func (*Job) Finish

func (j *Job) Finish()

func (*Job) Info

func (j *Job) Info(text string)

func (*Job) Name

func (j *Job) Name() string

func (*Job) PayloadFromId

func (j *Job) PayloadFromId(payloadID string) (InvocationPayload, error)

func (*Job) PrintStats

func (j *Job) PrintStats()

func (*Job) SubmittedTask

func (j *Job) SubmittedTask(payload InvocationPayload)

func (*Job) TakeQuery

func (j *Job) TakeQuery() time.Time

func (*Job) TakeSpawn

func (j *Job) TakeSpawn() time.Time

func (*Job) Wait

func (j *Job) Wait()

func (*Job) WithTimeout

func (j *Job) WithTimeout(timeout time.Duration) error

type Measurable

type Measurable interface {
	//XXX: these I don't like
	MakeFailure(id, cause string, start time.Time) Measurement
	MakeMeasurement(map[string]interface{}) Measurement
}

type Measurement

type Measurement map[string]interface{}

func (Measurement) InvocationID

func (data Measurement) InvocationID() string

func (Measurement) IsFailure

func (data Measurement) IsFailure() bool

func (Measurement) JobID

func (data Measurement) JobID() string

func (Measurement) SetInvocationID

func (data Measurement) SetInvocationID(name string)

func (Measurement) SetJobID

func (data Measurement) SetJobID(name string)

func (Measurement) SetRequestLatency

func (data Measurement) SetRequestLatency(latency time.Duration)

func (Measurement) WithDefaults

func (m Measurement) WithDefaults() Measurement

type MockInvocation

type MockInvocation struct {
	IID             string
	SUB             time.Time
	COM             time.Time
	DONE            bool
	ERR             error
	Tries           int8
	Delay           time.Duration
	SuccessSelector func(invocation *MockInvocation) bool
}

func (*MockInvocation) Done

func (m *MockInvocation) Done()

func (*MockInvocation) Error

func (m *MockInvocation) Error() error

func (*MockInvocation) GetNumberOfSubmissions

func (m *MockInvocation) GetNumberOfSubmissions() int8

func (*MockInvocation) ID

func (m *MockInvocation) ID() string

func (*MockInvocation) IsCompleted

func (m *MockInvocation) IsCompleted() bool

func (*MockInvocation) Latancy

func (m *MockInvocation) Latancy() time.Duration

func (*MockInvocation) MarkAsResubmitted

func (m *MockInvocation) MarkAsResubmitted()

func (*MockInvocation) Runtime

func (m *MockInvocation) Runtime() Runtime

func (*MockInvocation) SetError

func (m *MockInvocation) SetError(err error)

func (*MockInvocation) Submitted

func (m *MockInvocation) Submitted() int8

func (*MockInvocation) SubmittedAt

func (m *MockInvocation) SubmittedAt() time.Time

func (*MockInvocation) Succeed

func (m *MockInvocation) Succeed() bool

func (*MockInvocation) WriteError

func (m *MockInvocation) WriteError(writer ResultCollector)

type MockRuntime

type MockRuntime struct {
}

func (*MockRuntime) InvocationPayload

func (m *MockRuntime) InvocationPayload(c *Context, s ...string) ([]InvocationPayload, error)

func (*MockRuntime) MakeDeployment

func (m *MockRuntime) MakeDeployment(c *Context, s ...string) (Deployable, error)

func (*MockRuntime) MakeFailure

func (m *MockRuntime) MakeFailure(id, cause string, start time.Time) Measurement

func (*MockRuntime) MakeMeasurement

func (m *MockRuntime) MakeMeasurement(m2 map[string]interface{}) Measurement

type MockWriter

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

func (*MockWriter) Add

func (m *MockWriter) Add(measurement Measurement)

func (*MockWriter) Print

func (m *MockWriter) Print()

func (*MockWriter) Write

func (m *MockWriter) Write(s string) error

type Monitor

type Monitor struct {
}

func (Monitor) Advance

func (m Monitor) Advance(i int)

func (Monitor) Expand

func (m Monitor) Expand(i int)

func (Monitor) Finish

func (m Monitor) Finish()

func (Monitor) Info

func (m Monitor) Info(s string)

func (Monitor) Render

func (m Monitor) Render()

func (Monitor) Setup

func (m Monitor) Setup()

type Platform

type Platform interface {
	//deploys a function
	Deploy(deployable Deployable) (Deployment, error)
	//removes a deployment
	Remove(deployment Deployment) error
	//scales up the deployment or changes current configuration
	Scale(Deployment, ...ScaleOptions) (Deployment, error)
	//all platforms are at least invocable
	Invokable
}

type ProgressMonitor

type ProgressMonitor interface {
	Setup()
	Advance(int)
	Expand(int)
	Render()
	Finish()
	Info(string)
}

type ResultCollector

type ResultCollector interface {
	Add(measurement Measurement)
	Write(string2 string) error
	Print()
}

func NewCollector

func NewCollector() ResultCollector

type Runtime

type Runtime interface {
	//compile a set of given files to a deployment package that can be deployed to any platfrom
	MakeDeployment(*Context, ...string) (Deployable, error)

	//combine a set of input files to an invocation payload
	InvocationPayload(*Context, ...string) ([]InvocationPayload, error)

	Measurable
}

type ScaleOptions

type ScaleOptions func(deployment Deployment)

type Submittable

type Submittable interface {
	Platform
	Invokable
	//Submit a job asynchronously - must be collected using Collect
	//TODO push <-chan map[string]interface{} into job..
	Submit(*Job, InvocationPayload, chan<- map[string]interface{}, ...InvocableOptions) error
	Collect(*Job, <-chan map[string]interface{}, ResultCollector, ...InvocableOptions) error
}

Interface for Async Submission of Workloads

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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