Skip to content

Commit d4f8d8c

Browse files
authored
Merge pull request #2263 from antgonza/rm-moi-ipython
rm moi and ipython
2 parents 8b4ce80 + f50dc35 commit d4f8d8c

File tree

14 files changed

+24
-360
lines changed

14 files changed

+24
-360
lines changed

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ install:
3232
'pandas>=0.18' 'matplotlib>=1.1.0' 'scipy>0.13.0' 'numpy>=1.7' 'h5py>=2.3.1'
3333
- source activate qiita
3434
- pip install -U pip
35-
- pip install sphinx sphinx-bootstrap-theme 'ipython[all]==2.4.1' nose-timer codecov
35+
- pip install sphinx sphinx-bootstrap-theme nose-timer codecov
3636
- travis_retry pip install . --process-dependency-links
3737
- 'echo "backend: Agg" > matplotlibrc'
3838
# Install the biom plugin so we can run the analysis tests
@@ -50,8 +50,6 @@ before_script:
5050
# export QIITA_CONFIG_FP=`pwd`/qiita_core/support_files/config_test_travis.cfg;
5151
# export MOI_CONFIG_FP=`pwd`/qiita_core/support_files/config_test_travis.cfg;
5252
# fi
53-
- ipython profile create qiita-general --parallel
54-
- qiita-env start_cluster qiita-general
5553
- qiita-env make --no-load-ontologies
5654
- |
5755
if [ ${TEST_ADD_STUDIES} == "False" ]; then

CONTRIBUTING.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Since Qiita is a package that is continuously growing, we found ourselves in a p
5656

5757
### Configuration file
5858

59-
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:
59+
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:
6060

6161
* 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.
6262
* 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.
@@ -83,8 +83,6 @@ Scripts in Qiita are located inside the scripts directory, their actions will re
8383

8484
* `qiita-env make` will create a new environment (as specified by the Qiita config file).
8585
* `qiita-env drop` will delete the environment (as specified by the Qiita config file).
86-
* `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).
87-
* `qiita-env stop_cluster qiita-general`, terminates a cluster named ‘qiita-general’.
8886
* `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`.
8987

9088
## Making Database Changes

INSTALL.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ Install Qiita (this occurs through setuptools' `setup.py` file in the qiita dire
110110
pip install -e . --process-dependency-links
111111
```
112112

113-
Install the development version of moi:
114-
```bash
115-
pip install https://github.com/biocore/mustached-octo-ironman/archive/master.zip --no-deps
116-
```
117-
118113
At this point, Qiita will be installed and the system will start. However,
119114
you will need to install plugins in order to process any kind of data. For a list
120115
of available plugins, visit the [Qiita Spots](https://github.com/qiita-spots)
@@ -151,12 +146,6 @@ Set your `QIITA_CONFIG_FP` environment variable to point to that file (into `.ba
151146
source activate qiita
152147
```
153148

154-
Setup ipython profile for qiita:
155-
156-
```bash
157-
ipython profile create qiita-general --parallel
158-
```
159-
160149
Next, make a test environment:
161150

162151
```bash
@@ -173,12 +162,6 @@ Next, start redis server (the command may differ depending on your operating sys
173162
redis-server
174163
```
175164

176-
Start the IPython cluster:
177-
178-
```bash
179-
qiita-env start_cluster qiita-general && sleep 30
180-
```
181-
182165
Start the qiita server:
183166

184167
```bash

qiita_core/configuration_manager.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,6 @@ class ConfigurationManager(object):
5858
The host where the database lives
5959
port : int
6060
The port used to connect to the postgres database in the previous host
61-
ipyc_demo : str
62-
The IPython demo cluster profile
63-
ipyc_demo_n : int
64-
The size of the demo cluster
65-
ipyc_reserved : str
66-
The IPython reserved cluster profile
67-
ipyc_reserved_n : int
68-
The size of the reserved cluster
69-
ipyc_general : str
70-
The IPython general cluster profile
71-
ipyc_general_n : int
72-
The size of the general cluster
7361
smtp_host : str
7462
The SMTP host from which mail will be sent
7563
smtp_port : int
@@ -145,7 +133,7 @@ def __init__(self):
145133
config.readfp(conf_file)
146134

147135
_required_sections = {'main', 'redis', 'postgres', 'smtp', 'ebi',
148-
'ipython', 'portal'}
136+
'portal'}
149137
if not _required_sections.issubset(set(config.sections())):
150138
missing = _required_sections - set(config.sections())
151139
raise MissingConfigSection(', '.join(missing))
@@ -155,7 +143,6 @@ def __init__(self):
155143
self._get_postgres(config)
156144
self._get_redis(config)
157145
self._get_ebi(config)
158-
self._get_ipython(config)
159146
self._get_vamps(config)
160147
self._get_portal(config)
161148

@@ -283,10 +270,6 @@ def _get_ebi(self, config):
283270
self.ebi_center_name = sec_get('EBI_CENTER_NAME')
284271
self.ebi_organization_prefix = sec_get('EBI_ORGANIZATION_PREFIX')
285272

286-
def _get_ipython(self, config):
287-
self.ipython_contexts = config.get('ipython', 'context').split(',')
288-
self.ipython_default = config.get('ipython', 'default')
289-
290273
def _get_vamps(self, config):
291274
self.vamps_user = config.get('vamps', 'USER')
292275
self.vamps_pass = config.get('vamps', 'PASSWORD')

qiita_core/environment_manager.py

Lines changed: 14 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,12 @@
66
# The full license is in the file LICENSE, distributed with this software.
77
# -----------------------------------------------------------------------------
88

9-
from os import fork
10-
from sys import exit, exc_info, stderr
9+
from sys import exc_info, stderr
1110
import traceback
1211

13-
from IPython.parallel.apps.ipclusterapp import IPClusterStart, IPClusterStop
14-
1512

1613
MAX_TEST_WAIT = 5
17-
TEST_RUNNERS = ('local', 'remote', 'moi', 'all')
18-
19-
20-
def start_cluster(profile):
21-
"""Start a cluster"""
22-
me = fork()
23-
if me == 0:
24-
c = IPClusterStart(profile=profile, log_level=0, daemonize=True)
25-
c.initialize(argv=[])
26-
c.start()
27-
28-
29-
def stop_cluster(profile):
30-
"""Stop a cluster"""
31-
me = fork()
32-
if me == 0:
33-
c = IPClusterStop(profile=profile, log_level=0)
34-
c.initialize(argv=[])
35-
c.start()
36-
exit(0)
14+
TEST_RUNNERS = ('local', 'remote', 'all')
3715

3816

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

4624

47-
def _test_wrapper_moi(func):
48-
"""Submit a function through moi"""
49-
try:
50-
from moi.job import submit_nouser
51-
_, _, ar = submit_nouser(func)
52-
except:
53-
return ('FAIL', traceback.format_exception(*exc_info()))
54-
55-
return _ipy_wait(ar)
56-
57-
58-
def _test_wrapper_remote(func):
59-
"""Execute a function on a remote ipengine"""
60-
from IPython.parallel import Client
61-
from qiita_core.configuration_manager import ConfigurationManager
62-
config = ConfigurationManager()
63-
c = Client(profile=config.ipython_default)
64-
bv = c.load_balanced_view()
65-
return _ipy_wait(bv.apply_async(func))
66-
67-
68-
def _ipy_wait(ar):
69-
"""Wait on a IPython AsyncResult"""
70-
ar.wait(timeout=MAX_TEST_WAIT)
71-
72-
if ar.ready():
73-
result = _test_wrapper_local(ar.get)
74-
else:
75-
result = ('FAIL', 'No result after %d seconds' % MAX_TEST_WAIT)
76-
77-
return result
78-
79-
8025
def _test_result(test_type, name, state, result, expected):
8126
"""Write out the results of the test"""
8227
correct_result = result == expected
@@ -104,26 +49,11 @@ def _test_result(test_type, name, state, result, expected):
10449
stderr.write('\n')
10550

10651

107-
def _test_runner(test_type, name, func, expected):
108-
"""Dispatch to the corresponding runner"""
109-
if test_type == 'local':
110-
state, result = _test_wrapper_local(func)
111-
elif test_type == 'moi':
112-
state, result = _test_wrapper_moi(func)
113-
elif test_type == 'remote':
114-
state, result = _test_wrapper_remote(func)
115-
else:
116-
raise ValueError("Unknown test type: %s" % test_type)
117-
118-
_test_result(test_type, name, state, result, expected)
119-
120-
12152
def test(runner):
12253
"""Test the environment
12354
124-
* Verify redis connectivity indepedent of moi
55+
* Verify redis connectivity
12556
* Verify database connectivity
126-
* Verify submission via moi
12757
12858
Tests are performed both on the server and ipengines.
12959
"""
@@ -148,23 +78,21 @@ def postgres_test(**kwargs):
14878
c = SQLConnectionHandler()
14979
return c.execute_fetchone("SELECT 42")[0]
15080

151-
def moi_test(**kwargs):
152-
"""Submit a function via moi"""
153-
from moi.job import submit_nouser
154-
155-
def inner(a, b, **kwargs):
156-
return a + b
157-
158-
_, _, ar = submit_nouser(inner, 7, 35)
159-
state, result = _ipy_wait(ar)
160-
return result
161-
16281
if runner == 'all':
163-
runner = ('local', 'remote', 'moi')
82+
runner = ('local', )
16483
else:
16584
runner = [runner]
16685

16786
for name in runner:
16887
_test_runner(name, "redis", redis_test, 42)
16988
_test_runner(name, "postgres", postgres_test, 42)
170-
_test_runner(name, "submit via moi", moi_test, 42)
89+
90+
91+
def _test_runner(test_type, name, func, expected):
92+
"""Dispatch to the corresponding runner"""
93+
if test_type == 'local':
94+
state, result = _test_wrapper_local(func)
95+
else:
96+
raise ValueError("Unknown test type: %s" % test_type)
97+
98+
_test_result(test_type, name, state, result, expected)

qiita_core/support_files/config_test.cfg

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,6 @@ EBI_CENTER_NAME = qiita-test
144144
# study aliases
145145
EBI_ORGANIZATION_PREFIX = example_organization
146146

147-
148-
# ----------------------------- IPython settings -----------------------------
149-
[ipython]
150-
# context is expected to be a comma separated list
151-
context = qiita-general
152-
default = qiita-general
153-
154147
# ----------------------------- VAMPS settings -----------------------------
155148
[vamps]
156149
# general info to submit to vamps

qiita_core/tests/test_configuration_manager.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,6 @@ def test_init(self):
9494
self.assertEqual(obs.ebi_center_name, "qiita-test")
9595
self.assertEqual(obs.ebi_organization_prefix, "example_organization")
9696

97-
# IPython section
98-
self.assertEqual(obs.ipython_contexts, ["qiita-general"])
99-
self.assertEqual(obs.ipython_default, "qiita-general")
100-
10197
# VAMPS section
10298
self.assertEqual(obs.vamps_user, "user")
10399
self.assertEqual(obs.vamps_pass, "password")
@@ -333,13 +329,6 @@ def test_get_portal(self):
333329
# study aliases
334330
EBI_ORGANIZATION_PREFIX = example_organization
335331
336-
337-
# ----------------------------- IPython settings -----------------------------
338-
[ipython]
339-
# context is expected to be a comma separated list
340-
context = qiita-general
341-
default = qiita-general
342-
343332
# ----------------------------- VAMPS settings -----------------------------
344333
[vamps]
345334
# general info to submit to vamps

qiita_pet/webserver.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@
1111
import tornado.escape
1212
import tornado.web
1313
import tornado.websocket
14-
from os.path import dirname, join, exists
15-
from shutil import copy
14+
from os.path import dirname, join
1615
from base64 import b64encode
1716
from uuid import uuid4
18-
from moi import moi_js, moi_list_js
19-
from moi.websocket import MOIMessageHandler
2017

2118
from qiita_core.qiita_settings import qiita_config
2219
from qiita_core.util import is_test_environment
@@ -85,9 +82,6 @@
8582

8683

8784
_vendor_js = join(STATIC_PATH, 'vendor', 'js')
88-
if not exists(join(_vendor_js, 'moi.js')):
89-
copy(moi_js(), _vendor_js)
90-
copy(moi_list_js(), _vendor_js)
9185

9286

9387
class Application(tornado.web.Application):
@@ -117,7 +111,6 @@ def __init__(self):
117111
(r"/analysis/sharing/", ShareAnalysisAJAX),
118112
(r"/artifact/samples/", ArtifactGetSamples),
119113
(r"/artifact/info/", ArtifactGetInfo),
120-
(r"/moi-ws/", MOIMessageHandler),
121114
(r"/consumer/", MessageHandler),
122115
(r"/admin/error/", LogEntryViewerHandler),
123116
(r"/admin/approval/", StudyApprovalList),

qiita_ware/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
from tempfile import mkdtemp
1313
from os import environ
1414
from traceback import format_exc
15-
from moi.job import system_call
1615

1716
from qiita_db.artifact import Artifact
1817
from qiita_db.logger import LogEntry
18+
from qiita_db.processing_job import _system_call as system_call
1919
from qiita_core.qiita_settings import qiita_config
2020
from qiita_ware.ebi import EBISubmission
2121
from qiita_ware.exceptions import ComputeError, EBISubmissionError

0 commit comments

Comments
 (0)