automatically maintain docker repositories with agents
Janitor uses a multi-agent architecture (based on mastra) to validate and repair Docker repositories:
- Janitor (agent) - Coordinates the whole process
- Docker Validation (workflow) - Tests Docker builds and container execution
- Dev (agent) - Diagnoses and repairs issues in Docker repositories
- PR Creator (agent) - Creates pull requests with fixes on GitHub
This guide will help you set up and run Janitor locally for maintaining and validating Docker repositories.
- Node.js (v22 or later)
- npm
- Docker Desktop installed and running
- API keys:
- Anthropic API key - Create an account and get your API key from the console
- GitHub Personal Access Token - Create a token with
repo
scope - RunPod API key - Sign up for RunPod and create an API key in your account settings
- RunPod Endpoint ID - Create a serverless endpoint using vLLM with ToolACE-2-Llama-3.1-8B (or any other compatible llm with function calling capabilities) and use its ID
-
Clone the repository:
git clone https://github.com/runpod/janitor.git cd janitor
-
Install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env
-
Edit the
.env
file and add your API keys:ANTHROPIC_API_KEY=sk-*************************** GITHUB_PERSONAL_ACCESS_TOKEN=ghp_*************************** RUNPOD_API_KEY=rpa_*************************** RUNPOD_ENDPOINT_ID=*************************** RUNPOD_MODEL_NAME=Team-ACE/ToolACE-2-Llama-3.1-8B
To start the development server:
npm run dev
This will launch the Mastra development server which allows you to interact with the agents via a web interface.
To validate a Docker repository:
npm run test:janitor
This will:
- Clone the example repository (TimPietrusky/worker-basic)
- Validate the Dockerfile
- Attempt repairs if needed
- Create a PR with fixes (if GitHub token is configured)