Skip to content

feat(agent): Add shutdown lifecycle states and shutdown_script support - #6139

Merged
mafredri merged 21 commits into
mainfrom
mafredri/feat-shutdown-script
Mar 6, 2023
Merged

mafredri merged 21 commits into
mainfrom
mafredri/feat-shutdown-script

Conversation

@mafredri

@mafredri mafredri commented Feb 9, 2023 •

Copy link
Copy Markdown
Member

This PR adds support for agent shutdown lifecycle states and shutdown_script.

It (currently) relies on terraform provider abilities to gracefully shut down. For instance with the docker provider it can be controlled via:

resource "docker_container" "workspace" {
  destroy_grace_seconds = 30
  stop_timeout          = 30
  stop_signal           = "SIGINT"
}

The agent can handle common signals like SIGHUP, SIGINT, SIGTERM. If need be, more signals could be handled.

Builds upon #5171
Fixes #4677

Note:

  • In hindsight, I should probably have called the lifecycle states stopping, stop_timeout, stop_error, stopped, yay or nay to make this change?

@mafredri

mafredri commented Feb 13, 2023 •

Copy link
Copy Markdown
Member Author

TODOs (a1222d0) have been removed in favor of #6180 (primarily #6177).

@mtojek mtojek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

LGTM, but I didn't analyze it too deeply as the PR is massive.

@mafredri
mafredri force-pushed the mafredri/feat-shutdown-script branch from 2ac1a38 to 2ca1810 Compare February 20, 2023 13:35
@kylecarbs
kylecarbs removed their request for review February 26, 2023 18:05
@github-actions

github-actions Bot commented Mar 6, 2023

Copy link
Copy Markdown
Contributor

This Pull Request is becoming stale. In order to minimize WIP, prevent merge conflicts and keep the tracker readable, I'm going close to this PR in 3 days if there isn't more activity.

@github-actions github-actions Bot added the stale This issue is like stale bread. label Mar 6, 2023
@mtojek

mtojek commented Mar 6, 2023

Copy link
Copy Markdown
Member

Hey @mafredri! Is it something that you will continue to work soon?

@mafredri

mafredri commented Mar 6, 2023

Copy link
Copy Markdown
Member Author

Hey @mafredri! Is it something that you will continue to work soon?

Yup, I'll get this rebased and (try to) merge it today. 👍🏻

@mafredri
mafredri force-pushed the mafredri/feat-shutdown-script branch from 2ca1810 to 22ad8b9 Compare March 6, 2023 12:04
@mafredri mafredri removed the stale This issue is like stale bread. label Mar 6, 2023
@mafredri mafredri changed the title feat(agent): Add shutdown lifecycle states and shutdown_script support feat(agent): Add shutdown lifecycle states and shutdown_script support Mar 6, 2023
@mafredri
mafredri merged commit 22e3ff9 into main Mar 6, 2023
@mafredri
mafredri deleted the mafredri/feat-shutdown-script branch March 6, 2023 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run script before workspace stop

2 participants