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