General Notes

Requirements

Working with Source

Run Locally w/ Docker

  1. Copy a *-docker-compose.yaml file corresponding to your usage to docker-compose.yaml. This file is untracked so feel free to modify as necessary. Idea is to commit anything generic but system/setup dependent should go on ‘your’ version i.e. local UID/GID, etc.

  2. Check the first comment which will provide the best instruction on how to start the service; yes, it is a bit long. Note: Any of the keyword arguments prepended to the docker-compose command can be safely moved into a dedicated .env and read automatically if they are not evaluated i.e. $(...). Below is a brief description of the non-evaluated environment variables:

PY_VER=3.8    # (pharus) Python version: 3.6|3.7|3.8
IMAGE=djtest  # (pharus) Image type:     djbase|djtest|djlab|djlabhub
DISTRO=alpine # (pharus) Distribution:   alpine|debian

Run Tests w/ Docker

To run the test watcher, perform the following:

  1. In one terminal, start the dev Docker environment with the above instructions to start LabBook and Pharus with hot-reload support.

  2. In another terminal, you can run the watcher using:

docker exec -it datajoint-labbook_datajoint-labbook_1 npm test -- --coverage
# OR to just run it once:
docker exec -ite CI=true datajoint-labbook_datajoint-labbook_1 npm test -- --coverage

Building the Docs

Docs are based on sphinx and typedocs where the latter is used for autodoc-ing the typescript code base.

To build docs simply run: docker-compose -f docker-compose-docs.yaml up. The build docs should be located under /docs/build/html/index.html.

Working with git submodule dependency

pharus is treated as a backend dependency managed by git’s builtin submodules. It allows us to nest entire git repos with separate history and easy access. Below are some helpful commands to be used after cloning the source repo.

First time git submodule initialization

git submodule init` then `git submodule update

Update submodules to latest (Update to latest master version)

git submodule foreach git pull

Create a new submodule

git submodule add -b master git@github.com:datajoint/pharus.git

References