kubevirtci icon indicating copy to clipboard operation
kubevirtci copied to clipboard

fix: use pre-generated image lists for pre-pulling images

Open dhiller opened this issue 10 months ago • 24 comments

What this PR does / why we need it:

Detection of missing pre-pulled images broke when the provisioning was moved into gocli. Therefore we change from calling fetch-images.sh at runtime to a generated pre-pull-images file.

Changes in this PR:

  • generation: script update-pre-pull-images.sh generates pre-pull-images, calling fetch-images.sh, which is moved from the version folders into the main provision/k8s folder
  • simplification: replace the logic of pre-pulling based on fetch-images.sh and extra-... with simply concatting pre-pull-images and extra-pre-pull-images text file
  • safety-net: pre-pull-images needs to get updated whenever the manifests inside either the k8s version folder or the manifests inside the gocli change - add a call to update-pre-pull-images.sh to check idempotency (no changes in repo) in check-cluster-up.sh
  • install: set some more flags to install cdi and ceph, remove the install-everything script

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #

Special notes for your reviewer:

dhiller avatar Feb 07 '25 17:02 dhiller

Skipping CI for Draft Pull Request. If you want CI signal for your change, please convert it to an actual PR. You can still manually trigger a test run with /test all

kubevirt-bot avatar Feb 07 '25 17:02 kubevirt-bot

/test check-provision-k8s-1.32

dhiller avatar Feb 10 '25 10:02 dhiller

@dhiller: The /test command needs one or more targets. The following commands are available to trigger required jobs:

  • /test check-gocli
  • /test check-provision-centos-base
  • /test check-provision-k8s-1.30
  • /test check-provision-k8s-1.30-s390x
  • /test check-provision-k8s-1.31
  • /test check-provision-k8s-1.32
  • /test check-provision-k8s-1.32-s390x
  • /test check-provision-manager
  • /test check-up-kind-1.30-vgpu
  • /test check-up-kind-ovn
  • /test check-up-kind-sriov

The following commands are available to trigger optional jobs:

  • /test check-provision-alpine-with-test-tooling
  • /test check-provision-k8s-1.31-s390x
  • /test check-up-kind-1.28
  • /test check-up-kind-1.31

Use /test all to run the following jobs that were automatically triggered:

  • check-gocli
  • check-provision-alpine-with-test-tooling
  • check-provision-k8s-1.30
  • check-provision-k8s-1.31
  • check-provision-k8s-1.31-s390x
  • check-provision-k8s-1.32
  • check-provision-manager
  • check-up-kind-1.30-vgpu
  • check-up-kind-sriov

In response to this:

/test check-provision-k8s-1.32

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

kubevirt-bot avatar Feb 10 '25 10:02 kubevirt-bot

/test check-provision-k8s-1.32

dhiller avatar Feb 10 '25 10:02 dhiller

/test check-provision-k8s-1.32

dhiller avatar Feb 10 '25 10:02 dhiller

/test check-provision-k8s-1.32

dhiller avatar Feb 10 '25 15:02 dhiller

/hold

waiting for https://github.com/kubevirt/project-infra/pull/3948

dhiller avatar Feb 11 '25 12:02 dhiller

updating images through https://github.com/kubevirt/project-infra/pull/3949

dhiller avatar Feb 11 '25 15:02 dhiller

/unhold

dhiller avatar Feb 12 '25 11:02 dhiller

/test check-provision-k8s-1.32

dhiller avatar Feb 12 '25 11:02 dhiller

/test check-provision-k8s-1.32

dhiller avatar Feb 13 '25 09:02 dhiller

@brianmcarey I think I have it working now :)

dhiller avatar Feb 13 '25 09:02 dhiller

Hm, strange, on all the check-provision the same test fails: [sig-network] [rfe_id:694][crit:medium][vendor:[email protected]][level:component]Networking VirtualMachineInstance with masquerade binding mechanism when performing migration [Conformance] should preserve connectivity - IPv6

Any ideas?

dhiller avatar Feb 17 '25 09:02 dhiller

/test check-provision-1.30 /test check-provision-1.31 /test check-provision-1.32

dhiller avatar Feb 17 '25 11:02 dhiller

@dhiller: The specified target(s) for /test were not found. The following commands are available to trigger required jobs:

