This is an automated email from the ASF dual-hosted git repository.
yiconghuang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/texera.git
The following commit(s) were added to refs/heads/main by this push:
new dcc05d5851 fix: use `TEXEAR_HOME` or the current directory as the
default working directory (#3870)
dcc05d5851 is described below
commit dcc05d585105a296f7548cc7f375316ff2c2ef36
Author: Yicong Huang <[email protected]>
AuthorDate: Sat Oct 11 23:42:49 2025 -0700
fix: use `TEXEAR_HOME` or the current directory as the default working
directory (#3870)
In our current implementation, we used the `core` folder as the root of
all services. When looking for the configuration of a service, we search
from the `core` folder. This logic relies heavily on the `core` folder.
This PR changes the behavior:
1. We use `TEXERA_HOME` env variable to find the root of the Texera
repo. All services/configures/files should be searched starting from
this dir.
2. When omitted, we use the current directory as the default working
directory.
fixes #3871
---
.../org/apache/texera/service/ComputingUnitManagingService.scala | 8 ++++++--
core/config/src/main/scala/org/apache/amber/util/PathUtils.scala | 3 ---
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git
a/computing-unit-managing-service/src/main/scala/org/apache/texera/service/ComputingUnitManagingService.scala
b/computing-unit-managing-service/src/main/scala/org/apache/texera/service/ComputingUnitManagingService.scala
index c7aeb67d7b..4639789fb1 100644
---
a/computing-unit-managing-service/src/main/scala/org/apache/texera/service/ComputingUnitManagingService.scala
+++
b/computing-unit-managing-service/src/main/scala/org/apache/texera/service/ComputingUnitManagingService.scala
@@ -24,7 +24,6 @@ import io.dropwizard.auth.AuthDynamicFeature
import io.dropwizard.core.Application
import io.dropwizard.core.setup.{Bootstrap, Environment}
import org.apache.amber.config.StorageConfig
-import org.apache.amber.util.PathUtils.workflowComputingUnitManagingServicePath
import org.apache.texera.auth.{JwtAuthFilter, SessionUser}
import org.apache.texera.dao.SqlServer
import org.apache.texera.service.resource.{
@@ -33,6 +32,8 @@ import org.apache.texera.service.resource.{
HealthCheckResource
}
+import java.nio.file.Path
+
class ComputingUnitManagingService extends
Application[ComputingUnitManagingServiceConfiguration] {
override def initialize(
@@ -68,8 +69,11 @@ class ComputingUnitManagingService extends
Application[ComputingUnitManagingServ
}
object ComputingUnitManagingService {
+
def main(args: Array[String]): Unit = {
- val configFilePath = workflowComputingUnitManagingServicePath
+ val configFilePath = Path
+ .of(sys.env.getOrElse("TEXERA_HOME", "."))
+ .resolve("computing-unit-managing-service")
.resolve("src")
.resolve("main")
.resolve("resources")
diff --git a/core/config/src/main/scala/org/apache/amber/util/PathUtils.scala
b/core/config/src/main/scala/org/apache/amber/util/PathUtils.scala
index 255ae8f657..6fb12c990d 100644
--- a/core/config/src/main/scala/org/apache/amber/util/PathUtils.scala
+++ b/core/config/src/main/scala/org/apache/amber/util/PathUtils.scala
@@ -58,9 +58,6 @@ object PathUtils {
lazy val fileServicePath: Path = corePath.resolve("file-service")
- lazy val workflowComputingUnitManagingServicePath: Path =
- corePath.resolve("computing-unit-managing-service")
-
lazy val configServicePath: Path = corePath.resolve("config-service")
lazy val accessControlServicePath: Path =
corePath.resolve("access-control-service")