Documentation
¶
Index ¶
- Constants
- func NewJobScheduler(ctx context.Context, runtime *actors.Runtime, location *time.Location) (schedulertypes.JobScheduler, error)
- type ActivitySweepJob
- type AnalyticsJob
- type AutoHealJob
- func (j *AutoHealJob) CanRestartExported(containerID string, maxRestarts int, window time.Duration) bool
- func (j *AutoHealJob) ListContainers(ctx context.Context, dockerClient *client.Client) ([]container.Summary, error)
- func (j *AutoHealJob) Name() string
- func (j *AutoHealJob) RecordRestartAtExported(containerID string, t time.Time)
- func (j *AutoHealJob) RecordRestartExported(containerID string)
- func (j *AutoHealJob) Reschedule(ctx context.Context) error
- func (j *AutoHealJob) ResetRestartTracking()
- func (j *AutoHealJob) Run(ctx context.Context)
- func (j *AutoHealJob) Schedule(ctx context.Context) string
- func (j *AutoHealJob) ShouldSchedule(ctx context.Context) bool
- type AutoUpdateJob
- type DockerClientRefreshJob
- type EventCleanupJob
- type ExpiredSessionsCleanupJob
- type FilesystemWatcherJob
- type ImageUpdateWatcher
- func (w *ImageUpdateWatcher) Name() string
- func (w *ImageUpdateWatcher) RefreshSchedule()
- func (w *ImageUpdateWatcher) RunNow(ctx context.Context) error
- func (w *ImageUpdateWatcher) Start(ctx context.Context) error
- func (w *ImageUpdateWatcher) Stop(ctx context.Context) error
- func (w *ImageUpdateWatcher) Trigger()
- type PruningVolumeHelperJob
- type ScheduledPruneJob
- type UploadSessionsCleanupJob
- type VulnerabilityScanJob
Constants ¶
const ActivitySweepJobName = "activity-sweep"
const (
AnalyticsJobName = "analytics-heartbeat"
)
const AutoHealJobName = "auto-heal"
const DockerClientRefreshJobName = "docker-client-refresh"
const EventCleanupJobName = "event-cleanup"
const ExpiredSessionsCleanupJobName = "expired-sessions-cleanup"
const (
PruningVolumeHelperJobName = "pruning-volume-helper"
)
const ScheduledPruneJobName = "scheduled-prune"
const UploadSessionsCleanupJobName = "upload-sessions-cleanup"
UploadSessionsCleanupJobName identifies the hourly purge of idle chunked upload sessions.
const VulnerabilityScanJobName = "vulnerability-scan"
Variables ¶
This section is empty.
Functions ¶
func NewJobScheduler ¶
func NewJobScheduler(ctx context.Context, runtime *actors.Runtime, location *time.Location) (schedulertypes.JobScheduler, error)
NewJobScheduler creates an actor-owned scheduler control plane.
Types ¶
type ActivitySweepJob ¶ added in v2.6.0
type ActivitySweepJob struct {
// contains filtered or unexported fields
}
ActivitySweepJob periodically fails queued/running activities whose worker is no longer alive in this process, so a lost terminal write (crash, panic, dropped DB write) cannot leave an activity stuck in running forever. It is an internal job: it has no job_metadata entry and is invisible in the Jobs UI.
func NewActivitySweepJob ¶ added in v2.6.0
func NewActivitySweepJob(activityService *activity.ActivityService) *ActivitySweepJob
func (*ActivitySweepJob) Name ¶ added in v2.6.0
func (j *ActivitySweepJob) Name() string
func (*ActivitySweepJob) Run ¶ added in v2.6.0
func (j *ActivitySweepJob) Run(ctx context.Context)
type AnalyticsJob ¶
type AnalyticsJob struct {
// contains filtered or unexported fields
}
func NewAnalyticsJob ¶
func NewAnalyticsJob( settingsService *settings.SettingsService, kvService *kv.KVService, httpClient *http.Client, cfg *config.Config, ) *AnalyticsJob
func (*AnalyticsJob) Name ¶
func (j *AnalyticsJob) Name() string
func (*AnalyticsJob) Reschedule ¶
func (j *AnalyticsJob) Reschedule(ctx context.Context) error
func (*AnalyticsJob) Run ¶
func (j *AnalyticsJob) Run(ctx context.Context)
type AutoHealJob ¶
type AutoHealJob struct {
// contains filtered or unexported fields
}
func NewAutoHealJob ¶
func NewAutoHealJob( dockerClientService *docker.DockerClientService, settingsService *settings.SettingsService, eventService *event.EventService, notificationService *notification.NotificationService, admissionGate *actors.Gate[actors.AdmissionKey], ) (*AutoHealJob, error)
func (*AutoHealJob) CanRestartExported ¶
func (j *AutoHealJob) CanRestartExported(containerID string, maxRestarts int, window time.Duration) bool
CanRestartExported exposes canRestart for testing.
func (*AutoHealJob) ListContainers ¶ added in v2.8.0
func (*AutoHealJob) Name ¶
func (j *AutoHealJob) Name() string
func (*AutoHealJob) RecordRestartAtExported ¶
func (j *AutoHealJob) RecordRestartAtExported(containerID string, t time.Time)
RecordRestartAtExported records a restart at a specific time for testing.
func (*AutoHealJob) RecordRestartExported ¶
func (j *AutoHealJob) RecordRestartExported(containerID string)
RecordRestartExported exposes recordRestart for testing.
func (*AutoHealJob) Reschedule ¶
func (j *AutoHealJob) Reschedule(ctx context.Context) error
func (*AutoHealJob) ResetRestartTracking ¶
func (j *AutoHealJob) ResetRestartTracking()
ResetRestartTracking clears all restart records (exported for testing).
func (*AutoHealJob) Run ¶
func (j *AutoHealJob) Run(ctx context.Context)
func (*AutoHealJob) ShouldSchedule ¶
func (j *AutoHealJob) ShouldSchedule(ctx context.Context) bool
type AutoUpdateJob ¶
type AutoUpdateJob struct {
// contains filtered or unexported fields
}
func NewAutoUpdateJob ¶
func NewAutoUpdateJob(updaterModule *updater.Module, settingsService *settings.SettingsService, admissionGate *actors.Gate[actors.AdmissionKey]) (*AutoUpdateJob, error)
func (*AutoUpdateJob) Name ¶
func (j *AutoUpdateJob) Name() string
func (*AutoUpdateJob) Reschedule ¶
func (j *AutoUpdateJob) Reschedule(ctx context.Context) error
func (*AutoUpdateJob) Run ¶
func (j *AutoUpdateJob) Run(ctx context.Context)
func (*AutoUpdateJob) ShouldSchedule ¶
func (j *AutoUpdateJob) ShouldSchedule(ctx context.Context) bool
type DockerClientRefreshJob ¶
type DockerClientRefreshJob struct {
// contains filtered or unexported fields
}
DockerClientRefreshJob keeps the cached Docker client aligned with the daemon API version after daemon restarts or upgrades.
func NewDockerClientRefreshJob ¶
func NewDockerClientRefreshJob(dockerClientService *docker.DockerClientService, settingsService *settings.SettingsService) *DockerClientRefreshJob
NewDockerClientRefreshJob creates the scheduled Docker client refresh job.
func (*DockerClientRefreshJob) Name ¶
func (j *DockerClientRefreshJob) Name() string
func (*DockerClientRefreshJob) Run ¶
func (j *DockerClientRefreshJob) Run(ctx context.Context)
type EventCleanupJob ¶
type EventCleanupJob struct {
// contains filtered or unexported fields
}
func NewEventCleanupJob ¶
func NewEventCleanupJob(eventService *event.EventService, activityService *activity.ActivityService, settingsService *settings.SettingsService) *EventCleanupJob
func (*EventCleanupJob) Name ¶
func (j *EventCleanupJob) Name() string
func (*EventCleanupJob) Reschedule ¶
func (j *EventCleanupJob) Reschedule(ctx context.Context) error
func (*EventCleanupJob) Run ¶
func (j *EventCleanupJob) Run(ctx context.Context)
type ExpiredSessionsCleanupJob ¶
type ExpiredSessionsCleanupJob struct {
// contains filtered or unexported fields
}
func NewExpiredSessionsCleanupJob ¶
func NewExpiredSessionsCleanupJob(sessionService *session.SessionService, settingsService *settings.SettingsService) *ExpiredSessionsCleanupJob
func (*ExpiredSessionsCleanupJob) Name ¶
func (j *ExpiredSessionsCleanupJob) Name() string
func (*ExpiredSessionsCleanupJob) Reschedule ¶
func (j *ExpiredSessionsCleanupJob) Reschedule(ctx context.Context) error
func (*ExpiredSessionsCleanupJob) Run ¶
func (j *ExpiredSessionsCleanupJob) Run(ctx context.Context)
type FilesystemWatcherJob ¶
type FilesystemWatcherJob struct {
// contains filtered or unexported fields
}
func NewFilesystemWatcherJob ¶
func NewFilesystemWatcherJob( ctx context.Context, actorRuntime *actors.Runtime, projectService *project.ProjectService, templateService *template.TemplateService, settingsService *settings.SettingsService, projectScanDepth int, ) (*FilesystemWatcherJob, error)
func (*FilesystemWatcherJob) RestartProjectsWatcher ¶
func (j *FilesystemWatcherJob) RestartProjectsWatcher(ctx context.Context) error
func (*FilesystemWatcherJob) RestartTemplatesWatcher ¶
func (j *FilesystemWatcherJob) RestartTemplatesWatcher(ctx context.Context) error
type ImageUpdateWatcher ¶ added in v2.5.0
type ImageUpdateWatcher struct {
// contains filtered or unexported fields
}
ImageUpdateWatcher continuously reconciles image update state after Docker image changes.
func NewImageUpdateWatcher ¶ added in v2.5.0
func NewImageUpdateWatcher(runtime *actors.Runtime, cfg *config.Config, imageUpdateService *imageupdate.ImageUpdateService, settingsService *settings.SettingsService, environmentService *environment.EnvironmentService, dockerService *docker.DockerClientService, projectService *project.ProjectService) (*ImageUpdateWatcher, error)
NewImageUpdateWatcher constructs the image update watcher from the existing services.
func (*ImageUpdateWatcher) Name ¶ added in v2.5.0
func (w *ImageUpdateWatcher) Name() string
Name identifies the watcher in scheduler lifecycle logs.
func (*ImageUpdateWatcher) RefreshSchedule ¶ added in v2.5.0
func (w *ImageUpdateWatcher) RefreshSchedule()
RefreshSchedule wakes the actor so it re-reads pollingInterval.
func (*ImageUpdateWatcher) RunNow ¶ added in v2.5.0
func (w *ImageUpdateWatcher) RunNow(ctx context.Context) error
RunNow requests immediate admission from the watcher actor and waits for that scan. An active scan is refused immediately instead of being queued.
func (*ImageUpdateWatcher) Start ¶ added in v2.5.0
func (w *ImageUpdateWatcher) Start(ctx context.Context) error
Start subscribes to Docker image events and owns the watcher actor until ctx is canceled.
func (*ImageUpdateWatcher) Stop ¶ added in v2.7.0
func (w *ImageUpdateWatcher) Stop(ctx context.Context) error
Stop terminates the watcher actor within the caller's lifecycle deadline.
func (*ImageUpdateWatcher) Trigger ¶ added in v2.5.0
func (w *ImageUpdateWatcher) Trigger()
Trigger records a trailing-edge image scan without blocking the event publisher.
type PruningVolumeHelperJob ¶
type PruningVolumeHelperJob struct {
// contains filtered or unexported fields
}
PruningVolumeHelperJob periodically removes idle volume workspace helper containers. The run frequency is fixed (every 5 minutes); how stale a helper must be pruned is driven by the volumeHelperIdleTimeout setting.
func NewPruningVolumeHelperJob ¶
func NewPruningVolumeHelperJob(volumeModule *volume.Module, settingsService *settings.SettingsService) *PruningVolumeHelperJob
func (*PruningVolumeHelperJob) Name ¶
func (j *PruningVolumeHelperJob) Name() string
func (*PruningVolumeHelperJob) Reschedule ¶
func (j *PruningVolumeHelperJob) Reschedule(ctx context.Context) error
func (*PruningVolumeHelperJob) Run ¶
func (j *PruningVolumeHelperJob) Run(ctx context.Context)
type ScheduledPruneJob ¶
type ScheduledPruneJob struct {
// contains filtered or unexported fields
}
func NewScheduledPruneJob ¶
func NewScheduledPruneJob(systemModule *system.Module, settingsService *settings.SettingsService, notificationService *notification.NotificationService) *ScheduledPruneJob
func (*ScheduledPruneJob) Name ¶
func (j *ScheduledPruneJob) Name() string
func (*ScheduledPruneJob) Reschedule ¶
func (j *ScheduledPruneJob) Reschedule(ctx context.Context) error
func (*ScheduledPruneJob) Run ¶
func (j *ScheduledPruneJob) Run(ctx context.Context)
func (*ScheduledPruneJob) Schedule ¶
func (j *ScheduledPruneJob) Schedule(ctx context.Context) string
func (*ScheduledPruneJob) ShouldSchedule ¶
func (j *ScheduledPruneJob) ShouldSchedule(ctx context.Context) bool
type UploadSessionsCleanupJob ¶ added in v2.8.0
type UploadSessionsCleanupJob struct {
// contains filtered or unexported fields
}
UploadSessionsCleanupJob purges upload sessions that have been idle for longer than uploadSessionMaxAge. It runs on managers and agents alike, since sessions live on whichever node serves the environment.
func NewUploadSessionsCleanupJob ¶ added in v2.8.0
func NewUploadSessionsCleanupJob(uploadService *upload.UploadService) *UploadSessionsCleanupJob
NewUploadSessionsCleanupJob builds the cleanup job for the scheduler.
func (*UploadSessionsCleanupJob) Name ¶ added in v2.8.0
func (j *UploadSessionsCleanupJob) Name() string
func (*UploadSessionsCleanupJob) Reschedule ¶ added in v2.8.0
func (j *UploadSessionsCleanupJob) Reschedule(ctx context.Context) error
func (*UploadSessionsCleanupJob) Run ¶ added in v2.8.0
func (j *UploadSessionsCleanupJob) Run(ctx context.Context)
type VulnerabilityScanJob ¶
type VulnerabilityScanJob struct {
// contains filtered or unexported fields
}
VulnerabilityScanJob periodically scans all Docker images for vulnerabilities using Trivy. It is opt-in via the "vulnerabilityScanEnabled" setting.
func NewVulnerabilityScanJob ¶
func NewVulnerabilityScanJob(vulnerabilityService *vulnerability.VulnerabilityService, settingsService *settings.SettingsService) *VulnerabilityScanJob
NewVulnerabilityScanJob creates a new VulnerabilityScanJob.
func (*VulnerabilityScanJob) Name ¶
func (j *VulnerabilityScanJob) Name() string
func (*VulnerabilityScanJob) Run ¶
func (j *VulnerabilityScanJob) Run(ctx context.Context)
func (*VulnerabilityScanJob) Schedule ¶
func (j *VulnerabilityScanJob) Schedule(ctx context.Context) string
Schedule returns the cron expression for the job. Defaults to daily at midnight.
func (*VulnerabilityScanJob) ShouldSchedule ¶
func (j *VulnerabilityScanJob) ShouldSchedule(ctx context.Context) bool
Source Files
¶
- activity_sweep_job.go
- analytics_job.go
- auto_heal_job.go
- auto_update_job.go
- docker_client_refresh_job.go
- event_cleanup_job.go
- expired_sessions_cleanup_job.go
- filesystem_watcher_job.go
- image_update_watcher.go
- scheduled_prune_job.go
- scheduler.go
- upload_sessions_cleanup_job.go
- volume_helper_reaper_job.go
- vulnerability_scan_job.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package entityjobs holds the per-entity dynamic-job registry shared by the services that schedule one job per database row (GitOps syncs, environment health checks).
|
Package entityjobs holds the per-entity dynamic-job registry shared by the services that schedule one job per database row (GitOps syncs, environment health checks). |