Spaces:
Sleeping
Sleeping
File size: 4,065 Bytes
9a2f7e1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | ---
title: FixOS Environment Server
emoji: "🔧"
colorFrom: blue
colorTo: green
sdk: docker
pinned: false
app_port: 8000
base_path: /web
tags:
- openenv
- troubleshooting
- deterministic
---
# FixOS
FixOS is a deterministic OS troubleshooting simulation environment for evaluating AI agents on realistic system maintenance workflows.
The environment simulates:
- Processes with PID, CPU %, and memory usage
- Services (`nginx`, `mysql`) with status and config dependencies
- Filesystem with config/log files and disk impact
- Resources (`cpu_percent`, `memory_mb`, `disk_percent`)
- Timestamped logs and command history
- Deterministic task variants with reproducible scoring
## OpenEnv Spec Compliance
This project implements:
- Typed models in `models.py`
- `reset()`, `step()`, and `state` in `server/my_env_environment.py`
- OpenEnv manifest in `openenv.yaml`
- FastAPI server in `server/app.py`
- Baseline script in `inference.py`
## Tasks and Difficulty
There are 7 deterministic tasks across 3 tiers:
- `easy_1`: nginx stopped
- `easy_2`: mysql stopped + log hint
- `medium_1`: invalid nginx config + log hint
- `medium_2`: invalid mysql config + log hint
- `hard_1`: invalid nginx config + disk 97% + high CPU pid 909 + mysql dependency issue
- `hard_2`: invalid mysql config + disk 98% + high CPU pid 910 + nginx dependency issue
- `hard_3`: invalid nginx config + disk 99% + cpu contention (pids 920/921) + port blocker pid 922
Task selection is deterministic and cycles in fixed order per reset.
## Action Space
`FixOSAction`
- `command: str`
- `args: dict`
Supported commands:
- `ps`, `top`, `df`, `status`, `logs`, `cat`, `edit`, `restart`, `kill`, `rm`
## Observation Space
`FixOSObservation`
- `command_output: str`
- `processes: List[ProcessInfo]`
- `services: List[ServiceInfo]`
- `filesystem: List[FileInfo]`
- `resources: Dict[str, float]`
- `logs: List[LogEntry]`
- `history: List[str]`
- `task_id: str`
- `task_difficulty: str`
- `task_score: float`
- `is_success_step: bool`
- `remaining_steps: int`
- `reward: float`
- `done: bool`
## Reward Function (0.0 to 1.0 per step)
Positive signals:
- `+0.1` exploration commands (`ps/top/df/status/logs/cat`)
- `+0.2` diagnostic hit from logs or config reads with error/warn patterns
- `+0.3` edit attempt
- `+0.3` kill high CPU process (`cpu >= 50`)
- `+0.3` file removal that reduces disk
- `+0.5` service restart from stopped/failed to running
- `+0.5` disk normalized from `>95` to `<=95`
- `+0.5` task solved
- `+0.4 * delta` score improvement
Reward is clamped to `[0.0, 1.0]`.
## Quick Start
### 1. Install dependencies
```bash
pip install -e .
```
### 2. Run server
```bash
uvicorn server.app:app --host 0.0.0.0 --port 8000 --reload
```
### 3. Validate OpenEnv spec
```bash
openenv validate
```
### 4. Build Docker image
```bash
docker build -t fixos-env:latest -f server/Dockerfile .
```
## Baseline Inference
The required inference script is at `inference.py`.
Required environment variables:
- `API_BASE_URL`
- `MODEL_NAME`
- `HF_TOKEN`
Run:
```bash
python inference.py
```
The script emits structured logs using `[START]`, `[STEP]`, and `[END]` records.
## Hugging Face Spaces Deployment
From project root:
```bash
openenv push
```
After deployment verify:
- `POST /reset` returns HTTP 200
- `openenv validate` passes locally
- Docker image builds successfully
## Pre-submission Validator
Run your validator script before submission:
```bash
./validate-submission.sh https://your-space.hf.space .
```
It checks:
- HF Space ping (`/reset`)
- Docker build
- `openenv validate`
## Project Structure
```text
my_env/
+-- __init__.py
+-- client.py
+-- inference.py
+-- models.py
+-- openenv.yaml
+-- pyproject.toml
+-- README.md
+-- requirements.txt
`-- server/
+-- __init__.py
+-- app.py
+-- Dockerfile
+-- my_env_environment.py
`-- requirements.txt
```
|