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

Build images with cockpit (HMS-5417) #2787

Merged
merged 10 commits into from
Jan 30, 2025

Conversation

croissanne
Copy link
Member

@croissanne croissanne commented Jan 22, 2025

cockpit-ib.mp4

JIRA: HMS-5417

@croissanne croissanne changed the title Blueprints and composes cockpit build images with cockpit Jan 22, 2025
@croissanne croissanne force-pushed the blueprints-and-composes-cockpit branch 2 times, most recently from 253559b to d2479f6 Compare January 23, 2025 12:58
@croissanne croissanne force-pushed the blueprints-and-composes-cockpit branch 2 times, most recently from df3f978 to 979eb42 Compare January 24, 2025 13:28
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 13.10345% with 378 lines in your changes missing coverage. Please review.

Project coverage is 83.22%. Comparing base (4145157) to head (df0fbcc).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/store/cockpitApi.ts 9.41% 202 Missing ⚠️
...ueprints/helpers/onPremToHostedBlueprintMapper.tsx 2.10% 93 Missing ⚠️
src/Components/ImagesTable/ImageDetails.tsx 4.00% 24 Missing ⚠️
src/Components/ImagesTable/Status.tsx 5.55% 17 Missing ⚠️
src/Components/ImagesTable/Instance.tsx 6.66% 14 Missing ⚠️
src/Components/ImagesTable/ImagesTable.tsx 35.00% 13 Missing ⚠️
src/test/mocks/cockpit/index.ts 9.09% 10 Missing ⚠️
src/store/backendApi.ts 66.66% 4 Missing ⚠️
src/test/mocks/cockpit/fsinfo.ts 0.00% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2787      +/-   ##
==========================================
- Coverage   84.55%   83.22%   -1.33%     
==========================================
  Files         190      190              
  Lines       21811    22214     +403     
  Branches     2169     2174       +5     
==========================================
+ Hits        18442    18488      +46     
- Misses       3347     3704     +357     
  Partials       22       22              
Files with missing lines Coverage Δ
src/Components/Blueprints/BuildImagesButton.tsx 71.64% <ø> (ø)
src/constants.ts 100.00% <100.00%> (ø)
src/store/emptyCockpitApi.ts 100.00% <100.00%> (ø)
src/store/enhancedCockpitApi.ts 52.08% <100.00%> (+15.97%) ⬆️
src/test/mocks/cockpit/fsinfo.ts 8.33% <0.00%> (-0.76%) ⬇️
src/store/backendApi.ts 67.44% <66.66%> (-0.31%) ⬇️
src/test/mocks/cockpit/index.ts 17.14% <9.09%> (-3.70%) ⬇️
src/Components/ImagesTable/ImagesTable.tsx 89.38% <35.00%> (-2.81%) ⬇️
src/Components/ImagesTable/Instance.tsx 49.47% <6.66%> (-2.37%) ⬇️
src/Components/ImagesTable/Status.tsx 82.03% <5.55%> (-5.79%) ⬇️
... and 3 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4145157...df0fbcc. Read the comment docs.

@croissanne croissanne force-pushed the blueprints-and-composes-cockpit branch from 979eb42 to e417e88 Compare January 27, 2025 10:02
@croissanne croissanne force-pushed the blueprints-and-composes-cockpit branch from e417e88 to 929c498 Compare January 28, 2025 17:45
@croissanne croissanne changed the title build images with cockpit Build images with cockpit Jan 28, 2025
@croissanne croissanne marked this pull request as ready for review January 28, 2025 17:46
@croissanne croissanne force-pushed the blueprints-and-composes-cockpit branch from 929c498 to 01f12b6 Compare January 28, 2025 17:52
Copy link
Collaborator

@kingsleyzissou kingsleyzissou left a comment

Choose a reason for hiding this comment

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

Great stuff. Just had some comments about the tags stuff that could be added to the enhancedCockpitApi instead but pretty minor.

Edit to add: this should probably clear up the type errors too

src/store/cockpitApi.ts Outdated Show resolved Hide resolved
src/store/cockpitApi.ts Outdated Show resolved Hide resolved
src/store/cockpitApi.ts Outdated Show resolved Hide resolved
@croissanne croissanne force-pushed the blueprints-and-composes-cockpit branch 2 times, most recently from d605846 to 32be84b Compare January 29, 2025 10:22
Copy link
Collaborator

@kingsleyzissou kingsleyzissou left a comment

Choose a reason for hiding this comment

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

LGTM, think the PR just needs a description :)

@croissanne
Copy link
Member Author

/jira-epic COMPOSER-2411

@schutzbot schutzbot changed the title Build images with cockpit Build images with cockpit (HMS-5417) Jan 29, 2025
`.cache` is for writing, `.local/share` is technically static data.
The structure of the local cache is now:
```
└── blueprint
    └── blueprint.json
    └── image1
    └── image2
└── blueprint2
    └── blueprint2.json
    └── image1
```

Building an image reads the blueprint, and creates a new image file
under the relevant blueprint folder, which contains the image request.

The image request that's sent off to composer and the request that's
saved differs slightly in the upload structures.
The mixed api supports both the service and on-prem.
Reads all of the image entries under the cache.
Finds the relevant compose, asks for its status and reads the original
compose request from disk.
Adds `mtime` tot fsinfo, and `replace` to `cockpit.file`.
With the custom query functions the cached data from getComposes and
getBlueprintComposes doesn't get invalidated. Luckily RTKQuery provides
a mechanism to invalidate the cache after a mutation.
@croissanne croissanne force-pushed the blueprints-and-composes-cockpit branch from 32be84b to df0fbcc Compare January 29, 2025 13:53
@croissanne croissanne merged commit 40d1d4c into osbuild:main Jan 30, 2025
16 of 19 checks passed
@croissanne croissanne deleted the blueprints-and-composes-cockpit branch January 30, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants