You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by "zhaoyang20201221 (via GitHub)" <gi...@apache.org> on 2023/04/26 03:02:25 UTC

[GitHub] [incubator-streampark] zhaoyang20201221 opened a new pull request, #2705: update build

zhaoyang20201221 opened a new pull request, #2705:
URL: https://github.com/apache/incubator-streampark/pull/2705

   <!--
   Thank you for contributing to StreamPark! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   ## Contribution Checklist
   
     - If this is your first time, please read our contributor guidelines: [Submit Code](https://streampark.apache.org/community/submit_guide/submit_code).
   
     - Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/incubator-streampark/issues).
   
     - Name the pull request in the form "[Feature] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
   
     - If the PR is unfinished, add `[WIP]` in your PR title, e.g., `[WIP][Feature] Title of the pull request`.
   
   -->
   
   ## What changes were proposed in this pull request
   
   Issue Number: close #xxx <!-- REMOVE this line if no issue to close -->
   
   <!--(For example: This pull request proposed to add checkstyle plugin).-->
   
   ## Brief change log
   
   <!--*(for example:)*
   - *Add maven-checkstyle-plugin to root pom.xml*
   -->
   
   ## Verifying this change
   
   <!--*(Please pick either of the following options)*-->
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   <!--*(example:)*
   - *Added integration tests for end-to-end.*
   - *Added *Test to verify the change.*
   - *Manually verified the change by testing locally.* -->
   
   ## Does this pull request potentially affect one of the following parts
    - Dependencies (does it add or upgrade a dependency): (yes / 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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] zhaoyang20201221 commented on pull request #2705: [improve-2695][console-service] The flink/pipe/build interface is not standardized

Posted by "zhaoyang20201221 (via GitHub)" <gi...@apache.org>.
zhaoyang20201221 commented on PR #2705:
URL: https://github.com/apache/incubator-streampark/pull/2705#issuecomment-1541270344

   @wolfboysPTAL,thanks.


-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] wolfboys merged pull request #2705: [improve-2695][console-service] The flink/pipe/build interface is not standardized

Posted by "wolfboys (via GitHub)" <gi...@apache.org>.
wolfboys merged PR #2705:
URL: https://github.com/apache/incubator-streampark/pull/2705


-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] zhoulii commented on a diff in pull request #2705: [improve-2695][console-service] The flink/pipe/build interface is not standardized

Posted by "zhoulii (via GitHub)" <gi...@apache.org>.
zhoulii commented on code in PR #2705:
URL: https://github.com/apache/incubator-streampark/pull/2705#discussion_r1188063430


##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/AppBuildPipeServiceImpl.java:
##########
@@ -130,6 +131,8 @@
 
   @Autowired private ResourceService resourceService;
 
+  @Autowired private AppBuildPipeService appBuildPipeService;

Review Comment:
   the injection of `AppBuildPipeService` is unnecessary.



##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/AppBuildPipeServiceImpl.java:
##########
@@ -342,6 +376,38 @@ public void onDockerPushProgressChange(DockerPushSnapshot snapshot) {
     return saved;
   }
 
