Show More
@@ -11,12 +11,13 b'' | |||
|
11 | 11 | #----------------------------------------------------------------------------- |
|
12 | 12 | |
|
13 | 13 | import os |
|
14 | import json | |
|
14 | 15 | import time |
|
16 | import warnings | |
|
17 | from datetime import datetime | |
|
15 | 18 | from getpass import getpass |
|
16 | 19 | from pprint import pprint |
|
17 | from datetime import datetime | |
|
18 | import warnings | |
|
19 | import json | |
|
20 | ||
|
20 | 21 | pjoin = os.path.join |
|
21 | 22 | |
|
22 | 23 | import zmq |
@@ -26,16 +27,15 b' from IPython.utils.path import get_ipython_dir' | |||
|
26 | 27 | from IPython.external.decorator import decorator |
|
27 | 28 | from IPython.external.ssh import tunnel |
|
28 | 29 | |
|
29 | import streamsession as ss | |
|
30 | from clusterdir import ClusterDir, ClusterDirError | |
|
31 | # from remotenamespace import RemoteNamespace | |
|
32 | from view import DirectView, LoadBalancedView | |
|
33 | from dependency import Dependency, depend, require, dependent | |
|
34 | 30 | import error |
|
35 | 31 | import map as Map |
|
32 | import streamsession as ss | |
|
36 | 33 | from asyncresult import AsyncResult, AsyncMapResult |
|
34 | from clusterdir import ClusterDir, ClusterDirError | |
|
35 | from dependency import Dependency, depend, require, dependent | |
|
37 | 36 | from remotefunction import remote,parallel,ParallelFunction,RemoteFunction |
|
38 | 37 | from util import ReverseDict, disambiguate_url, validate_url |
|
38 | from view import DirectView, LoadBalancedView | |
|
39 | 39 | |
|
40 | 40 | #-------------------------------------------------------------------------- |
|
41 | 41 | # helpers for implementing old MEC API via client.apply |
@@ -17,16 +17,16 b' The IPython cluster directory' | |||
|
17 | 17 | |
|
18 | 18 | from __future__ import with_statement |
|
19 | 19 | |
|
20 | import re | |
|
21 | 20 | import os |
|
21 | import logging | |
|
22 | import re | |
|
22 | 23 | import shutil |
|
23 | 24 | import sys |
|
24 | import logging | |
|
25 | 25 | import warnings |
|
26 | 26 | |
|
27 | 27 | from IPython.config.loader import PyFileConfigLoader |
|
28 | from IPython.core.application import Application, BaseAppConfigLoader | |
|
29 | 28 | from IPython.config.configurable import Configurable |
|
29 | from IPython.core.application import Application, BaseAppConfigLoader | |
|
30 | 30 | from IPython.core.crashhandler import CrashHandler |
|
31 | 31 | from IPython.core import release |
|
32 | 32 | from IPython.utils.path import ( |
@@ -24,10 +24,8 b' from IPython.utils.importstring import import_item' | |||
|
24 | 24 | from IPython.utils.traitlets import Int, Str, Instance, List, Bool |
|
25 | 25 | |
|
26 | 26 | from entry_point import signal_children |
|
27 | ||
|
28 | ||
|
29 | from scheduler import launch_scheduler | |
|
30 | 27 | from hub import Hub, HubFactory |
|
28 | from scheduler import launch_scheduler | |
|
31 | 29 | |
|
32 | 30 | #----------------------------------------------------------------------------- |
|
33 | 31 | # Configurable |
@@ -1,8 +1,9 b'' | |||
|
1 | 1 | """Dependency utilities""" |
|
2 | 2 | |
|
3 | 3 | from IPython.external.decorator import decorator |
|
4 | from error import UnmetDependency | |
|
4 | ||
|
5 | 5 | from asyncresult import AsyncResult |
|
6 | from error import UnmetDependency | |
|
6 | 7 | |
|
7 | 8 | |
|
8 | 9 | class depend(object): |
@@ -4,10 +4,11 b' it handles registration, etc. and launches a kernel' | |||
|
4 | 4 | connected to the Controller's queue(s). |
|
5 | 5 | """ |
|
6 | 6 | from __future__ import print_function |
|
7 | ||
|
8 | import logging | |
|
7 | 9 | import sys |
|
8 | 10 | import time |
|
9 | 11 | import uuid |
|
10 | import logging | |
|
11 | 12 | from pprint import pprint |
|
12 | 13 | |
|
13 | 14 | import zmq |
@@ -18,12 +19,11 b' from IPython.config.configurable import Configurable' | |||
|
18 | 19 | from IPython.utils.traitlets import Instance, Str, Dict, Int, Type, CFloat |
|
19 | 20 | # from IPython.utils.localinterfaces import LOCALHOST |
|
20 | 21 | |
|
22 | import heartmonitor | |
|
21 | 23 | from factory import RegistrationFactory |
|
22 | from util import disambiguate_url | |
|
23 | ||
|
24 | from streamsession import Message | |
|
25 | 24 | from streamkernel import Kernel |
|
26 | import heartmonitor | |
|
25 | from streamsession import Message | |
|
26 | from util import disambiguate_url | |
|
27 | 27 | |
|
28 | 28 | def printer(*msg): |
|
29 | 29 | # print (self.log.handlers, file=sys.__stdout__) |
@@ -7,14 +7,14 b' NOTE: Most of this module has been deprecated by moving to Configurables' | |||
|
7 | 7 | """ |
|
8 | 8 | |
|
9 | 9 | # Standard library imports. |
|
10 | import logging | |
|
11 | 10 | import atexit |
|
12 | import sys | |
|
11 | import logging | |
|
13 | 12 | import os |
|
14 | 13 | import stat |
|
15 | 14 | import socket |
|
16 | from subprocess import Popen, PIPE | |
|
15 | import sys | |
|
17 | 16 | from signal import signal, SIGINT, SIGABRT, SIGTERM |
|
17 | from subprocess import Popen, PIPE | |
|
18 | 18 | try: |
|
19 | 19 | from signal import SIGKILL |
|
20 | 20 | except ImportError: |
@@ -12,19 +12,18 b'' | |||
|
12 | 12 | #----------------------------------------------------------------------------- |
|
13 | 13 | |
|
14 | 14 | |
|
15 | import os | |
|
16 | 15 | import logging |
|
17 | ||
|
16 | import os | |
|
18 | 17 | import uuid |
|
19 | 18 | |
|
20 | 19 | from zmq.eventloop.ioloop import IOLoop |
|
21 | 20 | |
|
22 | 21 | from IPython.config.configurable import Configurable |
|
23 | from IPython.utils.traitlets import Str,Int,Instance, CUnicode, CStr | |
|
24 | 22 | from IPython.utils.importstring import import_item |
|
23 | from IPython.utils.traitlets import Str,Int,Instance, CUnicode, CStr | |
|
25 | 24 | |
|
26 | from IPython.zmq.parallel.entry_point import select_random_ports | |
|
27 | 25 | import IPython.zmq.parallel.streamsession as ss |
|
26 | from IPython.zmq.parallel.entry_point import select_random_ports | |
|
28 | 27 | |
|
29 | 28 | #----------------------------------------------------------------------------- |
|
30 | 29 | # Classes |
@@ -6,8 +6,8 b' and hearts are tracked based on their XREQ identities.' | |||
|
6 | 6 | |
|
7 | 7 | from __future__ import print_function |
|
8 | 8 | import time |
|
9 | import uuid | |
|
10 | 9 | import logging |
|
10 | import uuid | |
|
11 | 11 | |
|
12 | 12 | import zmq |
|
13 | 13 | from zmq.devices import ProcessDevice,ThreadDevice |
@@ -15,10 +15,10 b' and monitors traffic through the various queues.' | |||
|
15 | 15 | #----------------------------------------------------------------------------- |
|
16 | 16 | from __future__ import print_function |
|
17 | 17 | |
|
18 | import logging | |
|
18 | 19 | import sys |
|
19 | from datetime import datetime | |
|
20 | 20 | import time |
|
21 | import logging | |
|
21 | from datetime import datetime | |
|
22 | 22 | |
|
23 | 23 | import zmq |
|
24 | 24 | from zmq.eventloop import ioloop |
@@ -26,14 +26,14 b' from zmq.eventloop.zmqstream import ZMQStream' | |||
|
26 | 26 | |
|
27 | 27 | # internal: |
|
28 | 28 | from IPython.config.configurable import Configurable |
|
29 | from IPython.utils.traitlets import HasTraits, Instance, Int, CStr, Str, Dict, Set, List, Bool | |
|
30 | 29 | from IPython.utils.importstring import import_item |
|
30 | from IPython.utils.traitlets import HasTraits, Instance, Int, CStr, Str, Dict, Set, List, Bool | |
|
31 | 31 | |
|
32 | 32 | from entry_point import select_random_ports |
|
33 | 33 | from factory import RegistrationFactory, LoggingFactory |
|
34 | 34 | |
|
35 | from streamsession import Message, wrap_exception, ISO8601 | |
|
36 | 35 | from heartmonitor import HeartMonitor |
|
36 | from streamsession import Message, wrap_exception, ISO8601 | |
|
37 | 37 | from util import validate_url_container |
|
38 | 38 | |
|
39 | 39 | try: |
@@ -1,6 +1,8 b'' | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | from __future__ import print_function |
|
3 | import sys,os | |
|
3 | ||
|
4 | import os | |
|
5 | import sys | |
|
4 | 6 | import time |
|
5 | 7 | from subprocess import Popen, PIPE |
|
6 | 8 |
@@ -15,12 +15,11 b' The ipcluster application.' | |||
|
15 | 15 | # Imports |
|
16 | 16 | #----------------------------------------------------------------------------- |
|
17 | 17 | |
|
18 |
import |
|
|
18 | import errno | |
|
19 | 19 | import logging |
|
20 | 20 | import os |
|
21 | import re | |
|
21 | 22 | import signal |
|
22 | import logging | |
|
23 | import errno | |
|
24 | 23 | |
|
25 | 24 | import zmq |
|
26 | 25 | from zmq.eventloop import ioloop |
@@ -18,12 +18,11 b' The IPython controller application.' | |||
|
18 | 18 | from __future__ import with_statement |
|
19 | 19 | |
|
20 | 20 | import copy |
|
21 | import sys | |
|
22 | 21 | import os |
|
23 | 22 | import logging |
|
24 | import stat | |
|
25 | 23 | import socket |
|
26 | ||
|
24 | import stat | |
|
25 | import sys | |
|
27 | 26 | import uuid |
|
28 | 27 | |
|
29 | 28 | import zmq |
@@ -15,9 +15,9 b' The IPython engine application' | |||
|
15 | 15 | # Imports |
|
16 | 16 | #----------------------------------------------------------------------------- |
|
17 | 17 | |
|
18 | import json | |
|
18 | 19 | import os |
|
19 | 20 | import sys |
|
20 | import json | |
|
21 | 21 | |
|
22 | 22 | import zmq |
|
23 | 23 | from zmq.eventloop import ioloop |
@@ -15,10 +15,10 b' Facilities for launching IPython processes asynchronously.' | |||
|
15 | 15 | # Imports |
|
16 | 16 | #----------------------------------------------------------------------------- |
|
17 | 17 | |
|
18 | import logging | |
|
18 | 19 | import os |
|
19 | 20 | import re |
|
20 | 21 | import sys |
|
21 | import logging | |
|
22 | 22 | |
|
23 | 23 | from signal import SIGINT, SIGTERM |
|
24 | 24 | try: |
@@ -13,11 +13,12 b'' | |||
|
13 | 13 | #----------------------------------------------------------------------------- |
|
14 | 14 | |
|
15 | 15 | |
|
16 | import sys | |
|
17 | 16 | import logging |
|
17 | import sys | |
|
18 | 18 | |
|
19 | 19 | import zmq |
|
20 | 20 | from zmq.eventloop import ioloop, zmqstream |
|
21 | ||
|
21 | 22 | from IPython.utils.traitlets import Int, Str, Instance, List |
|
22 | 23 | |
|
23 | 24 | from factory import LoggingFactory |
@@ -11,9 +11,11 b' from datetime import datetime' | |||
|
11 | 11 | from pymongo import Connection |
|
12 | 12 | |
|
13 | 13 | from dictdb import BaseDB |
|
14 | #---------------------- | |
|
14 | ||
|
15 | #----------------------------------------------------------------------------- | |
|
15 | 16 | # MongoDB class |
|
16 | #---------------------- | |
|
17 | #----------------------------------------------------------------------------- | |
|
18 | ||
|
17 | 19 | class MongoDB(BaseDB): |
|
18 | 20 | """MongoDB TaskRecord backend.""" |
|
19 | 21 | def __init__(self, session_uuid, *args, **kwargs): |
@@ -22,7 +24,6 b' class MongoDB(BaseDB):' | |||
|
22 | 24 | self._records = self._db['task_records'] |
|
23 | 25 | self._table = {} |
|
24 | 26 | |
|
25 | ||
|
26 | 27 | def add_record(self, msg_id, rec): |
|
27 | 28 | """Add a new Task Record, by msg_id.""" |
|
28 | 29 | # print rec |
@@ -10,11 +10,14 b' Python Scheduler exists.' | |||
|
10 | 10 | #---------------------------------------------------------------------- |
|
11 | 11 | |
|
12 | 12 | from __future__ import print_function |
|
13 | import sys | |
|
13 | ||
|
14 | 14 | import logging |
|
15 | import sys | |
|
16 | ||
|
17 | from datetime import datetime, timedelta | |
|
15 | 18 | from random import randint, random |
|
16 | 19 | from types import FunctionType |
|
17 | from datetime import datetime, timedelta | |
|
20 | ||
|
18 | 21 | try: |
|
19 | 22 | import numpy |
|
20 | 23 | except ImportError: |
@@ -25,13 +28,11 b' from zmq.eventloop import ioloop, zmqstream' | |||
|
25 | 28 | |
|
26 | 29 | # local imports |
|
27 | 30 | from IPython.external.decorator import decorator |
|
28 | # from IPython.config.configurable import Configurable | |
|
29 | 31 | from IPython.utils.traitlets import Instance, Dict, List, Set |
|
30 | 32 | |
|
31 | 33 | import error |
|
32 | # from client import Client | |
|
33 | from dependency import Dependency | |
|
34 | 34 | import streamsession as ss |
|
35 | from dependency import Dependency | |
|
35 | 36 | from entry_point import connect_logger, local_logger |
|
36 | 37 | from factory import SessionFactory |
|
37 | 38 |
@@ -10,15 +10,17 b' Kernel adapted from kernel.py to use ZMQ Streams' | |||
|
10 | 10 | # Standard library imports. |
|
11 | 11 | from __future__ import print_function |
|
12 | 12 | import __builtin__ |
|
13 | from code import CommandCompiler | |
|
13 | ||
|
14 | import logging | |
|
14 | 15 | import os |
|
15 | 16 | import sys |
|
16 | 17 | import time |
|
17 | 18 | import traceback |
|
18 | import logging | |
|
19 | ||
|
20 | from code import CommandCompiler | |
|
19 | 21 | from datetime import datetime |
|
20 | from signal import SIGTERM, SIGKILL | |
|
21 | 22 | from pprint import pprint |
|
23 | from signal import SIGTERM, SIGKILL | |
|
22 | 24 | |
|
23 | 25 | # System library imports. |
|
24 | 26 | import zmq |
@@ -31,11 +33,11 b' from IPython.zmq.completer import KernelCompleter' | |||
|
31 | 33 | from IPython.zmq.iostream import OutStream |
|
32 | 34 | from IPython.zmq.displayhook import DisplayHook |
|
33 | 35 | |
|
36 | import heartmonitor | |
|
37 | from client import Client | |
|
34 | 38 | from factory import SessionFactory |
|
35 | 39 | from streamsession import StreamSession, Message, extract_header, serialize_object,\ |
|
36 | 40 | unpack_apply_message, ISO8601, wrap_exception |
|
37 | import heartmonitor | |
|
38 | from client import Client | |
|
39 | 41 | |
|
40 | 42 | def printer(*args): |
|
41 | 43 | pprint(args, stream=sys.__stdout__) |
@@ -4,12 +4,19 b'' | |||
|
4 | 4 | |
|
5 | 5 | |
|
6 | 6 | import os |
|
7 | import pprint | |
|
7 | 8 | import sys |
|
8 | 9 | import traceback |
|
9 | import pprint | |
|
10 | 10 | import uuid |
|
11 | 11 | from datetime import datetime |
|
12 | 12 | |
|
13 | try: | |
|
14 | import cPickle | |
|
15 | pickle = cPickle | |
|
16 | except: | |
|
17 | cPickle = None | |
|
18 | import pickle | |
|
19 | ||
|
13 | 20 | import zmq |
|
14 | 21 | from zmq.utils import jsonapi |
|
15 | 22 | from zmq.eventloop.zmqstream import ZMQStream |
@@ -19,13 +26,6 b' from IPython.utils.newserialized import serialize, unserialize' | |||
|
19 | 26 | |
|
20 | 27 | from IPython.zmq.parallel.error import RemoteError |
|
21 | 28 | |
|
22 | try: | |
|
23 | import cPickle | |
|
24 | pickle = cPickle | |
|
25 | except: | |
|
26 | cPickle = None | |
|
27 | import pickle | |
|
28 | ||
|
29 | 29 | # packer priority: jsonlib[2], cPickle, simplejson/json, pickle |
|
30 | 30 | json_name = '' if not jsonapi.jsonmod else jsonapi.jsonmod.__name__ |
|
31 | 31 | if json_name in ('jsonlib', 'jsonlib2'): |
General Comments 0
You need to be logged in to leave comments.
Login now