Skip to content

feat(status): display pinned deployments #1285

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

Merged
merged 1 commit into from
May 15, 2025

Conversation

p5
Copy link
Contributor

@p5 p5 commented Apr 25, 2025

Part of #904

Displays pinned deployments as part of "bootc status".
Includes unit tests to ensure correct parsing of the
pinned deployments, and that they are displayed in
human readable formats correctly.


Please find below how they look in both human and machine readable formats.
When the staged, booted or rollback deployments are pinned, the information is not duplicated in the outputs.

Please let me know if this output format is alright, or if you'd prefer some changes.

Human readable:

❯ sudo ./target/debug/bootc status          
[sudo] password for admin: 
● Booted image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
        Digest: sha256:fa8a2a7212a110caedb3729d70513fbcd518c4ed3f011ff16f4531b3b7a4d60e (amd64)
       Version: 250507 (2025-05-07T01:44:43Z)
        Pinned: yes

  Rollback image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
          Digest: sha256:6c4d19f8ecc21c055c81d0993921399f0cc034ec69ad49bece9c12f5bb1dddf8 (amd64)
         Version: 250505 (2025-05-05T01:46:41Z)

 Other image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
      Digest: sha256:244bcf3584f5dd9bb424f5dbb0084709c9b68a12299e8242cb4e7fa74e31a7a9 (amd64)
     Version: 250427 (2025-04-27T01:44:43Z)
      Pinned: yes

 Other image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
      Digest: sha256:b1874fbb5f442657f3cc07a547c54292ca3f24fe828ab4f3132df4c9f23f1e3e (amd64)
     Version: 250425 (2025-04-25T01:46:32Z)
      Pinned: yes

YAML:

❯ sudo ./target/debug/bootc status --format yaml
apiVersion: org.containers.bootc/v1
kind: BootcHost
metadata:
  name: host
spec:
  image:
    image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
    transport: registry
    signature: containerPolicy
  bootOrder: default
status:
  staged: null
  booted:
    image:
      image:
        image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
        transport: registry
        signature: containerPolicy
      version: '250507'
      timestamp: 2025-05-07T01:44:43Z
      imageDigest: sha256:fa8a2a7212a110caedb3729d70513fbcd518c4ed3f011ff16f4531b3b7a4d60e
      architecture: amd64
    cachedUpdate: null
    incompatible: false
    pinned: true
    store: ostreeContainer
    ostree:
      checksum: fd78346c7935323a1af213718b85ca21b25f69ea91affa5c30c38cb2ff3eebf3
      deploySerial: 0
  rollback:
    image:
      image:
        image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
        transport: registry
        signature: containerPolicy
      version: '250505'
      timestamp: 2025-05-05T01:46:41Z
      imageDigest: sha256:6c4d19f8ecc21c055c81d0993921399f0cc034ec69ad49bece9c12f5bb1dddf8
      architecture: amd64
    cachedUpdate:
      image:
        image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
        transport: registry
        signature: containerPolicy
      version: '250507'
      timestamp: 2025-05-07T01:44:43Z
      imageDigest: sha256:fa8a2a7212a110caedb3729d70513fbcd518c4ed3f011ff16f4531b3b7a4d60e
      architecture: amd64
    incompatible: false
    pinned: false
    store: ostreeContainer
    ostree:
      checksum: 9af4a6d0f76b6b6d0fe0ca6d8bd87f01ec328c959fe456f755300405d7fd1b02
      deploySerial: 0
  otherDeployments:
  - image:
      image:
        image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
        transport: registry
      version: '250427'
      timestamp: 2025-04-27T01:44:43Z
      imageDigest: sha256:244bcf3584f5dd9bb424f5dbb0084709c9b68a12299e8242cb4e7fa74e31a7a9
      architecture: amd64
    cachedUpdate:
      image:
        image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
        transport: registry
      version: '250429'
      timestamp: 2025-04-29T01:45:31Z
      imageDigest: sha256:6f37694f15a64e92f04d8341e0f1ea5d8c67c0fda39f916c8b7740075468a331
      architecture: amd64
    incompatible: false
    pinned: true
    store: ostreeContainer
    ostree:
      checksum: d67eb1fcd1afa31735d278255a94fe9783c5ac5b7b443ae27d5d13a0ef8e0b03
      deploySerial: 0
  - image:
      image:
        image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
        transport: registry
        signature: containerPolicy
      version: '250425'
      timestamp: 2025-04-25T01:46:32Z
      imageDigest: sha256:b1874fbb5f442657f3cc07a547c54292ca3f24fe828ab4f3132df4c9f23f1e3e
      architecture: amd64
    cachedUpdate:
      image:
        image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
        transport: registry
        signature: containerPolicy
      version: '250427'
      timestamp: 2025-04-27T01:44:43Z
      imageDigest: sha256:244bcf3584f5dd9bb424f5dbb0084709c9b68a12299e8242cb4e7fa74e31a7a9
      architecture: amd64
    incompatible: false
    pinned: true
    store: ostreeContainer
    ostree:
      checksum: cac59f70910b5ef683d1e6589609789d104d206c18089efa14b51619466cfe17
      deploySerial: 1
  rollbackQueued: false
  type: bootcHost

