|
2 | 2 |
|
3 | 3 | *Description coming soon.* |
4 | 4 |
|
5 | | -## 1. Install Dependencies |
| 5 | +## Setup Instructions |
| 6 | + |
| 7 | +1. Install Ollama |
6 | 8 |
|
7 | 9 | ```bash |
8 | | -pip install -r requirements.txt |
| 10 | +brew install ollama |
9 | 11 | ``` |
10 | 12 |
|
11 | | -## 2. Set Up Ollama LLM |
12 | | - |
13 | | -Start the Ollama server and pull the required model: |
| 13 | +2. Pull the Mistral model |
14 | 14 |
|
15 | 15 | ```bash |
16 | 16 | ollama serve |
17 | 17 | ollama pull mistral |
18 | | -ollama run mistral |
19 | 18 | ``` |
20 | 19 |
|
21 | | -## 3. Set Up the Database |
| 20 | +3. Install Docker |
22 | 21 |
|
23 | | -Run Alembic to create and apply database migrations: |
| 22 | +Install Docker Desktop: https://www.docker.com/products/docker-desktop/ |
24 | 23 |
|
25 | 24 | ```bash |
26 | | -alembic -c src/infrastructure/db/alembic.ini revision --autogenerate -m "initial migration" |
27 | | -alembic -c src/infrastructure/db/alembic.ini upgrade head |
| 25 | +brew install docker-compose |
| 26 | +``` |
| 27 | + |
| 28 | +4. Run Docker Compose |
| 29 | + |
| 30 | +```bash |
| 31 | +docker-compose up |
28 | 32 | ``` |
29 | 33 |
|
30 | | -> Make sure your database connection URL is properly configured in `src/infrastructure/db/alembic.ini` and your SQLAlchemy settings. |
| 34 | +5. Install More Stuff |
| 35 | + |
| 36 | +```bash |
| 37 | +brew install libpq && brew link --force libpq |
| 38 | +brew install openssl@3 |
| 39 | +``` |
31 | 40 |
|
32 | | -## 4. Run Celery Worker |
| 41 | +6. Create a virtual environment |
33 | 42 |
|
34 | | -Start the Celery worker to process tasks: |
| 43 | +```bash |
| 44 | +python3 -m venv venv |
| 45 | +source venv/bin/activate |
| 46 | +``` |
35 | 47 |
|
36 | | -### Development (single-threaded) |
| 48 | +7. Install dependencies |
37 | 49 |
|
38 | 50 | ```bash |
39 | | -PYTHONPATH=src celery -A infrastructure.celery worker --loglevel=info --pool=solo |
| 51 | +env \ |
| 52 | + LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib" \ |
| 53 | + CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include" \ |
| 54 | + PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@3/lib/pkgconfig" \ |
| 55 | + pip install -r requirements.txt |
40 | 56 | ``` |
41 | 57 |
|
42 | | -### Production-like (multi-threaded) |
| 58 | +8. Run Migrations |
43 | 59 |
|
44 | 60 | ```bash |
45 | | -PYTHONPATH=src celery -A services.celery worker --pool=threads --concurrency=12 |
| 61 | +alembic -c src/infrastructure/db/alembic.ini upgrade head |
46 | 62 | ``` |
47 | 63 |
|
48 | | -## 5. Running Tests |
49 | 64 |
|
50 | | -Run the full test suite using Pytest: |
| 65 | +## Run Data Ingestion |
| 66 | + |
| 67 | +In one terminal, activate your virtual environment and run Celery: |
51 | 68 |
|
52 | 69 | ```bash |
53 | | -PYTHONPATH=src pytest |
| 70 | +source venv/bin/activate |
| 71 | +PYTHONPATH=src celery -A config.celery worker --loglevel=info --pool=solo |
54 | 72 | ``` |
55 | 73 |
|
56 | | -## 6. Updating `requirements.txt` |
| 74 | +Then in another terminal run the data ingestion script: |
| 75 | + |
| 76 | +```bash |
| 77 | +source venv/bin/activate |
| 78 | +make post-deploy |
| 79 | +``` |
57 | 80 |
|
58 | | -After installing new packages, freeze your environment: |
| 81 | +## Run Dev CLI |
59 | 82 |
|
60 | 83 | ```bash |
61 | | -pip freeze > requirements.txt |
| 84 | +source venv/bin/activate |
| 85 | +make dev-cli |
62 | 86 | ``` |
| 87 | + |
| 88 | +## Run Tests |
| 89 | + |
| 90 | +```bash |
| 91 | +source venv/bin/activate |
| 92 | +make test |
| 93 | +``` |
0 commit comments