Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(dogfood/coder): add shutdown script and graceful agent shutdown#17110

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mafredri merged 1 commit intomainfrommafredri/fix-dogfood-shutdown-script
Mar 26, 2025
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletionsdogfood/coder/main.tf
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -357,6 +357,14 @@ resource "coder_agent" "dev" {
cd "${local.repo_dir}" && make clean
cd "${local.repo_dir}/site" && pnpm install
EOT

shutdown_script = <<-EOT
#!/usr/bin/env bash
set -eux -o pipefail

# Stop the Docker service to prevent errors during workspace destroy.
sudo service docker stop
EOT
}

# Add a cost so we get some quota usage in dev.coder.com
Expand DownExpand Up@@ -418,6 +426,10 @@ resource "docker_container" "workspace" {
# CPU limits are unnecessary since Docker will load balance automatically
memory = data.coder_workspace_owner.me.name == "code-asher" ? 65536 : 32768
runtime = "sysbox-runc"
# Ensure the workspace is given time to execute shutdown scripts.
destroy_grace_seconds = 60
stop_timeout = 60
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Does this make sense as we actually do not stop the container but destroy it.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I believe when a container is destroyed, it is first stopped. See motivation here#6174 which explains why we're setting bothdestroy_grace_seconds andstop_timeout.

stop_signal = "SIGINT"
env = [
"CODER_AGENT_TOKEN=${coder_agent.dev.token}",
"USE_CAP_NET_ADMIN=true",
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp