diff --git a/clmctest/monitoring/rspec.yml b/clmctest/monitoring/rspec.yml index 43fd381b410f406dfd4f323218f26aaad230d2fa..7d7c38d514b415a2049c3e553c8fe42066bd96d9 100644 --- a/clmctest/monitoring/rspec.yml +++ b/clmctest/monitoring/rspec.yml @@ -31,6 +31,8 @@ hosts: host: 8888 - guest: 9092 host: 9092 + - guest: 9080 + host: 9080 ip_address: "172.40.231.51" - name: ipendpoint1 cpus: 1 diff --git a/docs/clmc-service.md b/docs/clmc-service.md index 37a41bd8f61b9cf879f3c0c08d572e639363fdc1..a179f0e9bf1b4c0fb508cded06b11749bba2eba0 100644 --- a/docs/clmc-service.md +++ b/docs/clmc-service.md @@ -231,4 +231,4 @@ Finally, start the service on localhost by using pyramid's **pserve**: pserve development.ini --reload ``` -You should now be able to make requests to the CLMC service on http://localhost:8080/aggregator/config and http://localhost:8080/aggregator/control. +You should now be able to make requests to the CLMC service on http://localhost:9080/aggregator/config and http://localhost:9080/aggregator/control. diff --git a/scripts/clmc-service/install.sh b/scripts/clmc-service/install.sh index 900c9433aed8c55c1d936b2b5f8c2e146ce3f918..4f47288cfd4be9234695f5d7d24baf1e172a3873 100755 --- a/scripts/clmc-service/install.sh +++ b/scripts/clmc-service/install.sh @@ -24,8 +24,8 @@ #// #///////////////////////////////////////////////////////////////////////// -# Force fail on command fail -set -euo pipefail +# Force fail on command fail (off for now as virtualenvwrapper install fails) +# set -euo pipefail # Define tickstack software versions INFLUX_VERSION=1.5.2 @@ -37,9 +37,7 @@ KAPACITOR_CHECKSUM=eea9b215f241906570eafe3857e1d4c5 CHRONOGRAF_VERSION=1.4.4.2 CHRONOGRAF_CHECKSUM=eea6915aa6db8f134fcd3b095e863b773bfb3a16a26e346dd65904a07df97963 -# install python for the simulator apt-get update -apt-get -y install python # install influx wget https://dl.influxdata.com/influxdb/releases/influxdb_${INFLUX_VERSION}_amd64.deb 2> /dev/null @@ -71,3 +69,78 @@ dpkg -i chronograf_${CHRONOGRAF_VERSION}_amd64.deb systemctl start influxdb systemctl start kapacitor systemctl start chronograf + +## CLMC-SERVICE +## ---------------------------------------------------------------------------------- + +# install virtualenvwrapper to manage python environments - and check +echo "----> Installing Python3 and Pip3" +apt-get install -y python3 python3-pip +update-alternatives --install /usr/bin/python python /usr/bin/python3 10 + +echo "----> Installing virtualenv and wrapper" +apt-get install -y python3-virtualenv virtualenvwrapper +pip3 install virtualenv +pip3 install virtualenvwrapper + +echo "----> Configuring virtualenvwrapper" +export WORKON_HOME=$HOME/.virtualenvs +source /usr/local/bin/virtualenvwrapper.sh + +# check the mkvirtualenv with a return value of 1 if version comes back correctly +mkvirtualenv --version +if [ $? -ne 1 ] ; then + echo "Failed: installing virtualenvwrapper" + exit 1 +fi + +# create CLMC virtual environment - and check +echo "----> Making CLMC Python environment" +mkvirtualenv CLMC +if [ $? -ne 0 ] ; then + echo "Failed: creating CLMC python environment" + exit 1 +fi + +# switch the CLMC environment - and check +echo "----> Switching to use CLMC python environment" +workon CLMC +if [ $? -ne 0 ] ; then + echo "Failed: switching to CLMC python environment" + exit 1 +fi + +# install tox - and check +echo "----> Installing TOX" +pip3 install tox +tox --version +if [ $? -ne 0 ] ; then + echo "Failed: installing tox" + exit 1 +fi + +# navigate to the clmc-webservice - and check +echo "----> Moving to CLMC webservice" +cd /vagrant/src/clmc-webservice +if [ $? -ne 0 ] ; then + echo "Failed: could not find clmc-webservice" + exit 1 +fi + +# install the service +echo "----> Installing CLMC web service" +pip3 install -e . +if [ $? -ne 0 ] ; then + echo "Failed: installing clmc-webservice" + exit 1 +fi + +# start the service +echo "----> Starting CLMC web service" +pserve development.ini --reload +if [ $? -ne 0 ] ; then + echo "Failed: starting clmc-webservice" + exit 1 +else + echo "CLMC service started." +fi \ No newline at end of file diff --git a/src/clmc-webservice/development.ini b/src/clmc-webservice/development.ini index 9ec4dc522937ff2c1606dd19287c5c2f23ce5598..4b5384d1b58cc8bb95465a82d8e6c31fade9d4bd 100644 --- a/src/clmc-webservice/development.ini +++ b/src/clmc-webservice/development.ini @@ -27,7 +27,7 @@ aggregator_database_url = http://172.40.231.51:8086 [server:main] use = egg:waitress#main -listen = localhost:8080 +listen = localhost:9080 ### # logging configuration diff --git a/src/clmc-webservice/production.ini b/src/clmc-webservice/production.ini index 7f5e32331a58c686de4361e6d12a011e56a340b1..5f1d9dcadef33a939fe616f56c97347a39b16263 100644 --- a/src/clmc-webservice/production.ini +++ b/src/clmc-webservice/production.ini @@ -22,7 +22,7 @@ aggregator_database_url = http://172.40.231.51:8086 [server:main] use = egg:waitress#main -listen = *:8080 +listen = *:9080 ### # logging configuration diff --git a/src/clmc-webservice/setup.py b/src/clmc-webservice/setup.py index 817d1bdbebd1b4d58b61144a3edf692832d2ea60..0b195c5433419b000bf0ff63abf59f9d01e00123 100644 --- a/src/clmc-webservice/setup.py +++ b/src/clmc-webservice/setup.py @@ -1,5 +1,5 @@ """ -// © University of Southampton IT Innovation Centre, 2018 +// (c) University of Southampton IT Innovation Centre, 2018 // // Copyright in this software belongs to University of Southampton // IT Innovation Centre of Gamma House, Enterprise Road, diff --git a/src/clmc-webservice/tox.ini b/src/clmc-webservice/tox.ini index b7fe1eac855e39b717787d62b2a9c2144d715b7e..49efb9f07566378a3a7d1af73bc6e73fbd819dad 100644 --- a/src/clmc-webservice/tox.ini +++ b/src/clmc-webservice/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36 +envlist = py35 [testenv] deps=pytest commands=pytest \ No newline at end of file