Skip to content

Commit

Permalink
Merge pull request qiita-spots#689 from ElDeveloper/release-0.0.1
Browse files Browse the repository at this point in the history
REL: Pre-Alpha release 0.0.1
  • Loading branch information
antgonza committed Nov 25, 2014
2 parents a0628e5 + 13d2db9 commit b0f91f9
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 35 deletions.
41 changes: 31 additions & 10 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Dependencies
------------

Qiita is a python package, with support for python 2.7 and 3.2, that depends on the following python libraries (all of them can be installed using pip):
Qiita is a python package, with support for python 2.7, that depends on the following python libraries (all of them can be installed using pip):

<!--
* [pgbouncer](http://pgfoundry.org/projects/pgbouncer)
* [IPython](https://github.com/ipython/ipython)
-->

* [IPython](https://github.com/ipython/ipython)
* [tornado 3.1.1](http://www.tornadoweb.org/en/stable/)
* [toredis](https://pypi.python.org/pypi/toredis)
* [Psycopg2](http://initd.org/psycopg/download/)
Expand All @@ -26,24 +26,45 @@ Qiita is a python package, with support for python 2.7 and 3.2, that depends on
And on the following packages:

* [PostgresSQL 9.3](http://www.postgresql.org/download/)
* [redis 2.8.0](https://pypi.python.org/pypi/redis/)

<!--
* [redis-server](http://redis.io)
-->

Install
-------

Once you have [PostgresSQL](http://www.postgresql.org/download/) and [redis](https://pypi.python.org/pypi/redis/) installed (follow the instruction on their web site), simply run these commands to install qiita and configure the demo environment, replacing $QIITA_DIR for the path where qiita is installed
(note that if you are not using Ubuntu you might need to follow the instructions in the next section):
(note that if you are not using Ubuntu you might need to follow the instructions in the next section).

```bash
pip install numpy
pip install cogent burrito qcli emperor pyzmq
pip install https://github.com/biocore/qiime/archive/master.zip --no-deps
pip install qiita-spots
```

After these commands are executed, you will need (1) download a [sample Qiita configuration file](https://raw.githubusercontent.com/biocore/qiita/a0628e54aef85b1a064d40d57ca981aaf082a120/qiita_core/support_files/config_test.txt), (2) set the `QIITA_CONFIG_FP` environment variable and (3) proceed to initialize your environment:

```bash
echo "export QIITA_CONFIG_FP=$QIITA_DIR/qiita_core/support_files/config_demo.txt" >> ~/.bashrc
# (1) use curl -O if using OS X
wget https://github.com/biocore/qiita/blob/a0628e54aef85b1a064d40d57ca981aaf082a120/qiita_core/support_files/config_test.txt
# (2) set the enviroment variable in your .bashrc
echo "export QIITA_CONFIG_FP=config_test.txt" >> ~/.bashrc
source ~/.bashrc
pip install https://github.com/biocore/qiita/archive/master.zip
qiita_env make_env --env demo
# (3) start a test environment
qiita_env make --no-load-ontologies
```

Finally you need to start the server:

```bash
# IPython takes a while to get initialized so wait 30 seconds
qiita_env start_cluster demo test reserved && sleep 30
qiita webserver start

```

If all the above commands executed correctly, you should be able to go to http://localhost:8888 in your browser, to login use `[email protected]` and `password` as the credentials.


## If using other operating systems that are not Ubuntu

You will need to add the postgres user to the database. In order to do this, run:
Expand Down
16 changes: 0 additions & 16 deletions qiita_pet/webserver.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# login code modified from https://gist.github.com/guillaumevincent/4771570
import tornado.auth
import tornado.escape
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import tornado.websocket
from tornado.options import define, options
from os.path import dirname, join
from base64 import b64encode
from uuid import uuid4
Expand Down Expand Up @@ -35,7 +31,6 @@
from qiita_pet.handlers.download import DownloadHandler
from qiita_db.util import get_mountpoint

define("port", default=8888, help="run on the given port", type=int)

DIRNAME = dirname(__file__)
STATIC_PATH = join(DIRNAME, "static")
Expand Down Expand Up @@ -96,14 +91,3 @@ def __init__(self):
"login_url": "/auth/login/"
}
tornado.web.Application.__init__(self, handlers, **settings)


def main():
tornado.options.parse_command_line()
http_server = tornado.httpserver.HTTPServer(Application())
http_server.listen(options.port)
print("Tornado started on port", options.port)
tornado.ioloop.IOLoop.instance().start()

if __name__ == "__main__":
main()
26 changes: 26 additions & 0 deletions scripts/qiita
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
# -----------------------------------------------------------------------------

import click
import tornado.httpserver
import tornado.ioloop
from psycopg2 import OperationalError

from qiita_db.util import (get_filepath_types, get_filetypes,
Expand Down Expand Up @@ -58,6 +60,11 @@ def maintenance():
pass


@qiita.group()
def webserver():
pass


# #############################################################################
# DB COMMANDS
# #############################################################################
Expand Down Expand Up @@ -244,5 +251,24 @@ def status():
print r_server.ttl('maintenance'), "seconds remaining"


# #############################################################################
# WEBSERVER COMMANDS
# #############################################################################

@webserver.command()
@click.option('--port', required=False, type=int, help='Port where the '
'webserver will start', default=8888)
def start(port):
# in order to use this command you need to have an IPython cluster running,
# for now this makes it so that you can use other sub-commands without
# having to do that. The solution will (perhaps) be to move this subcommand
# into an entirely different script.
from qiita_pet.webserver import Application

http_server = tornado.httpserver.HTTPServer(Application())
http_server.listen(port)
print("Qiita started on port", port)
tornado.ioloop.IOLoop.instance().start()

if __name__ == '__main__':
qiita()
27 changes: 18 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,43 @@
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------

__version__ = "0.1.0-dev"
__version__ = "0.0.1"

from setuptools import setup
from glob import glob


classes = """
Development Status :: 4 - Beta
Development Status :: 2 - Pre-Alpha
License :: OSI Approved :: BSD License
Topic :: Scientific/Engineering :: Bio-Informatics
Topic :: Software Development :: Libraries :: Application Frameworks
Topic :: Software Development :: Libraries :: Python Modules
Programming Language :: Python
Programming Language :: Python :: 2.7
Programming Language :: Python :: Implementation :: CPython
Operating System :: OS Independent
Operating System :: POSIX :: Linux
Operating System :: MacOS :: MacOS X
"""

long_description = """Qiita is a databasing and UI effort for QIIME"""
long_description = """Qiita: Spot Patterns"""

classifiers = [s.strip() for s in classes.split('\n') if s]

setup(name='qiita',
setup(name='qiita-spots',
version=__version__,
long_description=long_description,
license="BSD",
description='Qiita',
description='Qiita: Spot Patterns',
author="Qiita development team",
author_email="[email protected]",
url='http://biocore.github.io/qiita',
url='https://github.com/biocore/qiita',
test_suite='nose.collector',
packages=['qiita_core',
'qiita_db',
'qiita_pet',
'qiita_ware',
'qiita_pet/handlers',
'qiita_ware'
],
package_data={'qiita_core': ['support_files/config_test.txt'],
'qiita_db': ['support_files/*.sql',
Expand All @@ -59,7 +59,16 @@
'support_files/test_data/job/2_test_folder/*',
'support_files/test_data/uploads/1/*',
'support_files/test_data/templates/*',
'support_files/work_data/*']},
'support_files/work_data/*'],
'qiita_pet': ['static/css/*.css', 'static/img/*.png',
'static/img/*.gif', 'static/img/*.ico',
'static/js/*.js', 'static/vendor/css/*.css',
'static/vendor/css/images/*.png',
'static/vendor/fonts/glyphicons*.*',
'static/vendor/images/*.png',
'static/vendor/js/*.js',
'results/admin/jobname/*.html',
'templates/*.html']},
scripts=glob('scripts/*'),
extras_require={'test': ["nose >= 0.10.1", "pep8", 'mock'],
'doc': ["Sphinx >= 1.2.2", "sphinx-bootstrap-theme"]},
Expand Down

0 comments on commit b0f91f9

Please sign in to comment.