-
Notifications
You must be signed in to change notification settings - Fork 16
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: add launch VM button #865
Conversation
6b1c9b8
to
2a40cc1
Compare
c1e9589
to
9dbe951
Compare
This is an initial implementation and meant for experimenting as parts have not been finalized yet / further discussion needed. Feel free to test it out @deboer-tim @slemeur We can further discuss this during the week! |
00a2992
to
017082e
Compare
7f889c4
to
b38fa33
Compare
Comments from my initial testing:
|
Agreed, let's launch it and maybe just link to docs near the status icon to give more information?
I don't think we should hide, but maybe an empty page saying "must build raw image, no raw image found"?
Intentional! Sorry!
Will fix.
I agree :( I think we should have that in a follow up issue / PR though.
|
Screen.Recording.2024-10-01.at.12.56.43.PM.mov@deboer-tim Ready for another review! I have done the following:
Feel free to test it out and let me know if this works and I can begin adding some unit tests so we can get this initial POC in. |
73cc1d8
to
a570f03
Compare
Ready for review with the exception of unit tests being added later. This is marked as experimental (as per the tab) and only shown for macOS users. |
packages/backend/src/launch-vm.ts
Outdated
// Before launching, make sure that we stop any previously running VM's and ignore any errors when stopping | ||
//await stopVM(); |
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.
?
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.
need to revisit the design to be more pluggable
also probably needs to have a Class/instance/state per runner as here we're passing tons of useless parameters
ACK, I'll refactor the launch-vm.ts part to make it more pluggable for future implementations (linux, windows, etc.) |
d9d4f4f
to
99c3d3f
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.
As before, testing worked without any issues.
I don't love auto-launching a 'large' VM, but that's fine for first pass. The main drawback is the VM getting reset when you leave the tab, but again that is expected for this first step.
packages/shared/src/BootcAPI.ts
Outdated
@@ -21,6 +21,7 @@ import type { ImageInfo, ImageInspectInfo, ManifestInspectInfo } from '@podman-d | |||
|
|||
export abstract class BootcApi { | |||
abstract checkPrereqs(): Promise<string | undefined>; | |||
abstract checkVMLaunchPrereqs(folder: string, architecture: string): Promise<string | undefined>; |
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.
Both backend and frontend know about list of BootcBuildInfos (i.e. disk images), but frontend grabs folder and arch from one of these to check if it can be launched, then to actually launchVM(). Seems like we could use the BootBuildInfo or its id directly instead? i.e. can I launch disk image X / run disk image Y.
561f0d5
to
b314111
Compare
@deboer-tim updated with a new commit! Let me know if that works and I can start on tests 👍 |
Thanks for the changes! I was also suggesting instead of: |
Done! I use BuildImageInfo for that section now because who knows what other information we may be passing in the future now. |
464623c
to
89f5a7a
Compare
### What does this PR do? * Using QEMU we add a feature to "Launch VM" in the background * Uses websockets, qemu as well as our xterm.js library to achieve this * Launches in "snapshot" mode so no data is written to .raw file so the file can be easily re-used ### Screenshot / video of UI <!-- If this PR is changing UI, please include screenshots or screencasts showing the difference --> ### What issues does this PR fix or reference? <!-- Include any related issues from Podman Desktop repository (or from another issue tracker). --> Closes containers#813 ### How to test this PR? <!-- Please explain steps to reproduce --> 1. Be on macOS silicon 2. `brew install qemu` 3. Build a bootc container image 4. Press launch VM button in actions bar Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Tests added and ready for review 👍 |
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.
Thanks for all the improvements, @cdrage. One minor url change noted but otherwise let's get this in and get some feedback!
@@ -17,7 +20,20 @@ async function deleteBuild(): Promise<void> { | |||
async function gotoLogs(): Promise<void> { | |||
router.goto(`/disk-image/${btoa(object.id)}/build`); | |||
} | |||
|
|||
async function gotoVM(): Promise<void> { | |||
router.goto(`/details/${btoa(object.id)}/vm`); |
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.
I think this needs to be updated to /disk-image/
after the nav change.
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
@deboer-tim Updated and confirm link works now! Agreed, let's get this in even if it's in nightly and get some feedback :) Screen.Recording.2024-10-21.at.9.34.34.AM.mov |
dismissing as changes were made based on review + two other reviews of tim and axel
feat: add launch VM button
What does this PR do?
file can be easily re-used
Screenshot / video of UI
Screen.Recording.2024-09-27.at.11.05.00.AM.mov
What issues does this PR fix or reference?
Closes #813
How to test this PR?
brew install qemu
Signed-off-by: Charlie Drage charlie@charliedrage.com