LOVE service to send SAL commands from http endpoints using salobj.
See the documentation here: https://lsst-ts.github.io/LOVE-commander/html/index.html
In order to use the LOVE-commander as part of the LOVE system we recommend to use the docker-compose and configuration files provided in the LOVE-integration-tools repo. Please follow the instructions there.
We provide docker images and a docker-compose file in order to load the LOVE-commander locally for development purposes, i.e. run tests and build documentation.
This docker-compose does not copy the code into the image, but instead it mounts the repository inside the image, this way you can edit the code from outside the docker container with no need to rebuild or restart.
Follow these instructions to run the application in a docker container and get into it:
- Launch and get into the container:
cd docker/
export dev_cycle=develop #Here you can set a specified version of the lsstts/develop-env image
docker-compose up -d --build
docker-exec commander bash
- Inside the container:, load the setup and got to love folder
source /home/saluser/.setup_dev.sh #Here some configurations will be loaded and you will enter another bash. Press [Ctrl + D] to exit the current console, then the love-producer package will be installed and you can continue with the following step
cd /usr/src/love
Once inside the container and in the love
folder you can run the tests. Disabling plugins that may throw errors due to not having write access is recommended:
pytest -p no:cacheprovider -p no:pytest_session2file
You may filter tests with the -k <filter-substring>
flag, where <filter-substring>
can be a file or a test suite name.
For example the following command:
pytest -p no:cacheprovider -p no:pytest_session2file -k metadata
will run the test_metadata
test of the test_salinfo.py
file.
Once inside the container and in the love
folder you can build the documentation as follows:
cd docsrc/
./create_docs.sh
In order to maintaing code linting and formatting we use pre-commit
that runs Flake8 (https://flake8.pycqa.org/) and Black (https://github.com/psf/black) using Git Hooks. To enable this you have to:
- Install
pre-commit
in your local development environment:
pip install pre-commit
- Set up the git hook scripts running:
pre-commit install
- Start developing! Linter and Formatter will be executed on every commit you make