Skip to content

Conversation

@sirpaleet
Copy link
Member

@sirpaleet sirpaleet commented Sep 25, 2025

What this PR does / why we need it:

Some people may find the installation process and running the hack e2e-scripts a bit difficult, so making a target for the script and fixing the installed packages and dependencies should be done to make it easier to run them on a VM, and documentation should be added as well.

There is some previous discussion in here: #2642

@metal3-io-bot metal3-io-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 25, 2025
@metal3-io-bot
Copy link
Contributor

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

@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign honza for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@metal3-io-bot metal3-io-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 25, 2025
@sirpaleet
Copy link
Member Author

In case no-one wants to pick this up I can just make this PR about this one target as well, and add some comments to documentation :)

@sirpaleet sirpaleet force-pushed the siiri/makefile-e2e-targets branch from dc0a2e2 to 821e988 Compare September 29, 2025 07:53
@@ -0,0 +1,55 @@
#!/usr/bin/env bash
Copy link
Member Author

Choose a reason for hiding this comment

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

Added this to script

@sirpaleet
Copy link
Member Author

Additional checks for if installations exist could be added.
The installations could be made to the project's bin, but then in other places the scripts would not know how to find them.

TODO:

  • test-e2e is used in ci-e2e.sh script so make a new target
  • expand on clean-e2e to have optional steps on cleanup with flags
  • update info in docs/testing.md and test/e2e/README.md

@sirpaleet
Copy link
Member Author

I noticed that in here: https://github.com/metal3-io/baremetal-operator/blob/main/hack/ci-e2e.sh#L57 there is clear attempt at making the script self-sufficient and it should probably install all needed packages. But alas it does not. I'll expand on just this and remove the new target :D + edit the other scripts to fit this

@sirpaleet sirpaleet force-pushed the siiri/makefile-e2e-targets branch from 821e988 to 708d8ae Compare September 29, 2025 12:50
@sirpaleet sirpaleet changed the title 🌱 Add e2e-prerequisites and ease running e2e locally 🌱 Fix hack/ci-e2e.sh script installations Sep 29, 2025
@sirpaleet
Copy link
Member Author

sirpaleet commented Sep 29, 2025

This has now been confined to the scope of installations, and adding the script target. I'll open the PR but I will most likely not have the time to edit all changes if they are major. I'll make an issue on the "TODO" i added before.

EDIT: #2707 has the cleanup issue, and #2708 has the kubectl version bump (which I unfortunately do not have time for)

I noticed that in here: https://github.com/metal3-io/baremetal-operator/blob/main/hack/ci-e2e.sh#L57 there is clear attempt at making the script self-sufficient and it should probably install all needed packages. But alas it does not. I'll expand on just this and remove the new target :D + edit the other scripts to fit this

Additionally based on this finding, changed from a new target for installations to adding the necessary steps to the hack/ci-e2e.sh and making a new ensure_docker.sh for the docker installation.

@sirpaleet sirpaleet marked this pull request as ready for review September 29, 2025 12:58
@metal3-io-bot metal3-io-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 29, 2025
@sirpaleet sirpaleet force-pushed the siiri/makefile-e2e-targets branch 2 times, most recently from b065e26 to 255f03e Compare September 29, 2025 13:28
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# shellcheck disable=SC1091
Copy link
Member Author

Choose a reason for hiding this comment

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

Added this to fix the shellcheck issue, this code is from the official installation instructions of installing Docker Engine on Ubuntu.

@sirpaleet sirpaleet force-pushed the siiri/makefile-e2e-targets branch 2 times, most recently from fe55660 to 271fdee Compare September 30, 2025 07:02
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker "${USER}"
newgrp docker
Copy link
Member

Choose a reason for hiding this comment

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

This does nothing

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm confused as to which part, since it works for me? The new docker group?

## To note: Run this on your VM and not your local machine. These installations
## work for linux amd64, at least on Ubuntu 24.04. You may need to log out and
## log in to apply all changes if the installations are done for the first time.
.PHONY: run-e2e-script
Copy link
Member

Choose a reason for hiding this comment

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

this is not descriptive name for the target... setup-e2e or such would be nicer

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree the naming is a bit clunky, it's just that the "setup" would imply installations and anything more vague would imply it is used in actual e2e runs elsewhere no? Or maybe not?

@sirpaleet sirpaleet force-pushed the siiri/makefile-e2e-targets branch 2 times, most recently from 18d7a3e to 5a1774b Compare September 30, 2025 07:43
Edit Makefile to add run-e2e-script, fix installations, and add documentation.

Signed-off-by: Siiri Kemppainen <[email protected]>
@sirpaleet sirpaleet force-pushed the siiri/makefile-e2e-targets branch from 5a1774b to 4939f30 Compare September 30, 2025 08:27
@sirpaleet
Copy link
Member Author

Left a couple of comments, and fixed some things. This is as much as I have time today, in case someone has an opinion of the furture of this PR I'm all ears but contributing to this has to end on my part for now :( I'll try to answer if someone has a question though!

sudo apt-get update
sudo apt-get install -y libvirt-dev pkg-config
sudo apt-get install -y libvirt-daemon-system qemu-kvm virt-manager libvirt-dev
make build
Copy link
Member Author

Choose a reason for hiding this comment

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

This might be repetition with L82, but this does some necessary steps also, just might slow down the script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants