Documentation ¶
Index ¶
- Variables
- func NewErrorAction(err error) store.ErrorAction
- func NewImageBuilder(db build.DockerBuilder, custb build.CustomBuilder, ...) *imageBuilder
- func ParseYAMLFromManifests(manifests ...model.Manifest) ([]k8s.K8sEntity, error)
- func ProvideSubscribers(hudsc *server.HeadsUpServerController, ...) []store.Subscriber
- func ProvideSubscribersAPIOnly(hudsc *server.HeadsUpServerController, ...) []store.Subscriber
- func SpanIDForBuildLog(buildCount int) logstore.SpanID
- type BuildAndDeployer
- type BuildController
- type BuildLogActionWriter
- type BuildOrder
- type CompositeBuildAndDeployer
- type DockerComposeBuildAndDeployer
- type FallbackTester
- type HudStoppedAction
- type ImageBuildAndDeployer
- type InitAction
- type KINDLoader
- type LiveUpdateBuildAndDeployer
- type LocalTargetBuildAndDeployer
- type ManifestReloadedAction
- type PodWatcherMaker
- type ServiceWatcherMaker
- type TelemetryScriptRanAction
- type UIDUpdateAction
- type Upper
Constants ¶
This section is empty.
Variables ¶
var DeployerBaseWireSet = wire.NewSet(wire.Value(dockerfile.Labels{}), wire.Value(UpperReducer), k8s.ProvideMinikubeClient, build.DefaultDockerBuilder, build.NewDockerImageBuilder, build.NewExecCustomBuilder, wire.Bind(new(build.CustomBuilder), new(*build.ExecCustomBuilder)), NewLocalTargetBuildAndDeployer, NewImageBuildAndDeployer, containerupdate.NewDockerUpdater, containerupdate.NewExecUpdater, NewLiveUpdateBuildAndDeployer, NewDockerComposeBuildAndDeployer, NewImageBuilder, DefaultBuildOrder, tracer.InitOpenTelemetry, wire.Bind(new(BuildAndDeployer), new(*CompositeBuildAndDeployer)), NewCompositeBuildAndDeployer, buildcontrol.ProvideUpdateMode, )
var DeployerWireSet = wire.NewSet( DeployerBaseWireSet, )
var DeployerWireSetTest = wire.NewSet( DeployerBaseWireSet, wire.InterfaceValue(new(trace.SpanProcessor), (trace.SpanProcessor)(nil)), )
var ImageBuildCount = &view.View{ Name: "image_build_count", Measure: ImageBuildDuration, Aggregation: view.Count(), Description: "Image build count", TagKeys: []tag.Key{KeyImageRef, KeyBuildError}, }
var ImageBuildDuration = stats.Float64( "image_build_duration", "Image build duration", stats.UnitMilliseconds)
Loosely adapted from how opencensus does HTTP aggregations: https://github.com/census-instrumentation/opencensus-specs/blob/master/stats/HTTP.md#http-stats https://pkg.go.dev/go.opencensus.io/plugin/ochttp
var ImageBuildDurationDistribution = view.Distribution(
10, 100, 500, 1000, 2000, 5000,
10000, 15000, 20000, 30000, 45000, 60000, 120000,
240000, 480000, 1000000, 2000000, 5000000)
var ImageBuildDurationView = &view.View{ Name: "image_build_duration_dist", Measure: ImageBuildDuration, Aggregation: ImageBuildDurationDistribution, Description: "Image build time, by image ref", TagKeys: []tag.Key{KeyImageRef, KeyBuildError}, }
var K8sDeployCount = &view.View{ Name: "k8s_deploy_count", Measure: K8sDeployDuration, Aggregation: view.Count(), Description: "K8s deploy count", TagKeys: []octag.Key{keyResourceName, keyHasError}, }
var K8sDeployDuration = stats.Float64( "k8s_deploy_duration", "K8s Deploy duration", stats.UnitMilliseconds)
var K8sDeployDurationDistribution = view.Distribution(
10, 100, 500, 1000, 2000, 5000,
10000, 15000, 20000, 30000, 45000, 60000)
var K8sDeployDurationView = &view.View{ Name: "k8s_deploy_duration_dist", Measure: K8sDeployDuration, Aggregation: K8sDeployDurationDistribution, Description: "K8s Deploy time", TagKeys: []octag.Key{keyResourceName, keyHasError}, }
var K8sDeployObjects = stats.Int64("objects", "The number of objects deployed", "1")
var K8sDeployObjectsCount = &view.View{ Name: "k8s_deploy_objects_count", Measure: K8sDeployObjects, Aggregation: view.LastValue(), Description: "K8s objects per resource", TagKeys: []octag.Key{keyResourceName, keyHasError}, }
var KeyBuildError = tag.MustNewKey("build_error")
var KeyImageRef = tag.MustNewKey("image_ref")
Metric and label names must match the following rules: https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels
var UpperReducer = store.Reducer(upperReducerFn)
Functions ¶
func NewErrorAction ¶
func NewErrorAction(err error) store.ErrorAction
func NewImageBuilder ¶ added in v0.14.1
func NewImageBuilder(db build.DockerBuilder, custb build.CustomBuilder, updateMode buildcontrol.UpdateMode) *imageBuilder
func ParseYAMLFromManifests ¶
func ProvideSubscribers ¶ added in v0.8.0
func ProvideSubscribers( hudsc *server.HeadsUpServerController, tscm *controllers.TiltServerControllerManager, cb *controllers.ControllerBuilder, hud hud.HeadsUpDisplay, ts *hud.TerminalStream, tp *prompt.TerminalPrompt, pw *k8swatch.PodWatcher, sw *k8swatch.ServiceWatcher, plm *runtimelog.PodLogManager, pfc *portforward.Controller, fsms *fswatch.ManifestSubscriber, bc *BuildController, cc *configs.ConfigsController, dcw *dcwatch.EventWatcher, dclm *runtimelog.DockerComposeLogManager, ar *analytics.AnalyticsReporter, au *analytics.AnalyticsUpdater, ewm *k8swatch.EventWatchManager, tcum *cloud.CloudStatusManager, dp *dockerprune.DockerPruner, tc *telemetry.Controller, lsc *local.ServerController, podm *k8srollout.PodMonitor, ec *exit.Controller, mc *metrics.Controller, mmc *metrics.ModeController, ) []store.Subscriber
func ProvideSubscribersAPIOnly ¶ added in v0.19.0
func ProvideSubscribersAPIOnly( hudsc *server.HeadsUpServerController, tscm *controllers.TiltServerControllerManager, cb *controllers.ControllerBuilder, ts *hud.TerminalStream, ) []store.Subscriber
Subscribers that only read from the new Tilt API, and run the API server.
func SpanIDForBuildLog ¶ added in v0.10.24
Types ¶
type BuildAndDeployer ¶
type BuildAndDeployer interface { // Returns a BuildResultSet containing output (build result and associated // file changes) for each target built in this call. The BuildResultSet only // contains results for newly built targets--if a target was clean and didn't // need to be built, it doesn't appear in the result set. // // BuildResult can be used to construct a set of BuildStates, which contain // the last successful builds of each target and the files changed since that // build. BuildAndDeploy(ctx context.Context, st store.RStore, specs []model.TargetSpec, currentState store.BuildStateSet) (store.BuildResultSet, error) }
type BuildController ¶
type BuildController struct {
// contains filtered or unexported fields
}
func NewBuildController ¶
func NewBuildController(b BuildAndDeployer) *BuildController
func (*BuildController) DisableForTesting ¶ added in v0.1.0
func (c *BuildController) DisableForTesting()
func (*BuildController) OnChange ¶
func (c *BuildController) OnChange(ctx context.Context, st store.RStore, _ store.ChangeSummary)
type BuildLogActionWriter ¶ added in v0.2.0
type BuildLogActionWriter struct {
// contains filtered or unexported fields
}
type BuildOrder ¶
type BuildOrder []BuildAndDeployer
func DefaultBuildOrder ¶
func DefaultBuildOrder(lubad *LiveUpdateBuildAndDeployer, ibad *ImageBuildAndDeployer, dcbad *DockerComposeBuildAndDeployer, ltbad *LocalTargetBuildAndDeployer, updMode buildcontrol.UpdateMode, env k8s.Env, runtime container.Runtime) BuildOrder
func (BuildOrder) String ¶ added in v0.7.11
func (bo BuildOrder) String() string
type CompositeBuildAndDeployer ¶
type CompositeBuildAndDeployer struct {
// contains filtered or unexported fields
}
CompositeBuildAndDeployer tries to run each builder in order. If a builder emits an error, it uses the FallbackTester to determine whether the error is critical enough to stop the whole pipeline, or to fallback to the next builder.
func NewCompositeBuildAndDeployer ¶
func NewCompositeBuildAndDeployer(builders BuildOrder, tracer trace.Tracer) *CompositeBuildAndDeployer
func (*CompositeBuildAndDeployer) BuildAndDeploy ¶
func (composite *CompositeBuildAndDeployer) BuildAndDeploy(ctx context.Context, st store.RStore, specs []model.TargetSpec, currentState store.BuildStateSet) (store.BuildResultSet, error)
type DockerComposeBuildAndDeployer ¶ added in v0.4.1
type DockerComposeBuildAndDeployer struct {
// contains filtered or unexported fields
}
func NewDockerComposeBuildAndDeployer ¶ added in v0.4.1
func NewDockerComposeBuildAndDeployer(dcc dockercompose.DockerComposeClient, dc docker.Client, ib *imageBuilder, c build.Clock) *DockerComposeBuildAndDeployer
func (*DockerComposeBuildAndDeployer) BuildAndDeploy ¶ added in v0.4.1
func (bd *DockerComposeBuildAndDeployer) BuildAndDeploy(ctx context.Context, st store.RStore, specs []model.TargetSpec, currentState store.BuildStateSet) (res store.BuildResultSet, err error)
type FallbackTester ¶
type HudStoppedAction ¶ added in v0.1.0
type HudStoppedAction struct {
// contains filtered or unexported fields
}
func NewHudStoppedAction ¶ added in v0.1.0
func NewHudStoppedAction(err error) HudStoppedAction
func (HudStoppedAction) Action ¶ added in v0.1.0
func (HudStoppedAction) Action()
type ImageBuildAndDeployer ¶
type ImageBuildAndDeployer struct {
// contains filtered or unexported fields
}
func NewImageBuildAndDeployer ¶
func NewImageBuildAndDeployer( db build.DockerBuilder, customBuilder build.CustomBuilder, k8sClient k8s.Client, env k8s.Env, analytics *analytics.TiltAnalytics, updMode buildcontrol.UpdateMode, c build.Clock, runtime container.Runtime, kl KINDLoader, ) *ImageBuildAndDeployer
func (*ImageBuildAndDeployer) BuildAndDeploy ¶
func (ibd *ImageBuildAndDeployer) BuildAndDeploy(ctx context.Context, st store.RStore, specs []model.TargetSpec, stateSet store.BuildStateSet) (resultSet store.BuildResultSet, err error)
type InitAction ¶
type InitAction struct { EngineMode store.EngineMode TiltfilePath string ConfigFiles []string UserArgs []string TiltBuild model.TiltBuild StartTime time.Time AnalyticsUserOpt analytics.Opt CloudAddress string Token token.Token TerminalMode store.TerminalMode }
func (InitAction) Action ¶
func (InitAction) Action()
type KINDLoader ¶ added in v0.14.0
type KINDLoader interface {
LoadToKIND(ctx context.Context, ref reference.NamedTagged) error
}
func NewKINDLoader ¶ added in v0.14.0
func NewKINDLoader(env k8s.Env, clusterName k8s.ClusterName) KINDLoader
type LiveUpdateBuildAndDeployer ¶ added in v0.9.5
type LiveUpdateBuildAndDeployer struct {
// contains filtered or unexported fields
}
func NewLiveUpdateBuildAndDeployer ¶ added in v0.9.5
func NewLiveUpdateBuildAndDeployer(dcu *containerupdate.DockerUpdater, ecu *containerupdate.ExecUpdater, updMode buildcontrol.UpdateMode, env k8s.Env, runtime container.Runtime, c build.Clock) *LiveUpdateBuildAndDeployer
func (*LiveUpdateBuildAndDeployer) BuildAndDeploy ¶ added in v0.9.5
func (lubad *LiveUpdateBuildAndDeployer) BuildAndDeploy(ctx context.Context, st store.RStore, specs []model.TargetSpec, stateSet store.BuildStateSet) (store.BuildResultSet, error)
type LocalTargetBuildAndDeployer ¶ added in v0.10.8
type LocalTargetBuildAndDeployer struct {
// contains filtered or unexported fields
}
TODO(maia): CommandRunner interface for testability
func NewLocalTargetBuildAndDeployer ¶ added in v0.10.8
func NewLocalTargetBuildAndDeployer(c build.Clock) *LocalTargetBuildAndDeployer
func (*LocalTargetBuildAndDeployer) BuildAndDeploy ¶ added in v0.10.8
func (bd *LocalTargetBuildAndDeployer) BuildAndDeploy(ctx context.Context, st store.RStore, specs []model.TargetSpec, stateSet store.BuildStateSet) (resultSet store.BuildResultSet, err error)
type ManifestReloadedAction ¶
type ManifestReloadedAction struct { OldManifest model.Manifest NewManifest model.Manifest Error error }
func (ManifestReloadedAction) Action ¶
func (ManifestReloadedAction) Action()
type TelemetryScriptRanAction ¶ added in v0.10.25
func (TelemetryScriptRanAction) Action ¶ added in v0.10.25
func (TelemetryScriptRanAction) Action()
type UIDUpdateAction ¶ added in v0.8.9
type UIDUpdateAction struct { UID types.UID EventType watch.EventType ManifestName model.ManifestName Entity k8s.K8sEntity }
func (UIDUpdateAction) Action ¶ added in v0.8.9
func (UIDUpdateAction) Action()
type Upper ¶
type Upper struct {
// contains filtered or unexported fields
}
TODO(nick): maybe this should be called 'BuildEngine' or something? Upper seems like a poor and undescriptive name.
Source Files ¶
- actions.go
- build_and_deployer.go
- buildcontroller.go
- docker_compose_build_and_deployer.go
- extractors.go
- image_build_and_deployer.go
- image_builder.go
- live_update_build_and_deployer.go
- live_update_state_tree.go
- local_target_build_and_deployer.go
- metrics.go
- parse.go
- pod.go
- subscribers.go
- upper.go
- wire_gen.go
Directories ¶
Path | Synopsis |
---|---|
Package analytics handles reporting of anonymized usage statistics about what features of Tilt are in use.
|
Package analytics handles reporting of anonymized usage statistics about what features of Tilt are in use. |
Package metrics handles reporting of identifable metrics about user code for personal and team consumption.
|
Package metrics handles reporting of identifable metrics about user code for personal and team consumption. |