fsanyoto commited on
Commit
3c1ea31
·
verified ·
1 Parent(s): 32744f6

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
RELEASES.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "current": "a4e6ccbce1ed",
3
  "releases": [
4
  {
5
  "version": "v83",
 
1
  {
2
+ "current": "5a3e53380f59",
3
  "releases": [
4
  {
5
  "version": "v83",
VERSION CHANGED
@@ -1 +1 @@
1
- a4e6ccbce1ed
 
1
+ 5a3e53380f59
api/sync_worker.py CHANGED
@@ -23,18 +23,32 @@ def configure(env=None):
23
  env["AIOS_DUCKDB_STORE_DIR"] = str(worker_dir)
24
  env["AIOS_DUCKDB_PATH"] = str(worker_db)
25
  env["AIOS_DUCKDB_MEMORY"] = env.get("AIOS_WORKER_DUCKDB_MEMORY") or "4GB"
26
- env["AIOS_DUCKDB_THREADS"] = env.get("AIOS_WORKER_DUCKDB_THREADS") or "2"
27
  return worker_db
28
 
29
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  def main():
31
  worker_db = configure()
32
  worker_db.parent.mkdir(parents=True, exist_ok=True)
 
33
  for path in (str(_RI), str(API_DIR)):
34
  if path not in sys.path:
35
  sys.path.insert(0, path)
36
  print(f"[sync-worker] pid={os.getpid()} duckdb={worker_db} "
37
- f"memory_limit={os.environ['AIOS_DUCKDB_MEMORY']} threads={os.environ['AIOS_DUCKDB_THREADS']}",
 
38
  flush=True)
39
  print("[sync-worker] amazon_store.sync excludes brand analytics reports (memory); "
40
  "they stay out of this worker too", flush=True)
 
23
  env["AIOS_DUCKDB_STORE_DIR"] = str(worker_dir)
24
  env["AIOS_DUCKDB_PATH"] = str(worker_db)
25
  env["AIOS_DUCKDB_MEMORY"] = env.get("AIOS_WORKER_DUCKDB_MEMORY") or "4GB"
26
+ env["AIOS_DUCKDB_THREADS"] = env.get("AIOS_WORKER_DUCKDB_THREADS") or "1"
27
  return worker_db
28
 
29
 
30
+ def lower_priority(env=None):
31
+ """Drop this process to a low CPU priority, so the web process wins every contested core."""
32
+ env = os.environ if env is None else env
33
+ step = int(env.get("AIOS_WORKER_NICE") or 15)
34
+ if step and hasattr(os, "nice"):
35
+ try:
36
+ return os.nice(step)
37
+ except OSError:
38
+ return None
39
+ return None
40
+
41
+
42
  def main():
43
  worker_db = configure()
44
  worker_db.parent.mkdir(parents=True, exist_ok=True)
45
+ niceness = lower_priority()
46
  for path in (str(_RI), str(API_DIR)):
47
  if path not in sys.path:
48
  sys.path.insert(0, path)
49
  print(f"[sync-worker] pid={os.getpid()} duckdb={worker_db} "
50
+ f"memory_limit={os.environ['AIOS_DUCKDB_MEMORY']} threads={os.environ['AIOS_DUCKDB_THREADS']} "
51
+ f"nice={niceness}",
52
  flush=True)
53
  print("[sync-worker] amazon_store.sync excludes brand analytics reports (memory); "
54
  "they stay out of this worker too", flush=True)
web/public/AIOS_DEPLOY_RECEIPT CHANGED
@@ -1 +1 @@
1
- 31637b3b3f684b7c7795e667f4cd10da6215d5d665724db8d0e0de6b34741c43
 
1
+ 3e3eda8157019e5f0b93b658187c41d1b52b539235e4899b84fa1a0b714cac43