From b5ab9246adfe01ae39967f11a5d1d14b427e6f9b Mon Sep 17 00:00:00 2001 From: facu_r Date: Tue, 25 Sep 2018 09:29:56 -0300 Subject: [PATCH 1/3] add installation script --- utilities/GeppettoConfiguration.json | 25 +++++++++++++++ utilities/install.py | 48 ++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 utilities/GeppettoConfiguration.json create mode 100644 utilities/install.py diff --git a/utilities/GeppettoConfiguration.json b/utilities/GeppettoConfiguration.json new file mode 100644 index 00000000..8ac2de8b --- /dev/null +++ b/utilities/GeppettoConfiguration.json @@ -0,0 +1,25 @@ +{ + "_README": "http://docs.geppetto.org/en/latest/build.html", + "contextPath": "org.geppetto.frontend", + "useSsl": false, + "embedded": false, + "embedderURL": ["/"], + "rootRedirect": "", + "noTest": false, + "extensions": { + "geppetto-default/ComponentsInitialization": false, + "geppetto-scidash/ComponentsInitialization": true + }, + "themes": { + "geppetto-default/colors": false, + "geppetto-scidash/styles/colors": true + }, + "properties": { + "title": "SciDash", + "description": "SciDash is a project that enables the reproducible execution and visualization of data-driven unit test for assessing model quality.", + "type": "website", + "url": "http://scidash.github.io/", + "icon": "http://scidash.github.io/assets/icons/favicon-32x32.png", + "image": "http://scidash.github.io/assets/scidash-text.png" + } +} \ No newline at end of file diff --git a/utilities/install.py b/utilities/install.py new file mode 100644 index 00000000..9287cfd4 --- /dev/null +++ b/utilities/install.py @@ -0,0 +1,48 @@ +import setuptools +from setuptools.command.install import install +import subprocess +import json +import os, sys +from shutil import copyfile + +branch = "development" + +#by default clones branch (which can be passed as a parameter python install.py branch test_branch) +#if branch doesnt exist clones the default_branch +def clone(repository, folder, default_branch, cwdp='', recursive = False): + global branch + print("Cloning "+repository) + if recursive: + subprocess.call(['git', 'clone', '--recursive', repository], cwd='./'+cwdp) + else: + subprocess.call(['git', 'clone', repository], cwd='./'+cwdp) + +def main(argv): + global branch + if(len(argv) > 0): + if(argv[0] == 'branch'): + branch = argv[1] + +if __name__ == "__main__": + main(sys.argv[1:]) + +# set cwd +os.chdir(os.getcwd()+"/../") + +# install requirements +subprocess.call(['pip', 'install', '-r', 'requirements.txt'], cwd='./') + +# Clone Repos +clone('https://github.com/openworm/org.geppetto.frontend','org.geppetto.frontend','developmente', 'static') +clone('https://github.com/MetaCell/geppetto-scidash.git','geppetto-scidash','developmente', 'static/org.geppetto.frontend/src/main/webapp/extensions/') + +# change extension +print("Enabling Geppetto SciDash Extension ...") +geppetto_configuration = os.path.join(os.path.dirname(__file__), './utilities/GeppettoConfiguration.json') +copyfile(geppetto_configuration, './static/org.geppetto.frontend/src/main/webapp/GeppettoConfiguration.json') + +# Install and building +print("NPM Install and build for Geppetto Frontend ...") +subprocess.call(['npm', 'install'], cwd='./static/org.geppetto.frontend/src/main/webapp/') +subprocess.call(['npm', 'run', 'build-dev-noTest'], cwd='./static/org.geppetto.frontend/src/main/webapp/') + From c235f7f43190fef883613052eb2efb152e95ae42 Mon Sep 17 00:00:00 2001 From: facu_r Date: Tue, 25 Sep 2018 10:27:29 -0300 Subject: [PATCH 2/3] update README.md --- README.md | 59 ++++++++++--------------------------------------------- 1 file changed, 10 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index e0b54924..eceb1975 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ SciDash is a geppetto / django-based client-server web application. ## Installation +We recommend you to use a virtual environment for the installation, so you can keep all the dependencies within that environment. + **Dependencies** ``` pip install pygeppetto-django @@ -26,67 +28,26 @@ For OS X: brew install redis ``` +*Install PostgreSQL server* +Install PostgreSQL server: [instructions](https://www.postgresql.org/download/linux/ubuntu/) for Ubuntu, [application](https://postgresapp.com/) for MacOS + **Install SciDash** ``` git clone https://github.com/MetaCell/scidash -cd scidash -pip install -r requirements.txt -mkdir static -cd static -git clone https://github.com/openworm/org.geppetto.frontend -cd org.geppetto.frontend/src/main/webapp -npm install -npm run build-dev-noTest +cd utilities +python install.py ``` Optional for development to enable dynamic refresh of client code when editing html/js/css: ``` +cd statis/org.geppetto.frontend/src/main/webapp npm run build-dev-noTest:watch ``` Also you should create an .env file in the project root, an example can be found in the folder: deploy/dotenv. -**Install SciDash Geppetto Extension** - -Clone the Geppetto SciDash extension into the extensions folder -``` -cd org.geppetto.frontend/src/main/webapp/extensions -git clone https://github.com/MetaCell/geppetto-scidash.git -``` - -Then edit [GeppettoConfiguration.json](https://github.com/openworm/org.geppetto.frontend/blob/master/src/main/webapp/GeppettoConfiguration.json) to look like this: -``` -{ - "_README": "http://docs.geppetto.org/en/latest/build.html", - "contextPath": "org.geppetto.frontend", - "useSsl": false, - "embedded": false, - "embedderURL": ["/"], - "rootRedirect": "", - "noTest": false, - "extensions": { - "geppetto-default/ComponentsInitialization": false, - "geppetto-scidash/ComponentsInitialization": true - }, - "themes": { - "geppetto-default/colors": false, - "geppetto-scidash/styles/colors": true - }, - "properties": { - "title": "SciDash", - "description": "SciDash is a project that enables the reproducible execution and visualization of data-driven unit test for assessing model quality.", - "type": "website", - "url": "http://scidash.github.io/", - "icon": "http://scidash.github.io/assets/icons/favicon-32x32.png", - "image": "http://scidash.github.io/assets/scidash-text.png" - } -} -``` - -**Install Database** - -1. Install PostgreSQL server: [instructions](https://www.postgresql.org/download/linux/ubuntu/) for Ubuntu, [application](https://postgresapp.com/) for MacOS -2. Run: +**Configure Database** +Run: ``` # navigate to scidash root folder cd deploy/scripts From 99214289c8d79fff43cff45488022c691f0487dd Mon Sep 17 00:00:00 2001 From: facu_r Date: Tue, 25 Sep 2018 10:51:05 -0300 Subject: [PATCH 3/3] use deploy/geppetto/GepppettoConfiguration.json --- README.md | 5 +++-- utilities/install.py => install.py | 5 +---- utilities/GeppettoConfiguration.json | 25 ------------------------- 3 files changed, 4 insertions(+), 31 deletions(-) rename utilities/install.py => install.py (95%) delete mode 100644 utilities/GeppettoConfiguration.json diff --git a/README.md b/README.md index eceb1975..670f5933 100644 --- a/README.md +++ b/README.md @@ -29,13 +29,14 @@ brew install redis ``` *Install PostgreSQL server* -Install PostgreSQL server: [instructions](https://www.postgresql.org/download/linux/ubuntu/) for Ubuntu, [application](https://postgresapp.com/) for MacOS +- [instructions](https://www.postgresql.org/download/linux/ubuntu/) for Ubuntu +- [application](https://postgresapp.com/) for MacOS **Install SciDash** ``` git clone https://github.com/MetaCell/scidash -cd utilities +cd scidash python install.py ``` Optional for development to enable dynamic refresh of client code when editing html/js/css: diff --git a/utilities/install.py b/install.py similarity index 95% rename from utilities/install.py rename to install.py index 9287cfd4..2dc14bf8 100644 --- a/utilities/install.py +++ b/install.py @@ -26,9 +26,6 @@ def main(argv): if __name__ == "__main__": main(sys.argv[1:]) -# set cwd -os.chdir(os.getcwd()+"/../") - # install requirements subprocess.call(['pip', 'install', '-r', 'requirements.txt'], cwd='./') @@ -38,7 +35,7 @@ def main(argv): # change extension print("Enabling Geppetto SciDash Extension ...") -geppetto_configuration = os.path.join(os.path.dirname(__file__), './utilities/GeppettoConfiguration.json') +geppetto_configuration = os.path.join(os.path.dirname(__file__), './deploy/geppetto/GeppettoConfiguration.json') copyfile(geppetto_configuration, './static/org.geppetto.frontend/src/main/webapp/GeppettoConfiguration.json') # Install and building diff --git a/utilities/GeppettoConfiguration.json b/utilities/GeppettoConfiguration.json deleted file mode 100644 index 8ac2de8b..00000000 --- a/utilities/GeppettoConfiguration.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "_README": "http://docs.geppetto.org/en/latest/build.html", - "contextPath": "org.geppetto.frontend", - "useSsl": false, - "embedded": false, - "embedderURL": ["/"], - "rootRedirect": "", - "noTest": false, - "extensions": { - "geppetto-default/ComponentsInitialization": false, - "geppetto-scidash/ComponentsInitialization": true - }, - "themes": { - "geppetto-default/colors": false, - "geppetto-scidash/styles/colors": true - }, - "properties": { - "title": "SciDash", - "description": "SciDash is a project that enables the reproducible execution and visualization of data-driven unit test for assessing model quality.", - "type": "website", - "url": "http://scidash.github.io/", - "icon": "http://scidash.github.io/assets/icons/favicon-32x32.png", - "image": "http://scidash.github.io/assets/scidash-text.png" - } -} \ No newline at end of file