Critical Fix: Align internal port to 8000 to satisfy OpenEnv library requirements
Browse files- Dockerfile +3 -3
- inference.py +1 -1
- server/app.py +2 -2
Dockerfile
CHANGED
|
@@ -10,11 +10,11 @@ RUN pip install --no-cache-dir --timeout 120 -r requirements.txt
|
|
| 10 |
COPY . .
|
| 11 |
|
| 12 |
# Expose port
|
| 13 |
-
EXPOSE
|
| 14 |
|
| 15 |
# Liveness probe — validator checks this
|
| 16 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
|
| 17 |
-
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:
|
| 18 |
|
| 19 |
# Start server
|
| 20 |
-
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "
|
|
|
|
| 10 |
COPY . .
|
| 11 |
|
| 12 |
# Expose port
|
| 13 |
+
EXPOSE 8000
|
| 14 |
|
| 15 |
# Liveness probe — validator checks this
|
| 16 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
|
| 17 |
+
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"
|
| 18 |
|
| 19 |
# Start server
|
| 20 |
+
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "8000"]
|
inference.py
CHANGED
|
@@ -316,7 +316,7 @@ async def main() -> None:
|
|
| 316 |
env = PolicyEvolverEnv(base_url=base_url, provider=provider)
|
| 317 |
await env.connect()
|
| 318 |
else:
|
| 319 |
-
local_url = os.environ.get("ENV_BASE_URL", "http://127.0.0.1:
|
| 320 |
env = PolicyEvolverEnv(base_url=local_url)
|
| 321 |
# For local testing, we might want to check connection immediately or let run_episode handle it
|
| 322 |
except Exception as e:
|
|
|
|
| 316 |
env = PolicyEvolverEnv(base_url=base_url, provider=provider)
|
| 317 |
await env.connect()
|
| 318 |
else:
|
| 319 |
+
local_url = os.environ.get("ENV_BASE_URL", "http://127.0.0.1:8000")
|
| 320 |
env = PolicyEvolverEnv(base_url=local_url)
|
| 321 |
# For local testing, we might want to check connection immediately or let run_episode handle it
|
| 322 |
except Exception as e:
|
server/app.py
CHANGED
|
@@ -106,7 +106,7 @@ def run_baseline_route():
|
|
| 106 |
"API_KEY": os.environ.get("API_KEY", ""),
|
| 107 |
"API_BASE_URL": os.environ.get("API_BASE_URL", ""),
|
| 108 |
"MODEL_NAME": os.environ.get("MODEL_NAME", "llama-3.1-8b-instant"),
|
| 109 |
-
"ENV_BASE_URL": "http://127.0.0.1:
|
| 110 |
}
|
| 111 |
|
| 112 |
result = subprocess.run(
|
|
@@ -401,7 +401,7 @@ async def startup_event():
|
|
| 401 |
|
| 402 |
def main():
|
| 403 |
# Sync with Hugging Face and local requirements
|
| 404 |
-
uvicorn.run("server.app:app", host="0.0.0.0", port=
|
| 405 |
|
| 406 |
if __name__ == "__main__":
|
| 407 |
main()
|
|
|
|
| 106 |
"API_KEY": os.environ.get("API_KEY", ""),
|
| 107 |
"API_BASE_URL": os.environ.get("API_BASE_URL", ""),
|
| 108 |
"MODEL_NAME": os.environ.get("MODEL_NAME", "llama-3.1-8b-instant"),
|
| 109 |
+
"ENV_BASE_URL": "http://127.0.0.1:8000",
|
| 110 |
}
|
| 111 |
|
| 112 |
result = subprocess.run(
|
|
|
|
| 401 |
|
| 402 |
def main():
|
| 403 |
# Sync with Hugging Face and local requirements
|
| 404 |
+
uvicorn.run("server.app:app", host="0.0.0.0", port=8000, reload=False)
|
| 405 |
|
| 406 |
if __name__ == "__main__":
|
| 407 |
main()
|