Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse CAPI e2e test #1080

Open
mboukhalfa opened this issue Jul 7, 2023 · 6 comments
Open

Reuse CAPI e2e test #1080

mboukhalfa opened this issue Jul 7, 2023 · 6 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. triage/accepted Indicates an issue is ready to be actively worked on.

Comments

@mboukhalfa
Copy link
Member

User Story

As a developer, I would like to reuse CAPI (Cluster API) e2e tests such as kcp_remediation test in CAPM3 (Cluster API Provider Metal3) however CAPI randomly generates the namespaces hosting the cluster in the BeforeEach of the test, and in CAPM3, the cluster expect the BMH resources to be pre-created that namespace. I want to find a solution that allows us to make BMH (BareMetalHost) resources available in the namespace that hosts the cluster.

Detailed Description

Currently, when reusing CAPI e2e test in CAPM3, we encounter difficulties because CAPI creates clusters in randomly generated namespaces. However, in CAPM3, we pre-create the BMH resources in a fixed namespace where we expect the cluster to be created. This misalignment prevents us from reusing CAPI e2e tests.

To overcome this challenge, we need to find a way to synchronize the creation of namespaces and BMH resources, ensuring that the required BMHs are available in the namespace hosting the cluster at the time of the creation of this cluster. This will enable us to reuse many CAPI tests in CAPM3 instead of reimplimenting them.

We have explored potential workarounds, the best option seems to include BMH resources in the cluster template in a new CI cluster template dedicated for testing only, but this approach is not be suitable for official cluster templates and could potentially confuse developers and users regarding the intended production usage of Metal3.

Additionally, creating BMHs for each test poses challenges in terms of time and resource consumption. We need to consider the trade-off between running tests in parallel, skipping inspection, or finding alternative solutions to maintain efficiency without compromising the integrity of tests.

Overall, we aim to find a solution that allows us to reuse CAPI tests in CAPM3, ensuring the availability of BMH resources in the namespace generated by CAPI tests when creating a cluster.

Anything else you would like to add:

I believe addressing this issue will improve the testability of CAPM3, reusing more e2e tests that are maintained by CAPI community. This enhancement will facilitate the adoption of new e2e test created on CAPI.

/kind feature

@metal3-io-bot metal3-io-bot added kind/feature Categorizes issue or PR as related to a new feature. needs-triage Indicates an issue lacks a `triage/foo` label and requires one. labels Jul 7, 2023
@Rozzii
Copy link
Member

Rozzii commented Jul 18, 2023

On the last community meeting there were not enough participants to arrive to a conclusion regarding this topic.

@metal3-io metal3-io deleted a comment from metal3-io-bot Jul 18, 2023
@Rozzii
Copy link
Member

Rozzii commented Jul 19, 2023

/triage accepted

@metal3-io-bot metal3-io-bot added triage/accepted Indicates an issue is ready to be actively worked on. and removed needs-triage Indicates an issue lacks a `triage/foo` label and requires one. labels Jul 19, 2023
@Rozzii
Copy link
Member

Rozzii commented Jul 19, 2023

On the community meeting on 19th of July 2023 the community has decided that this is a valid use-case.

@metal3-io-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues will close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@metal3-io-bot metal3-io-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 24, 2023
@Rozzii
Copy link
Member

Rozzii commented Oct 24, 2023

/remove-lifecycle stale
/lifecycle frozen

@metal3-io-bot metal3-io-bot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 24, 2023
@lentzi90
Copy link
Member

lentzi90 commented Dec 11, 2023

This would be a good topic for roadmap and API design discussions. A slightly different but related issue is if you have one team managing the BareMetalHosts and another (or even multiple) team(s) that "consume" them. In this case you may want to have the BMHs in other namespaces than where the clusters are.

In my opinion, the solution is to decouple CAPM3 from BMO. What I mean is that CAPM3 should not directly interact with the BMHs. Instead we could have something similar to how PersistentVolumes and PersistentVolumeClaims work. CAPM3 can create a claim that BMO can then fill with a suitable BMH. The BMHs could even be cluster wide objects. We should investigate what that would mean first though.

Another part of the puzzle would be multi-tenancy and authentication. How can we ensure that user A does not hijack user B's BMHs? In the CAPI model, other providers take some credentials as input when creating a cluster. This is enough to authenticate against the providers "backend". We do not have something like this currently, but it sure would solve some issues around multi-tenancy. It would mean that CAPM3 needs to provide credentials in order to get a BMH, and the pool of BMHs that are available would depend on the credentials.

Food for thought 🙂 I would love to discuss this more and play with the design to see what we could come up with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. triage/accepted Indicates an issue is ready to be actively worked on.
Projects
Status: CAPM3 WIP
Development

No branches or pull requests

4 participants