Skip to content

feat(agent/agentcontainers): update containers periodically #17972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 22, 2025
Next Next commit
feat(agent/agentcontainers): update containers periodically
This change introduces a significant refactor to the agentcontainers API
and enabled periodic updates of Docker containers rather than on-demand.
Consequently this change also allows us to move away from using a
locking channel and replace it with a mutex, which simplifies usage.

Additionally a previous oversight was fixed, and testing added, to clear
devcontainer running/dirty status when the container has been removed.

Updates #16424
Updates coder/internal#621
  • Loading branch information
mafredri committed May 21, 2025
commit 0b002ec9f5c4cc19c05b208798b0f2cc6f3d0084
6 changes: 0 additions & 6 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -1176,12 +1176,6 @@ func (a *agent) handleManifest(manifestOK *checkpoint) func(ctx context.Context,
}
a.metrics.startupScriptSeconds.WithLabelValues(label).Set(dur)
a.scriptRunner.StartCron()
if containerAPI := a.containerAPI.Load(); containerAPI != nil {
// Inform the container API that the agent is ready.
// This allows us to start watching for changes to
// the devcontainer configuration files.
containerAPI.SignalReady()
}
})
if err != nil {
return xerrors.Errorf("track conn goroutine: %w", err)
Expand Down
Loading
Loading