Skip to content
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

Interactive debugger #4463

Closed
shykes opened this issue Jan 26, 2023 · 19 comments
Closed

Interactive debugger #4463

shykes opened this issue Jan 26, 2023 · 19 comments

Comments

@shykes
Copy link
Contributor

shykes commented Jan 26, 2023

Note: this is implemented as of Dagger 0.12

It would be amazing to have a way to add "breakpoints" to the DAG, and interactively inspect the state at the given point (via an interactive shell for example).

This has been requested and proposed many times, and we even saw a proof-of-concept by @aluzzardi :) This issue is for tracking and lobbying purposes 😄

@schlapzz
Copy link
Contributor

+1 for this feature. In my experience this would be extrem helpful to debug problems "beyond" the SDKs. I found myself often in the situation when I wish I have the option to inspect the file system after a new directory mount or command execution.

@jpadams
Copy link
Contributor

jpadams commented Jun 2, 2023

From user in Discord:
https://discord.com/channels/707636530424053791/708371226174685314/1114265034009346108

what is the easiest (shortest? 😁) way from a failed step in a pipeline, to debugging it interactively in the same environment, so you could run commands/inspect filesystem and such? — basically, mimicking targets in a dockerfile, and being able to exec into the failed container state? — preferably using go sdk — but any pointers appreciated, i’ve been mucking with nsenter from the buildkit host — but hoping for something along the lines of earthly -i if possible 😄

@jpadams
Copy link
Contributor

jpadams commented Jun 2, 2023

@jpadams
Copy link
Contributor

jpadams commented Jun 2, 2023

From discord:
https://discord.com/channels/707636530424053791/708371226174685314/1071139783037952010

Hey yall - trying to dig through the discord here - wondering about debugging containers in intermediate steps. Is this possible?

I think it had been discussed a while back. I've been pinned on an older version of dagger for a little bit, curious about developments since then

edit: Just found #4463 - I'll follow for updates there.

@jpadams
Copy link
Contributor

jpadams commented Jun 2, 2023

@schlapzz
Copy link
Contributor

schlapzz commented Jun 4, 2023

I think a good starting point would be to implement the --invoke=on-error from Buildkit.
This would help at least to debug failing builds.

docker/buildx#1640

@jpadams
Copy link
Contributor

jpadams commented Jun 8, 2023

@verdverm
Copy link
Contributor

This would also be useful in a non-debugging step, where I may want to create ephemeral, dagger powered environments. In other words, the end of a pipeline can be an interactive session, or maybe an intermediate stage where the user has to do something, and when they are done, the pipeline continues.

@helderco
Copy link
Contributor

From Discord:

Screenshot 2023-07-29 at 16 33 32

@robertu94
Copy link

robertu94 commented Oct 27, 2023

This would be a great feature for some use cases we deal with. Specifically we have builds that we do seldomly that take hours each time. If these fail in a container the current best that we can do is experience the failure, start a new interactive container instance on the previous image, and run the command again and wait for another several hours until it fails again so we can debug interactively.

@robertu94
Copy link

Another separate cool use case is if you could look at diffs between images interactively or iteratively/interactively walk the image history to consider all versions of a file in all the images produced by a pipeline for debugging.

@suhlig
Copy link

suhlig commented Nov 4, 2023

Coming from a Concourse background, where fly intercept (gives you an interactive shell in a running or failed container) is one of the commands most praised by developers: YES PLEASE.

@gmile gmile mentioned this issue Apr 2, 2024
7 tasks
@samalba samalba removed the kind/dx label Jun 4, 2024
@rawkode
Copy link
Contributor

rawkode commented Sep 13, 2024

Just came to open an issue for a withBreapoint() method on a Container.

Yes, please!

@shykes
Copy link
Contributor Author

shykes commented Sep 14, 2024

@rawkode have you tried Container.terminal()?

@rawkode
Copy link
Contributor

rawkode commented Sep 14, 2024

Yes, the with breakpoint idea came to me after having to continually edit functions to return a container and commenting out code to debug.

withBreakpoint() could be a function that is a noop most of the time, except when we enable them with Dagger call. It would simplify getting into a terminal without juggling our code.

@rawkode
Copy link
Contributor

rawkode commented Sep 14, 2024

Oh, wait. Are you saying I can add .terminal to my code and it works? No more commenting 😮

@shykes
Copy link
Contributor Author

shykes commented Sep 14, 2024

Oh, wait. Are you saying I can add .terminal to my code and it works? No more commenting 😮

yes :) @aluzzardi was also tired of having to do what you described, and took matters in his own hands 💪

@shykes
Copy link
Contributor Author

shykes commented Sep 14, 2024

@rawkode bonus you can also do Directory.terminal()

@rawkode
Copy link
Contributor

rawkode commented Sep 14, 2024

Y'all are too good to us.

Love it!

@shykes shykes closed this as completed Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants