Make PXE installer more stable. Improve performance about ISO downloading and image import#1078
Open
jjqq2013 wants to merge 1 commit into
Open
Make PXE installer more stable. Improve performance about ISO downloading and image import#1078jjqq2013 wants to merge 1 commit into
jjqq2013 wants to merge 1 commit into
Conversation
85828a9 to
3ea5749
Compare
jjqq2013
commented
Jul 6, 2025
| echo "Decompress & import $i ..." | ||
| zstd -d $i --stdout --force --no-progress | ctr -n k8s.io images import --no-unpack - >/dev/null | ||
| done | ||
| fi |
Contributor
Author
There was a problem hiding this comment.
After review are done, I will re-indent above code block.
jjqq2013
commented
Jul 6, 2025
| # So let us just unify the handling: always do the import by our own logic, instead of letting RKE2 doing it. | ||
| # - Our purpose is not to install real RKE2, but just pre-import images to real RKE2's containerd image store | ||
| # for the future. So we should remove temporary files generated by temporary RKE2. | ||
| echo "Stop temporary RKE2 and remove temporary files..." |
Contributor
Author
There was a problem hiding this comment.
For reviewers: see above comment. It is for stability and consistency.
jjqq2013
commented
Jul 6, 2025
| ctr -n k8s.io images import --no-unpack /usr/local/images.tar | ||
| rm /usr/local/images.tar | ||
| echo "Decompress & import $i ..." | ||
| zstd -d $i --stdout --force --no-progress | ctr -n k8s.io images import --no-unpack - >/dev/null |
Contributor
Author
There was a problem hiding this comment.
- the
ctr images importare too verbose and distracting. - Using the
zstd ... --stdout | ctr ... importwill decompress and import on-the-fly, save several minutes.
But of course, the performance of this explicit importing mechanism can not compete with the auto image importing of the RKE2, seems mainly because this import still need transfer the tar to the containerd first.
jjqq2013
commented
Jul 6, 2025
| if [ "$INSTALL_MODE" = "ISO" ]; then | ||
| echo "Copying RKE2 images to the target location..." | ||
| rsync -ahv --progress ${ISOMNT}/bundle/harvester/images/rke2-images.*.tar.zst $TARGET/$RKE2_IMAGES_DIR | ||
| echo "Copying remaining images temporary location..." |
Contributor
Author
There was a problem hiding this comment.
For reviewers: please change the "Conversations" setting to "Hide whitespace".
e72181d to
0a8f66b
Compare
Signed-off-by: jjqq2013 <osexp2000@gmail.com>
0a8f66b to
d3aabe2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
Harvester-v1.5.0 PXE installer sometimes hang up due to temporary RKE2 server exited after about 15m while auto image importing have not finished.
Solution:
Do not depend on the auto image import of the temporary RKE2, but do the same thing like in ISO install mode: start containerd then import images explicitly.
Related Issue(s):
Issue harvester/harvester#8606
Test plan:
https://github.com/jjqq2013/harvester-os-raw-disk-image-builder/
Additional documentation or context