Skip to content

Re-add shell debug util #3024

@sipsma

Description

@sipsma

A while back we had a util that dropped you into an shell with an arbitrary buildkit FS mounted, core of the implementation here: https://github.com/dagger/cloak/blob/561153a1f499948f9593fedf6a8b8603e1939d57/engine/engine.go#L126-L142

This was extremely useful at the time for debugging. Without it, you usually have to submit execops that operate essentially as println debug statements.

We should re-add this util. To start very simple, we can just support the ability to drop into a shell at a given FSID when using the cloak CLI. Further enhancements after that include:

  1. The ability to drop into a failed exec (including the changes made during the failure). While undocumented, Buildkit supports this: https://github.com/moby/buildkit/blob/c9a0f4d2de095591e742d7f411d9ed36a03a1c4e/client/build_test.go#L1278-L1310
  2. The ability to drop into a shell when running a script (perhaps with a CLOAK_DEBUG_SHELL=true env var or something)
  3. The ability to access the shell from a web browser. This requires exposing it over a more generic protocol directly from the cloak engine. One possible path to approaching this is with websockets, as mentioned here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/engineAbout dagger core engine

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions