jieguangzhou commented on code in PR #10739:
URL: https://github.com/apache/dolphinscheduler/pull/10739#discussion_r913336497
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-mlflow/src/main/java/org/apache/dolphinscheduler/plugin/task/mlflow/MlflowTask.java:
##########
@@ -197,6 +206,33 @@ private Map<String, Property> getParamsMap() {
}
+ public int checkDockerHealth() throws Exception {
+ logger.info("checking container healthy ... ");
+ int exitCode = -1;
+ String[] command = {"sh", "-c",
String.format(MlflowConstants.DOCKER_HEALTH_CHECK,
mlflowParameters.getContainerName())};
+ for(int x = 0; x < MlflowConstants.DOCKER_HEALTH_CHECK_TIMEOUT; x =
x+1) {
+ String status;
+ try {
+ status = OSUtils.exeShell(command).replace("\n",
"").replace("\"", "");
+ } catch (Exception e) {
+ status = String.format("error --- %s", e.getMessage());
+ }
+ logger.info("container healthy status: {}", status);
+
+ if (status.equals("healthy")) {
+ exitCode = 0;
+ logger.info("container is healthy");
+ return exitCode;
+ }else {
+ logger.info("The health check has been running for {}
seconds", x * 5);
+ Thread.sleep(5000);
Review Comment:
Already fix
--
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]