+  /**
+   * check the build environment
+   *
+   * @param appId application id
+   * @param forceBuild forced start pipeline or not
+   * @return
+   */
+  @Override
+  public void checkBuildEnv(Long appId, boolean forceBuild) {
+    Application app = applicationService.getById(appId);
+
+    // 1) check flink version
+    FlinkEnv env = flinkEnvService.getById(app.getVersionId());
+    boolean checkVersion = env.getFlinkVersion().checkVersion(false);
+    if (!checkVersion) {
+      throw new ApiAlertException("Unsupported flink version: " + env.getFlinkVersion().version());
+    }
+
+    // 2) check env
+    boolean envOk = applicationService.checkEnv(app);
+    if (!envOk) {
+      throw new ApiAlertException(

Review Comment:
   same as above



##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/AppBuildPipeServiceImpl.java:
##########
@@ -342,6 +376,38 @@ public void onDockerPushProgressChange(DockerPushSnapshot snapshot) {
     return saved;
   }
 
+  /**
+   * check the build environment
+   *
+   * @param appId application id
+   * @param forceBuild forced start pipeline or not
+   * @return
+   */
+  @Override
+  public void checkBuildEnv(Long appId, boolean forceBuild) {
+    Application app = applicationService.getById(appId);
+
+    // 1) check flink version
+    FlinkEnv env = flinkEnvService.getById(app.getVersionId());
+    boolean checkVersion = env.getFlinkVersion().checkVersion(false);
+    if (!checkVersion) {
+      throw new ApiAlertException("Unsupported flink version: " + env.getFlinkVersion().version());
+    }

Review Comment:
   we can use `ApiAlertException.throwIfFalse` to make code more concise.



##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/AppBuildPipeService.java:
##########
@@ -33,9 +31,23 @@
 
 public interface AppBuildPipeService extends IService<AppBuildPipeline> {
 
-  /** Build application. This is an async call method. */
-  boolean buildApplication(@Nonnull Application app, ApplicationLog applicationLog)
-      throws Exception;
+  /**
+   * Build application. This is an async call method.
+   *
+   * @param appId application id
+   * @param forceBuild forced start pipeline or not
+   * @return Whether the pipeline was successfully started
+   */
+  boolean buildApplication(@Nonnull Long appId, boolean forceBuild) throws Exception;
+
+  /**
+   * check the build environment
+   *
+   * @param appId application id
+   * @param forceBuild forced start pipeline or not
+   * @return
+   */
+  void checkBuildEnv(Long appId, boolean forceBuild);

Review Comment:
   since this method is only used by `buildApplication` and no controller invokes it, we can make it a private method in AppBuildPipeServiceImpl.java



-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] zhaoyang20201221 commented on pull request #2705: [improve-2695][console-service] The flink/pipe/build interface is not standardized

Posted by "zhaoyang20201221 (via GitHub)" <gi...@apache.org>.
zhaoyang20201221 commented on PR #2705:
URL: https://github.com/apache/incubator-streampark/pull/2705#issuecomment-1534303709

   @wolfboys PTAL,thanks.


-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] zhaoyang20201221 commented on pull request #2705: [improve-2695][console-service] The flink/pipe/build interface is not standardized

Posted by "zhaoyang20201221 (via GitHub)" <gi...@apache.org>.
zhaoyang20201221 commented on PR #2705:
URL: https://github.com/apache/incubator-streampark/pull/2705#issuecomment-1540032452

   @zhoulii PTAL,thanks.


-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] zhaoyang20201221 commented on pull request #2705: [improve-2695][console-service] The flink/pipe/build interface is not standardized

Posted by "zhaoyang20201221 (via GitHub)" <gi...@apache.org>.
zhaoyang20201221 commented on PR #2705:
URL: https://github.com/apache/incubator-streampark/pull/2705#issuecomment-1540102087

   @zhoulii PTAL,thanks.


-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] wolfboys commented on pull request #2705: update build

Posted by "wolfboys (via GitHub)" <gi...@apache.org>.
wolfboys commented on PR #2705:
URL: https://github.com/apache/incubator-streampark/pull/2705#issuecomment-1528692817

   The bug has been fixed in the latest code, please see: https://github.com/apache/incubator-streampark/pull/2697


-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] wolfboys commented on pull request #2705: update build

Posted by "wolfboys (via GitHub)" <gi...@apache.org>.
wolfboys commented on PR #2705:
URL: https://github.com/apache/incubator-streampark/pull/2705#issuecomment-1528692481

   Thanks for your contribution, I will review it later.


-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] wolfboys closed pull request #2705: update build

Posted by "wolfboys (via GitHub)" <gi...@apache.org>.
wolfboys closed pull request #2705: update build
URL: https://github.com/apache/incubator-streampark/pull/2705


-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] zhoulii commented on a diff in pull request #2705: [improve-2695][console-service] The flink/pipe/build interface is not standardized

Posted by "zhoulii (via GitHub)" <gi...@apache.org>.
zhoulii commented on code in PR #2705:
URL: https://github.com/apache/incubator-streampark/pull/2705#discussion_r1188538548


##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/AppBuildPipeServiceImpl.java:
##########
@@ -342,6 +374,34 @@ public void onDockerPushProgressChange(DockerPushSnapshot snapshot) {
     return saved;
   }
 
+  /**
+   * check the build environment
+   *
+   * @param appId application id
+   * @param forceBuild forced start pipeline or not
+   * @return
+   */
+  private void checkBuildEnv(Long appId, boolean forceBuild) {
+    Application app = applicationService.getById(appId);
+
+    // 1) check flink version
+    FlinkEnv env = flinkEnvService.getById(app.getVersionId());
+    boolean checkVersion = env.getFlinkVersion().checkVersion(false);
+    ApiAlertException.throwIfFalse(
+        checkVersion, "Unsupported flink version:" + env.getFlinkVersion().version());
+
+    // 2) check env
+    boolean envOk = applicationService.checkEnv(app);
+    ApiAlertException.throwIfFalse(
+        envOk, "Check flink env failed, please check the flink version of this job");
+
+    // 3) Whether the application can currently start a new building progress
+    if (!forceBuild && allowToBuildNow(appId)) {

Review Comment:
   thanks for the updates, you may miss the inverse symbol here.



-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] wolfboys commented on pull request #2705: update build

Posted by "wolfboys (via GitHub)" <gi...@apache.org>.
wolfboys commented on PR #2705:
URL: https://github.com/apache/incubator-streampark/pull/2705#issuecomment-1528995712

   Thanks for your contribution, there are some checkstyle issue need to be resolved. you can run the command:
   ` mvn spotless:apply `


-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org