-
Notifications
You must be signed in to change notification settings - Fork 222
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
cmd/run: Optimize 'enter' and 'run' for already running containers, and turn IsToolboxContainer() into Container.IsToolbx() #1491
Conversation
a33e656
to
47be32d
Compare
Build failed. ✔️ unit-test SUCCESS in 6m 55s |
This makes it possible to confine the details of detecting a Toolbx container within the podman package, because it was not possible to use podman.IsToolboxContainer() when listing all the Toolbx containers. containers#1491
47be32d
to
4ed3c72
Compare
Build failed. ✔️ unit-test SUCCESS in 7m 06s |
This makes it possible to confine the details of detecting a Toolbx container within the podman package, because it was not possible to use podman.IsToolboxContainer() when listing all the Toolbx containers. containers#1491
4ed3c72
to
13627cc
Compare
|
Build succeeded. ✔️ unit-test SUCCESS in 7m 05s |
Build succeeded. ✔️ unit-test SUCCESS in 6m 42s |
Fallout from 238f245 containers#1493
This makes it possible to confine the details of detecting a Toolbx container within the podman package, because it was not possible to use podman.IsToolboxContainer() when listing all the Toolbx containers. containers#1491
Currently, the 'enter' and 'run' commands always invoke 'podman start' even if the Toolbx container's entry point is already running. There's no need for that. The commands already invoke 'podman inspect' to find out if the org.freedesktop.Flatpak.SessionHelper D-Bus service needs to be started. Thus, they already have what is needed to find out if the container is stopped and 'podman start' is necessary before it can be used with 'podman exec', or if it's already running. The unconditional 'podman start' invocation was followed by a second 'podman inspect' invocation to find out if the 'podman start' managed to start the container's entry point. There's no need for this second 'podman inspect' either, just like the 'podman start', when it's already known from the first 'podman inspect' that the container is running. The extra 'podman start' and 'podman inspect' invocations are sufficiently expensive to add a noticeable overhead to the 'enter' and 'run' commands. It's common to use a container that's already running, just like having multiple terminals within the same working directory, and terminal emulation applications like Ptyxis try to make it easier to do so [1]. Therefore, it's worth optimizing this code path. [1] https://gitlab.gnome.org/chergert/ptyxis https://flathub.org/apps/app.devsuite.Ptyxis containers#1070
a120b68
to
c1d30f4
Compare
Build succeeded. ✔️ unit-test SUCCESS in 6m 50s |
Build succeeded. ✔️ unit-test SUCCESS in 6m 28s |
Build succeeded. ✔️ unit-test SUCCESS in 7m 02s |
#1070