From 542e4755e180a1780894483232ede0d34e439c33 Mon Sep 17 00:00:00 2001 From: Alvaro Herrasti Date: Mon, 29 Aug 2016 18:17:47 -0700 Subject: [PATCH 1/5] Updated one time run setup --- install.sh | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/install.sh b/install.sh index 4d72a33..a67d336 100644 --- a/install.sh +++ b/install.sh @@ -7,9 +7,11 @@ # $ ssh geoserver4.euclid.cristipp.dev.ai2 sudo apt-get update +sudo apt-get update +sudo apt-get install unzip sudo apt-get install mysql-client mysql-server libmysqlclient-dev sudo apt-get install python-pip libblas-dev liblapack-dev gfortran python-numpy python-scipy python-matplotlib -sudo pip install scikit-learn sympy networkx nltk inflect pyparsing pydot2 mysql-python django django-picklefield jsonfield django-storages boto django-modeldict pillow unipath beautifulsoup4 requests +sudo pip install scikit-learn sympy networkx nltk inflect pyparsing pydot2 mysql-python django==1.8.2 django-picklefield jsonfield django-storages boto django-modeldict pillow unipath beautifulsoup4 requests algopy sudo apt-get install build-essential unzip sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev @@ -17,10 +19,9 @@ sudo pip install awscli echo "create database geodb" | mysql -u root sudo su ai2service <<'EOF' -aws configure cd ~ wget https://github.com/Itseez/opencv/archive/3.0.0.zip -unzip 3.0.0.zip +unzip -o 3.0.0.zip cd opencv-3.0.0/ mkdir release cd release @@ -28,25 +29,43 @@ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=~/usr/local -D Python_ make make install cd ~ -# git clone https://github.com/allenai/GeoServer -# git clone https://github.com/allenai/geosolver -# git clone https://github.com/allenai/EquationTree +git clone https://github.com/allenai/GeoServer.git +git clone https://github.com/allenai/geosolver.git +git clone https://github.com/allenai/EquationTree.git +git clone https://github.com/seominjoon/stanford-parser-server.git ghro GeoServer ln -s /opt/ai2ools/var/ghro/allenai/GeoServer GeoServer ghro geosolver ln -s /opt/ai2ools/var/ghro/allenai/geosolver geosolver ghro EquationTree ln -s /opt/ai2ools/var/ghro/allenai/EquationTree EquationTree -cd GeoServer/geoserver +wget -O stanford-parser-3.5.0.zip http://nlp.stanford.edu/software/stanford-parser-full-2014-10-31.zip +unzip -o stanford-parser-3.5.0.zip +mkdir -p stanford-parser-server/bin +mkdir -p stanford-parser-server/lib +wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/json-simple/json-simple-1.1.1.jar -P ./stanford-parser-server/lib/ +cp ./stanford-parser-full-2014-10-31/* ./stanford-parser-server/lib/ +cd ./stanford-parser-server +chmod 755 run.sh +nohup ./run.sh & + +# Fixes to geosolver + +cd ../geosolver +sed -i 's/import pyipopt//g' geosolver/solver/numeric_solver.py + +cd ../GeoServer/geoserver # https://github.com/allenai/ai2ools/blob/master/lib/bash/helpers.sh -aws s3 cp s3://geosolver-server/dump/89a68dc2de4e87bfc2f09ad41ef25a1b1911dd60/labels.json . -aws s3 cp s3://geosolver-server/dump/89a68dc2de4e87bfc2f09ad41ef25a1b1911dd60/questions.json . -aws s3 cp s3://geosolver-server/dump/89a68dc2de4e87bfc2f09ad41ef25a1b1911dd60/media.tar.gz . +wget "https://s3-us-west-2.amazonaws.com/geosolver-server/dump/a685bed60d23f1684a7344d665fd5b421d2e5aa6/questions.json" +wget "https://s3-us-west-2.amazonaws.com/geosolver-server/dump/a685bed60d23f1684a7344d665fd5b421d2e5aa6/labels.json" +wget "https://s3-us-west-2.amazonaws.com/geosolver-server/dump/a685bed60d23f1684a7344d665fd5b421d2e5aa6/semantics.json" +wget "https://s3-us-west-2.amazonaws.com/geosolver-server/dump/a685bed60d23f1684a7344d665fd5b421d2e5aa6/media.tar.gz" tar -xvzf media.tar.gz python manage.py migrate --settings=geoserver.settings.local python manage.py loaddata questions.json --settings=geoserver.settings.local python manage.py loaddata labels.json --settings=geoserver.settings.local # python manage.py loaddata semantics.json --settings=geoserver.settings.local -export PYTHONPATH=~/geosolver:~/EquationTree:~/usr/local/lib/python2.7/dist-packages; nohup python manage.py runserver 0:8080 --settings=geoserver.settings.local 2>&1 > log.txt & +export PYTHONPATH=~/geosolver:~/EquationTree:~/usr/local/lib/python2.7/dist-packages; nohup python manage.py runserver 0:8000 --settings=geoserver.settings.local 2>&1 > log.txt & +cd ../../geosolver +export PYTHONPATH=PYTHONPATH:~/usr/local/lib/python2.7/dist-packages; python -m geosolver.run 1025 EOF - From 4cb43e42aaca7b22713752a72723c79cdab880c3 Mon Sep 17 00:00:00 2001 From: Alvaro Herrasti Date: Mon, 29 Aug 2016 18:58:28 -0700 Subject: [PATCH 2/5] Removed equation tree --- install.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) mode change 100644 => 100755 install.sh diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 index a67d336..cc8803e --- a/install.sh +++ b/install.sh @@ -29,16 +29,14 @@ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=~/usr/local -D Python_ make make install cd ~ -git clone https://github.com/allenai/GeoServer.git -git clone https://github.com/allenai/geosolver.git -git clone https://github.com/allenai/EquationTree.git +git clone https://github.com/seominjoon/geoserver.git +git clone https://github.com/seominjoon/geosolver.git git clone https://github.com/seominjoon/stanford-parser-server.git +mv geoserver GeoServer ghro GeoServer ln -s /opt/ai2ools/var/ghro/allenai/GeoServer GeoServer ghro geosolver ln -s /opt/ai2ools/var/ghro/allenai/geosolver geosolver -ghro EquationTree -ln -s /opt/ai2ools/var/ghro/allenai/EquationTree EquationTree wget -O stanford-parser-3.5.0.zip http://nlp.stanford.edu/software/stanford-parser-full-2014-10-31.zip unzip -o stanford-parser-3.5.0.zip mkdir -p stanford-parser-server/bin @@ -65,7 +63,7 @@ python manage.py migrate --settings=geoserver.settings.local python manage.py loaddata questions.json --settings=geoserver.settings.local python manage.py loaddata labels.json --settings=geoserver.settings.local # python manage.py loaddata semantics.json --settings=geoserver.settings.local -export PYTHONPATH=~/geosolver:~/EquationTree:~/usr/local/lib/python2.7/dist-packages; nohup python manage.py runserver 0:8000 --settings=geoserver.settings.local 2>&1 > log.txt & +export PYTHONPATH=~/geosolver:~/usr/local/lib/python2.7/dist-packages; nohup python manage.py runserver 0:8000 --settings=geoserver.settings.local 2>&1 > log.txt & cd ../../geosolver export PYTHONPATH=PYTHONPATH:~/usr/local/lib/python2.7/dist-packages; python -m geosolver.run 1025 EOF From 800b469aad7990176b8981757851364823f4f688 Mon Sep 17 00:00:00 2001 From: Alvaro Herrasti Date: Mon, 29 Aug 2016 19:37:37 -0700 Subject: [PATCH 3/5] Removed duplicate package --- install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install.sh b/install.sh index cc8803e..6535afd 100755 --- a/install.sh +++ b/install.sh @@ -8,7 +8,6 @@ sudo apt-get update sudo apt-get update -sudo apt-get install unzip sudo apt-get install mysql-client mysql-server libmysqlclient-dev sudo apt-get install python-pip libblas-dev liblapack-dev gfortran python-numpy python-scipy python-matplotlib sudo pip install scikit-learn sympy networkx nltk inflect pyparsing pydot2 mysql-python django==1.8.2 django-picklefield jsonfield django-storages boto django-modeldict pillow unipath beautifulsoup4 requests algopy From 70e35d7cfdbc7366cb1c8a2048202b0f7bf617df Mon Sep 17 00:00:00 2001 From: Alvaro Herrasti Date: Fri, 3 Feb 2017 13:31:14 -0800 Subject: [PATCH 4/5] Install script update --- install.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 6535afd..89b70f6 100755 --- a/install.sh +++ b/install.sh @@ -8,6 +8,7 @@ sudo apt-get update sudo apt-get update +sudo apt-get install unzip sudo apt-get install mysql-client mysql-server libmysqlclient-dev sudo apt-get install python-pip libblas-dev liblapack-dev gfortran python-numpy python-scipy python-matplotlib sudo pip install scikit-learn sympy networkx nltk inflect pyparsing pydot2 mysql-python django==1.8.2 django-picklefield jsonfield django-storages boto django-modeldict pillow unipath beautifulsoup4 requests algopy @@ -17,16 +18,15 @@ sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libp sudo pip install awscli echo "create database geodb" | mysql -u root -sudo su ai2service <<'EOF' cd ~ -wget https://github.com/Itseez/opencv/archive/3.0.0.zip +wget -nc https://github.com/Itseez/opencv/archive/3.0.0.zip unzip -o 3.0.0.zip cd opencv-3.0.0/ mkdir release cd release cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=~/usr/local -D Python_ADDITIONAL_VERSIONS=2.7 .. -make -make install +sudo make +sudo make install cd ~ git clone https://github.com/seominjoon/geoserver.git git clone https://github.com/seominjoon/geosolver.git @@ -61,8 +61,7 @@ tar -xvzf media.tar.gz python manage.py migrate --settings=geoserver.settings.local python manage.py loaddata questions.json --settings=geoserver.settings.local python manage.py loaddata labels.json --settings=geoserver.settings.local -# python manage.py loaddata semantics.json --settings=geoserver.settings.local +python manage.py loaddata semantics.json --settings=geoserver.settings.local export PYTHONPATH=~/geosolver:~/usr/local/lib/python2.7/dist-packages; nohup python manage.py runserver 0:8000 --settings=geoserver.settings.local 2>&1 > log.txt & cd ../../geosolver export PYTHONPATH=PYTHONPATH:~/usr/local/lib/python2.7/dist-packages; python -m geosolver.run 1025 -EOF From 7774aea6ed65c51ffbbd3840d6ca7b816cc72288 Mon Sep 17 00:00:00 2001 From: Alvaro Herrasti Date: Fri, 3 Feb 2017 13:39:53 -0800 Subject: [PATCH 5/5] Updated data sources in install script --- install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 89b70f6..dab94f2 100755 --- a/install.sh +++ b/install.sh @@ -53,10 +53,10 @@ sed -i 's/import pyipopt//g' geosolver/solver/numeric_solver.py cd ../GeoServer/geoserver # https://github.com/allenai/ai2ools/blob/master/lib/bash/helpers.sh -wget "https://s3-us-west-2.amazonaws.com/geosolver-server/dump/a685bed60d23f1684a7344d665fd5b421d2e5aa6/questions.json" -wget "https://s3-us-west-2.amazonaws.com/geosolver-server/dump/a685bed60d23f1684a7344d665fd5b421d2e5aa6/labels.json" -wget "https://s3-us-west-2.amazonaws.com/geosolver-server/dump/a685bed60d23f1684a7344d665fd5b421d2e5aa6/semantics.json" -wget "https://s3-us-west-2.amazonaws.com/geosolver-server/dump/a685bed60d23f1684a7344d665fd5b421d2e5aa6/media.tar.gz" +wget "https://s3-us-west-2.amazonaws.com/geosolver-server/dump/68bd697ca57cdac1f2738a8d7e468fdccd7e5545/questions.json" +wget "https://s3-us-west-2.amazonaws.com/geosolver-server/dump/68bd697ca57cdac1f2738a8d7e468fdccd7e5545/labels.json" +wget "https://s3-us-west-2.amazonaws.com/geosolver-server/dump/68bd697ca57cdac1f2738a8d7e468fdccd7e5545/semantics.json" +wget "https://s3-us-west-2.amazonaws.com/geosolver-server/dump/68bd697ca57cdac1f2738a8d7e468fdccd7e5545/media.tar.gz" tar -xvzf media.tar.gz python manage.py migrate --settings=geoserver.settings.local python manage.py loaddata questions.json --settings=geoserver.settings.local