Skip to content

Commit 9e8d141

Browse files
committed
Initial commit: cell-state-compiler full-stack monorepo
0 parents  commit 9e8d141

161 files changed

Lines changed: 20354 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# ─── Database ────────────────────────────────────────────────────────────────
2+
POSTGRES_HOST=postgres
3+
POSTGRES_PORT=5432
4+
POSTGRES_DB=cell_state_compiler
5+
POSTGRES_USER=cellcompiler
6+
POSTGRES_PASSWORD=cellcompiler
7+
DATABASE_URL=postgresql+psycopg2://cellcompiler:cellcompiler@postgres:5432/cell_state_compiler
8+
9+
# ─── Redis ───────────────────────────────────────────────────────────────────
10+
REDIS_URL=redis://redis:6379/0
11+
12+
# ─── JWT ─────────────────────────────────────────────────────────────────────
13+
JWT_SECRET=dev_change_me_in_production_use_32_char_minimum_xx
14+
JWT_ALGORITHM=HS256
15+
ACCESS_TOKEN_EXPIRE_MINUTES=1440
16+
17+
# ─── CORS / API ──────────────────────────────────────────────────────────────
18+
CORS_ORIGINS=http://localhost:3000
19+
NEXT_PUBLIC_API_BASE_URL=http://localhost:8000/api/v1
20+
21+
# ─── Genome Model Service ────────────────────────────────────────────────────
22+
GENOME_MODEL_SERVICE_URL=http://genome-model-service:8100
23+
24+
# ─── Evo 2 Configuration ─────────────────────────────────────────────────────
25+
# Provider: local | nvidia_nim
26+
EVO2_PROVIDER=local
27+
# Model sizes:
28+
# evo2_1b_base — CPU-compatible, dev/test (~2 GB)
29+
# evo2_7b — Single A100/H100 40GB+
30+
# evo2_40b — Multi-GPU, 2× H100 80GB required (use docker-compose.gpu.yml)
31+
EVO2_MODEL_NAME=evo2_1b_base
32+
EVO2_MODEL_VERSION=
33+
# Device: cpu | cuda:0
34+
EVO2_DEVICE=cpu
35+
EVO2_MAX_CONTEXT_LENGTH=8192
36+
EVO2_DEFAULT_EMBEDDING_LAYER=
37+
EVO2_HEALTH_RUN_SMOKE_TEST=true
38+
39+
# ─── HuggingFace ─────────────────────────────────────────────────────────────
40+
# Required to download evo2_40b if the repository is gated.
41+
# Get your token at https://huggingface.co/settings/tokens
42+
HUGGINGFACE_TOKEN=
43+
44+
# ─── Evo 2 Generation Gate ───────────────────────────────────────────────────
45+
# Generation is disabled by default. Set true only in controlled research contexts.
46+
ENABLE_EVO2_GENERATION=false
47+
48+
# ─── Sequence Safety ─────────────────────────────────────────────────────────
49+
ENABLE_REAL_SEQUENCE_STORAGE=false
50+
SEQUENCE_SAFETY_MODE=restricted
51+
MAX_SEQUENCE_LENGTH=8192
52+
53+
# ─── NVIDIA NIM (alternative to local Evo 2) ─────────────────────────────────
54+
NVIDIA_NIM_API_KEY=
55+
NVIDIA_NIM_EVO2_URL=
56+
NVIDIA_NIM_TIMEOUT_SECONDS=120
57+
58+
# ─── Worker ──────────────────────────────────────────────────────────────────
59+
WORKER_CONCURRENCY=2

