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

Add a human readable output for bootc status #408

Open
mrguitar opened this issue Mar 20, 2024 · 5 comments · May be fixed by #602
Open

Add a human readable output for bootc status #408

mrguitar opened this issue Mar 20, 2024 · 5 comments · May be fixed by #602
Assignees
Labels
area/cli Related to the client/CLI enhancement New feature or request good first issue Good for newcomers

Comments

@mrguitar
Copy link
Contributor

Coming from rpm-ostree, I can quickly see & more importantly grok the output from rpm-ostree status. bootc status has all the good stuff, but it takes much longer to wade through the output, and scroll up in the terminal, etc. Adding an option to boil it down like --pretty or --human, as Colin suggested, would really help speed me up and add better clarity for users. I can definitely see a kube admin preferring the existing output, so let's not lose that.

@cgwalters cgwalters added enhancement New feature or request area/cli Related to the client/CLI good first issue Good for newcomers labels Mar 20, 2024
@cgwalters
Copy link
Collaborator

Yes totally! To give more color to this the current bootc design is very much influenced by the "imperative + DBus API" of rpm-ostree being tough to deal with for systems like the https://github.com/openshift/machine-config-operator/ that want to actually manage the system declaratively in a Kube-like style. IOW we want to support agents scripting, in the general case.

However we should totally have nice ergonomics for standalone agentless systems, and this is very much part of that. Labeling as good-first-issue.

@lukewarmtemp
Copy link
Contributor

This is the current output for bootc status:

sudo ./bootc status
apiVersion: org.containers.bootc/v1alpha1
kind: BootcHost
metadata:
  name: host
spec:
  image:
    image: localhost:5000/fcos:latest
    transport: registry
  bootOrder: default
status:
  staged: null
  booted:
    image:
      image:
        image: localhost:5000/fcos:latest
        transport: registry
      version: 40.20240504.3.0
      timestamp: null
      imageDigest: sha256:2f7207cddc3b01ee0980a4c8152d1277e0a0b5fe0ebff27bcc5e9b101e08d7ce
    cachedUpdate: null
    incompatible: false
    pinned: false
    ostree:
      checksum: 05b704430628019881d929c204ad4293230dc34d7df962428268faf145be8ac7
      deploySerial: 0
  rollback:
    image:
      image:
        image: quay.io/luyang/fcos-karg-test2
        transport: registry
      version: 40.20240504.3.0
      timestamp: null
      imageDigest: sha256:d5d43c888d3017c19ee912714ce206716dd56564eea5818e5b2f32f6e74feae5
    cachedUpdate: null
    incompatible: false
    pinned: false
    ostree:
      checksum: 6f3d22c95edbd7257e5de1a6dcd88e31c4536031776230e4daa1629f679cc098
      deploySerial: 0
  rollbackQueued: false
  type: bootcHost

What information is most important to keep when making the human readable option?

@prestist prestist self-assigned this Jun 6, 2024
@miabbott
Copy link
Contributor

miabbott commented Jun 6, 2024

IMO, I would start with a similar output to what we have in rpm-ostree status

$ rpm-ostree status
State: idle
AutomaticUpdates: stage; rpm-ostreed-automatic.timer: last run 6h ago
Deployments:
  ostree-image-signed:docker://ghcr.io/miabbott/rh-meatwad:latest
                   Digest: sha256:1f1b95df8599e5a61ffbc6d8c118d0a16ee83a0adeae8e5303972df3abc5ee1b
                  Version: 40.20240605.0 (2024-06-05T17:08:06Z)
                     Diff: 232 upgraded, 1 removed, 2 added

● ostree-image-signed:docker://ghcr.io/miabbott/rh-meatwad:latest
                   Digest: sha256:5d709d78ae0054a10fb3eb8a6332d93c1598b6fc1effb5be2b32886a09a7dd22
                  Version: 40.20240521.0 (2024-05-21T15:48:42Z)

  ostree-image-signed:docker://ghcr.io/miabbott/rh-meatwad:latest
                   Digest: sha256:18d3d274ca7442613c7dd3f78ba80476dcc37f64a6851b37288730ee96f3e780
                  Version: 39.20240509.0 (2024-05-09T17:07:45Z)

From bootc status, I would capture the image name, the version, and the imageDigest and represent them for the booted and rollback deployments.

@lukewarmtemp lukewarmtemp linked a pull request Jun 13, 2024 that will close this issue
@lukewarmtemp
Copy link
Contributor

We've been working through this issue in our weekly mobbing sessions and came across @cgwalters recent comment: #602 (comment). Originally, we were thinking of creating and printing a smaller yaml with the image name, the version, and the imageDigest. However, if we've interpreted the comment correctly, it might be better to just extract the fields and format them into a print statement?

A rough example:

if (opt.pretty) {
  println!("image name: {:?}", host.status.booted.image)
  println!("version: {:?}", host.status.booted.version)
}
image name: quay.io/luyang/fcos-karg-test2
   version: 40.20240504.3.0

@cgwalters
Copy link
Collaborator

Yes, though I think we should consider how to render important things like "you have a new image staged", etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to the client/CLI enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants