Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 300 lines (247 sloc) 12.361 kb
ab3d9bb @mmeisinger base service and process, service startup
mmeisinger authored
1 ==================================================
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
2 Ocean Observatories Initiative Cyberinfrastructure
aabfe74 @mmeisinger Included magnet modules into ion.core packages and removed dependency…
mmeisinger authored
3 Integrated Observatory Network (ION)
4 ioncore-python - Capability Container and Core Modules
ab3d9bb @mmeisinger base service and process, service startup
mmeisinger authored
5 ==================================================
db03ff6 @mmeisinger Bootstrap class and core service structure
mmeisinger authored
6
aabfe74 @mmeisinger Included magnet modules into ion.core packages and removed dependency…
mmeisinger authored
7 April 2010 - September 2010 (C) UCSD Regents
ab3d9bb @mmeisinger base service and process, service startup
mmeisinger authored
8
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
9 This project provides a service framework with auxilliary functions for running
ea45e76 @mmeisinger removed rm_pyc.sh in favor of ant target; updated README with depende…
mmeisinger authored
10 architecturally complete versions of all the services of the OOI release 1
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
11 system with their full architectural dependencies in Python.
12 Functionally it provides a data distribution network based on pub-sub messaging
13 as well as instrument integration, with underlying infrastructure services
14 (security, persistence) and provisioning.
b2b045b @mmeisinger README updated with dependencies
mmeisinger authored
15
16 The "core" part of LCAarch provides base classes and a framework for spawnable,
17 message communicating processes, for services with defined names, for
ea45e76 @mmeisinger removed rm_pyc.sh in favor of ant target; updated README with depende…
mmeisinger authored
18 bootstrapping the system, for managing logging and configuration etc. This
19 is an early implementation of the OOI Python Capability Container.
b2b045b @mmeisinger README updated with dependencies
mmeisinger authored
20
ad37c05 @mmeisinger PEP8 compliance
mmeisinger authored
21 For more information, please see:
fa52725 @mmeisinger Added Python version check
mmeisinger authored
22 http://www.oceanobservatories.org/spaces/display/syseng/CIAD+COI+SV+Python+Capability+Container
ab3d9bb @mmeisinger base service and process, service startup
mmeisinger authored
23
b2b045b @mmeisinger README updated with dependencies
mmeisinger authored
24 Get LCAarch with
ab3d9bb @mmeisinger base service and process, service startup
mmeisinger authored
25 ::
26 git clone git@amoeba.ucsd.edu:lcaarch.git
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
27 cd lcaarch
28
29
30 Dependencies
31 ============
32
33 LCAarch is compatible with Python 2.5 and higher, but not Python 3.x
34 This project has several dependencies on libraries and packages. Most of these
35 dependencies are resolved automatically using the provided setup script.
36
37 Step 1: Virtual env
54d0960 @mmeisinger Improved README.txt
mmeisinger authored
38 Create a Python virtual environment using virtualenv. This ensures that all
39 libraries and dependencies are installed separately from the Python
40 system libraries
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
41 ::
42 mkvirtualenv lcaarch
43 workon lcaarch
44
45 Step 2: Core libraries (you can skip this step)
46 Install some core libraries first. Sometimes the automatic installer
47 produces errors, if these libraries are not present beforehand.
48 ::
54d0960 @mmeisinger Improved README.txt
mmeisinger authored
49 easy_install numpy
50 easy_install -U twisted
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
51
52 Step 3: Run the setup script
53 ::
fa52725 @mmeisinger Added Python version check
mmeisinger authored
54 ant install # This is equivalent to python setup.py install
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
55
56 This should download and install all the dependencies and will run for a while.
57 Check the trace output that there are no substantial errors. You are now ready
58 to run.
59
60 Current dependencies include:
aabfe74 @mmeisinger Included magnet modules into ion.core packages and removed dependency…
mmeisinger authored
61 twisted, carrot, numpy, txamqp, msgpack-python, httplib2, pycassa, simplejson,
d6bfb7e Added dependency for gviz_api
David Stuebe authored
62 pydap, pydap.handlers.netcdf, pydap.responses.netcdf, pydap.handlers.nca,
3928f4b @timf Adding dependencies to lcaarch/ion: nimboss, txrabbitmq (both are pac…
timf authored
63 gviz_api.py, nimboss, txrabbitmq
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
64
65 NOTE: As the project evolves and new code is added, dependencies might change.
66 Run the setup script once in a while and when you get errors
67
4715758 @mmeisinger removed test from boostrap, changed datastore for new msg format
mmeisinger authored
68
ab3d9bb @mmeisinger base service and process, service startup
mmeisinger authored
69 Usage
70 =====
4715758 @mmeisinger removed test from boostrap, changed datastore for new msg format
mmeisinger authored
71
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
72 (all subsequent steps assume you are in the lcaarch/ root dir)
d9eb8b7 @mmeisinger package init, ts test
mmeisinger authored
73
aabfe74 @mmeisinger Included magnet modules into ion.core packages and removed dependency…
mmeisinger authored
74 Start empty Python Capability Container shell with:
ab3d9bb @mmeisinger base service and process, service startup
mmeisinger authored
75 ::
fa52725 @mmeisinger Added Python version check
mmeisinger authored
76 bin/start-cc -h amoeba.ucsd.edu
77 bin/start-cc # to run with localhost
54d0960 @mmeisinger Improved README.txt
mmeisinger authored
78 # Alternatively the direct call to twistd developer
79 twistd -n cc -h amoeba.ucsd.edu
80 # To set a sysname, i.e. a "cluster name" for all containers in a cluster
81 twistd -n cc -h amoeba.ucsd.edu -a sysname=mycluster
3a84fde @mmeisinger Bootstrap improvements, procutils, datastore test
mmeisinger authored
82
aabfe74 @mmeisinger Included magnet modules into ion.core packages and removed dependency…
mmeisinger authored
83 (to end a capability container shell, press Ctrl-D Ctrl-C)
e710e44 @mmeisinger CC agent with announcement on identification request; can spawn a pro…
mmeisinger authored
84
3a84fde @mmeisinger Bootstrap improvements, procutils, datastore test
mmeisinger authored
85 Start system by executing within the CC shell:
ab3d9bb @mmeisinger base service and process, service startup
mmeisinger authored
86 ><>
87 from ion.core import bootstrap
88 bootstrap.start()
89
84c4757 @mmeisinger Added simple mock Java integration service for LCA and ant target to …
mmeisinger authored
90 Alternatively (better) from UNIX shell executing a script:
d9eb8b7 @mmeisinger package init, ts test
mmeisinger authored
91 ::
fa52725 @mmeisinger Added Python version check
mmeisinger authored
92 bin/start-cc -h amoeba.ucsd.edu res/scripts/bootstrap.py
93 bin/start-cc -h amoeba.ucsd.edu res/scripts/newcc.py
94 bin/start-cc -h amoeba.ucsd.edu -a nproducers=25 res/scripts/pubsub.py
dcae3c7 Fixed order of consumer names in pubsub script
David Stuebe authored
95
d9eb8b7 @mmeisinger package init, ts test
mmeisinger authored
96
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
97 Testing
98 =======
99
b78736b @mmeisinger changed readme; make sure to update and install latest magnet
mmeisinger authored
100 Run trial test cases (recursively)
d9eb8b7 @mmeisinger package init, ts test
mmeisinger authored
101 ::
e710e44 @mmeisinger CC agent with announcement on identification request; can spawn a pro…
mmeisinger authored
102 trial ion
b78736b @mmeisinger changed readme; make sure to update and install latest magnet
mmeisinger authored
103 trial ion.core
104 trial ion.services.coi.test.test_resource_registry
d9eb8b7 @mmeisinger package init, ts test
mmeisinger authored
105
cad868a @mmeisinger Updated README to correct magnet dependency: now master
mmeisinger authored
106 A good learning example is the HelloService
107 ::
108 trial ion.play.test.test_hello
109
110 Or in the CC shell:
111 ><>
112 from ion.play import hello_service
113 spawn(hello_service)
114 send(1, {'op':'hello','content':'Hello you there!'})
115
116 from ion.play.hello_service import HelloServiceClient
342829f @mmeisinger Local configuration override in ionlocal.config. Unit tests get broke…
mmeisinger authored
117 hc = HelloServiceClient()
cad868a @mmeisinger Updated README to correct magnet dependency: now master
mmeisinger authored
118 hc.hello()
119
ab3d9bb @mmeisinger base service and process, service startup
mmeisinger authored
120
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
121 Build and Packaging using Ant
122 =============================
ab3d9bb @mmeisinger base service and process, service startup
mmeisinger authored
123
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
124 LCAarch provides ANT support (see http://ant.apache.org/).
125 To check that ant is installed properly, run
126 :: ant
ab3d9bb @mmeisinger base service and process, service startup
mmeisinger authored
127
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
128 To clean your working directories, run
129 :: ant clean
7d23793 @mmeisinger Added ant build file; supports clean and start of CC
mmeisinger authored
130
fa52725 @mmeisinger Added Python version check
mmeisinger authored
131 To install all Python dependencies, run
132 :: ant install
133
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
134 To compile all code to see if there are Python compile errors anywhere:
135 :: ant compile
c43dc6c @mmeisinger Readme appended with last changes, OTP functions in base_process
mmeisinger authored
136
137
138 ---------------------------------------------------------------------------
139 Change log:
140 ===========
141
90805ff @mmeisinger Process RPC refactoring and timeout management
mmeisinger authored
142 2010-10-28:
143 - Set RPC default timeout to 15 secs (see ion.config).
144 Use a different secs value in in rpc_send(..., ..., timeout=5)
145
a9c7c0c @mmeisinger Refactoring: Moved BaseProcess and BaseService; changed all dependents
mmeisinger authored
146 2010-10-05:
147 - REFACTORING OF BASE CLASSES CONTINUED
148 - Changed ion.core.base_process.BaseProcess to ion.core.process.process.Process
149 - Changed ion.services.base_service.BaseService to
150 ion.core.process.service_process.ServiceProcess
151 - Modified all dependent classes
152
41492d8 @mmeisinger Receiver refactoring; removed/modified Receiver imports
mmeisinger authored
153 2010-10-04:
154 - MASSIVE REFACTORING IN BASE CLASSES
ccdf027 @mmeisinger Fixed one more test
mmeisinger authored
155 - Refactored the former magnet code into more object oriented style.
6a8d5aa @mmeisinger Added a bit to README.txt
mmeisinger authored
156 - Requires Carrot 0.10.11. Carrot before does not handle all deferred
ccdf027 @mmeisinger Fixed one more test
mmeisinger authored
157 operations correctly.
158 - Refactored the Receiver use. There are now subclasses for Receivers that
159 manage and declare the specific types of AMQP resources, such as worker and
160 fanout. No more declare_messaging necessary.
161 - Refactoried the capability container classes.
41492d8 @mmeisinger Receiver refactoring; removed/modified Receiver imports
mmeisinger authored
162 - Added a FSM based StateObject. Many manager/controller level objects now make
163 use of states. States and operations INIT -> initialize() -> READY ->
6a8d5aa @mmeisinger Added a bit to README.txt
mmeisinger authored
164 activate() -> ACTIVE -> terminate() -> TERMINATED (and more, with errors)
41492d8 @mmeisinger Receiver refactoring; removed/modified Receiver imports
mmeisinger authored
165 - BaseProcess (and subclasses), Receiver, ProcessDesc, Container etc are all
166 BasicLifecyleObjects.
3d99325 @mmeisinger Added a bit to README.txt
mmeisinger authored
167 - BaseProcess now waits to activate the receiver until in ACTIVE state. Before,
168 code can do RPC, but not receive messages on the process id
41492d8 @mmeisinger Receiver refactoring; removed/modified Receiver imports
mmeisinger authored
169 - Massively enhanced the capability container API. Delegated the actual
170 implementation to manager classes: proc, exchange, app manager
3d99325 @mmeisinger Added a bit to README.txt
mmeisinger authored
171 - Refactored the way processes are spawned. Refactored ProcessDesc to use the
6a8d5aa @mmeisinger Added a bit to README.txt
mmeisinger authored
172 new container API. Processes are by default immediately initialized and
173 activated. The op_init message has been eliminated.
174 - Renamed ProtocolFactory to ProcessFactory; changed in each process module
41492d8 @mmeisinger Receiver refactoring; removed/modified Receiver imports
mmeisinger authored
175 - Message headers now contain status code for every message. 'OK is the default
176 and 'ERROR' is set on error
d70646e @mmeisinger Refactored RPC error reply into ReceivedError; fixed code and tests
mmeisinger authored
177 - BaseProcess.rpc_send now raises a ReceivedError in case the RPC comes back
178 with status='ERROR'
41492d8 @mmeisinger Receiver refactoring; removed/modified Receiver imports
mmeisinger authored
179 - Changed reply_ok and reply_err: a dict content value will not be modified
180 - Fixed imports and tests throughout the code base
ccdf027 @mmeisinger Fixed one more test
mmeisinger authored
181 - Added OTP style apps and app files as primary way to start up processes
182 in the container. See res/apps/*.app files and ion.core.pack
41492d8 @mmeisinger Receiver refactoring; removed/modified Receiver imports
mmeisinger authored
183
aabfe74 @mmeisinger Included magnet modules into ion.core packages and removed dependency…
mmeisinger authored
184 2010-09-20:
fa52725 @mmeisinger Added Python version check
mmeisinger authored
185 - Added start scripts in bin/
2ce7fde @mmeisinger Updated README
mmeisinger authored
186 - Use ant install to install Python dependencies (calls python setup.py install)
aabfe74 @mmeisinger Included magnet modules into ion.core packages and removed dependency…
mmeisinger authored
187 - Removed dependency on magnet. Included all relevant magnet code in ion.core
188 packages cc and messaging.
189 Start with: twistd -n cc
190 - Included all CEI services and base classes in code base
191
4a5d195 @mmeisinger Initial container class
mmeisinger authored
192 2010-08-29:
193 - Changed all logging instances for loggers to log, to avoid name clashes.
194
ba80634 @mmeisinger BaseProcess refactoring; added second receiver for backend interactio…
mmeisinger authored
195 2010-08-14:
196 - BaseProcess: added backend receiver, used for sending out any messages
197 from self.send and self.rpc_send. This keeps the message queue for the process
198 frontend separate from the process backend, e.g. for RPC during a message
199 processing.
200 - Changed BaseProcess logging to make message send and receive easier to spot.
201
911af58 @mmeisinger Fixed BaseProcess: states, message dispatching, error handling
mmeisinger authored
202 2010-08-06:
203 - BaseProcess.spawn() now calls init() automatically. No need to call init()
204 on a process anymore manually. For testing only. Note: The correct way to
205 spawn a process is through a parent process with spawn_child()
206 - Modified and fixed the BaseProcess states, when receiving messages
207 - MAJOR update to BaseProcess message dispatching and subsequent error handling.
208 On error, reply_err messages are sent back, if reply-to header set.
209
7d23793 @mmeisinger Added ant build file; supports clean and start of CC
mmeisinger authored
210 2010-08-03:
211 - Added ant build.xml file to LCAarch root dir. Start with ant.
212 Supports ant clean, which removes all *.pyc from ion path.
213
b93d956 Fixing trial errors and adding comments
David Stuebe authored
214 2010-07-23:
215 - Refactored the Registry Services to inherit from a common base class. This
216 will allow easier implementation of the many registries in the OOICI. The
217 Resource Registry and Service Registry now have basic registration of resource
218 descriptions and services.
219 - The Ion message is now encoded usig the MsgPack library to allow for binary
220 transport of message content. The JSON library was mangleing string content.
221 This is a temporary fix for a wider problem with the encoding structure which
222 needs to be addressed in construction.
223
dfe8bf2 @mmeisinger fixed problems with logging change; added log level configuration bas…
mmeisinger authored
224 2010-06-07:
225 - Redefined logging import to set as module level logger. Each module has now
226 a different logger that can be configured separately. Don't configure
227 manually though.
228 - Added possibility to modify logging levels by module/package, with support
229 for package hierarchy. See res/logging/loglevels.cfg for standard entries.
230 Do not modify. Add file res/logging/loglevelslocal.cfg for local override.
08d0190 @mmeisinger fixed some errors related to logging changes
mmeisinger authored
231 Default logging level for all ion code: WARNING
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
232
f92eeba @mmeisinger Added process shutdown support to BaseProcess; refactored BaseProcess…
mmeisinger authored
233 2010-06-02:
234 - BaseProcess self members renamed to conform to PEP8
235 - Added process shutdown to BaseProcess
982030b @mmeisinger Refactoring in BaseProcess to support an onspawn hook
mmeisinger authored
236 - Added container UNIX shell argument -a processes=<path to filename> used
237 by newcc.py script, with a list of processes to startup in standard format
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
238
3f881c9 @mmeisinger Changed IStore delete to remove; parameterizable cassandra backend
mmeisinger authored
239 2010-05-25:
240 - Made Cassandra backend parameterizable with keyspace/colfamily and added
241 SuperColumn support.
f2ff6a5 @mmeisinger Refactored IStore interface and modified backends, object store, coi …
mmeisinger authored
242 - Modified the IStore interface to support a create_store factory method. This
243 method can yield and return a deferred. Modified and fixed IStore impls.
3f881c9 @mmeisinger Changed IStore delete to remove; parameterizable cassandra backend
mmeisinger authored
244 Changed delete to remove to be more compliant with standard collections.
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
245
241d1d0 @mmeisinger BaseProcess.reply_ok and reply_err added and service operations chang…
mmeisinger authored
246 2010-05-22:
247 - Added timeout to BaseProcess.rpc_send. Use with kwarg timeout=<secs>
248 - CC-Agent detects missing known containers and removes them from the list
249 - Enhanced CC-Agent operations and CC shell helpers
250 - Added sequence numbers for messages
251 - Added glue functions BaseProcess.reply_ok and reply_err and changes some
252 RPC style service operations.
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
253
342829f @mmeisinger Local configuration override in ionlocal.config. Unit tests get broke…
mmeisinger authored
254 2010-05-20:
255 - The system now looks for a local config file ionlocal.config and if exists,
256 overrides entries in ion.config.
257 - Test cases use the config file to determine the broker host to use. If local
70573b4 @mmeisinger added BaseProcessClient and changed all BaseServiceClient subclasses …
mmeisinger authored
258 config override exists, a different broker (e.g. localhost) can be given.
259 - Added BaseProcessClient and changed BaseServiceClient and all clients and
260 all test cases (again).
3827a32 @mmeisinger shell helper functions
mmeisinger authored
261 - Added container shell helpers under 'cc', such as cc.spawn('hello')
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
262
e710e44 @mmeisinger CC agent with announcement on identification request; can spawn a pro…
mmeisinger authored
263 2010-05-16:
264 - Removed support for BaseProcess.send_message and reply_message. Always use
265 send, reply and rpc_send now.
266 - Any BaseProcess instance can now spawn_child() other processes.
267 - Removed RpcClient class, because every process can do rpc_send()
268 - Service processes now also listen to their service name's queue. The service
269 name is determined from the service declaration. Two processes will listen
270 to the same queue and take messages round robin from the queue.
271 - Startup arguments evaluated, for instance to start with system name set:
272 twistd -n magnet -a sysname=mysys
273 twistd -n magnet -a "{'sysname':'mysys'}"
274 - Added capability container agent process. Start with:
275 twistd -n magnet res/scripts/newcc.py
276 Agents announce themselves to others in the same system and can spawn procs.
277 - Name scope 'local' for messaging names means now really local to one container.
278 Use scope 'system' for names unique for each bootstrapped system. Do not use
279 global names, because they will clash.
280 - Less verbose trace output for process init messages and changes to other
281 trace output as well.
bc50a38 @mmeisinger Changed BaseServiceClient __init__ args and all client impls; takes n…
mmeisinger authored
282 - Changed BaseServiceClient and tests. Initializer arguments different.
cad868a @mmeisinger Updated README to correct magnet dependency: now master
mmeisinger authored
283 - Using master branch of magnet now
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
284
7a9f54a @mmeisinger python 2.5 compatibility: changed .format to % and json import
mmeisinger authored
285 2010-05-10:
286 - Based on entries in config files, service process modules are sought and
287 loaded in order to collect the service process declarations. This enables
288 a registration of services with versions and dependencies on startup
07a06bb @mmeisinger Revised README file to reflect automatic setup and ant build
mmeisinger authored
289
c43dc6c @mmeisinger Readme appended with last changes, OTP functions in base_process
mmeisinger authored
290 2010-05-06:
291 - Refactored the BaseProcess class.
292 - You can now do RPC directly from the process, via self.rpc_send without
5ea10a7 @mmeisinger made IonTestCase and all tests PEP8 compliant
mmeisinger authored
293 the need for an RpcClient. Works even with other messages coming in at the
294 same time (using the conv-id)
c43dc6c @mmeisinger Readme appended with last changes, OTP functions in base_process
mmeisinger authored
295 - Added aliases: self.send, self.reply (use these now)
296 - Process instance can be spawned via self.spawn()
297 - Provided an easier to use BaseServiceClient, which uses a default service
298 name lookup. Accepts BaseProcess instance as argument to use for sending/
299 receiving service calls.
Something went wrong with that request. Please try again.