SamuelLance73 commited on
Commit
6abbd16
·
verified ·
1 Parent(s): a1c829c

Automated deployment update from ML build

Browse files
Files changed (2) hide show
  1. config/nginx.conf.template +1 -1
  2. orchestrator.py +1 -23
config/nginx.conf.template CHANGED
@@ -24,7 +24,7 @@ http {
24
  location / {
25
  root /home/user/static;
26
  index index.html;
27
- try_files $uri $uri/ @backend;
28
  }
29
 
30
  location @backend {
 
24
  location / {
25
  root /home/user/static;
26
  index index.html;
27
+ try_files /index.html @backend;
28
  }
29
 
30
  location @backend {
orchestrator.py CHANGED
@@ -106,11 +106,6 @@ def main():
106
  nginx_log = devnull
107
 
108
  os.makedirs("/home/user/static", exist_ok=True)
109
- try:
110
- with open("/home/user/static/index.html", "w") as f:
111
- f.write("<html><body><h1>AI Model Server Loading...</h1><p>Synchronizing checkpoint topology...</p></body></html>")
112
- except Exception as e:
113
- logger.warning(f"Failed to create static index.html: {e}")
114
 
115
  nginx.start(nginx_log)
116
 
@@ -236,24 +231,7 @@ def main():
236
 
237
  logger.success("Model loaded successfully. Background services active.")
238
 
239
- logger.info("Waiting for Gradio API server to become responsive...")
240
- for _ in range(30):
241
- try:
242
- import urllib.request
243
- with urllib.request.urlopen("http://127.0.0.1:7861", timeout=1) as conn:
244
- if conn.status == 200:
245
- logger.success("Gradio API server is responsive. Transitioning from loading page...")
246
- break
247
- except Exception:
248
- pass
249
- time.sleep(1)
250
-
251
- try:
252
- if os.path.exists("/home/user/static/index.html"):
253
- os.remove("/home/user/static/index.html")
254
- logger.info("Successfully transitioned to live Gradio API server.")
255
- except Exception as e:
256
- logger.error(f"Failed to remove loading page: {e}")
257
 
258
  app_proc.wait()
259
 
 
106
  nginx_log = devnull
107
 
108
  os.makedirs("/home/user/static", exist_ok=True)
 
 
 
 
 
109
 
110
  nginx.start(nginx_log)
111
 
 
231
 
232
  logger.success("Model loaded successfully. Background services active.")
233
 
234
+ logger.info("Background services are active.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
 
236
  app_proc.wait()
237