Spaces:
Sleeping
Sleeping
fix: full compliance with multi-mode deployment requirements
Browse files- Dockerfile +2 -4
- openenv.yaml +4 -0
- pyproject.toml +6 -2
- server.py → server/app.py +4 -1
- uv.lock +0 -0
Dockerfile
CHANGED
|
@@ -2,11 +2,9 @@ FROM python:3.10-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
COPY requirements.txt .
|
| 6 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 7 |
-
|
| 8 |
COPY . .
|
|
|
|
| 9 |
|
| 10 |
EXPOSE 7860
|
| 11 |
|
| 12 |
-
CMD ["
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
|
|
|
|
|
|
| 5 |
COPY . .
|
| 6 |
+
RUN pip install --no-cache-dir .
|
| 7 |
|
| 8 |
EXPOSE 7860
|
| 9 |
|
| 10 |
+
CMD ["server"]
|
openenv.yaml
CHANGED
|
@@ -20,3 +20,7 @@ tasks:
|
|
| 20 |
endpoint: "http://localhost:7860"
|
| 21 |
observation_schema: "causal_stream_env.models.Observation"
|
| 22 |
action_schema: "causal_stream_env.models.Action"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
endpoint: "http://localhost:7860"
|
| 21 |
observation_schema: "causal_stream_env.models.Observation"
|
| 22 |
action_schema: "causal_stream_env.models.Action"
|
| 23 |
+
|
| 24 |
+
server:
|
| 25 |
+
entry: server
|
| 26 |
+
port: 7860
|
pyproject.toml
CHANGED
|
@@ -17,9 +17,13 @@ dependencies = [
|
|
| 17 |
"pydantic",
|
| 18 |
"openai",
|
| 19 |
"requests",
|
| 20 |
-
"pytest"
|
|
|
|
| 21 |
]
|
| 22 |
|
|
|
|
|
|
|
|
|
|
| 23 |
[tool.setuptools.packages.find]
|
| 24 |
where = ["."]
|
| 25 |
-
include = ["causal_stream_env*"]
|
|
|
|
| 17 |
"pydantic",
|
| 18 |
"openai",
|
| 19 |
"requests",
|
| 20 |
+
"pytest",
|
| 21 |
+
"openenv-core>=0.2.0"
|
| 22 |
]
|
| 23 |
|
| 24 |
+
[project.scripts]
|
| 25 |
+
server = "server.app:main"
|
| 26 |
+
|
| 27 |
[tool.setuptools.packages.find]
|
| 28 |
where = ["."]
|
| 29 |
+
include = ["causal_stream_env*", "server*"]
|
server.py → server/app.py
RENAMED
|
@@ -33,5 +33,8 @@ def get_state(task_id: int):
|
|
| 33 |
raise HTTPException(status_code=404, detail="Task not initialized.")
|
| 34 |
return envs[task_id].get_state()
|
| 35 |
|
| 36 |
-
|
| 37 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
raise HTTPException(status_code=404, detail="Task not initialized.")
|
| 34 |
return envs[task_id].get_state()
|
| 35 |
|
| 36 |
+
def main():
|
| 37 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
| 38 |
+
|
| 39 |
+
if __name__ == "__main__":
|
| 40 |
+
main()
|
uv.lock
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|