/test check-gocli
/test check-provision-centos-base
/test check-provision-k8s-1.30
/test check-provision-k8s-1.30-s390x
/test check-provision-k8s-1.31
/test check-provision-k8s-1.32
/test check-provision-k8s-1.32-s390x
/test check-provision-manager
/test check-up-kind-1.30-vgpu
/test check-up-kind-ovn
/test check-up-kind-sriov

The following commands are available to trigger optional jobs:

/test check-provision-alpine-with-test-tooling
/test check-provision-k8s-1.31-s390x
/test check-up-kind-1.28
/test check-up-kind-1.31

Use /test all to run the following jobs that were automatically triggered:

check-gocli
check-provision-alpine-with-test-tooling
check-provision-k8s-1.30
check-provision-k8s-1.31
check-provision-k8s-1.31-s390x
check-provision-k8s-1.32
check-provision-manager
check-up-kind-1.30-vgpu
check-up-kind-sriov

In response to this:

/test check-provision-1.30 /test check-provision-1.31 /test check-provision-1.32

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

kubevirt-bot avatar Feb 17 '25 11:02 kubevirt-bot

/test check-provision-k8s-1.30 /test check-provision-k8s-1.31 /test check-provision-k8s-1.32

dhiller avatar Feb 17 '25 11:02 dhiller

/test check-provision-1.32

dhiller avatar Mar 03 '25 18:03 dhiller

@dhiller: The specified target(s) for /test were not found. The following commands are available to trigger required jobs:

/test check-gocli
/test check-provision-centos-base
/test check-provision-k8s-1.30
/test check-provision-k8s-1.30-s390x
/test check-provision-k8s-1.31
/test check-provision-k8s-1.32
/test check-provision-k8s-1.32-s390x
/test check-provision-manager
/test check-up-kind-1.30-vgpu
/test check-up-kind-ovn
/test check-up-kind-sriov

The following commands are available to trigger optional jobs:

/test check-provision-alpine-with-test-tooling
/test check-provision-k8s-1.31-s390x
/test check-up-kind-1.28
/test check-up-kind-1.31

Use /test all to run the following jobs that were automatically triggered:

check-gocli
check-provision-alpine-with-test-tooling
check-provision-k8s-1.30
check-provision-k8s-1.31
check-provision-k8s-1.31-s390x
check-provision-k8s-1.32
check-provision-manager
check-up-kind-1.30-vgpu
check-up-kind-sriov

In response to this:

/test check-provision-1.32

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

kubevirt-bot avatar Mar 03 '25 18:03 kubevirt-bot

/test check-provision-k8s-1.32

dhiller avatar Mar 04 '25 08:03 dhiller

@oshoval @ormergi maybe you have some ideas about this:

All the check-provision lanes are constantly failing on a specific sig-network Conformance test named [sig-network] [rfe_id:694][crit:medium][vendor:[email protected]][level:component]Networking VirtualMachineInstance with masquerade binding mechanism when performing migration [Conformance] should preserve connectivity - IPv6 (source)

On the main sig-network lanes that test seemed to have a very mild flakiness, could be test-order-dependency, since that test was not the only one failing.

I have no idea what might be missing here - the only thing I found differing from the k/kubevirt sig-network lane config was something around KUBEVIRT_DEPLOY_NET_BINDING_CNI, but I doubt that this is the reason?

Another note: I found that the IPv6 largely duplicates the IPv4 version of the test - except the section around DHCP for the IPv4 test

I'd appreciate any idea or suggestion ...

dhiller avatar Mar 18 '25 15:03 dhiller

Hi, seems the migration fails, maybe worth either only ideas so far are:

  1. remove it from kci conformance - just relay on the kubevirt one
  2. add sleep and then connect to the job via admin access that you and Brian have to determine deeper what is the reason ?

oshoval avatar Mar 18 '25 15:03 oshoval

@sourcery-ai review

dhiller avatar Apr 08 '25 14:04 dhiller

Reviewer's Guide by Sourcery

This pull request refactors the image pre-pulling mechanism by replacing runtime calls to fetch-images.sh with a pre-generated pre-pull-images file, simplifying the process and ensuring consistency across different Kubernetes versions.

Sequence diagram for the updated image pre-pulling process

