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

FLINK-36332 Add option to select the Fabric8 httpclient implemention #881

Merged
merged 10 commits into from
Oct 7, 2024

Conversation

SamBarker
Copy link
Contributor

What is the purpose of the change

Enable the building of the operator using alternative Fabric8 http clients.

Brief change log

Enable the building of the operator using alternative Fabric8 http clients.

Verifying this change

This change is already covered by existing tests, such as (please describe tests).

The build should still work even when run with -Dfabric8.httpclinent.impl=vertx or jdk or jetty for that matter 😁

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): yes.
  • The public API, i.e., is any changes to the CustomResourceDescriptors: no
  • Core observer or reconciler logic that is regularly executed: no

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

Comment on lines +437 to +434
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp.version}</version>
</dependency>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

By default kubernetes-httpclient-okhttp pulls in OkHttp 3.X which is reported to have problems with Kubernetes IPV6 stacks e.g. https://issues.apache.org/jira/browse/FLINK-31928

pom.xml Outdated Show resolved Hide resolved
@gyfora
Copy link
Contributor

gyfora commented Sep 24, 2024

Do you have any recommendation how we should test this and make sure it works? Maybe we can add a case to the e2e-s somehow?

@csviri
Copy link

csviri commented Sep 24, 2024

Eventually we should move to Vertx as default, which is the preferred one in fabric8.

@SamBarker
Copy link
Contributor Author

Do you have any recommendation how we should test this and make sure it works? Maybe we can add a case to the e2e-s somehow?

Hmm thats a good question. It looks fairly easy to add it to maven build matrix (though at what cost?) and thus test on every build. That is however of debatable value as there is no change to the projects code and thus all it would really be doing is testing a third party dependency and is that very interesting at unit/integration test level?

A more interesting angle as suggested is to include it in the e2e suite. Which again has a massive implication for the spread of tests but is probably more interesting as it validates it works against various different minikube setups.

I've added both options in different commits so we can easily drop them if they aren't considered helpful.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
@SamBarker SamBarker force-pushed the optional-httpclient branch 6 times, most recently from 0f284ea to 071042c Compare September 26, 2024 22:39
@SamBarker
Copy link
Contributor Author

I think the e2e workflow is now correctly setup (and has passed on my fork

@SamBarker
Copy link
Contributor Author

I should note I'm not convinced the workflow is doing what its expected to do I've documented my findings as FLINK-36392 which I'm happy to work on next.

I've also noticed a bunch of warnings about deprecated node version from the actions so have opened FLINK-36393 which I'm currently testing a PR for on my fork.

@SamBarker
Copy link
Contributor Author

I think the e2e workflow is now correctly setup (and has passed on my fork

Nope its not. The includes with the http-client seem to be overriding tests and not adding an extra run as intended...

I'm tempted to suggest splitting out test_application_operations.sh as a separate "smoke test" workflow that could run with each http-client with a fixed combination of the other matrix args.

My other thought is to have a workflow per Java version as that controls the supported flink versions as well and possibly the test suite as well as some of the tests have version exclusions.

A workflow per Java version feels easier for people to reason about too, but I don't have a lot of project context or history to work from so could be missing something...

@gyfora
Copy link
Contributor

gyfora commented Sep 27, 2024

@SamBarker I think it makes sense to split the test workflows. It has grown too much and it's getting a bit annoying as you can see :)

Please feel free to propose any reasonable split, I think your understanding is probably as good as anyone's at this point.

@SamBarker SamBarker force-pushed the optional-httpclient branch 3 times, most recently from 2853554 to bb6c577 Compare October 6, 2024 21:30
@SamBarker
Copy link
Contributor Author

SamBarker commented Oct 6, 2024

Please feel free to propose any reasonable split, I think your understanding is probably as good as anyone's at this point.

In the scope of this PR i've just pulled out a smoke test job which validates the HTTP clients can do the basics. I don't see that as being a great split for future testing of other combinations however I'd like to look at a wider restructure in a separate PR.

I'd also like to call out bb6c577 my primary motivation for adding it was to have a clearer picture of what was actually being built (in my fork) but I think its reasonable to merge. As I don't see any point in running the full job matrix if the basics aren't working (and thus saving actions minutes/ other resources). The same argument could be extended to making the smoke test dependent on the test_ci job as well, but I haven't done that here as it might slow down feedback from the edge to edge tests due to some un-related or flanky unit test failures.

Comment on lines +75 to +79
namespace: ["default"]
java-version: ["21"]
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should actually move the namespace , and java-version matrix also to the smoke_test and fix-it (remove-it) in the regular e2es.

The http-client, java-version, namespace matrix doesn't need all the different tests, it either works or it doesn't (famous last words).

Copy link
Contributor

Choose a reason for hiding this comment

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

actually the namespace flink/default doesn't really need more than 1 test (regardless of other params...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should actually move the namespace , and java-version matrix also to the smoke_test and fix-it (remove-it) in the regular e2es.

I agree it's a bit strange. What I was intending to do was make the smallest change here and revisit it in a follow up hence the matrix of single values.

actually the namespace flink/default doesn't really need more than 1 test (regardless of other params...)

Thanks that’s the kind of insight I need for restructuring🧩.

Copy link
Contributor

Choose a reason for hiding this comment

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

@SamBarker , how would you like to proceed with this? As long as we are adding the matrix changes I suggested in a followup , this is good from my side.

Should we squash it and merge it or would you want to add the restructuring here as a "second" commit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd like to get this merged and follow up with the restructuring.

Squashing seems wise 😆

@gyfora gyfora merged commit 4f87bc2 into apache:main Oct 7, 2024
233 checks passed
SamBarker added a commit to SamBarker/flink-kubernetes-operator that referenced this pull request Oct 9, 2024
The goal is to remove namespace from the main CI run based on apache#881 (comment)
SamBarker added a commit to SamBarker/flink-kubernetes-operator that referenced this pull request Oct 10, 2024
The goal is to remove namespace from the main CI run based on apache#881 (comment)
@SamBarker SamBarker deleted the optional-httpclient branch October 10, 2024 21:54
SamBarker added a commit to SamBarker/flink-kubernetes-operator that referenced this pull request Oct 13, 2024
The goal is to remove namespace from the main CI run based on apache#881 (comment)
SamBarker added a commit to SamBarker/flink-kubernetes-operator that referenced this pull request Oct 14, 2024
The goal is to remove namespace from the main CI run based on apache#881 (comment)
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.

3 participants