event

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: May 31, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// JobArrivedRoutingKey - AMQP routing key for subscribers interested
	// in jobs arriving in the system (e.g. via a webhook).
	JobArrivedRoutingKey = "job.event.arrived"

	// JobQueuedRoutingKey - AMQP routing key for subscribers interested
	// in jobs getting queued for processing.
	JobQueuedRoutingKey = "job.event.queued"

	// JobUpdatedRoutingKey - AMQP routing key for subscribers interested
	// in a job's progress after it's been picked up for processing.
	JobUpdatedRoutingKey = "job.event.updated"

	// SchedulesReceivedRoutingKey - AMQP routing key for subscribers interested
	// in schedules in the build file parsed by workers.
	SchedulesReceivedRoutingKey = "schedules.event.received"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type JobArrived

type JobArrived struct {
	ProjectID  int64
	AccountID  int64
	Ref        string
	CloneURL   string
	CommitID   string
	Submitter  string
	DeliveryID string
}

JobArrived event.

Publishers:

  • api: when a job request arrives to create a job from a (web)hook, a scheduled job or the UI.

Consumers:

  • scheduler: decides if/when the job will be submitted to the worker queue for processing.

type JobInfo

type JobInfo = JobArrived

JobInfo - JobArrived alias

type JobQueued

type JobQueued struct {
	JobID int64
	JobInfo
}

JobQueued event.

Publishers:

  • scheduler: when a `Job arrival` is accepted for processing. Reasons for rejection: failure to verify origin, internal errors.

Consumers:

  • worker: picks up the job for processing.

type JobUpdated

type JobUpdated struct {
	JobID          int64
	CommitID       string
	ProjectID      int64
	AccountID      int64
	Service        string // e.g. "sagify"
	WorkDir        string
	Region         string // e.g. "us-east-1"
	Endpoint       string // endpoint name if exists
	Type           string // e.g. "training", "tuning"
	Status         string
	SageMakerJobID string
	StartedAt      time.Time
}

JobUpdated event.

Publishers:

  • worker: published multiple times throughout a job's lifecycle.

Consumers:

  • progress: updates job store accordingly.

type ScheduleEntry

type ScheduleEntry struct {
	When        string
	Tag         string
	Branch      string
	Description string
}

ScheduleEntry holds a scheduled job's details

type Schedules

type Schedules map[string]*ScheduleEntry

Schedules holds "schedule name to schedule details" info

type SchedulesReceived

type SchedulesReceived struct {
	AccountID int64
	ProjectID int64
	Schedules *Schedules
}

SchedulesReceived event.

Publishers:

  • worker: published once when parsing the build file.

Consumers:

  • scheduler: updates project's schedules accordingly. Existing schedules not present in the event will be removed, existing schedules present in the event will be updated. New Schedules (not already existing and added to the build file) will be created.

Jump to

Keyboard shortcuts

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