sequenceDiagram
    participant User
    participant updateScript as update-pre-pull-images.sh
    participant fetchScript as fetch-images.sh
    participant prePullFile as pre-pull-images
    participant extraPrePullFile as extra-pre-pull-images

    User->>updateScript: Run update-pre-pull-images.sh
    updateScript->>fetchScript: Call fetch-images.sh for version folder
    updateScript->>fetchScript: Call fetch-images.sh for gocli opts
    fetchScript-->>updateScript: Return list of images
    updateScript->>prePullFile: Write unique images to pre-pull-images
    updateScript->>extraPrePullFile: Remove duplicates from extra-pre-pull-images

Class diagram for the updated image pre-pulling scripts

classDiagram
    class update-pre-pull-images.sh {
        +fetchImages(provision_dir)
        +removeDuplicates()
    }
    class fetch-images.sh {
        +checkArgs()
        +main()
    }
    class pre-pull-images
    class extra-pre-pull-images

    update-pre-pull-images.sh --> fetch-images.sh : uses
    update-pre-pull-images.sh --> pre-pull-images : generates
    update-pre-pull-images.sh --> extra-pre-pull-images : modifies

File-Level Changes

Change Details Files
Replace runtime image fetching with pre-generated image lists.
  • Introduced update-pre-pull-images.sh script to generate pre-pull-images file.
  • Moved fetch-images.sh from version folders to the main provision/k8s folder.
  • Replaced logic of pre-pulling images with concatenation of pre-pull-images and extra-pre-pull-images files.
cluster-provision/k8s/check-cluster-up.sh
cluster-provision/k8s/1.30/k8s_provision.sh
cluster-provision/k8s/1.31/k8s_provision.sh
cluster-provision/k8s/1.32/k8s_provision.sh
cluster-provision/k8s/1.33/k8s_provision.sh
cluster-provision/k8s/fetch-images.sh
cluster-provision/gocli/cmd/provision.go
cluster-provision/k8s/check-pod-images.sh
cluster-provision/k8s/update-pre-pull-images.sh
cluster-provision/k8s/1.30/pre-pull-images
cluster-provision/k8s/1.31/pre-pull-images
cluster-provision/k8s/1.32/pre-pull-images
cluster-provision/k8s/1.33/pre-pull-images
cluster-provision/k8s/fetch-images-exclude-patterns
Remove redundant scripts and update image pre-pulling logic.
  • Removed fetch-images.sh from individual version folders.
  • Updated check-cluster-up.sh to ensure pre-pull-images is up-to-date.
  • Removed deploy-manifests.sh script.
cluster-provision/k8s/1.31/fetch-images.sh
cluster-provision/k8s/1.32/fetch-images.sh
cluster-provision/k8s/1.33/fetch-images.sh
cluster-provision/k8s/deploy-manifests.sh
Enhance image fetching and pre-pulling safety.
  • Added a safety-net to ensure pre-pull-images is updated when manifests change.
  • Updated check-cluster-up.sh to validate idempotency of update-pre-pull-images.sh.
cluster-provision/k8s/check-cluster-up.sh
cluster-provision/k8s/update-pre-pull-images.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an issue from a review comment by replying to it. You can also reply to a review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull request title to generate a title at any time. You can also comment @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment @sourcery-ai summary on the pull request to (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

  • Contact our support team for questions or feedback.
  • Visit our documentation for detailed guides and information.
  • Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.

sourcery-ai[bot] avatar Apr 08 '25 14:04 sourcery-ai[bot]

/test check-provision-k8s-1.32

dhiller avatar May 13 '25 07:05 dhiller

/test check-provision-k8s-1.32

dhiller avatar May 13 '25 09:05 dhiller

/test check-provision-k8s-1.32

dhiller avatar May 13 '25 10:05 dhiller

/test check-provision-k8s-1.32 check-provision-k8s-1.33 check-provision-k8s-1.31

dhiller avatar May 14 '25 10:05 dhiller

/test check-provision-k8s-1.32 check-provision-k8s-1.33 check-provision-k8s-1.31

dhiller avatar May 14 '25 10:05 dhiller

/test check-provision-k8s-1.32 check-provision-k8s-1.33 check-provision-k8s-1.31

dhiller avatar May 15 '25 06:05 dhiller

/test check-provision-k8s-1.32 check-provision-k8s-1.33 check-provision-k8s-1.31

dhiller avatar May 15 '25 10:05 dhiller