Abhinav Singh commited on
Commit
7800a62
·
1 Parent(s): 7d21a80

chore(infra): add Dockerfile, dependencies, and build config

Browse files

Dockerfile:
- Base: python:3.11-slim (matches HF Spaces docker runtime)
- Installs gcc for native extension builds
- Copies requirements.txt first for Docker layer caching
- EXPOSE 7860 (required by HuggingFace Spaces)
- HEALTHCHECK via urllib (no extra deps needed)
- CMD: uvicorn server.app:app --host 0.0.0.0 --port 7860

requirements.txt: fastapi, uvicorn[standard], pydantic, openai,
pyyaml, requests, openenv-core (pinned versions for reproducibility)

pyproject.toml:
- [project.scripts] server = 'server.app:main' (required by openenv validate)
- openenv-core>=0.2.0 as runtime dependency

uv.lock: generated by uv lock, required by openenv validate check

Files changed (4) hide show
  1. Dockerfile +19 -0
  2. pyproject.toml +32 -0
  3. requirements.txt +7 -0
  4. uv.lock +0 -0
Dockerfile ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ RUN apt-get update && apt-get install -y \
6
+ gcc \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ COPY requirements.txt .
10
+ RUN pip install --no-cache-dir -r requirements.txt
11
+
12
+ COPY . .
13
+
14
+ EXPOSE 7860
15
+
16
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
17
+ CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/')" || exit 1
18
+
19
+ CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]
pyproject.toml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [build-system]
2
+ requires = ["setuptools>=68.0", "wheel"]
3
+ build-backend = "setuptools.backends.legacy:build"
4
+
5
+ [project]
6
+ name = "sql-optim-env"
7
+ version = "1.0.0"
8
+ description = "OpenEnv-compliant RL environment for AI SQL query optimization agents."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = { text = "Apache-2.0" }
12
+ keywords = ["openenv", "sql", "database", "optimization", "rl", "reinforcement-learning", "llm-agent"]
13
+
14
+ dependencies = [
15
+ "fastapi==0.115.0",
16
+ "uvicorn[standard]==0.30.6",
17
+ "pydantic==2.8.2",
18
+ "openai>=1.0.0",
19
+ "pyyaml==6.0.2",
20
+ "requests==2.32.3",
21
+ "openenv-core>=0.2.0",
22
+ ]
23
+
24
+ [project.scripts]
25
+ server = "server.app:main"
26
+
27
+ [project.optional-dependencies]
28
+ dev = ["pytest", "httpx"]
29
+
30
+ [tool.setuptools.packages.find]
31
+ where = ["."]
32
+ include = ["*"]
requirements.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ fastapi==0.115.0
2
+ uvicorn[standard]==0.30.6
3
+ pydantic==2.8.2
4
+ openai>=1.0.0
5
+ pyyaml==6.0.2
6
+ requests==2.32.3
7
+ openenv-core>=0.2.0
uv.lock ADDED
The diff for this file is too large to render. See raw diff