@@ -8,8 +8,8 @@ getting you started.
881 . 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
15152. 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).
0 commit comments