ingest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MiddlewareIngestQueue = "MIDDLEWARE_INGEST_TASK_QUEUE"
)

Variables

This section is empty.

Functions

func DoBuildWorkflow

func DoBuildWorkflow(ctx workflow.Context, in *MiddlewareIngestParams) error

DoBuildWorkflow is a workflow executes build Activities. Meant to be run async from a parent workflow that quits to release the API call.

func StartBuildWorkflow

func StartBuildWorkflow(ctx workflow.Context, in *MiddlewareIngestParams) error

StartBuildWorkflow spawns another async workflow to perform actual build and releases, and returns immediately to release the API call.

Types

type IngestWorker

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

IngestWorker runs build activities.

func NewIngestWorker

func NewIngestWorker(workDir string, db *serverdb.DB, w *watcher.Watcher) *IngestWorker

func (*IngestWorker) BuildActivity

func (w *IngestWorker) BuildActivity(ctx context.Context, sha string, in *MiddlewareIngestParams) error

func (*IngestWorker) FinalizeActivity

func (*IngestWorker) PrepareGithubBuildActivity

func (w *IngestWorker) PrepareGithubBuildActivity(
	ctx context.Context,
	in *MiddlewareIngestParams,
) (*MiddlewareIngestResult, error)

func (*IngestWorker) PrepareLocalBuildActivity

func (w *IngestWorker) PrepareLocalBuildActivity(
	ctx context.Context,
	in *MiddlewareIngestParams,
) (*MiddlewareIngestResult, error)

func (*IngestWorker) UploadWasmOutputActivity

func (w *IngestWorker) UploadWasmOutputActivity(ctx context.Context, slug, sha string) error

type MiddlewareIngestParams

type MiddlewareIngestParams struct {
	Slug string

	// Temporal can't unmarshal oneofs in protos so use bytes and unmarshal ourselves.
	Params *middlewarev1.MiddlewareIngestParams
}

type MiddlewareIngestResult

type MiddlewareIngestResult struct {
	// SHA256 of the build.
	// For local builds this is the hash of the build directory + params.
	// For GIT builds this is the hash of the commit + params.
	SHA string

	// Whether the build was previously cached (a build with SHA above exists in the store).
	Cached bool

	// Err is set if build fails midway.
	Err string
}

Jump to

Keyboard shortcuts

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