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

feat(CLI): envd doctor command #283

Closed
gaocegege opened this issue Jun 12, 2022 · 7 comments · Fixed by #471
Closed

feat(CLI): envd doctor command #283

gaocegege opened this issue Jun 12, 2022 · 7 comments · Fixed by #471

Comments

@gaocegege
Copy link
Member

Description

envd will print out status information in envd doctor:

  • envd version
  • Operating system
  • Docker host and version
  • Kubernetes version
  • Type of Kubernetes cluster (Docker for Mac, Microk8s, etc)
  • Container runtime
@gaocegege
Copy link
Member Author

Ref #124

@popfido
Copy link
Member

popfido commented Jun 17, 2022

This might be a good first issue for golang beginner like me lol. May I be the assignee?

Several issues about the description:

  • There exists a short option or some commands (like version). Is it necessary for us to prepare one for doctor? If yes, what kind of status information should be left in short mode?
  • What is the exact information of Container runtime printed by doctor? When there are multiple containers generatedby envd are running, shall we print them all?
  • What is the Docker Host?
  • How can the program find the type of Kubernetes cluster.

@gaocegege
Copy link
Member Author

Thanks for your contribution! 🎉 👍 I assigned you. I used to think the issue is a little hard to newcomers. Thus I removed the good-first-issue label.

There exists a short option or some commands (like version). Is it necessary for us to prepare one for doctor? If yes, what kind of status information should be left in short mode?

I think we can make a flag envd version --detail instead of a new command, WDYT?

What is the exact information of Container runtime printed by doctor? When there are multiple containers generatedby envd are running, shall we print them all?

We can get the Docker host and version and container runtime via Docker API call docker info

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Docker Buildx (Docker Inc., v0.8.2-docker)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 13
  Running: 4
  Paused: 0
  Stopped: 9
 Images: 148
 Server Version: 20.10.16
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux nvidia runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 212e8b6fa2f44b9c21b2798135fc6fb7c53efc16
 runc version: v1.1.1-0-g52de29d
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.13.0-44-generic
 Operating System: Ubuntu 20.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 31.28GiB
 Name: cegao
 ID: 5YKB:IS5J:33IZ:VQMR:I3EE:53XI:6OYN:552P:HPTQ:3WTU:H34X:G5BT
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: gaocegege
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Registry Mirrors:
  https://docker.mirrors.sjtug.sjtu.edu.cn/
 Live Restore Enabled: false

What is the Docker Host?

We can just print the docker host version from the docker info.

Server:
 Server Version: 20.10.16

How can the program find the type of Kubernetes cluster.

Now we do not support Kubernetes yet #179 #237, just ignore it.

@popfido
Copy link
Member

popfido commented Jun 17, 2022

@gaocegege Cool. It seems that all the information now is about versioning. Then I think it's okay to put it as a sub option for versioning. But when use --detail, do envd need to print those information in normal version command?

@gaocegege
Copy link
Member Author

do envd need to print that information in normal version command?

I do not think we need this info when running envd version. Since it is not helpful to users.

@popfido
Copy link
Member

popfido commented Jun 17, 2022

I mean when running envd version --detail, should informations in envd version be printed?

@gaocegege
Copy link
Member Author

I mean when running envd version --detail, should informations in envd version be printed?

Oh I think so.

gaocegege pushed a commit that referenced this issue Jun 20, 2022
* Add '--detail' for detail version information

Signed-off-by: Popfido <wanghailin317@gmail.com>

* tidy go mods

Signed-off-by: Popfido <wanghailin317@gmail.com>

* fixed issues according to CI test report

Signed-off-by: Popfido <wanghailin317@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants