Skip to content

Conversation

roypat
Copy link
Contributor

@roypat roypat commented Sep 12, 2024

Always block inside Microvm.start() until the vm has finished booting
(if a network device is present in the microvm). This means that we no
longer need wait_for_up calls after every start() call.

Existing wait_for_ups were replaced with

grep -rl wait_for_up tests/integration_tests/ \
    |xargs sed '/wait_for_up/d' -i

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this
    PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet
    contribution quality standards.

  • This functionality cannot be added in rust-vmm.

Always block inside `Microvm.start()` until the vm has finished booting
(if a network device is present in the microvm). This means that we no
longer need `wait_for_up` calls after every `start()` call.

Signed-off-by: Patrick Roy <[email protected]>
If we start Firecracker with a config file, then the microvm will boot
in `.spawn()` instead of `.start()` (since we are not driving
Firecracker via API requests). Thus, if this is the case, put the
`wait_for_up` into `Microvm.spawn()`.

Signed-off-by: Patrick Roy <[email protected]>
@roypat roypat force-pushed the wait-for-up-by-default branch from 7fcf5f2 to eab4731 Compare September 12, 2024 13:57
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.32%. Comparing base (8eea9df) to head (6612049).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4798   +/-   ##
=======================================
  Coverage   84.32%   84.32%           
=======================================
  Files         249      249           
  Lines       27521    27521           
=======================================
  Hits        23206    23206           
  Misses       4315     4315           
Flag Coverage Δ
5.10-c5n.metal 84.54% <ø> (ø)
5.10-m5n.metal 84.52% <ø> (-0.01%) ⬇️
5.10-m6a.metal 83.81% <ø> (ø)
5.10-m6g.metal 80.89% <ø> (ø)
5.10-m6i.metal 84.52% <ø> (ø)
5.10-m7g.metal 80.89% <ø> (ø)
6.1-c5n.metal 84.54% <ø> (ø)
6.1-m5n.metal 84.52% <ø> (-0.01%) ⬇️
6.1-m6a.metal 83.82% <ø> (+<0.01%) ⬆️
6.1-m6g.metal 80.89% <ø> (ø)
6.1-m6i.metal 84.51% <ø> (ø)
6.1-m7g.metal 80.89% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@roypat roypat force-pushed the wait-for-up-by-default branch from eab4731 to f1f594c Compare September 12, 2024 14:13
After restoring a snapshot, we are not waiting for the VM to finish
booting (it needs to have done that before we took a snapshot), but
having a `wait_for_up` here is still a good sanity check for ensuring
the VM is still responsive. So far our tests have been inconsistent on
whether to put a `wait_for_up` here. This makes them consistent by
always doing `wait_for_up` if a network device is available.

Signed-off-by: Patrick Roy <[email protected]>
 `wait_for_up`s were replaced with

```
grep -rl wait_for_up tests/integration_tests/ \
|xargs sed '/wait_for_up/d' -i
```

Signed-off-by: Patrick Roy <[email protected]>
`vm.start()` already asserts `vm.state == "Running"`, so no need to do
it again at the callsite.

Signed-off-by: Patrick Roy <[email protected]>
@roypat roypat force-pushed the wait-for-up-by-default branch from f1f594c to 4af1906 Compare September 12, 2024 14:29
@roypat roypat marked this pull request as ready for review September 12, 2024 14:30
@roypat roypat added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Sep 12, 2024
@roypat roypat merged commit 7a8148b into firecracker-microvm:main Sep 13, 2024
6 of 7 checks passed
roypat added a commit to roypat/firecracker that referenced this pull request Sep 16, 2024
To indicate that we're really waiting until sshd is up and accepting
connections, as a proxy for the actual boot process.

Suggested during code review in firecracker-microvm#4798.

Signed-off-by: Patrick Roy <[email protected]>
roypat added a commit that referenced this pull request Sep 16, 2024
To indicate that we're really waiting until sshd is up and accepting
connections, as a proxy for the actual boot process.

Suggested during code review in #4798.

Signed-off-by: Patrick Roy <[email protected]>
RiverPhillips pushed a commit to RiverPhillips/firecracker that referenced this pull request Sep 20, 2024
To indicate that we're really waiting until sshd is up and accepting
connections, as a proxy for the actual boot process.

Suggested during code review in firecracker-microvm#4798.

Signed-off-by: Patrick Roy <[email protected]>
Signed-off-by: River Phillips <[email protected]>
ShadowCurse pushed a commit to ShadowCurse/firecracker that referenced this pull request Nov 5, 2024
To indicate that we're really waiting until sshd is up and accepting
connections, as a proxy for the actual boot process.

Suggested during code review in firecracker-microvm#4798.

Signed-off-by: Patrick Roy <[email protected]>
ShadowCurse pushed a commit to ShadowCurse/firecracker that referenced this pull request Nov 5, 2024
To indicate that we're really waiting until sshd is up and accepting
connections, as a proxy for the actual boot process.

Suggested during code review in firecracker-microvm#4798.

Signed-off-by: Patrick Roy <[email protected]>
ShadowCurse pushed a commit to ShadowCurse/firecracker that referenced this pull request Nov 5, 2024
To indicate that we're really waiting until sshd is up and accepting
connections, as a proxy for the actual boot process.

Suggested during code review in firecracker-microvm#4798.

Signed-off-by: Patrick Roy <[email protected]>
ShadowCurse pushed a commit to ShadowCurse/firecracker that referenced this pull request Nov 5, 2024
To indicate that we're really waiting until sshd is up and accepting
connections, as a proxy for the actual boot process.

Suggested during code review in firecracker-microvm#4798.

Signed-off-by: Patrick Roy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Awaiting review Indicates that a pull request is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants