Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ src/node_modules
!pnpm-workspace.yaml
!scripts/bootstrap.mjs
!apps/web-evals/
!apps/roomote/
!src/
!webview-ui/
!packages/evals/.docker/entrypoints/runner.sh
Expand Down
11 changes: 5 additions & 6 deletions .roo/rules/rules.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Repository Rules

1. This repository is a monorepo that uses pnpm workspaces. Prefer `pnpm` over `npm` when executing commands.
2. Tests should be written with vitest instead of jest.

# Code Quality Rules

1. Test Coverage:
Expand All @@ -8,14 +13,8 @@
- Tests must be run from the same directory as the `package.json` file that specifies `vitest` in `devDependencies`

2. Lint Rules:

- Never disable any lint rules without explicit user approval

3. Styling Guidelines:
- Use Tailwind CSS classes instead of inline style objects for new markup
- VSCode CSS variables must be added to webview-ui/src/index.css before using them in Tailwind classes
- Example: `<div className="text-md text-vscode-descriptionForeground mb-2" />` instead of style objects

# Adding a New Setting

To add a new setting that persists its state, follow the steps in docs/settings.md
9 changes: 9 additions & 0 deletions apps/roomote/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
DATABASE_URL=postgresql://postgres:password@localhost:5433/cloud_agents
REDIS_URL=redis://localhost:6380

GH_WEBHOOK_SECRET=your-webhook-secret-here
GH_TOKEN=your-token-here

OPENROUTER_API_KEY=sk-or-v1-...

SLACK_API_TOKEN=xoxb-...
10 changes: 10 additions & 0 deletions apps/roomote/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Next.js
.next

