Kenchu123 opened a new pull request #719: URL: https://github.com/apache/submarine/pull/719
### What is this PR for? <!-- A few sentences describing the overall goals of the pull request's commits. First time? Check out the contributing guide - https://submarine.apache.org/contribution/contributions.html --> We have created the submarine custom resource and controlled it by the operator. However, we want to know the states such as "New", "Creating", "Running", and "Failed" for the submarine custom resource, so we can watch the states of it. States: 1. NewState: initial state 2. CreatingState: after adding a submarine CR and waiting for the pods to be READY 3. RunningState: after all pods are READY 4. FailedState: when errors occur State Machine: ``` //+-----------------------------------------------------------------+ //| +---------+ +----------+ +----------+ | //| | | | | | | | //| | New +---------> Creating +----------> Running | | //| | | | | | | | //| +----+----+ +-----+----+ +-----+----+ | //| | | | | //| | | | | //| | | | | //| | | +-----v----+ | //| | | | | | //| +--------------------+---------------> Failed | | //| | | | //| +----------+ | //+-----------------------------------------------------------------+ ``` Reference: https://github.com/GoogleCloudPlatform/spark-on-k8s-operator/blob/master/pkg/controller/sparkapplication/controller.go ### What type of PR is it? [Improvement] ### Todos * [x] - Add state machine logic in sync handler * [x] - Add event record for any state change ### What is the Jira issue? <!-- * Open an issue on Jira https://issues.apache.org/jira/browse/SUBMARINE/ * Put link here, and add [SUBMARINE-*Jira number*] in PR title, eg. `SUBMARINE-23. PR title` --> https://issues.apache.org/jira/browse/SUBMARINE-950 ### How should this be tested? <!-- * First time? Setup Travis CI as described on https://submarine.apache.org/contribution/contributions.html#continuous-integration * Strongly recommended: add automated unit tests for any new or changed behavior * Outline any manual steps to test the PR here. --> ### Screenshots (if appropriate) https://user-images.githubusercontent.com/17617373/130261443-41ca8100-b2e5-40ba-ad03-7f4b80345e62.mov ### Questions: * Do the license files need updating? No * Are there breaking changes for older versions? No * Does this need new documentation? No -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
