Skip to content

Make PXE installer more stable. Improve performance about ISO downloading and image import#1078

Open
jjqq2013 wants to merge 1 commit into
harvester:masterfrom
jjqq2013:james-harv-install
Open

Make PXE installer more stable. Improve performance about ISO downloading and image import#1078
jjqq2013 wants to merge 1 commit into
harvester:masterfrom
jjqq2013:james-harv-install

Conversation

@jjqq2013

@jjqq2013 jjqq2013 commented Jul 6, 2025

Copy link
Copy Markdown
Contributor

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

@jjqq2013 jjqq2013 force-pushed the james-harv-install branch from 85828a9 to 3ea5749 Compare July 6, 2025 02:50
echo "Decompress & import $i ..."
zstd -d $i --stdout --force --no-progress | ctr -n k8s.io images import --no-unpack - >/dev/null
done
fi

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

After review are done, I will re-indent above code block.

# 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..."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For reviewers: see above comment. It is for stability and consistency.

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

@jjqq2013 jjqq2013 Jul 6, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  • the ctr images import are too verbose and distracting.
  • Using the zstd ... --stdout | ctr ... import will 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.

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..."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For reviewers: please change the "Conversations" setting to "Hide whitespace".

@jjqq2013 jjqq2013 force-pushed the james-harv-install branch 7 times, most recently from e72181d to 0a8f66b Compare July 10, 2025 02:55
Signed-off-by: jjqq2013 <osexp2000@gmail.com>
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.

1 participant