Skip to content

Commit c38b05e

Browse files
committed
path redefined for synthetic data studio for buold and start
1 parent 42273f8 commit c38b05e

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

build/build_client.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,17 @@
55

66
PROJECT_ROOT = Path.cwd()
77

8+
# Check if we're in a composable environment
9+
if os.getenv("IS_COMPOSABLE"):
10+
# If composable, change to the specified directory
11+
12+
PROJECT_ROOT = Path("/home/cdsw/synthetic-data-studio")
13+
else:
14+
# Otherwise, use the current directory as the project root
15+
PROJECT_ROOT = Path.cwd()
16+
817
# Add project root to Python path
918
sys.path.insert(0, str(PROJECT_ROOT))
10-
1119
# Import PathManager
1220
from app.core.path_manager import PathManager
1321
path_manager = PathManager()
@@ -22,15 +30,16 @@ def ensure_uv_installed():
2230

2331
# Setup virtual environment and dependencies
2432
def setup_environment():
25-
project_root = path_manager.root_dir
26-
venv_dir = project_root / ".venv"
33+
# project_root = path_manager.root_dir
34+
# print("path_root: ", project_root)
35+
venv_dir = PROJECT_ROOT / ".venv"
2736

2837
# Create venv if it doesn't exist - specifying the path explicitly
2938
if not venv_dir.exists():
30-
subprocess.run(["uv", "venv", ".venv"], cwd=project_root, check=True)
39+
subprocess.run(["uv", "venv", ".venv"], cwd=PROJECT_ROOT, check=True)
3140

3241
# Install dependencies with uv pip instead of sync to avoid pyproject.toml parsing issues
33-
subprocess.run(["uv", "pip", "install", "-e", "."], cwd=project_root, check=True)
42+
subprocess.run(["uv", "pip", "install", "-e", "."], cwd=PROJECT_ROOT, check=True)
3443

3544
# Main execution
3645
with path_manager.in_project_directory():

build/start_application.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,26 @@
44
from pathlib import Path
55

66

7-
PROJECT_ROOT = Path.cwd()
8-
7+
# Check if we're in a composable environment
8+
if os.getenv("IS_COMPOSABLE"):
9+
# If composable, change to the specified directory
10+
11+
PROJECT_ROOT = Path("/home/cdsw/synthetic-data-studio")
12+
else:
13+
# Otherwise, use the current directory as the project root
14+
PROJECT_ROOT = Path.cwd()
15+
916
# Add project root to Python path
1017
sys.path.insert(0, str(PROJECT_ROOT))
11-
1218
# Import PathManager
1319
from app.core.path_manager import PathManager
1420
path_manager = PathManager()
1521

16-
# Initialize PathManager
17-
path_manager = PathManager()
22+
1823

1924
# Main execution
2025
with path_manager.in_project_directory():
21-
# Execute the start application script
26+
# Execute the start application script
2227
subprocess.run(["bash build/shell_scripts/start_application.sh"], shell=True, check=True)
23-
28+
2429
print("Application running")

0 commit comments

Comments
 (0)