Spaces:
Paused
Paused
Automated deployment update from ML build
Browse files- Dockerfile +0 -2
- core/orchestrator.py +13 -0
Dockerfile
CHANGED
|
@@ -49,8 +49,6 @@ COPY --chown=user:user services /home/user/services
|
|
| 49 |
COPY --chown=user:user config /home/user/config
|
| 50 |
|
| 51 |
COPY --chown=user:user nodes.txt /home/user/nodes.txt
|
| 52 |
-
COPY --chown=user:user whoami.sh /home/user/whoami.sh
|
| 53 |
-
RUN chmod +x /home/user/whoami.sh
|
| 54 |
|
| 55 |
USER user
|
| 56 |
WORKDIR /home/user
|
|
|
|
| 49 |
COPY --chown=user:user config /home/user/config
|
| 50 |
|
| 51 |
COPY --chown=user:user nodes.txt /home/user/nodes.txt
|
|
|
|
|
|
|
| 52 |
|
| 53 |
USER user
|
| 54 |
WORKDIR /home/user
|
core/orchestrator.py
CHANGED
|
@@ -132,6 +132,19 @@ def main():
|
|
| 132 |
|
| 133 |
os.makedirs("/home/user/static", exist_ok=True)
|
| 134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
nginx.start(nginx_log)
|
| 136 |
|
| 137 |
logger.info("Starting Gradio fake app (API server)...")
|
|
|
|
| 132 |
|
| 133 |
os.makedirs("/home/user/static", exist_ok=True)
|
| 134 |
|
| 135 |
+
space_id = os.environ.get("SPACE_ID", "")
|
| 136 |
+
if space_id and os.path.exists("/home/user/nodes.txt"):
|
| 137 |
+
try:
|
| 138 |
+
with open("/home/user/nodes.txt", "r") as f:
|
| 139 |
+
for line in f:
|
| 140 |
+
parts = line.strip().split(": ")
|
| 141 |
+
if len(parts) == 2 and parts[1] == space_id:
|
| 142 |
+
with open("/home/user/whoami.txt", "w") as out:
|
| 143 |
+
out.write(parts[0] + "\n")
|
| 144 |
+
break
|
| 145 |
+
except Exception:
|
| 146 |
+
pass
|
| 147 |
+
|
| 148 |
nginx.start(nginx_log)
|
| 149 |
|
| 150 |
logger.info("Starting Gradio fake app (API server)...")
|