Skip to content

Commit

Permalink
[Improve] Storage Initialize create python directory (apache#3206)
Browse files Browse the repository at this point in the history
* [Improve] Storage initialize create python dir
  • Loading branch information
ChengJie1053 authored Sep 30, 2023
1 parent 2fc895d commit 106160b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ case class Workspace(storageType: StorageType) {

lazy val APP_UPLOADS = s"$WORKSPACE/uploads"

lazy val APP_PYTHON_VENV = s"$WORKSPACE/python/venv.zip"
lazy val APP_PYTHON = s"$WORKSPACE/python"

lazy val APP_PYTHON_VENV = s"$APP_PYTHON/venv.zip"

lazy val APP_WORKSPACE = s"$WORKSPACE/workspace"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.apache.streampark.console.core.service.SettingService;
import org.apache.streampark.flink.kubernetes.v2.fs.EmbeddedFileServer;

import org.apache.commons.lang3.StringUtils;

import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -83,7 +85,7 @@ public void run(ApplicationArguments args) throws Exception {
}

String appHome = WebUtils.getAppHome();
if (appHome == null) {
if (StringUtils.isBlank(appHome)) {
throw new ExceptionInInitializerError(
String.format(
"[StreamPark] System initialization check failed,"
Expand Down Expand Up @@ -144,6 +146,7 @@ public synchronized void storageInitialize(StorageType storageType) {
workspace.APP_WORKSPACE(),
workspace.APP_BACKUPS(),
workspace.APP_SAVEPOINTS(),
workspace.APP_PYTHON(),
workspace.APP_JARS())
.forEach(fsOperator::mkdirsIfNotExists);

Expand Down Expand Up @@ -203,7 +206,7 @@ public synchronized void storageInitialize(StorageType storageType) {

public void checkFlinkEnv(StorageType storageType, FlinkEnv flinkEnv) throws IOException {
String flinkLocalHome = flinkEnv.getFlinkHome();
if (flinkLocalHome == null) {
if (StringUtils.isBlank(flinkLocalHome)) {
throw new ExceptionInInitializerError(
"[StreamPark] FLINK_HOME is undefined,Make sure that Flink is installed.");
}
Expand Down

0 comments on commit 106160b

Please sign in to comment.