@p5 p5 force-pushed the readonly-pinning branch 3 times, most recently from 12f9499 to 82f0a72 Compare April 25, 2025 17:37
@p5 p5 marked this pull request as ready for review April 25, 2025 17:38
@p5 p5 force-pushed the readonly-pinning branch from 82f0a72 to 5f6622c Compare April 26, 2025 21:34
Copy link
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for working on this!!

cgwalters added a commit that referenced this pull request Apr 29, 2025
@p5 p5 force-pushed the readonly-pinning branch 2 times, most recently from 8ab8d31 to 9a8fee3 Compare May 8, 2025 22:37
@jmarrero jmarrero mentioned this pull request May 9, 2025
@cgwalters cgwalters added enhancement New feature or request triaged This looks like a valid issue area/client Related to the client/CLI gain/medium Medium gain labels May 15, 2025
Copy link
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the delay in review, looks good to me!

One minor thing right now is you'll need to rebase and update the new spec fixture because there's a new required stateroot field.

@cgwalters
Copy link
Collaborator

you'll need to rebase

BTW I tried to do this myself to save the review -> wait -> edit -> push -> wait -> merge cycle, but I think you have "allow edits from maintainers" disabled on your PRs.

@p5
Copy link
Contributor Author

p5 commented May 15, 2025

Thanks! Will rebase shortly and re-test.

Sorry about the delay in review

No worries at all! I'm much more excited for the Composefs backend and factory reset work than being able to see pinned deployments 😆

BTW I tried to do this myself to save the review -> wait -> edit -> push -> wait -> merge cycle, but I think you have "allow edits from maintainers" disabled on your PRs.

I've not explicitly disabled anything. Or at least, not on purpose.
Will try and find how to change this for future PRs.

Part of bootc-dev#904

Displays pinned deployments as part of "bootc status".
Includes unit tests to ensure correct parsing of the
pinned deployments, and that they are displayed in
human readable formats correctly.

Signed-off-by: Robert Sturla <[email protected]>
@p5 p5 force-pushed the readonly-pinning branch from 9a8fee3 to 5358fda Compare May 15, 2025 17:47
@p5
Copy link
Contributor Author

p5 commented May 15, 2025

Rebased onto the latest main branch.
No conflicts, only adding stateroot: default onto the test fixture.

❯ cat ../../diff.diff
diff --git a/lib/src/fixtures/spec-booted-pinned.yaml b/lib/src/fixtures/spec-booted-pinned.yaml
index ddb8e5b..4d460e4 100644
--- a/lib/src/fixtures/spec-booted-pinned.yaml
+++ b/lib/src/fixtures/spec-booted-pinned.yaml
@@ -24,6 +24,7 @@ status:
     ostree:
       checksum: 439f6bd2e2361bee292c1f31840d798c5ac5ba76483b8021dc9f7b0164ac0f48
       deploySerial: 0
+      stateroot: default
   otherDeployments:
   - image:
       image:
@@ -39,6 +40,7 @@ status:
     ostree:
       checksum: 99b2cc3b6edce9ebaef6a6076effa5ee3e1dcff3523016ffc94a1b27c6c67e12
       deploySerial: 0
+      stateroot: default
   rollback: null
   rollbackQueued: false
   type: bootcHost

It all still functions locally as before.

❯ sudo ./target/debug/bootc status              
[sudo] password for admin: 
● Booted image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open@sha256:5db6d8b5f34d3cbdaa1e82ed0152a5ac980076d19317d4269db149cbde057bb2
        Digest: sha256:5db6d8b5f34d3cbdaa1e82ed0152a5ac980076d19317d4269db149cbde057bb2 (amd64)
       Version: 250509 (2025-05-09T01:45:48Z)

  Rollback image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
          Digest: sha256:fa8a2a7212a110caedb3729d70513fbcd518c4ed3f011ff16f4531b3b7a4d60e (amd64)
         Version: 250507 (2025-05-07T01:44:43Z)
          Pinned: yes

   Other image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
        Digest: sha256:244bcf3584f5dd9bb424f5dbb0084709c9b68a12299e8242cb4e7fa74e31a7a9 (amd64)
       Version: 250427 (2025-04-27T01:44:43Z)
        Pinned: yes

   Other image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
        Digest: sha256:b1874fbb5f442657f3cc07a547c54292ca3f24fe828ab4f3132df4c9f23f1e3e (amd64)
       Version: 250425 (2025-04-25T01:46:32Z)
        Pinned: yes

I'd much rather you be nitpicky when reviewing this PR than create follow ups. This is how I'll improve.

@cgwalters cgwalters merged commit f4a175d into bootc-dev:main May 15, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/client Related to the client/CLI enhancement New feature or request gain/medium Medium gain triaged This looks like a valid issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants