• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..29-Nov-2021-

MakefileH A D29-Nov-20211.7 KiB7859

READMEH A D29-Nov-20213 KiB9363

print_r.luaH A D29-Nov-20211.3 KiB6961

ps_lua.cH A D29-Nov-202112.1 KiB510406

ps_lua.luaH A D29-Nov-2021730 2017

ps_python.cH A D29-Nov-202118.8 KiB801664

ps_python.hH A D29-Nov-20211.8 KiB5330

ps_python.pyH A D29-Nov-2021826 2319

spoa-server.confH A D29-Nov-2021978 3430

spoa-server.spoe.confH A D29-Nov-2021310 1411

spoa.cH A D29-Nov-202131.3 KiB1,3171,006

spoa.hH A D29-Nov-20214.8 KiB165131

README

1Multi script langyage Stream Processing Offload Agent
2-----------------------------------------------------
3
4This agent receive SPOP message and process it with script languages. The
5language register callback with a message. Each callback receive the list
6of arguments with types according with the language capabilities. The
7callback write variables which are sent as response when the processing
8is done.
9
10
11  Prerequirement
12----------------
13
14You have to install the development packages, either from the
15distribution repositories or from the source.
16
17CentOS/RHEL: sudo yum install python3-devel
18
19The current minimal python version compatible with this library is 2.7.
20It's recommended to use python version 3 where possible due to python 2 deprecation.
21
22
23  Compilation
24---------------
25
26The server currently supports Lua and Python. Type "make" with the options:
27USE_LUA=1 and/or USE_PYTHON=1.
28
29You can add LUA_INC=.. LUA_LIB=.. to the make command to set the paths to
30the lua header files and lua libraries.
31
32Similarly, you can add PYTHON_INC=.. PYTHON_LIB=.. to the make command to set the paths to
33the python header files and python libraries.
34By default, it will try to compile by detecting the default python 3 parameters.
35It will fall back to python 2 if python 3 is not available.
36
37  Start the service
38---------------------
39
40After you have compiled it, to start the service, you just need to use "spoa"
41binary:
42
43    $> ./spoa  -h
44    Usage: ./spoa [-h] [-d] [-p <port>] [-n <num-workers>]
45        -h                  Print this message
46        -d                  Enable the debug mode
47        -p <port>           Specify the port to listen on (default: 12345)
48        -n <num-workers>    Specify the number of workers (default: 5)
49        -f <file>           Load script according with the supported languages
50
51The file processor is recognized using the extension. .lua or .luac for lua and
52.py for python. Start example:
53
54    $> ./spoa -d -f ps_lua.lua
55
56	 $> ./spoa -d -f ps_python.py
57
58
59  Configure
60-------------
61
62Sample configuration are join to this server:
63
64  spoa-server.conf      : The HAProxy configuration file using SPOE server
65  spoa-server.spoe.conf : The SPOP description file used by HAProxy
66  ps_lua.lua            : Processing Lua example
67  ps_python.py          : Processing Python example
68
69
70  Considerations
71------------------
72
73This server is a beta version. It works fine, but some improvement will be
74welcome:
75
76Main process:
77
78 * Improve log management: Today the log are sent on stdout.
79 * Improve process management: The dead process are ignored.
80 * Implement systemd integration.
81 * Implement threads: It would be fine to implement thread working. Shared
82   memory is welcome for managing database connection pool and something like
83   that.
84 * Add PHP support and some other languages.
85
86Python:
87
88 * Improve reporting: Catch python error message and report it in the right
89   place. Today the error are dumped on stdout. How using syslog for logging
90   stack traces ?
91
92Maybe some other things...
93