Skip to content
Newer
Older
100644 82 lines (59 sloc) 3.46 KB
99babfa [tests] documenting how to run the tests, etc
mvr authored
1 Cortex is a playground for experiments in distributed computing, AI, and language design.
2
e1d59ef [tests] improving docs
matt authored
3 Before you get started:
4 -----------------------
5 A few utilities that (might) be used by cortex. You can also just wait until you need them,
6 but the "bzr" requirements in partciular may prevent you from pip-installing the other
7 requirements.
8
9 $ sudo apt-get install bzr
10 $ sudo apt-get install nmap
11
99babfa [tests] documenting how to run the tests, etc
mvr authored
12 Installing:
e1d59ef [tests] improving docs
matt authored
13 Build venv:
5d65ad1 [master] updating installation instructions
matt authored
14
99babfa [tests] documenting how to run the tests, etc
mvr authored
15 $ virtualenv foo --no-site-packages
16 $ source foo/bin/activate
17
e1d59ef [tests] improving docs
matt authored
18 Install requirements (if pip doesn't work use easy_install for every line in file?)
99babfa [tests] documenting how to run the tests, etc
mvr authored
19 $ pip -E foo install -r cortex/requirements.txt
5d65ad1 [master] updating installation instructions
matt authored
20 $ sudo apt-get install nmap
21 $ sudo apt-get install python-dev
99babfa [tests] documenting how to run the tests, etc
mvr authored
22
23 see if it's installed:
24 $ python -c"import cortex"
25
26 Running tests:
e1d59ef [tests] improving docs
matt authored
27 --------------
28 $ source foo/bin/activate # activate the venv you made in the other step
96725dc better dox
mvr authored
29
30 Now you can choose one of:
31 $ python lib/cortex/tests # from directory with cortex src clone
32 $ python -m "cortex.tests.__main__" # from pre-installed source
cad1405 [gui] docs for channel and subscribers() method that defers to the ex…
mvr authored
33 $ cortex --test --gtk --services=gui # runs tests in terminal, launches gtk shell
99babfa [tests] documenting how to run the tests, etc
mvr authored
34
e1d59ef [tests] improving docs
matt authored
35 Looking around:
36 ---------------
37 One of the services cortex provides offers a system shell. Typing "go" inside
38 your activated virtualenv will invoke it. After the output from the bootup
39 procedure, you'll be dropped into something that looks more or less like a normal
40 ipython shell, but the prompt says something like:
99babfa [tests] documenting how to run the tests, etc
mvr authored
41
42 Universe(<ID>)[:<port>]<hostname> [1]
43
e1d59ef [tests] improving docs
matt authored
44 This terminal is just part of wider "universe", where the universe is everything
45 inside this cortex node. In particular the terminal is a service, of which there
46 are many. Try typing "universe.services":
99babfa [tests] documenting how to run the tests, etc
mvr authored
47
48 ServiceManager(['api', 'terminal', 'postoffice', 'mapper', 'linda'])
49
96725dc better dox
mvr authored
50 You already met the terminal-service. Briefly the purposes of the rest of these are:
51
52 1) The "postoffice" routes messages within the universe.
53
54 2) The "mapper" actively seeks out other cortex instances and can be configured to
55 look on the same machine, or on whatever networks the universe is made aware of.
56
57 3) The "api" service exists to specify communication policies for most things external
58 to the universe-- this includes other nodes but cortex boot-scripts and other things
59 may find it useful as well.
60
61 4) The "linda" service is a tuple-space abstraction; it is backed by the lindypy module.
62
e1d59ef [tests] improving docs
matt authored
63
64 Have you noticed by now red-text occasionally appearing after your cortex-shell
65 prompt? If so, then you have already discovered the event bus. The terminal
66 service consumes messages from this, and any other agent or service may write to
67 it. As mentioned earlier, the postoffice is responsible for routing these messages.
68 A typical message might look like this:
99babfa [tests] documenting how to run the tests, etc
mvr authored
69
70 Events: [(<PostOffice-Service 38814096>,),
71 ("Registered Peer: addr = 127.0.0.1 ...)
72 .... ]
73
e1d59ef [tests] improving docs
matt authored
74 The first part there is just the messenger that last handled the message, the body
75 says that a peer has been registered. Scrutinizing the message further we would find
76 that the message originated with the Mapper service, and that it also contains a
77 dictionary with lots of details about the scan it has finished. The terminal isn't
78 the only system component that has noticed a peer-registration event. Try typing
79 "peers" and interacting with the peer manager:
99babfa [tests] documenting how to run the tests, etc
mvr authored
80
81 PeerManager(['localhost:1337', 'localhost:1338'])
Something went wrong with that request. Please try again.