workflows

package
v0.0.0-...-13f153f Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

README

How to run temporal workflow

Run temporal workflow on dev

  1. Connect your cloudtop to GKE cluster: ./kube/attach.sh skia-infra-public-dev
  2. Connect to the service at localhost 7233:
    kubectl port-forward service/temporal --address 0.0.0.0 -n temporal 7233:7233
  3. (To test local changes) Run the worker with namespace perf-internal and taskqueue localhost.dev: bazelisk run //pinpoint/go/workflows/worker -- --namespace perf-internal
  4. (if needed) Change workflow parameters in sample/sample.go
  5. Trigger the workflow:
    bazelisk run //pinpoint/go/workflows/sample -- --namespace=perf-internal --bisect=true
  • make sure the namespace and taskqueue matches
  • there are command line flags for which workflow you want to trigger
  1. Check the workflow status on the dev deployment here.
  • Note that workflows disappear from the landing page after 24 hours.
  • Can also view results from the archival page

You need to redo steps 3-5 if you want to run your latest local changes.

Run temporal workflow on prod (follow these steps with care)

  1. Skia breakglass (More context at go/skia-infra-iac-handbook under Breakglass Access):
    grants add --wait_for_twosync --reason="b/XYZ -- justification" skia-infra-breakglass-policy:2h
  2. Connect your cloudtop to GKE cluster: ./kube/attach.sh skia-infra-public
  3. Connect to the service at localhost 7233:
    kubectl port-forward service/temporal --address 0.0.0.0 -n temporal 7233:7233
  4. (if needed) Change workflow parameters in sample/sample.go
  5. Trigger the workflow:
    bazelisk run //pinpoint/go/workflows/sample -- --namespace=perf-internal --taskQueue=perf.perf-chrome-public.bisect --flag_for_workflow=true
  6. Check the workflow status here

Notes:

  • For breakglass, adding a bug and a justification is required. Breakglass access is self-approved.
  • Temporal will by default use the prod workers when connecting to skia-infra-public so connecting to the worker is unnecessary.

Troubleshooting

403 to chrome-swarming

Please ask the team to add you to https://chrome-infra-auth.appspot.com/auth/groups/project-chromeperf-admins.

Common Temporal development pitfalls

  • All parameters must be exportable for golang to serialize the parameter into a temporal workflow or activity. i.e.
type example struct {
   key string
}
param := example{
   key: "value"
}
workflow.ExecuteActivity(ctx, FooActivity, param)

param will be empty.

Documentation

Overview

Package workflow contains const and types to invoke Workflows.

Index

Constants

View Source
const (
	Bisect                            = "perf.bisect"
	BuildChrome                       = "perf.build_chrome"
	CatapultBisect                    = "perf.catapult.bisect"
	ConvertToCatapultResponseWorkflow = "perf.catapult.response"
	RunBenchmark                      = "perf.run_benchmark"
	SingleCommitRunner                = "perf.single_commit_runner"
	PairwiseCommitsRunner             = "perf.pairwise_commits_runner"
	PairwiseWorkflow                  = "perf.pairwise"
	BugUpdate                         = "perf.bug_update"
)

Workflow name definitions.

Those are used to invoke the workflows. This is meant to decouple the souce code dependencies such that the client doesn't need to link with the actual implementation. TODO(b/326352379): introduce a specific type to encapsulate these workflow names

Variables

This section is empty.

Functions

This section is empty.

Types

type BisectParams

type BisectParams struct {
	// BisectWorkflow reuses BisectRequest message
	Request *pb.ScheduleBisectRequest
	// Available bot list
	BotIds []string
}

func (*BisectParams) GetImprovementDirection

func (bp *BisectParams) GetImprovementDirection() compare.ImprovementDir

GetImprovementDirection returns the improvement direction.

Returns Unknown by default regardless of input.

func (*BisectParams) GetInitialAttempt

func (bp *BisectParams) GetInitialAttempt() int32

GetInitialAttempt returns the initial attempt as int32.

If the given string value is invalid or unable to parse, it returns the default 0.

func (*BisectParams) GetMagnitude

func (bp *BisectParams) GetMagnitude() float64

GetMagnitude returns the magnitude as float64.

If the given string value is invalid or unable to parse, it returns the default 1.0.

type Build

type Build struct {
	// The parameters used to make this build.
	BuildChromeParams
	// ID is the buildbucket ID of the Chrome build.
	// https://github.com/luci/luci-go/blob/19a07406e/buildbucket/proto/build.proto#L138
	ID int64
	// Status is the status of the build, this is needed to surface the build failures.
	Status buildbucketpb.Status
	// CAS is the CAS address of the build isolate.
	CAS *swarmingV1.SwarmingRpcsCASReference
}

Build stores the build from Buildbucket.

type BuildChromeParams

type BuildChromeParams struct {
	// WorkflowID is arbitrary string that tags the build.
	// This is used to connect the downstream and know which build is used.
	// This is usually the pinpoint job ID.
	WorkflowID string
	// Commit is the chromium commit hash.
	Commit *midpoint.CombinedCommit
	// Device is the name of the device, e.g. "linux-perf".
	Device string
	// Target is name of the build isolate target
	// e.g. "performance_test_suite".
	Target string
	// Patch is the Gerrit patch included in the build.
	Patch []*buildbucketpb.GerritChange
}

Workflow params definitions.

Each workflow defines its own struct for the params, this will ensure the input parameter type safety, as well as expose them in a structured way.

type PairwiseParams

type PairwiseParams struct {
	// PairwiseWorkflow reuses SchedulePairwiseRequest proto request
	Request *pb.SchedulePairwiseRequest
}

func (*PairwiseParams) GetImprovementDirection

func (pp *PairwiseParams) GetImprovementDirection() compare.ImprovementDir

GetImprovementDirection returns the improvement direction.

Returns Unknown by default.

func (*PairwiseParams) GetInitialAttempt

func (pp *PairwiseParams) GetInitialAttempt() int32

GetInitialAttempt returns the initial attempt as int32.

Pairwise analysis needs to run an even number of commits to ensure an equal number of pairs where commit A goes first and commit B goes first. If the given string value is invalid or unable to parse, it returns the default 30.

type TestRun

type TestRun struct {
	// TaskID is the swarming task ID.
	TaskID string
	// Status is the swarming task status.
	Status run_benchmark.State
	// CAS is the CAS address of the test output.
	CAS *swarmingV1.SwarmingRpcsCASReference
	// Values is sampled values for each benchmark story.
	Values map[string][]float64
}

TestRun stores individual benchmark test run.

Directories

Path Synopsis
Package catapult contains all workflows and activities specific to making this backwards compatbile to Catapult.
Package catapult contains all workflows and activities specific to making this backwards compatbile to Catapult.

Jump to

Keyboard shortcuts

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