Follow the Architectural Decision Records to understand the choices made by the project.
To use docker-compose from source code, use the
docker-compose.yml.dev file instead of the image based one:
$ ln -sf docker-compose.yml.dev docker-compose.ymlTests rely on the Elasticsearch service so first you need to ensure the Elasticsearch container is running. You can run the "docker-compose up -d" or you can only run the Elasticsearch container by running "docker-compose start elastic".
If you don't have docker-compose, you can start the elasticsearch service with podman by running this command:
$ podman run --env discovery.type=single-node --publish 9200:9200/tcp --name elastic --rm $(awk '/docker.elastic/ { print $2 }' docker-compose.yml* | head -n 1 | sed 's/"//g')Then the tests can be executed using:
$ toxThis section explains how you can hack the Monocle code. The idea is to use the docker deployment to avoid complex development methods.
After changes, simply run the following command. docker-compose will rebuild and re-spawn the changed containers:
$ docker-compose up -d --buildTo have your code automatically reloaded on each change, just run it outside the container:
$ docker-compose stop web
$ cd web
$ npm install
$ npm startBefore submitting a Pull Request, make sure to configure the git hooks locally to avoid proposing broken code or not well formatted code.
To be sure to push correct branches, you have to configure the
pre-push git hook by creating .git/hooks/pre-push with the
following content:
#!/bin/bash
exec ./contrib/pre-push "$@"and making it executable with chmod +x .git/hooks/pre-push.
To be sure to have correctly formatted code, enable the pre-commit
git hook to reformat your code by creating .git/hooks/pre-commit
with the following content:
#!/bin/bash
exec ./contrib/pre-commit "$@"and making it executable with chmod +x .git/hooks/pre-commit.
Please refer to the file dummy/change.py that contain a Dummy driver and
some comments to help you get started.
Docker and Docker-compose might not be available so podman can be used to start a Monocle deployment environment.
The helper script contrib/start-with-podman.sh can be used:
contrib/start-with-podman.sh build
contrib/start-with-podman.sh create
contrib/start-with-podman.sh start
firefox http://localhost:3000See the usage section in the script.