envd icon indicating copy to clipboard operation
envd copied to clipboard

feat(CLI): Support debug command

Open gaocegege opened this issue 3 years ago • 5 comments

Description

We need to support debug commands to help users debug the build artifact easily.

Use case

Users may encounter problems during the build process. And the error is hard to resolve since the build process is complex.

As the envd user, I want to get the failed build artifact running, thus I can debug it in the running environment to know why it fails.

Ref https://github.com/ktock/buildg

gaocegege avatar May 09 '22 07:05 gaocegege

Some references:

  • https://github.com/moby/buildkit/pull/2835
  • https://github.com/moby/buildkit/pull/2813
  • https://github.com/moby/buildkit/issues/1472
  • https://github.com/docker/buildx/pull/1168
  • https://github.com/moby/buildkit/issues/749
  • https://github.com/docker/buildx/issues/1104

gaocegege avatar Jul 13 '22 08:07 gaocegege

https://github.com/ktock/buildg seems a good option.

aseaday avatar Jul 13 '22 16:07 aseaday

IMO, envd manifest shoud be a statement of final environment rather than the build process. So I think this issue's priority is not as important as others. Envd users only write out what they need.

aseaday avatar Jul 13 '22 17:07 aseaday

@aseaday Could you please explain more about it?

gaocegege avatar Jul 13 '22 23:07 gaocegege

This command is used to debug why the image fails to build. For example:

def build():
     install.conda_packages(name = [
        "un-existed",
    ], channel= ["pytorch"])
    base(os="ubuntu20.04", language="python3.8")
$ envd build
err: ...
(envd-debug) > exec bash
$ # Debug here.

gaocegege avatar Jul 14 '22 00:07 gaocegege