Search engine for Material Safety Datasheets based on Solr
Backend | Frontend | Deployment |
---|---|---|
Der Report und die Zwischenpräsentationen sind in docs/ zu finden.
NOTE: Read the following section carefully!
You will need the dataset which is NOT in this repository because of liscensing issues.
The dataset is linked as git submodule and can be installed by running:
git submodule update --init --recursive
All of the following setups will expect the dataset to be in <repo-root>/hazard-ds/hazard-dataset
. If your dataset is in a different location please override the path in the docker-compose files (the dataset is just mounted into the container) or override the application.property dataSetPath
.
If you are not running the backend in a docker container, there are 2 additional files needed.
Their default paths are <repo-root>/hazard-ds/fscMap.txt
and <repo-root>/hazard-ds/fsgMap.txt
. These paths can be adjusted through the environment variables fscMapPath
and fsgMapPath
.
NOTE Installtion Instructions for required Software to run MSDS Search:
NOTE Installtion Instructions for required Software to develop for MSDS Search:
NOTE: If you have questions about the following docker commands, you can find their documentation here. These are the basic commands which you will probably need:
docker-compose up -d
Start/create containers, volumes and networks. Setup and detach your console.docker-compose logs -f
View the logs and attach your console to them.docker-compose down
Stop and delete all containers.docker-compose down -v
Stop, delete all containers and remove all data volumes.-f
flag is used to specify a certain compose file. There are different compose files with different purposes in this repository.git clone https://github.com/leoek/material-safety-search.git
cd material-safety-search
git submodule update --init --recursive
docker login
sudo docker-compose -f docker-compose.staging.yml up -d
sudo docker-compose -f docker-compose.staging.yml logs -f mss-server
sudo docker-compose -f docker-compose.local.yml up -d
sudo docker-compose -f docker-compose.local.yml logs -f mss-server
sudo docker-compose -f docker-compose.staging.yml up -d
sudo docker-compose -f docker-compose.local.yml up -d
ATTENTION: Please note that the solr container does not require any login information. Therefore it should not be exposed to the public. Our docker-compose.local.yml configuration will expose all ports for debugging purposes. You should never use that configuration in any production environment.
/ansible
which is used by Jenkins to deploy the search engine to the demo server. The Ansible setup will work with most debian based systems.
ansible-role-common
: Basic server setup, you probably want to replace / adjust this.ansible-role-docker
: Install / update docker and docker-compose. Set it up to work with the Ansible docker_service
module (which has some flaws).ansible-role-docker-nginx-proxy
: Setup jwilder as a reverse proxy, with letsencrypt-companion for SSL certificatesdocker-mss-deployment-local
: This is the role which will deploy the search engine.docker-mss-deployment-local-reset-volumes
: This role can be used to clear the docker volumes. Use this if you want to re-index the dataset and clear all logs.The Api is defined by an [penapi specification]api.yml).
Check for these files to be present:
We are using git flow.
master
branch only contains released versions.develop
branch contains the current state of development. The code within develop
should always be in such a shape, that we could make a release without any patches needed.feature
branches. feature
branches should be commited to the remote repository and deleted once they are merged into develop
.git pull --rebase
.Every commit to develop will be built and published to docker hub by Jenkins. Builds from develop are tagged with next
, builds from master with stable
and their <full version>-<buildnumber>
. Until the first release, builds from develop will be pushed with their version to develop as well.
Every build from develop is deployed to mss.leoek.tech and api.mss.leoek.tech. The frontend can develop against that staging api.
Requirements:
Procedure:
sudo docker-compose -f docker-compose.local.yml up -d
Requirements:
Procedure:
docker-compose up -d
../gradlew bootRun
(theoretically it should work with the .bat file on windows, however until now nobody had the nerves to mess with windows).The frontend can be found within the frontend/ folder. Check out the rontend Readme
Requirements:
Procedure:
yarn
to obtain the dependencies.yarn start
to start the development server.NOTES:
-v
flag: docker-compose down -v
Postman can be used to talk to the backend directly. Import the supplied collection and environments and you should be good to go.