Skip to content

Commit a4d125f

Browse files
committed
docs: Update README and CONTRIBUTING instructions
* Update GitHub repo link * Run all instructions inside the Poetry environment for simplicity * Add insstructions for local development * Add note about running tests on Mac Signed-off-by: Phoevos Kalemkeris <[email protected]>
1 parent 10770be commit a4d125f

File tree

2 files changed

+44
-12
lines changed

2 files changed

+44
-12
lines changed

CONTRIBUTING.md

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ getting you started.
88
1. Clone the repository:
99

1010
```shell
11-
git clone https://github.com/CogStack/CogStack-ModelGateway.git cms-gateway
12-
cd cms-gateway
11+
git clone https://github.com/CogStack/cogstack-model-gateway.git
12+
cd cogstack-model-gateway
1313
```
1414

1515
2. Install Poetry if you haven't already:
@@ -24,32 +24,58 @@ getting you started.
2424
poetry install --with dev
2525
```
2626
27-
## Pre-commit Hooks
28-
29-
We use pre-commit hooks to ensure code quality. To set them up, follow these steps:
30-
31-
1. Install pre-commit if you haven't already:
27+
4. Activate the virtual environment:
3228
3329
```shell
34-
pip install pre-commit
30+
eval $(poetry env activate)
3531
```
3632
37-
2. Install the pre-commit hooks to your local Git repository:
33+
## Pre-commit Hooks
34+
35+
We use pre-commit hooks to ensure code quality. To set them up, follow these steps:
36+
37+
1. Install the pre-commit hooks to your local Git repository:
3838
3939
```shell
4040
pre-commit install
4141
```
4242
43-
3. (optional) To run the pre-commit hooks manually on all files, use:
43+
2. (optional) To run the pre-commit hooks manually on all files, use:
4444
4545
```shell
4646
pre-commit run --all-files
4747
```
4848
49+
## Running
50+
51+
To run the project locally, the [run_local.py](./run_local.py) script is provided as a shortcut for
52+
spinning up the required external services (e.g. PostgreSQL, RabbitMQ, MinIO) as Docker containers
53+
and starting the Gateway, Scheduler, and Ripper as separate processes on the host machine. It also
54+
watches for changes in the codebase and restarts the services when necessary. Before running the
55+
script, ensure you have configured the environment with the required variables, as described in the
56+
[Installation](./README.md#installation) section of the README, and then execute the following
57+
inside the virtual environment:
58+
59+
```shell
60+
python run_local.py
61+
```
62+
63+
Note that the script is meant as a convenience tool for local development, therefore coming with no
64+
quality guarantees, and should not be used in production.
65+
4966
## Testing
5067
51-
To run the tests, use the following command:
68+
To run the tests, execute the following command inside the virtual environment:
5269
5370
```shell
54-
poetry run pytest
71+
pytest
5572
```
73+
74+
### On Mac
75+
76+
If you're running the integration tests on Mac you may need to take some additional steps to ensure
77+
that the host machine can access the Docker containers. This is because Docker for Mac runs in a
78+
virtual machine and, as a result, the containers are not directly accessible from the host. Given
79+
that the services running as part of the integration tests use IP addresses to communicate with the
80+
containers, an easy solution to avoid manual configuration would be using a tool like
81+
[docker-mac-net-connect](https://github.com/chipmk/docker-mac-net-connect).

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,22 @@ CMG_SCHEDULER_MAX_CONCURRENT_TASKS=1
7070
# Postgres
7171
CMG_DB_USER=admin
7272
CMG_DB_PASSWORD=admin
73+
CMG_DB_HOST=postgres
74+
CMG_DB_PORT=5432
7375
CMG_DB_NAME=cmg_tasks
7476

7577
# RabbitMQ
7678
CMG_QUEUE_USER=admin
7779
CMG_QUEUE_PASSWORD=admin
80+
CMG_QUEUE_HOST=rabbitmq
81+
CMG_QUEUE_PORT=5672
7882
CMG_QUEUE_NAME=cmg_tasks
7983

8084
# MinIO
8185
CMG_OBJECT_STORE_ACCESS_KEY=admin
8286
CMG_OBJECT_STORE_SECRET_KEY=admin123
87+
CMG_OBJECT_STORE_HOST=minio
88+
CMG_OBJECT_STORE_PORT=9000
8389
CMG_OBJECT_STORE_BUCKET_TASKS=cmg-tasks
8490
CMG_OBJECT_STORE_BUCKET_RESULTS=cmg-results
8591

0 commit comments

Comments
 (0)