# docker
.docker/*
!.docker/scripts
!.docker/entrypoints

# ENV
!.env.example
27 changes: 27 additions & 0 deletions apps/roomote/Dockerfile.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# docker compose build base api

FROM roomote-base AS base

WORKDIR /roo

COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY packages/config-eslint/package.json ./packages/config-eslint/
COPY packages/config-typescript/package.json ./packages/config-typescript/
COPY packages/types/package.json ./packages/types/
COPY packages/ipc/package.json ./packages/ipc/
COPY apps/roomote/package.json ./apps/roomote/

COPY scripts/bootstrap.mjs ./scripts/
RUN pnpm install

COPY apps/roomote ./apps/roomote/
COPY packages/config-eslint ./packages/config-eslint/
COPY packages/config-typescript ./packages/config-typescript/
COPY packages/types ./packages/types/
COPY packages/ipc ./packages/ipc/

WORKDIR /roo/apps/roomote
RUN pnpm build
ENV NODE_ENV=production
EXPOSE 3001
CMD ["pnpm", "start"]
31 changes: 31 additions & 0 deletions apps/roomote/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# docker compose build base

FROM node:20-slim AS base

# Install pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

# Install common system packages
RUN apt update && \
apt install -y \
curl \
git \
vim \
jq \
netcat-openbsd \
apt-transport-https \
ca-certificates \
gnupg \
lsb-release \
wget \
gpg \
gh \
&& rm -rf /var/lib/apt/lists/*

# Install Docker cli
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt update && apt install -y docker-ce-cli \
&& rm -rf /var/lib/apt/lists/*
25 changes: 25 additions & 0 deletions apps/roomote/Dockerfile.controller
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# docker compose build base controller

FROM roomote-base AS base

WORKDIR /roo

COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY packages/config-eslint/package.json ./packages/config-eslint/
COPY packages/config-typescript/package.json ./packages/config-typescript/
COPY packages/types/package.json ./packages/types/
COPY packages/ipc/package.json ./packages/ipc/
COPY apps/roomote/package.json ./apps/roomote/

COPY scripts/bootstrap.mjs ./scripts/
RUN pnpm install

COPY apps/roomote ./apps/roomote/
COPY packages/config-eslint ./packages/config-eslint/
COPY packages/config-typescript ./packages/config-typescript/
COPY packages/types ./packages/types/
COPY packages/ipc ./packages/ipc/

WORKDIR /roo/apps/roomote
ENV NODE_ENV=production
CMD ["pnpm", "controller"]
25 changes: 25 additions & 0 deletions apps/roomote/Dockerfile.dashboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# docker compose build base dashboard

FROM roomote-base AS base

WORKDIR /roo

COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY packages/config-eslint/package.json ./packages/config-eslint/
COPY packages/config-typescript/package.json ./packages/config-typescript/
COPY packages/types/package.json ./packages/types/
COPY packages/ipc/package.json ./packages/ipc/
COPY apps/roomote/package.json ./apps/roomote/

COPY scripts/bootstrap.mjs ./scripts/
RUN pnpm install

COPY apps/roomote ./apps/roomote/
COPY packages/config-eslint ./packages/config-eslint/
COPY packages/config-typescript ./packages/config-typescript/
COPY packages/types ./packages/types/
COPY packages/ipc ./packages/ipc/

WORKDIR /roo/apps/roomote
EXPOSE 3002
CMD ["pnpm", "dashboard"]
62 changes: 62 additions & 0 deletions apps/roomote/Dockerfile.worker
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# docker compose build worker
# Note: Requires $GH_TOKEN to be set as build argument.

FROM roomote-base AS base

# Install additional worker-specific packages
RUN apt update && \
apt install -y \
xvfb \
&& rm -rf /var/lib/apt/lists/*

# Install VS Code
RUN wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg \
&& install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg \
&& echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | tee /etc/apt/sources.list.d/vscode.list > /dev/null \
&& rm -f packages.microsoft.gpg \
&& apt update && apt install -y code \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /roo

# Install extensions
RUN mkdir -p /roo/.vscode \
&& code --no-sandbox --user-data-dir /roo/.vscode --install-extension dbaeumer.vscode-eslint \
&& code --no-sandbox --user-data-dir /roo/.vscode --install-extension esbenp.prettier-vscode \
&& code --no-sandbox --user-data-dir /roo/.vscode --install-extension csstools.postcss \
&& code --no-sandbox --user-data-dir /roo/.vscode --install-extension RooVeterinaryInc.roo-cline

# Clone repo (requires $GH_TOKEN)
ARG GH_TOKEN
ENV GH_TOKEN=${GH_TOKEN}
WORKDIR /roo/repos
RUN git config --global user.email "[email protected]"
RUN git config --global user.name "Roo Code"
RUN git config --global credential.helper store
RUN echo "https://oauth2:${GH_TOKEN}@github.com" > ~/.git-credentials
RUN gh repo clone RooCodeInc/Roo-Code
WORKDIR /roo/repos/Roo-Code
RUN gh repo set-default RooCodeInc/Roo-Code
RUN pnpm install

# Install dependencies
WORKDIR /roo
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY packages/config-eslint/package.json ./packages/config-eslint/
COPY packages/config-typescript/package.json ./packages/config-typescript/
COPY packages/types/package.json ./packages/types/
COPY packages/ipc/package.json ./packages/ipc/
COPY apps/roomote/package.json ./apps/roomote/

COPY scripts/bootstrap.mjs ./scripts/
RUN pnpm install

COPY apps/roomote ./apps/roomote/
COPY packages/config-eslint ./packages/config-eslint/
COPY packages/config-typescript ./packages/config-typescript/
COPY packages/types ./packages/types/
COPY packages/ipc ./packages/ipc/

WORKDIR /roo/apps/roomote
ENV NODE_ENV=production
CMD ["pnpm", "worker"]
120 changes: 120 additions & 0 deletions apps/roomote/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
services:
base:
build:
context: ../../
dockerfile: apps/roomote/Dockerfile.base
image: roomote-base

db:
container_name: roomote-db
image: postgres:17.5
ports:
- "5433:5432"
volumes:
- ./.docker/postgres:/var/lib/postgresql/data
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
- POSTGRES_DB=cloud_agents
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d cloud_agents"]
interval: 5s
timeout: 5s
retries: 5
start_period: 30s

redis:
container_name: roomote-redis
image: redis:7-alpine
ports:
- "6380:6379"
volumes:
- ./.docker/redis:/data
command: redis-server --appendonly yes

dashboard:
container_name: roomote-dashboard
build:
context: ../../
dockerfile: apps/roomote/Dockerfile.dashboard
image: roomote-dashboard
ports:
- "3002:3002"
environment:
- REDIS_URL=redis://redis:6379
- NODE_ENV=production
depends_on:
redis:
condition: service_started

api:
container_name: roomote-api
build:
context: ../../
dockerfile: apps/roomote/Dockerfile.api
image: roomote-api
ports:
- "3001:3001"
environment:
- DATABASE_URL=postgresql://postgres:password@db:5432/cloud_agents
- REDIS_URL=redis://redis:6379
- NODE_ENV=production
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
db:
condition: service_healthy
redis:
condition: service_started

controller:
container_name: roomote-controller
build:
context: ../../
dockerfile: apps/roomote/Dockerfile.controller
args:
- GH_TOKEN=${GH_TOKEN}
image: roomote-controller
env_file:
- .env
environment:
- HOST_EXECUTION_METHOD=docker
- DATABASE_URL=postgresql://postgres:password@db:5432/cloud_agents
- REDIS_URL=redis://redis:6379
- NODE_ENV=production
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/roomote:/var/log/roomote
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped

worker:
build:
context: ../../
dockerfile: apps/roomote/Dockerfile.worker
args:
- GH_TOKEN=${GH_TOKEN}
image: roomote-worker
env_file:
- .env
environment:
- HOST_EXECUTION_METHOD=docker
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/roomote:/var/log/roomote
stdin_open: true
tty: true
depends_on:
db:
condition: service_healthy
redis:
condition: service_started

networks:
default:
name: roomote_default
driver: bridge
10 changes: 10 additions & 0 deletions apps/roomote/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "drizzle-kit"

export default defineConfig({
schema: "./src/db/schema.ts",
out: "./drizzle",
dialect: "postgresql",
dbCredentials: {
url: process.env.DATABASE_URL!,
},
})
21 changes: 21 additions & 0 deletions apps/roomote/drizzle/0000_cuddly_luke_cage.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
CREATE TABLE "cloud_jobs" (
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "cloud_jobs_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
"type" text NOT NULL,
"status" text DEFAULT 'pending' NOT NULL,
"payload" jsonb NOT NULL,
"result" jsonb,
"error" text,
"created_at" timestamp DEFAULT now() NOT NULL,
"started_at" timestamp,
"completed_at" timestamp
);
--> statement-breakpoint
CREATE TABLE "cloud_tasks" (
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "cloud_tasks_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
"job_id" integer NOT NULL,
"task_id" integer,
"container_id" text,
"created_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "cloud_tasks" ADD CONSTRAINT "cloud_tasks_job_id_cloud_jobs_id_fk" FOREIGN KEY ("job_id") REFERENCES "public"."cloud_jobs"("id") ON DELETE no action ON UPDATE no action;
1 change: 1 addition & 0 deletions apps/roomote/drizzle/0001_fluffy_sasquatch.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "cloud_jobs" ADD COLUMN "slack_thread_ts" text;
1 change: 1 addition & 0 deletions apps/roomote/drizzle/0002_brief_sentry.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "cloud_tasks" CASCADE;
Loading