harrry24/sysadmin-openenv
SysAdmin OpenEnv Simulator
This project is a submission for the Meta PyTorch OpenEnv Hackathon x Scaler Round 1. It implements a complete, real-world OpenEnv environment simulating a Junior System Administrator's workspace.
Environment Description
The SysAdmin Simulator evaluates an AI agent's ability to diagnose and repair simulated system, application, and process-level problems using a bash terminal interface. The agent is placed within an isolated Unix-like workspace where three distinct tasks of escalating difficulty are simulated.
This is not a toy game: investigating logs, fixing configuration files, and terminating rogue processes are daily realities for engineering and operations teams.
Tasks
- Easy (`easy_log_analysis`): The agent must
grepor analyze/var/log/auth.logto find the exact IP address responsible for repeated failed SSH login attempts, and submit the IP. - Medium (`med_config_fix`): The agent must fix a misconfigured Nginx/web server port in
/workspace/app/config/server.conffrom9090to the proper8080, then restart the service. - Hard (`hard_cpu_hog`): A rogue script (
evil_miner.sh) is running and consuming fake CPU cycles. The agent must locate the process ID (PID) of this script and issue akillcommand.
Action & Observation Spaces
The environment follows an interactive bash-shell paradigm.
Action Space
- The agent outputs a single bash command string.
- Schema:
Action(command: str) - Example:
{"command": "cat /var/log/auth.log"}or{"command": "submit 192.168.1.105"}
Observation Space
- The environment executes the command within a strict 5-second timeout in an isolated sandbox. It returns standard bash output.
- Schema:
Observation(stdout: str, stderr: str, exit_code: int, task_id: str, reward: float, done: bool, info: dict) - Reward Strategy:
1.0: Task completed successfully.0.0: Progressing / standard step.-0.05: The executed command failed (exit code != 0, giving the agent a slight penalty for hallucinating commands or syntax errors).
Setup & Execution Instructions
Prerequisites
- Docker OR Python 3.10+
- An OpenAI-compatible API key (e.g., standard OpenAI or a proxy like Hugging Face Router as provided in the hackathon).
Running Locally with Docker (Recommended)
You can test the entire pipeline locally, just as it would run on a Hugging Face Space.
- Build the Environment Container:
docker build -t openenv-sysadmin .- Run the Environment:
docker run -p 8000:8000 openenv-sysadmin- Run Inference (in a separate terminal):
export API_BASE_URL="https://api.openai.com/v1" # Or your specific router
export MODEL_NAME="gpt-4o-mini" # Or an open model
export HF_TOKEN="your_api_key_here"
python3 inference.pyRunning Locally without Docker
- Install dependencies:
pip install -r requirements.txt - Start the FastAPI server:
uvicorn app:app --host 0.0.0.0 --port 8000 - Set environment variables and run
python inference.py
Baseline Scores
The environment was evaluated using the internal inference.py running the gpt-4o-mini baseline agent:
- Easy Task (`easy_log_analysis`): [Score TBD by user]
- Medium Task (`med_config_fix`): [Score TBD by user]
- Hard Task (`hard_cpu_hog`): [Score TBD by user]
Judging Validation
This environment strictly adheres to the OpenEnv JSON model standard over HTTP endpoints (/reset, /step, /state). It meets the runtime limit requirement (the FastAPI server is highly lightweight, consuming <50MB RAM).
