# marmot How to deploy the marmot application --- 1. Run `mvn clean package docker:build` to build your application and a docker image for it 2. Make sure you are logged into the private docker registry. Follow the instructions at `https://weblicht.sfs.uni-tuebingen.de/gitlab/clarind/wl-webservices/service-marmot/container_registry`. Push the image to our private docker registry. ``` docker push weblicht.sfs.uni-tuebingen.de:5000/clarind/wl-webservices/service-marmot ``` 3. Create rancher config files. Copy the rancher dir from `https://weblicht.sfs.uni-tuebingen.de/gitlab/clarind/wl-webservices/service-jitar`. Modify the configs to match the service names. 4. Go to rancher(`https://weblicht.sfs.uni-tuebingen.de:8088) and deploy it. 1. Click add `Add Stack`` 2. Give the stack a name and some descriptions. 3. Upload the docker-compose.yml and rancher-compose.yml created in previous steps. 4. Click `Create` 5. Setup the load balancer (only needed for newly created services) 1. Go to stack `Global-lb` 2. Click `Upgrade/edit` 3. Add a new service rule 4. Update the newly added entry at the bottom. The Path should be the actual application context path. So is the port. 5. Click on Edit to save the changes. 6. Setup the Reverse proxy on weblicht machine in Tübingen. 1. ssh to weblicht and `cd /data/shibsp/etc/httpd/conf.d` 2. create a conf file under `services` if it's served for both http and https, otherwise create it under `services/https`or `services/http`.( For applications which require their own VirtualHosts, follow the example of weblicht-shannon) 3. Reload apache from rancher. Goto rancher and get inside the shibsp container and run ``` httpd -k graceful ``` 7. Test! at https://weblicht.sfs.uni-tuebingen.de/rws/service-/ How to upgrade --- 1. Follow Steps 1, 2 in previous section 2. Go to service-marmot stack in rancher, click on upgrade. Make sure that `always pull before creating`is checked. Click upgrade. 3. After the services start up, click on `finish upgrade` in the upperright corner. How to run and test the marmot application locally --- use the provided input file at service-marmot/src/main/resources/input.xml Run curl: curl -H 'content-type: text/tcf+xml' --data-binary @input.xml -X POST `http://localhost:8080/service-marmot/annotate/marmot/stream` Or: curl -H 'content-type: text/plain' --data-binary @input.txt -X POST `http://localhost:8080/service-marmot/annotate/marmot/bytes` Or wget: wget --post-file=input.xml --header='Content-Type: text/tcf+xml' `http://localhost:8080/service-marmot/annotate/marmot/stream` Or: wget --post-file=input.txt --header='Content-Type: text/plain' `http://localhost:8080/service-marmot/annotate/marmot/bytes` Health Check --- To see your applications health enter url `http://localhost:8081/healthcheck`