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-26787] Initial implementation of FlinkSessionJobController and… #112

Merged
merged 5 commits into from
Apr 3, 2022

Conversation

Aitozi
Copy link
Contributor

@Aitozi Aitozi commented Mar 26, 2022

… reconciler

This PR is the initial implementation of FlinkSessionJobController and FlinkSessionJobReconciler. It handles the create and delete events only. Other spec change will introduce in the follow up ticket.

@Aitozi Aitozi changed the title [FLINK-26787] Initial implementation of FlinkSessionJobController add… [FLINK-26787] Initial implementation of FlinkSessionJobController and… Mar 26, 2022
@Aitozi
Copy link
Contributor Author

Aitozi commented Mar 26, 2022

cc @gyfora @wangyang0918

Copy link
Contributor

@gyfora gyfora left a comment

Choose a reason for hiding this comment

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

Thank you @Aitozi I think this is an excellent starting point for this feature. I have added some minor comments regarding class naming/packaging etc.

helm/flink-operator/values.yaml Outdated Show resolved Hide resolved
helm/flink-operator/templates/flink-operator.yaml Outdated Show resolved Hide resolved
@wangyang0918
Copy link
Contributor

I am trying to get to this PR and will share the comments today.

Copy link
Contributor

@wangyang0918 wangyang0918 left a comment

Choose a reason for hiding this comment

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

Thanks @Aitozi for starting the concrete session job work. It looks already good and I left some minor comments.

@Aitozi Aitozi force-pushed the session-job-reconciler branch 2 times, most recently from 103b234 to aded648 Compare March 29, 2022 15:11
@Aitozi
Copy link
Contributor Author

Aitozi commented Mar 29, 2022

I have addressed your comments, partly left to follow up tickets, Please take a look again @wangyang0918

@gyfora
Copy link
Contributor

gyfora commented Apr 1, 2022

I think we should try to merge this PR early next week, @Aitozi please coordinate with @bgeng777 and @SteNicholas regarding the other outstanding PRs (#141 & #131) that will likely confict with your change a little

@Aitozi
Copy link
Contributor Author

Aitozi commented Apr 1, 2022

OK, I will push a next commit to fix the @wangyang0918's recent comments about the event source and will solve the conflicts at the same time and will ping your guys for the final review

Copy link
Contributor

@gyfora gyfora left a comment

Choose a reason for hiding this comment

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

Aside from the earlier comment regarding the validator interface I added a few minor things :)

But I think it looks really good

@Aitozi
Copy link
Contributor Author

Aitozi commented Apr 2, 2022

From my perspective, I think it's ready for review again. Please take look cc @gyfora @wangyang0918

import org.apache.flink.kubernetes.operator.crd.FlinkSessionJob;

import java.util.Optional;

/** Default validator implementation for {@link FlinkSessionJob}. */
public class DefaultSessionJobValidator implements FlinkResourceValidator<FlinkSessionJob> {
public class DefaultSessionJobValidator implements FlinkResourceValidator {
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that we have both methods in the interface can we drop the DefaultSessionJobValidator and just move the logic to the DefaultDeploymentValidator?

Copy link
Contributor Author

@Aitozi Aitozi Apr 3, 2022

Choose a reason for hiding this comment

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

I dropped the DefaultSessionJobValidator. Please see my last commit. The webhook have not changed accordingly. I want to create another PR for it.
Now I use validate(FlinkSessionJob sessionJob, Optional<FlinkDeployment> session) to validate the session job. It will check the relations of both. But for webhook, it may not have access to the secondary resource, Maybe we could only verify the target session job in the webhook and do the full validation in the operator. what do you think of this ?

Copy link
Contributor

@gyfora gyfora left a comment

Choose a reason for hiding this comment

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

Added some cosmetic comments but otherwise I think this is good to go 👍

@@ -62,7 +62,7 @@
public class AdmissionHandler extends SimpleChannelInboundHandler<HttpRequest> {
private static final Logger LOG = LoggerFactory.getLogger(AdmissionHandler.class);
private static final ObjectMapper objectMapper = new ObjectMapper();
protected static final String VALIDATE_REQUEST_PATH = "/validate";
protected static final String VALIDATE_REQUEST_PATH = "/validateDeployment";
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 you need to adjust the webhook template in the helm chart if you are changing this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's affected by the IDE refactor, reverted.

@gyfora gyfora merged commit e4a6faa into apache:main Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants