Skip to content

Remove moi #2260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 53 commits into from
Sep 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
2e102b4
Merge branch 'dev' of https://github.com/biocore/qiita into dev
josenavas Aug 31, 2017
de5c89f
upgrading software
antgonza Aug 31, 2017
6248208
mv r_client to qiita
antgonza Aug 31, 2017
eb19870
from redis import Redis
antgonza Aug 31, 2017
120e9ac
Merge pull request #2261 from antgonza/upgrading-software
josenavas Aug 31, 2017
58e2dab
Merge branch 'remove-moi' of https://github.com/biocore/qiita into r_…
antgonza Aug 31, 2017
8b4ce80
Merge pull request #2262 from antgonza/r_client-to-qiita
josenavas Aug 31, 2017
fa7cf3d
rm moi and ipython
antgonza Aug 31, 2017
a47c13b
Move qiita_db/private.py -> qiita_ware/private_plugin.py
josenavas Aug 31, 2017
c8c1b59
_system_call as system_call
antgonza Aug 31, 2017
c46c05f
flake8
antgonza Aug 31, 2017
f7e9b1e
rm create_raw_data
antgonza Aug 31, 2017
c16b177
Transferring VAMPS submission to internal job
josenavas Aug 31, 2017
4de94cd
rm other unnecessary files
antgonza Aug 31, 2017
f50dc35
addressing @josenavas comment
antgonza Aug 31, 2017
d4f8d8c
Merge pull request #2263 from antgonza/rm-moi-ipython
josenavas Aug 31, 2017
925a3a5
Merge branch 'remove-moi' of https://github.com/biocore/qiita into rm…
antgonza Aug 31, 2017
58cd5ae
Merge branch 'remove-moi' of https://github.com/biocore/qiita into tr…
josenavas Aug 31, 2017
0be1275
Merge pull request #2264 from antgonza/rm-create_raw_data
josenavas Aug 31, 2017
263f956
Solving merge conflicts
josenavas Aug 31, 2017
efa1924
Merge branch 'transfer-submit-to-vamps' into transfer-copy-raw-data
josenavas Aug 31, 2017
4f43236
Fixing merge conflicts
josenavas Aug 31, 2017
a528e04
Adding tests to private plugin
josenavas Aug 31, 2017
242df8e
rm wrapper.py
antgonza Aug 31, 2017
0bf7307
Removing import
josenavas Aug 31, 2017
6ee9022
Fixing import
josenavas Aug 31, 2017
c13e8bd
Merge branch 'transfer-submit-to-vamps' into transfer-copy-raw-data
josenavas Aug 31, 2017
c3bc77c
Modifying GUI to use the plugin
josenavas Aug 31, 2017
fbf5402
moving qiita pet in .travis.yml
antgonza Aug 31, 2017
71c0b41
Transfer submit to vamps (#2265)
josenavas Aug 31, 2017
b6f43c0
Merge branch 'remove-moi' of https://github.com/biocore/qiita into rm…
antgonza Aug 31, 2017
8051cbb
some other .travis.yml fixes
antgonza Aug 31, 2017
10d8cfd
Fixing import
josenavas Aug 31, 2017
df5f5c8
addressing @josenavas comment
antgonza Aug 31, 2017
5230bae
Merge pull request #2266 from antgonza/rm-wrapper.py
josenavas Aug 31, 2017
044e562
Merge branch 'remove-moi' of https://github.com/biocore/qiita into tr…
josenavas Aug 31, 2017
f2a12c6
Adding success test
josenavas Aug 31, 2017
a9e302a
adding some methods
antgonza Aug 31, 2017
dde3296
flake8
antgonza Aug 31, 2017
779a5d1
Transfer copy raw data (#2267)
josenavas Aug 31, 2017
2113fa4
fix conflicts
antgonza Aug 31, 2017
e03997a
change imports
antgonza Sep 1, 2017
48abc1e
adding delete_artifact and create_sample_template
antgonza Sep 1, 2017
2d8dffa
fixing errors and gui
antgonza Sep 1, 2017
df64ef5
fix delete error
antgonza Sep 2, 2017
dc7f78c
Merge pull request #2268 from antgonza/mv-some-methods
josenavas Sep 5, 2017
c227463
erge branch 'master' of https://github.com/biocore/qiita
antgonza Sep 7, 2017
22d52f0
Transfer update delete templates (#2274)
josenavas Sep 8, 2017
8178bab
Merge branch 'dev' of https://github.com/biocore/qiita
antgonza Sep 9, 2017
fb65ff1
Fixing the redis DB (#2277)
josenavas Sep 9, 2017
ecfbaf7
Merge branch 'remove-moi' of https://github.com/biocore/qiita into mo…
antgonza Sep 10, 2017
0a9182f
mv moi-ws to qiita_websocket
antgonza Sep 11, 2017
4ed9285
Merge pull request #2279 from antgonza/moi.send
josenavas Sep 11, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,3 @@ gg_13_8-*

# sphinx documentation
qiita_pet/static/doc/

# moi static files
qiita_pet/static/vendor/js/moi.js
qiita_pet/static/vendor/js/moi_list.js
25 changes: 9 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ env:
matrix:
- TEST_ADD_STUDIES=False COVER_PACKAGE=qiita_db
- TEST_ADD_STUDIES=False COVER_PACKAGE=qiita_pet
- TEST_ADD_STUDIES=False COVER_PACKAGE="qiita_core qiita_ware"
- TEST_ADD_STUDIES=True
- TEST_ADD_STUDIES=True COVER_PACKAGE="qiita_core qiita_ware"
before_install:
- redis-server --version
- wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
Expand All @@ -32,7 +31,7 @@ install:
'pandas>=0.18' 'matplotlib>=1.1.0' 'scipy>0.13.0' 'numpy>=1.7' 'h5py>=2.3.1'
- source activate qiita
- pip install -U pip
- pip install sphinx sphinx-bootstrap-theme 'ipython[all]==2.4.1' nose-timer codecov
- pip install sphinx sphinx-bootstrap-theme nose-timer codecov
- travis_retry pip install . --process-dependency-links
- 'echo "backend: Agg" > matplotlibrc'
# Install the biom plugin so we can run the analysis tests
Expand All @@ -42,29 +41,23 @@ install:
- mkdir ~/.qiita_plugins
- cp $PWD/qiita_core/support_files/BIOM\ type_2.1.4.conf ~/.qiita_plugins
before_script:
# Some of the tests rely on the plugin system to complete successfuly.
# Thus, we need a qiita webserver running to be able to execute the tests.
- export MOI_CONFIG_FP=`pwd`/qiita_core/support_files/config_test.cfg
# EBI, see the end of before_install about why this block is commented out
# - if [ ${TRAVIS_PULL_REQUEST} == "false" ]; then
# export QIITA_CONFIG_FP=`pwd`/qiita_core/support_files/config_test_travis.cfg;
# export MOI_CONFIG_FP=`pwd`/qiita_core/support_files/config_test_travis.cfg;
# fi
- ipython profile create qiita-general --parallel
- qiita-env start_cluster qiita-general
- qiita-env make --no-load-ontologies
- |
if [ ${TEST_ADD_STUDIES} == "False" ]; then
qiita pet webserver --no-build-docs start &
fi
- qiita-test-install
script:
# Some of the tests rely on the plugin system to complete successfuly.
# Thus, we need a qiita webserver running to be able to execute the tests.
- qiita pet webserver --no-build-docs start &
- sleep 5
- QIITA_PID=$!
- nosetests $COVER_PACKAGE --with-doctest --with-coverage --with-timer -v --cover-package=$COVER_PACKAGE
- kill $QIITA_PID
- if [ ${TEST_ADD_STUDIES} == "True" ]; then test_data_studies/commands.sh ; fi
- if [ ${TEST_ADD_STUDIES} == "True" ]; then qiita-cron-job ; fi
- if [ ${TEST_ADD_STUDIES} == "False" ]; then qiita-test-install ; fi
- if [ ${TEST_ADD_STUDIES} == "False" ]; then nosetests $COVER_PACKAGE --with-doctest --with-coverage --with-timer -v --cover-package=$COVER_PACKAGE; fi
- flake8 qiita_* setup.py scripts/*
- ls -R /home/travis/miniconda3/envs/qiita/lib/python2.7/site-packages/qiita_pet/support_files/doc/
- qiita pet webserver
addons:
postgresql: "9.3"
Expand Down
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Since Qiita is a package that is continuously growing, we found ourselves in a p

### Configuration file

The Qiita configuration file determines how the package interacts with your system’s resources (redis, postgres and the IPython cluster). Thus you should review the documentation detailed [here](https://docs.google.com/document/d/1u7kwLP31NM513-8xwpwvLbSQxYu0ehI6Jau1APR13e0/edit#), but especially bear in mind the following points:
The Qiita configuration file determines how the package interacts with your system’s resources (redis and postgres). Thus you should review the documentation detailed [here](https://docs.google.com/document/d/1u7kwLP31NM513-8xwpwvLbSQxYu0ehI6Jau1APR13e0/edit#), but especially bear in mind the following points:

* An example version of this file can be found here `qiita_core/support_files/qiita_config.txt` and if you don’t set a `QIITA_CONFIG_FP` environment variable, that’s the file that Qiita will use.
* The `[main]` section sets a `TEST_ENVIRONMENT` variable, which determines whether your system will be running unit tests or if it a demo/production system. You will want to set the value to TRUE if you are running the unit tests.
Expand All @@ -83,8 +83,6 @@ Scripts in Qiita are located inside the scripts directory, their actions will re

* `qiita-env make` will create a new environment (as specified by the Qiita config file).
* `qiita-env drop` will delete the environment (as specified by the Qiita config file).
* `qiita-env start_cluster qiita-general`, starts an IPython cluster named ‘qiita-general’. Normally you’ll want to wait a few seconds for the engines to start and become responsive (30-40 seconds depending on your system).
* `qiita-env stop_cluster qiita-general`, terminates a cluster named ‘qiita-general’.
* `qiita pet webserver start`, will start the Qiita web-application running on port 21174, you can change this using the `--port` flag, for example `--port=7532`.

## Making Database Changes
Expand Down
18 changes: 0 additions & 18 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ Install Qiita (this occurs through setuptools' `setup.py` file in the qiita dire
pip install -e . --process-dependency-links
```

Install the development version of moi:
```bash
pip install https://github.com/biocore/mustached-octo-ironman/archive/master.zip --no-deps
```

At this point, Qiita will be installed and the system will start. However,
you will need to install plugins in order to process any kind of data. For a list
of available plugins, visit the [Qiita Spots](https://github.com/qiita-spots)
Expand Down Expand Up @@ -145,18 +140,11 @@ Set your `QIITA_CONFIG_FP` environment variable to point to that file (into `.ba

```bash
echo "export QIITA_CONFIG_FP=$HOME/.qiita_config_test.cfg" >> ~/.bashrc
echo "export MOI_CONFIG_FP=$HOME/.qiita_config_test.cfg" >> ~/.bashrc
source ~/.bashrc
# Re-enable conda environment for qiita
source activate qiita
```

Setup ipython profile for qiita:

```bash
ipython profile create qiita-general --parallel
```

Next, make a test environment:

```bash
Expand All @@ -173,12 +161,6 @@ Next, start redis server (the command may differ depending on your operating sys
redis-server
```

Start the IPython cluster:

```bash
qiita-env start_cluster qiita-general && sleep 30
```

Start the qiita server:

```bash
Expand Down
19 changes: 1 addition & 18 deletions qiita_core/configuration_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,6 @@ class ConfigurationManager(object):
The host where the database lives
port : int
The port used to connect to the postgres database in the previous host
ipyc_demo : str
The IPython demo cluster profile
ipyc_demo_n : int
The size of the demo cluster
ipyc_reserved : str
The IPython reserved cluster profile
ipyc_reserved_n : int
The size of the reserved cluster
ipyc_general : str
The IPython general cluster profile
ipyc_general_n : int
The size of the general cluster
smtp_host : str
The SMTP host from which mail will be sent
smtp_port : int
Expand Down Expand Up @@ -145,7 +133,7 @@ def __init__(self):
config.readfp(conf_file)

_required_sections = {'main', 'redis', 'postgres', 'smtp', 'ebi',
'ipython', 'portal'}
'portal'}
if not _required_sections.issubset(set(config.sections())):
missing = _required_sections - set(config.sections())
raise MissingConfigSection(', '.join(missing))
Expand All @@ -155,7 +143,6 @@ def __init__(self):
self._get_postgres(config)
self._get_redis(config)
self._get_ebi(config)
self._get_ipython(config)
self._get_vamps(config)
self._get_portal(config)

Expand Down Expand Up @@ -283,10 +270,6 @@ def _get_ebi(self, config):
self.ebi_center_name = sec_get('EBI_CENTER_NAME')
self.ebi_organization_prefix = sec_get('EBI_ORGANIZATION_PREFIX')

def _get_ipython(self, config):
self.ipython_contexts = config.get('ipython', 'context').split(',')
self.ipython_default = config.get('ipython', 'default')

def _get_vamps(self, config):
self.vamps_user = config.get('vamps', 'USER')
self.vamps_pass = config.get('vamps', 'PASSWORD')
Expand Down
100 changes: 14 additions & 86 deletions qiita_core/environment_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,12 @@
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------

from os import fork
from sys import exit, exc_info, stderr
from sys import exc_info, stderr
import traceback

from IPython.parallel.apps.ipclusterapp import IPClusterStart, IPClusterStop


MAX_TEST_WAIT = 5
TEST_RUNNERS = ('local', 'remote', 'moi', 'all')


def start_cluster(profile):
"""Start a cluster"""
me = fork()
if me == 0:
c = IPClusterStart(profile=profile, log_level=0, daemonize=True)
c.initialize(argv=[])
c.start()


def stop_cluster(profile):
"""Stop a cluster"""
me = fork()
if me == 0:
c = IPClusterStop(profile=profile, log_level=0)
c.initialize(argv=[])
c.start()
exit(0)
TEST_RUNNERS = ('local', 'remote', 'all')


def _test_wrapper_local(func):
Expand All @@ -44,39 +22,6 @@ def _test_wrapper_local(func):
return ('FAIL', traceback.format_exception(*exc_info()))


def _test_wrapper_moi(func):
"""Submit a function through moi"""
try:
from moi.job import submit_nouser
_, _, ar = submit_nouser(func)
except:
return ('FAIL', traceback.format_exception(*exc_info()))

return _ipy_wait(ar)


def _test_wrapper_remote(func):
"""Execute a function on a remote ipengine"""
from IPython.parallel import Client
from qiita_core.configuration_manager import ConfigurationManager
config = ConfigurationManager()
c = Client(profile=config.ipython_default)
bv = c.load_balanced_view()
return _ipy_wait(bv.apply_async(func))


def _ipy_wait(ar):
"""Wait on a IPython AsyncResult"""
ar.wait(timeout=MAX_TEST_WAIT)

if ar.ready():
result = _test_wrapper_local(ar.get)
else:
result = ('FAIL', 'No result after %d seconds' % MAX_TEST_WAIT)

return result


def _test_result(test_type, name, state, result, expected):
"""Write out the results of the test"""
correct_result = result == expected
Expand Down Expand Up @@ -104,26 +49,11 @@ def _test_result(test_type, name, state, result, expected):
stderr.write('\n')


def _test_runner(test_type, name, func, expected):
"""Dispatch to the corresponding runner"""
if test_type == 'local':
state, result = _test_wrapper_local(func)
elif test_type == 'moi':
state, result = _test_wrapper_moi(func)
elif test_type == 'remote':
state, result = _test_wrapper_remote(func)
else:
raise ValueError("Unknown test type: %s" % test_type)

_test_result(test_type, name, state, result, expected)


def test(runner):
"""Test the environment

* Verify redis connectivity indepedent of moi
* Verify redis connectivity
* Verify database connectivity
* Verify submission via moi

Tests are performed both on the server and ipengines.
"""
Expand All @@ -148,23 +78,21 @@ def postgres_test(**kwargs):
c = SQLConnectionHandler()
return c.execute_fetchone("SELECT 42")[0]

def moi_test(**kwargs):
"""Submit a function via moi"""
from moi.job import submit_nouser

def inner(a, b, **kwargs):
return a + b

_, _, ar = submit_nouser(inner, 7, 35)
state, result = _ipy_wait(ar)
return result

if runner == 'all':
runner = ('local', 'remote', 'moi')
runner = ('local', )
else:
runner = [runner]

for name in runner:
_test_runner(name, "redis", redis_test, 42)
_test_runner(name, "postgres", postgres_test, 42)
_test_runner(name, "submit via moi", moi_test, 42)


def _test_runner(test_type, name, func, expected):
"""Dispatch to the corresponding runner"""
if test_type == 'local':
state, result = _test_wrapper_local(func)
else:
raise ValueError("Unknown test type: %s" % test_type)

_test_result(test_type, name, state, result, expected)
10 changes: 8 additions & 2 deletions qiita_core/qiita_settings.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
#!/usr/bin/env python
from __future__ import division

# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------
from __future__ import division

from redis import Redis

from qiita_core.configuration_manager import ConfigurationManager

qiita_config = ConfigurationManager()

r_client = Redis(host=qiita_config.redis_host,
port=qiita_config.redis_port,
password=qiita_config.redis_password,
db=qiita_config.redis_db)
7 changes: 0 additions & 7 deletions qiita_core/support_files/config_test.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,6 @@ EBI_CENTER_NAME = qiita-test
# study aliases
EBI_ORGANIZATION_PREFIX = example_organization


# ----------------------------- IPython settings -----------------------------
[ipython]
# context is expected to be a comma separated list
context = qiita-general
default = qiita-general

# ----------------------------- VAMPS settings -----------------------------
[vamps]
# general info to submit to vamps
Expand Down
11 changes: 2 additions & 9 deletions qiita_core/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from json import loads
from time import sleep

from moi import r_client
from qiita_core.qiita_settings import r_client

from qiita_db.processing_job import ProcessingJob

Expand Down Expand Up @@ -38,14 +38,7 @@ def wait_for_prep_information_job(prep_id, raise_if_none=True):
if res is not None:
payload = loads(res)
job_id = payload['job_id']
if payload['is_qiita_job']:
wait_for_processing_job(job_id)
else:
redis_info = loads(r_client.get(job_id))
while redis_info['status_msg'] == 'Running':
sleep(0.5)
redis_info = loads(r_client.get(job_id))
sleep(0.5)
wait_for_processing_job(job_id)


def wait_for_processing_job(job_id):
Expand Down
11 changes: 0 additions & 11 deletions qiita_core/tests/test_configuration_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ def test_init(self):
self.assertEqual(obs.ebi_center_name, "qiita-test")
self.assertEqual(obs.ebi_organization_prefix, "example_organization")

# IPython section
self.assertEqual(obs.ipython_contexts, ["qiita-general"])
self.assertEqual(obs.ipython_default, "qiita-general")

# VAMPS section
self.assertEqual(obs.vamps_user, "user")
self.assertEqual(obs.vamps_pass, "password")
Expand Down Expand Up @@ -333,13 +329,6 @@ def test_get_portal(self):
# study aliases
EBI_ORGANIZATION_PREFIX = example_organization


# ----------------------------- IPython settings -----------------------------
[ipython]
# context is expected to be a comma separated list
context = qiita-general
default = qiita-general

# ----------------------------- VAMPS settings -----------------------------
[vamps]
# general info to submit to vamps
Expand Down
Loading