Spaces:
Sleeping
Sleeping
Commit ·
bea2be2
1
Parent(s): 7ddfe40
Refine manual deployment guide
Browse files- MANUAL_TESTING.md +38 -6
MANUAL_TESTING.md
CHANGED
|
@@ -11,7 +11,7 @@ cd /home/sourav/Documents/blahblah/cicd-debugger-env
|
|
| 11 |
source .venv/bin/activate
|
| 12 |
```
|
| 13 |
|
| 14 |
-
Always run
|
| 15 |
|
| 16 |
```bash
|
| 17 |
.venv/bin/python
|
|
@@ -20,8 +20,14 @@ Always run tests with the project interpreter below, not system `python3`:
|
|
| 20 |
If dependencies are missing:
|
| 21 |
|
| 22 |
```bash
|
| 23 |
-
pip install -r requirements.txt
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
```
|
| 26 |
|
| 27 |
## 1) Run All Unit Tests
|
|
@@ -64,7 +70,7 @@ Expected output should include lines starting with:
|
|
| 64 |
Start server (Terminal 1):
|
| 65 |
|
| 66 |
```bash
|
| 67 |
-
uvicorn server.app:app --host 0.0.0.0 --port 7860
|
| 68 |
```
|
| 69 |
|
| 70 |
Test endpoints (Terminal 2):
|
|
@@ -76,6 +82,11 @@ curl -sS http://127.0.0.1:7860/state
|
|
| 76 |
curl -sS -X POST http://127.0.0.1:7860/step -H 'Content-Type: application/json' -d '{"action":"read_logs: inspect failing stage logs"}'
|
| 77 |
```
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
## 5) Docker Manual Test
|
| 80 |
|
| 81 |
Build image:
|
|
@@ -124,10 +135,16 @@ bash validate-submission.sh https://your-space-name.hf.space .
|
|
| 124 |
|
| 125 |
## 8) Baseline Across Easy/Medium/Hard
|
| 126 |
|
| 127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
```bash
|
| 130 |
-
.venv/bin/python baseline_inference.py --max-steps 5 --policy-mode imp --trajectories 3 --force-local-env
|
| 131 |
```
|
| 132 |
|
| 133 |
This writes:
|
|
@@ -136,6 +153,17 @@ This writes:
|
|
| 136 |
artifacts/baseline_scores.json
|
| 137 |
```
|
| 138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
## Common Issues
|
| 140 |
|
| 141 |
- `pytest: command not found`:
|
|
@@ -143,6 +171,10 @@ artifacts/baseline_scores.json
|
|
| 143 |
- `ModuleNotFoundError: No module named 'fastapi'` or `No module named 'openai'`:
|
| 144 |
- You are likely using system `python3` (`/usr/bin/python3`).
|
| 145 |
- Re-run with `.venv/bin/python -m unittest discover -s tests -v`.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
- `Bind for 0.0.0.0:7860 failed: port is already allocated`:
|
| 147 |
- Use host port 7861 (or another free port).
|
| 148 |
- OpenAI/HF credential issues during online inference:
|
|
|
|
| 11 |
source .venv/bin/activate
|
| 12 |
```
|
| 13 |
|
| 14 |
+
Always run commands with the project interpreter below, not system `python3`:
|
| 15 |
|
| 16 |
```bash
|
| 17 |
.venv/bin/python
|
|
|
|
| 20 |
If dependencies are missing:
|
| 21 |
|
| 22 |
```bash
|
| 23 |
+
.venv/bin/python -m pip install -r requirements.txt
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
Optional sanity checks:
|
| 27 |
+
|
| 28 |
+
```bash
|
| 29 |
+
which python
|
| 30 |
+
.venv/bin/python -c "import fastapi,openai; print('venv deps ok')"
|
| 31 |
```
|
| 32 |
|
| 33 |
## 1) Run All Unit Tests
|
|
|
|
| 70 |
Start server (Terminal 1):
|
| 71 |
|
| 72 |
```bash
|
| 73 |
+
.venv/bin/python -m uvicorn server.app:app --host 0.0.0.0 --port 7860
|
| 74 |
```
|
| 75 |
|
| 76 |
Test endpoints (Terminal 2):
|
|
|
|
| 82 |
curl -sS -X POST http://127.0.0.1:7860/step -H 'Content-Type: application/json' -d '{"action":"read_logs: inspect failing stage logs"}'
|
| 83 |
```
|
| 84 |
|
| 85 |
+
Expected `POST /reset` response includes typed reward fields:
|
| 86 |
+
- `reward`
|
| 87 |
+
- `reward_model.value`
|
| 88 |
+
- `reward_model.components`
|
| 89 |
+
|
| 90 |
## 5) Docker Manual Test
|
| 91 |
|
| 92 |
Build image:
|
|
|
|
| 135 |
|
| 136 |
## 8) Baseline Across Easy/Medium/Hard
|
| 137 |
|
| 138 |
+
OpenAI client mode:
|
| 139 |
+
|
| 140 |
+
```bash
|
| 141 |
+
OPENAI_API_KEY="<your_openai_compatible_api_key>" .venv/bin/python baseline_inference.py --max-steps 5 --policy-mode imp --trajectories 3 --force-local-env
|
| 142 |
+
```
|
| 143 |
+
|
| 144 |
+
Offline reproducible mode:
|
| 145 |
|
| 146 |
```bash
|
| 147 |
+
.venv/bin/python baseline_inference.py --max-steps 5 --policy-mode imp --trajectories 3 --offline --force-local-env
|
| 148 |
```
|
| 149 |
|
| 150 |
This writes:
|
|
|
|
| 153 |
artifacts/baseline_scores.json
|
| 154 |
```
|
| 155 |
|
| 156 |
+
## 9) Quick Full Verification
|
| 157 |
+
|
| 158 |
+
Run this sequence for a full local confidence check:
|
| 159 |
+
|
| 160 |
+
```bash
|
| 161 |
+
.venv/bin/python -m unittest discover -s tests -v
|
| 162 |
+
.venv/bin/python -m openenv.cli.__main__ validate
|
| 163 |
+
.venv/bin/python baseline_inference.py --max-steps 5 --policy-mode imp --trajectories 3 --offline --force-local-env
|
| 164 |
+
docker build -t cicd-debugger-env .
|
| 165 |
+
```
|
| 166 |
+
|
| 167 |
## Common Issues
|
| 168 |
|
| 169 |
- `pytest: command not found`:
|
|
|
|
| 171 |
- `ModuleNotFoundError: No module named 'fastapi'` or `No module named 'openai'`:
|
| 172 |
- You are likely using system `python3` (`/usr/bin/python3`).
|
| 173 |
- Re-run with `.venv/bin/python -m unittest discover -s tests -v`.
|
| 174 |
+
- `pip install -r requirements.txt` exits with code 1:
|
| 175 |
+
- Use `.venv/bin/python -m pip install -r requirements.txt`.
|
| 176 |
+
- Confirm venv is active: `source .venv/bin/activate`.
|
| 177 |
+
- If network is restricted, retry later or use a network that can reach PyPI.
|
| 178 |
- `Bind for 0.0.0.0:7860 failed: port is already allocated`:
|
| 179 |
- Use host port 7861 (or another free port).
|
| 180 |
- OpenAI/HF credential issues during online inference:
|