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

fix impossibility to rebuild child images #671

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

joulaud
Copy link
Member

@joulaud joulaud commented Jan 9, 2025

The Filter function (introduced by #336) reconstruct a completely new graph were unmodified images are completely discarded. I suppose it was done to have a (very) smaller graph to improve (a little) performance.

Unfortunately, the information on all direct parents images is needed when rebuilding, at least to properly amend the FROM line to be able to pull the right parent image. Thus this behaviour broke completely the build of every image with at least one not-to-rebuild parent since release v0.19.0

I fix this quickly by avoiding the Filter function altogether.

If the graph reduction were deemed useful it would be needed to discard only nodes which are not modified and which have no modified descendants. But I felt it was too complicated for me. Moreover I think the cost of the reconstruction of the graph offsets all the gains we could expect from having a smaller graph after it.

Fixes be5509e

@joulaud joulaud requested a review from a team as a code owner January 9, 2025 12:29
Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.92%. Comparing base (ad452c5) to head (3e56470).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #671      +/-   ##
==========================================
- Coverage   58.40%   57.92%   -0.49%     
==========================================
  Files          51       51              
  Lines        2866     2833      -33     
==========================================
- Hits         1674     1641      -33     
  Misses       1086     1086              
  Partials      106      106              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

pkg/dib/build.go Outdated Show resolved Hide resolved
@joulaud joulaud force-pushed the fjo/fix-rebuild-errors branch from b96099f to 7ef5705 Compare January 10, 2025 15:08
@joulaud joulaud changed the title fix impossibility to rebuild only child images fix impossibility to rebuild child images Jan 10, 2025
The Filter function constructs a completely new graph were unmodified images
are discarded. I suppose it was done to have a (very) smaller graph to improve
(a little) performance.

Unfortunately, we need info on all direct parents images when rebuilding, at
least to properly amend the FROM line to be able to pull the right parent
image. Thus this refacto broke completely rebuild of every image with at least
one not-to-rebuild parent.

I fix this quickly by avoiding the Filter function altogether which is too
complicated for our sake and does not really improves the performances.

Fixes be5509e
@joulaud joulaud force-pushed the fjo/fix-rebuild-errors branch from e27e513 to 96fca0a Compare January 13, 2025 11:10
Following 7ef5705 the "Filter" function is not used anymore.

After thinking I think it will not ever be used in this form as it is
not generic and thus it is better to completely delete it.

Indeed the function is buggy, difficult to understand (and to fix). E.g. I
still have not grasped what it try to do with the orphans and their
childs.

I think (without being sure) the idea behind this was to be able to work
on a smaller graph for performance but as the small graph is used just
once, the cost of constructing it in the first place completely offsets
the potential gains.
@joulaud joulaud force-pushed the fjo/fix-rebuild-errors branch from 96fca0a to 3e56470 Compare January 13, 2025 17:57
@antoinegelloz antoinegelloz merged commit a47e45d into radiofrance:main Jan 14, 2025
5 checks passed
@fahedouch
Copy link

IMO If we want to keep the creation of the new graph, one possible solution is to add a state to the Node object that holds the tagsToReplace map during the filtering of nodes. This way, we can ensure that the new tags are propagated to the new graph.

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.

3 participants