diff --git a/README.md b/README.md index e0b54924..670f5933 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,27 @@ For OS X: brew install redis ``` +*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 +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 diff --git a/install.py b/install.py new file mode 100644 index 00000000..2dc14bf8 --- /dev/null +++ b/install.py @@ -0,0 +1,45 @@ +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:]) + +# 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__), './deploy/geppetto/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/') +