-
Notifications
You must be signed in to change notification settings - Fork 372
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
Conversation
1735b09
to
c917ac6
Compare
There was a problem hiding this 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.
...src/main/java/org/apache/flink/kubernetes/operator/controller/FlinkSessionJobController.java
Show resolved
Hide resolved
...netes-operator/src/main/java/org/apache/flink/kubernetes/operator/observer/BaseObserver.java
Outdated
Show resolved
Hide resolved
...s-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/BaseReconciler.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/flink/kubernetes/operator/reconciler/FlinkSessionJobReconciler.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/flink/kubernetes/operator/reconciler/FlinkSessionJobReconciler.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/flink/kubernetes/operator/reconciler/FlinkSessionJobReconciler.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/flink/kubernetes/operator/reconciler/FlinkSessionJobReconciler.java
Outdated
Show resolved
Hide resolved
...rnetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/FlinkService.java
Outdated
Show resolved
Hide resolved
...perator/src/main/java/org/apache/flink/kubernetes/operator/validation/InternalValidator.java
Outdated
Show resolved
Hide resolved
...rnetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/FlinkService.java
Show resolved
Hide resolved
I am trying to get to this PR and will share the comments today. |
There was a problem hiding this 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.
...rnetes-operator/src/main/java/org/apache/flink/kubernetes/operator/artifact/JarResolver.java
Show resolved
Hide resolved
...src/main/java/org/apache/flink/kubernetes/operator/controller/FlinkSessionJobController.java
Show resolved
Hide resolved
...va/org/apache/flink/kubernetes/operator/reconciler/sessionjob/FlinkSessionJobReconciler.java
Outdated
Show resolved
Hide resolved
...rnetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/FlinkService.java
Outdated
Show resolved
Hide resolved
...rnetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/FlinkService.java
Show resolved
Hide resolved
...rnetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/FlinkService.java
Outdated
Show resolved
Hide resolved
103b234
to
aded648
Compare
I have addressed your comments, partly left to follow up tickets, Please take a look again @wangyang0918 |
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 |
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 |
...rc/main/java/org/apache/flink/kubernetes/operator/validation/DefaultDeploymentValidator.java
Outdated
Show resolved
Hide resolved
aded648
to
d784f52
Compare
d784f52
to
7a1b915
Compare
There was a problem hiding this 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
...perator/src/main/java/org/apache/flink/kubernetes/operator/config/OperatorConfigOptions.java
Show resolved
Hide resolved
...src/main/java/org/apache/flink/kubernetes/operator/controller/FlinkSessionJobController.java
Outdated
Show resolved
Hide resolved
helm/flink-kubernetes-operator/conf/flink-operator-config/log4j2.properties
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/flink/kubernetes/operator/controller/FlinkSessionJobController.java
Show resolved
Hide resolved
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 { |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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 ?
a48bfb7
to
fcf8bb0
Compare
There was a problem hiding this 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 👍
...operator/src/main/java/org/apache/flink/kubernetes/operator/validation/DefaultValidator.java
Outdated
Show resolved
Hide resolved
...or/src/main/java/org/apache/flink/kubernetes/operator/validation/FlinkResourceValidator.java
Outdated
Show resolved
Hide resolved
...or/src/main/java/org/apache/flink/kubernetes/operator/validation/FlinkResourceValidator.java
Outdated
Show resolved
Hide resolved
@@ -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"; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
c591e5d
to
b91df2c
Compare
… reconciler
This PR is the initial implementation of
FlinkSessionJobController
andFlinkSessionJobReconciler
. It handles the create and delete events only. Other spec change will introduce in the follow up ticket.