.github/workflows/ci.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
jobs:
10+
no-mock-evo2-check:
11+
name: "Verify no MockEvo2 in codebase"
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Check for MockEvo2 or mock_evo2
16+
run: |
17+
if grep -r "MockEvo2\|mock_evo2" --include="*.py" --include="*.ts" --include="*.tsx" .; then
18+
echo "ERROR: MockEvo2 or mock_evo2 found in codebase. Remove all mock Evo 2 adapters."
19+
exit 1
20+
fi
21+
echo "PASS: No mock Evo2 adapters found."
22+
23+
backend-tests:
24+
name: Backend API tests
25+
runs-on: ubuntu-latest
26+
services:
27+
postgres:
28+
image: pgvector/pgvector:pg16
29+
env:
30+
POSTGRES_DB: test_cell_state_compiler
31+
POSTGRES_USER: cellcompiler
32+
POSTGRES_PASSWORD: cellcompiler
33+
ports:
34+
- 5432:5432
35+
options: >-
36+
--health-cmd pg_isready
37+
--health-interval 5s
38+
--health-timeout 5s
39+
--health-retries 10
40+
redis:
41+
image: redis:7-alpine
42+
ports:
43+
- 6379:6379
44+
steps:
45+
- uses: actions/checkout@v4
46+
- uses: actions/setup-python@v5
47+
with:
48+
python-version: "3.11"
49+
- name: Install API deps
50+
working-directory: apps/api
51+
run: pip install -e ".[test]"
52+
- name: Run Alembic migrations
53+
working-directory: apps/api
54+
env:
55+
DATABASE_URL: postgresql+psycopg2://cellcompiler:cellcompiler@localhost:5432/test_cell_state_compiler
56+
run: alembic upgrade head
57+
- name: Run backend tests
58+
working-directory: apps/api
59+
env:
60+
DATABASE_URL: postgresql+psycopg2://cellcompiler:cellcompiler@localhost:5432/test_cell_state_compiler
61+
REDIS_URL: redis://localhost:6379/0
62+
JWT_SECRET: test_secret_32_chars_minimum_here_xx
63+
GENOME_MODEL_SERVICE_URL: http://localhost:8100
64+
run: pytest app/tests/ -v --tb=short
65+
66+
genome-service-tests:
67+
name: Genome model service tests
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v4
71+
- uses: actions/setup-python@v5
72+
with:
73+
python-version: "3.11"
74+
- name: Install genome service deps
75+
working-directory: apps/genome-model-service
76+
run: pip install -e ".[test]"
77+
- name: Run genome service tests
78+
working-directory: apps/genome-model-service
79+
env:
80+
EVO2_PROVIDER: local
81+
EVO2_MODEL_NAME: evo2_1b_base
82+
EVO2_DEVICE: cpu
83+
EVO2_HEALTH_RUN_SMOKE_TEST: "false"
84+
ENABLE_EVO2_GENERATION: "false"
85+
MAX_SEQUENCE_LENGTH: "8192"
86+
SEQUENCE_SAFETY_MODE: restricted
87+
run: pytest app/tests/ -v --tb=short
88+
89+
frontend-type-check:
90+
name: Frontend TypeScript check
91+
runs-on: ubuntu-latest
92+
steps:
93+
- uses: actions/checkout@v4
94+
- uses: actions/setup-node@v4
95+
with:
96+
node-version: "20"
97+
cache: "npm"
98+
cache-dependency-path: apps/web/package-lock.json
99+
- name: Install deps
100+
working-directory: apps/web
101+
run: npm ci
102+
- name: Type check
103+
working-directory: apps/web
104+
run: npx tsc --noEmit
105+
- name: Lint
106+
working-directory: apps/web
107+
run: npm run lint

.gitignore

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
.venv/
8+
venv/
9+
env/
10+
*.egg-info/
11+
dist/
12+
build/
13+
.eggs/
14+
.pytest_cache/
15+
.mypy_cache/
16+
htmlcov/
17+
.coverage
18+
coverage.xml
19+
*.cover
20+
21+
# Node
22+
node_modules/
23+
.next/
24+
out/
25+
dist/
26+
.turbo/
27+
*.tsbuildinfo
28+
29+
# Env
30+
.env
31+
.env.local
32+
.env.production
33+
secret_*.txt
34+
*.pem
35+
*.key
36+
37+
# Docker volumes
38+
pgdata/
39+
redis-data/
40+
uploads/
41+
42+
# OS
43+
.DS_Store
44+
Thumbs.db
45+
46+
# Logs
47+
*.log
48+
logs/
49+
50+
# IDE
51+
.vscode/
52+
.idea/
53+
*.swp
54+
55+
# Alembic
56+
apps/api/app/migrations/versions/*.pyc

0 commit comments

Comments
 (0)