Skip to content

Enhancement suggestion for image prepull #1368

@NymanRobin

Description

@NymanRobin

When preparing the host for the metal3-dev-env the virtual machine base images are rather big, which leads to the current process being quite fragile to network or process interruptions. This might lead to errors in the configuration since the integrity checks in iamge_prepull.sh are quite loose.

The first problem raises from checking if the image exists
if [[ ! -f "${IMAGE_NAME}" ]]; then
This only cares if the image exists not about the content at all

What does not help the situation is the check of checksum, since if the checksum does not exist it is generated from the file and file might be corrupt at this point already.

Finally I think the user experience could be elevated by adding a progress bar to this slow downloads so the user is not confused about what is happening with for example this options to wget: --show-progress --progress=bar:force:noscroll
Note: This is quite new option for wget so might break on some older machines so might be best to consider a fallback in case wget does not recognize the options

An improvement suggestion would be to download the checksum directly from artifactory each time and comparing with the one of the actual file
This is normally done by appending the type of checksum you want to the end of the filepath so something like this:
https://artifactory.nordix.org/ui/native/metal3/images/k8s_v1.29.0/UBUNTU_22.04_NODE_IMAGE_K8S_v1.29.0.qcow2.sha256

This did not work even though I can see in the Artifactory UI that the checksum is generated, might be related to repository settings could be investigated further.

Otherwise this could most likely also be achieved with some wget options

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.triage/acceptedIndicates an issue is ready to be actively worked on.

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions