-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat(lxd): store and check PID when launching instances #464
Conversation
Signed-off-by: Callahan Kovacs <[email protected]>
Signed-off-by: Callahan Kovacs <[email protected]>
Signed-off-by: Callahan Kovacs <[email protected]>
Signed-off-by: Callahan Kovacs <[email protected]>
Signed-off-by: Callahan Kovacs <[email protected]>
fd42b80
to
0c9a8ed
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #464 +/- ##
=======================================
Coverage 99.00% 99.01%
=======================================
Files 57 57
Lines 4532 4558 +26
=======================================
+ Hits 4487 4513 +26
Misses 45 45 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Callahan Kovacs <[email protected]>
0c9a8ed
to
d58ea04
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Alex Lowe <[email protected]>
tox
?The PID of the process that creates an instance is stored in the instance's LXD config and is used when launching an instance.
The
is_valid()
check for base instances now ensures an instance is stopped and has been fully setup. If another process is busy launching and setting up the base instance, thenis_valid()
will wait (and eventually time out). If the process that launched the base instance is inactive, then the instance is auto-cleaned (deleted and recreated).This last statement has a slight behavioral change. Previously, craft-providers raised a generic error (
Instance setup failed. Check LXD logs for more details
) and required the user to delete the base instance manually. Now, the bad base instance will be auto-cleaned. I think this is OK because this aligns with the design of the rest oflauncher
module where errors and misconfigured instances are auto-cleaned.I recommend reviewing this per-commit.
The base instance has a new config value (the pid), so this must be paired with #465.
Fixes #448
Fixes #455
(CRAFT-2221)