Documentation ¶
Index ¶
- Constants
- Variables
- func ParseYAMLFromManifests(manifests ...model.Manifest) ([]k8s.K8sEntity, error)
- func PopulatePortForwards(m model.Manifest, pod store.Pod) []model.PortForward
- func ProvideTimerMaker() timerMaker
- func TiltRunLabel() k8s.LabelPair
- type BuildAndDeployer
- type BuildCompleteAction
- type BuildController
- type BuildOrder
- type BuildStartedAction
- type CompositeBuildAndDeployer
- type DeployDiscovery
- func (d *DeployDiscovery) DeployInfoForImageBlocking(ctx context.Context, img reference.NamedTagged) (DeployInfo, error)
- func (d *DeployDiscovery) EnsureDeployInfoFetchStarted(ctx context.Context, img reference.NamedTagged, ns k8s.Namespace)
- func (d *DeployDiscovery) ForgetImage(img reference.NamedTagged) DeployInfo
- type DeployInfo
- type ErrorAction
- type FallbackTester
- type FsWatcherMaker
- type ImageBuildAndDeployer
- func (ibd *ImageBuildAndDeployer) BuildAndDeploy(ctx context.Context, manifest model.Manifest, state store.BuildState) (br store.BuildResult, err error)
- func (ibd *ImageBuildAndDeployer) PostProcessBuild(ctx context.Context, result, previousResult store.BuildResult)
- func (ibd *ImageBuildAndDeployer) SetInjectSynclet(inject bool)
- type InitAction
- type LocalContainerBuildAndDeployer
- type ManifestReloadedAction
- type PodChangeAction
- type PodLogAction
- type PodLogActionWriter
- type PodLogManager
- type PodLogWatch
- type PodWatcher
- type PodWatcherMaker
- type PortForwardController
- type ServiceChangeAction
- type ServiceWatcher
- type ServiceWatcherMaker
- type SyncletBuildAndDeployer
- type SyncletManager
- type UpdateMode
- type UpdateModeFlag
- type Upper
- type WatchManager
Constants ¶
const ManifestNameLabel = "tilt-manifest"
const TiltRunIDLabel = "tilt-runid"
Variables ¶
var AllUpdateModes = []UpdateMode{ UpdateModeAuto, UpdateModeImage, UpdateModeNaive, UpdateModeSynclet, UpdateModeContainer, }
var DeployerBaseWireSet = wire.NewSet(build.DefaultConsole, build.DefaultOut, wire.Value(build.Labels{}), build.DefaultImageBuilder, build.NewDockerImageBuilder, NewImageBuildAndDeployer, build.NewContainerUpdater, build.NewContainerResolver, NewSyncletBuildAndDeployer, NewLocalContainerBuildAndDeployer, DefaultBuildOrder, NewDeployDiscovery, wire.Bind(new(BuildAndDeployer), new(CompositeBuildAndDeployer)), NewCompositeBuildAndDeployer, ProvideUpdateMode, store.NewStore, )
var DeployerWireSet = wire.NewSet( DeployerBaseWireSet, NewSyncletManager, )
var DeployerWireSetTest = wire.NewSet( DeployerBaseWireSet, NewSyncletManagerForTests, )
var TiltRunID = uuid.New().String()
Functions ¶
func ParseYAMLFromManifests ¶
func PopulatePortForwards ¶
Extract the port-forward specs from the manifest. If any of them have ContainerPort = 0, populate them with the default port in the pod spec. Quietly drop forwards that we can't populate.
func ProvideTimerMaker ¶
func ProvideTimerMaker() timerMaker
func TiltRunLabel ¶
Types ¶
type BuildAndDeployer ¶
type BuildAndDeployer interface { // BuildAndDeploy builds and deployed the specified manifest. // // Returns a BuildResult that expresses the output of the build. // // BuildResult can be used to construct a BuildState, which contains // the last successful build and the files changed since that build. BuildAndDeploy(ctx context.Context, manifest model.Manifest, currentState store.BuildState) (store.BuildResult, error) // PostProcessBuild gets any info about the build that we'll need for subsequent builds. // In general, we'll store this info ON the BuildAndDeployer that needs it. // Each implementation of PostProcessBuild is responsible for executing long-running steps async. PostProcessBuild(ctx context.Context, result, prevResult store.BuildResult) }
type BuildCompleteAction ¶
type BuildCompleteAction struct { Result store.BuildResult Error error }
func NewBuildCompleteAction ¶
func NewBuildCompleteAction(result store.BuildResult, err error) BuildCompleteAction
func (BuildCompleteAction) Action ¶
func (BuildCompleteAction) Action()
type BuildController ¶
type BuildController struct {
// contains filtered or unexported fields
}
func NewBuildController ¶
func NewBuildController(b BuildAndDeployer) *BuildController
type BuildOrder ¶
type BuildOrder []BuildAndDeployer
func DefaultBuildOrder ¶
func DefaultBuildOrder(sbad *SyncletBuildAndDeployer, cbad *LocalContainerBuildAndDeployer, ibad *ImageBuildAndDeployer, env k8s.Env, mode UpdateMode) BuildOrder
type BuildStartedAction ¶
type BuildStartedAction struct { Manifest model.Manifest StartTime time.Time FilesChanged []string }
func (BuildStartedAction) Action ¶
func (BuildStartedAction) Action()
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, shouldFallBack FallbackTester) *CompositeBuildAndDeployer
func (*CompositeBuildAndDeployer) BuildAndDeploy ¶
func (composite *CompositeBuildAndDeployer) BuildAndDeploy(ctx context.Context, manifest model.Manifest, currentState store.BuildState) (store.BuildResult, error)
func (*CompositeBuildAndDeployer) PostProcessBuild ¶
func (composite *CompositeBuildAndDeployer) PostProcessBuild(ctx context.Context, result, prevResult store.BuildResult)
type DeployDiscovery ¶
type DeployDiscovery struct {
// contains filtered or unexported fields
}
Looks up containers after they've been deployed.
func NewDeployDiscovery ¶
func NewDeployDiscovery(kCli k8s.Client, store *store.Store) *DeployDiscovery
func (*DeployDiscovery) DeployInfoForImageBlocking ¶
func (d *DeployDiscovery) DeployInfoForImageBlocking(ctx context.Context, img reference.NamedTagged) (DeployInfo, error)
func (*DeployDiscovery) EnsureDeployInfoFetchStarted ¶
func (d *DeployDiscovery) EnsureDeployInfoFetchStarted(ctx context.Context, img reference.NamedTagged, ns k8s.Namespace)
func (*DeployDiscovery) ForgetImage ¶
func (d *DeployDiscovery) ForgetImage(img reference.NamedTagged) DeployInfo
Returns the deploy info that was forgotten, if any.
type DeployInfo ¶
type DeployInfo struct {
// contains filtered or unexported fields
}
func (DeployInfo) Empty ¶
func (d DeployInfo) Empty() bool
type ErrorAction ¶
type ErrorAction struct {
Error error
}
func NewErrorAction ¶
func NewErrorAction(err error) ErrorAction
func (ErrorAction) Action ¶
func (ErrorAction) Action()
type FallbackTester ¶
func DefaultShouldFallBack ¶
func DefaultShouldFallBack() FallbackTester
type FsWatcherMaker ¶
func ProvideFsWatcherMaker ¶
func ProvideFsWatcherMaker() FsWatcherMaker
type ImageBuildAndDeployer ¶
type ImageBuildAndDeployer struct {
// contains filtered or unexported fields
}
func NewImageBuildAndDeployer ¶
func NewImageBuildAndDeployer(b build.ImageBuilder, k8sClient k8s.Client, env k8s.Env, analytics analytics.Analytics, updateMode UpdateMode) *ImageBuildAndDeployer
func (*ImageBuildAndDeployer) BuildAndDeploy ¶
func (ibd *ImageBuildAndDeployer) BuildAndDeploy(ctx context.Context, manifest model.Manifest, state store.BuildState) (br store.BuildResult, err error)
func (*ImageBuildAndDeployer) PostProcessBuild ¶
func (ibd *ImageBuildAndDeployer) PostProcessBuild(ctx context.Context, result, previousResult store.BuildResult)
func (*ImageBuildAndDeployer) SetInjectSynclet ¶
func (ibd *ImageBuildAndDeployer) SetInjectSynclet(inject bool)
Turn on synclet injection. Should be called before any builds.
type InitAction ¶
func (InitAction) Action ¶
func (InitAction) Action()
type LocalContainerBuildAndDeployer ¶
type LocalContainerBuildAndDeployer struct {
// contains filtered or unexported fields
}
func NewLocalContainerBuildAndDeployer ¶
func NewLocalContainerBuildAndDeployer(cu *build.ContainerUpdater, analytics analytics.Analytics, dd *DeployDiscovery) *LocalContainerBuildAndDeployer
func (*LocalContainerBuildAndDeployer) BuildAndDeploy ¶
func (cbd *LocalContainerBuildAndDeployer) BuildAndDeploy(ctx context.Context, manifest model.Manifest, state store.BuildState) (result store.BuildResult, err error)
func (*LocalContainerBuildAndDeployer) PostProcessBuild ¶
func (cbd *LocalContainerBuildAndDeployer) PostProcessBuild(ctx context.Context, result, previousResult store.BuildResult)
type ManifestReloadedAction ¶
type ManifestReloadedAction struct { OldManifest model.Manifest NewManifest model.Manifest Error *manifestErr }
func (ManifestReloadedAction) Action ¶
func (ManifestReloadedAction) Action()
type PodChangeAction ¶
func NewPodChangeAction ¶
func NewPodChangeAction(pod *v1.Pod) PodChangeAction
func (PodChangeAction) Action ¶
func (PodChangeAction) Action()
type PodLogAction ¶
type PodLogAction struct { ManifestName model.ManifestName PodID k8s.PodID Log []byte }
func (PodLogAction) Action ¶
func (PodLogAction) Action()
type PodLogActionWriter ¶
type PodLogActionWriter struct {
// contains filtered or unexported fields
}
type PodLogManager ¶
type PodLogManager struct {
// contains filtered or unexported fields
}
Collects logs from deployed containers.
func NewPodLogManager ¶
func NewPodLogManager(kClient k8s.Client) *PodLogManager
type PodLogWatch ¶
type PodLogWatch struct {
// contains filtered or unexported fields
}
type PodWatcher ¶
type PodWatcher struct {
// contains filtered or unexported fields
}
func NewPodWatcher ¶
func NewPodWatcher(kCli k8s.Client) *PodWatcher
type PortForwardController ¶
type PortForwardController struct {
// contains filtered or unexported fields
}
func NewPortForwardController ¶
func NewPortForwardController(kClient k8s.Client) *PortForwardController
type ServiceChangeAction ¶
func NewServiceChangeAction ¶
func NewServiceChangeAction(service *v1.Service) ServiceChangeAction
func (ServiceChangeAction) Action ¶
func (ServiceChangeAction) Action()
type ServiceWatcher ¶
type ServiceWatcher struct {
// contains filtered or unexported fields
}
func NewServiceWatcher ¶
func NewServiceWatcher(kCli k8s.Client) *ServiceWatcher
type SyncletBuildAndDeployer ¶
type SyncletBuildAndDeployer struct {
// contains filtered or unexported fields
}
func NewSyncletBuildAndDeployer ¶
func NewSyncletBuildAndDeployer(dd *DeployDiscovery, sm SyncletManager) *SyncletBuildAndDeployer
func (*SyncletBuildAndDeployer) BuildAndDeploy ¶
func (sbd *SyncletBuildAndDeployer) BuildAndDeploy(ctx context.Context, manifest model.Manifest, state store.BuildState) (store.BuildResult, error)
func (*SyncletBuildAndDeployer) PostProcessBuild ¶
func (sbd *SyncletBuildAndDeployer) PostProcessBuild(ctx context.Context, result, previousResult store.BuildResult)
type SyncletManager ¶
type SyncletManager struct {
// contains filtered or unexported fields
}
func NewSyncletManager ¶
func NewSyncletManager(kCli k8s.Client) SyncletManager
func NewSyncletManagerForTests ¶
func NewSyncletManagerForTests(kCli k8s.Client, fakeCli synclet.SyncletClient) SyncletManager
func (SyncletManager) ClientForPod ¶
func (sm SyncletManager) ClientForPod(ctx context.Context, podID k8s.PodID, ns k8s.Namespace) (synclet.SyncletClient, error)
type UpdateMode ¶
type UpdateMode string
var ( // Auto-pick the build mode based on UpdateModeAuto UpdateMode = "auto" // Only do image builds UpdateModeImage UpdateMode = "image" // Only do image builds from scratch UpdateModeNaive UpdateMode = "naive" // Deploy a synclet to make container updates faster UpdateModeSynclet UpdateMode = "synclet" // Update containers in-place. This mode only works with DockerForDesktop and Minikube. // If you try to use this mode with a different K8s cluster type, we will return an error UpdateModeContainer UpdateMode = "container" )
func ProvideUpdateMode ¶
func ProvideUpdateMode(flag UpdateModeFlag, env k8s.Env) (UpdateMode, error)
type UpdateModeFlag ¶
type UpdateModeFlag UpdateMode
A type to bind to flag values that need validation.
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.
func NewUpper ¶
func NewUpper(ctx context.Context, b BuildAndDeployer, k8s k8s.Client, reaper build.ImageReaper, hud hud.HeadsUpDisplay, pw *PodWatcher, sw *ServiceWatcher, st *store.Store, plm *PodLogManager, pfc *PortForwardController, fwm *WatchManager, fswm FsWatcherMaker, bc *BuildController) Upper
func (Upper) CreateManifests ¶
type WatchManager ¶
type WatchManager struct {
// contains filtered or unexported fields
}
func NewWatchManager ¶
func NewWatchManager(watcherMaker FsWatcherMaker, timerMaker timerMaker) *WatchManager
Source Files ¶
- actions.go
- build_and_deployer.go
- buildcontroller.go
- deploy.go
- image_build_and_deployer.go
- local_container_build_and_deployer.go
- mode.go
- parse.go
- pod.go
- pod_watch.go
- podlogmanager.go
- portforwardcontroller.go
- service_watch.go
- synclet_build_and_deployer.go
- synclet_manager.go
- upper.go
- watchmanager.go
- wire_gen.go