Spaces:
Sleeping
Sleeping
sachin1801 commited on
Commit ·
0892130
1
Parent(s): 48aa332
doc update
Browse files- docs/DEVELOPMENT.md +68 -0
docs/DEVELOPMENT.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Development & Deployment Guide
|
| 2 |
+
|
| 3 |
+
## Quick Start (Local Development)
|
| 4 |
+
|
| 5 |
+
### Prerequisites
|
| 6 |
+
- Python 3.10
|
| 7 |
+
- ViennaRNA installed (`brew install brewsci/bio/viennarna` on macOS)
|
| 8 |
+
- Git LFS installed (`brew install git-lfs`)
|
| 9 |
+
|
| 10 |
+
### First-time Setup
|
| 11 |
+
```bash
|
| 12 |
+
git lfs install
|
| 13 |
+
git lfs pull
|
| 14 |
+
python3.10 -m venv venv310
|
| 15 |
+
source venv310/bin/activate
|
| 16 |
+
pip install -r webapp/requirements.txt
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
### Run Locally
|
| 20 |
+
```bash
|
| 21 |
+
source venv310/bin/activate
|
| 22 |
+
python -m uvicorn webapp.app.main:app --port 7860 --reload
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
Visit: http://localhost:7860
|
| 26 |
+
|
| 27 |
+
## Docker Development
|
| 28 |
+
|
| 29 |
+
### Build & Run
|
| 30 |
+
```bash
|
| 31 |
+
docker compose up --build
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
### Production-like Run
|
| 35 |
+
```bash
|
| 36 |
+
docker compose -f docker-compose.prod.yml up
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
## Deployment to Hugging Face Spaces
|
| 40 |
+
|
| 41 |
+
### Automatic (CI/CD) - Recommended
|
| 42 |
+
Push to `main` branch triggers automatic deployment:
|
| 43 |
+
```bash
|
| 44 |
+
git push origin main
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
The GitHub Action will:
|
| 48 |
+
1. Run tests
|
| 49 |
+
2. Push to HF Spaces (https://huggingface.co/spaces/sachin1801/splicing-predictor)
|
| 50 |
+
|
| 51 |
+
### Manual Deployment
|
| 52 |
+
```bash
|
| 53 |
+
git push hf main
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
### Required Secrets
|
| 57 |
+
- `HF_TOKEN` - Hugging Face access token with write permissions
|
| 58 |
+
|
| 59 |
+
## Troubleshooting
|
| 60 |
+
|
| 61 |
+
### "file signature not found" error
|
| 62 |
+
Run: `git lfs pull`
|
| 63 |
+
|
| 64 |
+
### Port mismatch (Shiny apps show "connection failed")
|
| 65 |
+
Use port 7860: `python -m uvicorn webapp.app.main:app --port 7860`
|
| 66 |
+
|
| 67 |
+
### Database corruption
|
| 68 |
+
Delete and restart: `rm webapp/splicing.db`
|