...
- SSH into to bd-clowder.ncsa.illinois.edu or bd-clowder-dev.ncsa.illinois.edu. Rest of the instructions are identical for both these machines unless specified otherwise.
- Clone extractor-info-service code repository into /home/browndog
git clone opensource.ncsa.illinois.edu/bitbucket/scm/bd/bd-aux-services.git
Install extractor-info-service
cd /home/browndog/bd-aux-services/extractor-info-fetcher
sudo pyvenv prototype-endpoint-env
source ./prototype-endpoint-env/bin/activate
sudo pip install -r requirements.txt
Update config.py so that the variables, especially rabbitmq_vhost, clowder_url, clowder_key store details about development instances or production instances based on the machine (i.e. dev or prod) in which the service is being installed. I.e. Extractor Info Fetcher in bd-clowder machine should use information about Brown Dog production instances where as in bd-clowder-dev machine, it should use information about Brown Dog development instances.
Convert source code from Python2.7 to Python3 compatible by running (or something similar):
sudo 2to3-3.5 -w extractor-info-fetcher.py
- Update file permissions:
sudo chown -R browndog /home/browndog/bd-aux-services/
sudo chgrp -R users /home/browndog/bd-aux-services/
Make sure that the flask app can be run locally:
sh ./run-scrip.sh
If everything looks fine, kill the Flask app by pressing Ctrl + C.
Setup the Flask app as a systemd service
sudo cp extractor-info-fetcher.service /lib/systemd/system
sudo systemctl daemon-reload
sudo systemctl start extractor-info-fetcher.service
Check the systemd service and make sure it is running:
sudo systemctl status extractor-info-fetcher.service
Update iptables to allow input traffic to port 5000 in the machine within NCSA network
Create a file in /etc/iptables/rules.d, say 51local.rules with contents:
# Extractor Info Service (Flask App)
-A INPUT -s 141.142.0.0/16 -p tcp -m state --state NEW -m tcp --dport 5000 -j ACCEPTsudo /etc/iptables/rules.sh
The above command will update the iptable rules
If the machine is a Nebula OpenStack VM, you will also need to create a security group in Nebula based on 51local.rules and add that group to the VM.
Try to access http://bd-clowder.ncsa.illinois.edu:5000 or http://bd-clowder-dev.ncsa.illinois.edu:5000 from within NCSA network and you should see a welcome message.