runledger-cli 0.1.0__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: runledger-cli
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Zero‑instrumentation experiment registry CLI
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -0,0 +1,28 @@
1
+ services:
2
+ postgres:
3
+ image: postgres:16
4
+ environment:
5
+ POSTGRES_DB: runledger
6
+ POSTGRES_USER: runledger
7
+ POSTGRES_PASSWORD: runledger
8
+ ports:
9
+ - "5432:5432"
10
+ healthcheck:
11
+ test: ["CMD-SHELL", "pg_isready -U runledger"]
12
+ interval: 5s
13
+ timeout: 5s
14
+ retries: 5
15
+
16
+ app:
17
+ image: ahmedrafatdev/runledger:latest
18
+ ports:
19
+ # Only accessible from this machine (localhost). Any local user can connect;
20
+ # for shared servers, add authentication or a reverse proxy.
21
+ - "127.0.0.1:8080:8080"
22
+ environment:
23
+ SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/runledger
24
+ SPRING_DATASOURCE_USERNAME: runledger
25
+ SPRING_DATASOURCE_PASSWORD: runledger
26
+ depends_on:
27
+ postgres:
28
+ condition: service_healthy
@@ -48,7 +48,7 @@ except Exception:
48
48
  # Configuration
49
49
  # ------------------------------------------------------------
50
50
  API_BASE = "http://localhost:8080/api/runs"
51
- COMPOSE_FILE = os.path.join(os.path.dirname(__file__), "..", "docker-compose.yml")
51
+ COMPOSE_FILE = os.path.join(os.path.dirname(__file__), "docker-compose.yml")
52
52
  HEALTH_URL = "http://localhost:8080/actuator/health"
53
53
  PAGE_SIZE = 10
54
54
 
@@ -86,11 +86,15 @@ def wait_for_backend(timeout=60):
86
86
  return False
87
87
 
88
88
  def start_backend():
89
- if not os.path.exists(COMPOSE_FILE):
90
- console.print("[red]docker-compose.yml not found. Are you in the project root?[/red]")
89
+ compose_file = COMPOSE_FILE
90
+ if not os.path.exists(compose_file):
91
+ console.print("[red]Cannot find docker-compose.yml[/red]")
91
92
  sys.exit(1)
92
93
  console.print("Starting RunLedger backend...")
93
- subprocess.run(f"docker compose -f {COMPOSE_FILE} up -d", shell=True, check=True)
94
+ subprocess.run(
95
+ ["docker", "compose", "-f", compose_file, "-p", "runledger", "up", "-d"],
96
+ shell=True, check=True
97
+ )
94
98
  if wait_for_backend():
95
99
  console.print("[green]RunLedger backend is running.[/green]")
96
100
  else:
@@ -98,12 +102,21 @@ def start_backend():
98
102
  sys.exit(1)
99
103
 
100
104
  def stop_backend():
101
- if os.path.exists(COMPOSE_FILE):
102
- subprocess.run(f"docker compose -f {COMPOSE_FILE} down", shell=True, check=True)
105
+ compose_file = COMPOSE_FILE
106
+ if os.path.exists(compose_file):
107
+ subprocess.run(
108
+ ["docker", "compose", "-f", compose_file, "-p", "runledger", "down"],
109
+ shell=True, check=True
110
+ )
103
111
  console.print("RunLedger backend stopped.")
104
112
  else:
105
113
  console.print("[red]Cannot find docker-compose.yml[/red]")
106
114
 
115
+ def ensure_backend():
116
+ """Start the backend if it's not already running."""
117
+ if not backend_running():
118
+ start_backend()
119
+
107
120
  # ------------------------------------------------------------
108
121
  # Ingestion
109
122
  # ------------------------------------------------------------
@@ -1166,6 +1179,7 @@ def main():
1166
1179
  has_data = False
1167
1180
 
1168
1181
  if not has_data:
1182
+ ensure_backend()
1169
1183
  from cli.guided import run_guided_search
1170
1184
  run_guided_search()
1171
1185
  else:
@@ -1267,6 +1281,7 @@ def main():
1267
1281
  elif args.command == "aggregate":
1268
1282
  cli_aggregate(args)
1269
1283
  elif args.command == "guided":
1284
+ ensure_backend()
1270
1285
  from cli.guided import run_guided_search
1271
1286
  run_guided_search()
1272
1287
  else:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "runledger-cli"
7
- version = "0.1.0"
7
+ version = "0.1.2"
8
8
  description = "Zero‑instrumentation experiment registry CLI"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -16,4 +16,7 @@ dependencies = [
16
16
  runledger = "cli.ledger:main"
17
17
 
18
18
  [tool.setuptools.packages.find]
19
- include = ["cli", "cli.*"]
19
+ include = ["cli", "cli.*"]
20
+
21
+ [tool.setuptools.package-data]
22
+ cli = ["docker-compose.yml"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: runledger-cli
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Zero‑instrumentation experiment registry CLI
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -1,6 +1,7 @@
1
1
  README.md
2
2
  pyproject.toml
3
3
  cli/__init__.py
4
+ cli/docker-compose.yml
4
5
  cli/guided.py
5
6
  cli/ledger.py
6
7
  cli/tests/__init__.py
File without changes
File without changes