Advertisement
dfarrell07

quick_preanalytics_dev_demo

Jan 26th, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.01 KB | None | 0 0
  1. [~/preanalytics]$ git status                                                      22:35:29
  2. On branch algo_standalone
  3. nothing to commit, working directory clean
  4. [~/preanalytics]$ cd preanalytics                                                 22:35:44
  5. [~/preanalytics/preanalytics]$ ./start.py                                         22:36:01
  6. usage: start things like the CLI and/or API server [-h] [-s] [-c]
  7.  
  8. optional arguments:
  9.   -h, --help    show this help message and exit
  10.   -s, --server  start algo API server
  11.   -c, --cli     start a CLI for interfacing with the algo API
  12. [~/preanalytics/preanalytics]$ ./start.py -sc                                     22:36:03
  13. Starting server
  14. server.py | __init__ | 46 | INFO | Algo API server initialized
  15. server.py | listen | 50 | INFO | API listening on: tcp://*:42000
  16. Starting CLI
  17. example_client.py | __init__ | 52 | INFO | ExampleClient connected to Server at tcp://127.0.0.1:42000
  18. prea$ help
  19.  
  20. Documented commands (type help <topic>):
  21. ========================================
  22. EOF  die  help  kill  ping  rand  shell
  23.  
  24. prea$ help help
  25. help [command]
  26.     Provide help on given command. If no argument, list commands.
  27. prea$ help ping
  28. ping
  29.     Ping the algo API server.
  30. prea$ help kill
  31. kill
  32.     Ask the server to exit.
  33. prea$ help die
  34. die
  35.     Disconnect from server and close CLI.
  36. prea$ help rand
  37. rand
  38.     Send algo_req-type message to API with random, valid data.
  39. prea$ help shell
  40. !|shell [command]
  41.     Send command to underlying system shell (like Bash).
  42. prea$ help EOF
  43. ctrl+d
  44.     Disconnect from server and close CLI with ctrl+d.
  45. prea$ ping
  46. Server response time: 0.869035720825ms
  47. prea$
  48. Server response time: 1.06811523438ms
  49. prea$
  50. Server response time: 1.1260509491ms
  51. prea$ shell ls
  52. algo          clients      __init__.py   interfaces  logs     server
  53. algo_config.yaml  config.yaml  __init__.pyc  lib     scripts  start.py
  54. prea$ !ls
  55. algo          clients      __init__.py   interfaces  logs     server
  56. algo_config.yaml  config.yaml  __init__.pyc  lib     scripts  start.py
  57. prea$ rand
  58. Sending random data:
  59. {'abused': 5,
  60.  'age': 17,
  61.  'age_first_sexual_experience': 'never',
  62.  'attractiveness': 5,
  63.  'developmental_disability': 2,
  64.  'gang_affil': 2,
  65.  'health_and_grooming': 4,
  66.  'immigration_crime': True,
  67.  'interactions_with_others': 5,
  68.  'marital_status': 'separated',
  69.  'nonconformist': 3,
  70.  'num_aggressive_sex_acts': 2,
  71.  'num_incarcerations': 3,
  72.  'num_other_violent_crimes': 3,
  73.  'num_psych_hospitalizations': 3,
  74.  'num_sex_crimes': 157,
  75.  'perceived_nonheteronormative': 1,
  76.  'physical_disabilities': 3,
  77.  'physique': 2,
  78.  'pretrial': False,
  79.  'race': 'islander',
  80.  'seductive': 3,
  81.  'self_importance': 4,
  82.  'sexual_aggression': 2,
  83.  'sexual_deviance': 5,
  84.  'sexual_pref': 'males_only',
  85.  'sexually_ids_with_children': 2,
  86.  'street_smart': 4,
  87.  'violence_history': 'none',
  88.  'violence_of_charges': 5,
  89.  'voice': 1,
  90.  'vulnerability': 5,
  91.  'years_sentenced': '1_to_4'}
  92. Scores returned from server:
  93. {'rperp': 542.6500000000002, 'rvic': 741.5000000000001}
  94. prea$ kill
  95. example_client.py | exit_server | 73 | INFO | Asking server to exit...
  96. server.py | handle_msg | 87 | INFO | Received message to die. Bye!
  97. prea$ die
  98. Disconnecting...
  99. example_client.py | clean_up | 96 | INFO | Closing ZMQ socket and context...
  100. example_client.py | clean_up | 100 | INFO | ExampleClient disconnected from Server tcp://127.0.0.1:42000
  101. Bye!
  102. [~/preanalytics]$ docker build -t dfarrell07/preanalytics:dev .; docker run -ti dfarrell07/preanalytics:dev tox
  103. Sending build context to Docker daemon   384 kB
  104. Sending build context to Docker daemon
  105. Step 0 : FROM debian:8.0
  106.  ---> 835c4d274060
  107. Step 1 : MAINTAINER Daniel Farrell <dfarrell07@gmail.com>
  108.  ---> Using cache
  109.  ---> ed3edfceb16a
  110. Step 2 : RUN apt-get update && apt-get install -y python-pip                                          libzmq-dev                                          python-zmq                                          python-dev                                          python-yaml                                          python                                          curl
  111.  ---> Using cache
  112.  ---> 12aef978d1c3
  113. Step 3 : RUN curl --silent --insecure -o requirements.txt "https://raw.githubusercontent.com/dfarrell07/PREAnalytics/docker/requirements.txt?token=AA1ukebXjgQAMQdi6VeE7YjbxFFhP-pyks5UyZcXwA%3D%3D" &&     pip install -r requirements.txt &&     rm requirements.txt
  114.  ---> Using cache
  115.  ---> 71dcc39a9dec
  116. Step 4 : ADD . /opt/preanalytics
  117.  ---> 22115c13d6db
  118. Removing intermediate container 7e7829dc0973
  119. Step 5 : WORKDIR /opt/preanalytics
  120.  ---> Running in fddb0456f1e1
  121.  ---> e0b36652e2e5
  122. Removing intermediate container fddb0456f1e1
  123. Successfully built e0b36652e2e5
  124. GLOB sdist-make: /opt/preanalytics/setup.py
  125. py27 create: /opt/preanalytics/.tox/py27
  126. py27 installdeps: -r/opt/preanalytics/requirements.txt
  127. py27 inst: /opt/preanalytics/.tox/dist/preanalytics-0.0.1.zip
  128. py27 runtests: PYTHONHASHSEED='3592427261'
  129. py27 runtests: commands[0] | python setup.py test
  130. [~/preanalytics]$ docker build -t dfarrell07/preanalytics:dev .; docker run -ti dfarrell07/preanalytics:dev tox
  131. Sending build context to Docker daemon   384 kB
  132. Sending build context to Docker daemon
  133. Step 0 : FROM debian:8.0
  134.  ---> 835c4d274060
  135. Step 1 : MAINTAINER Daniel Farrell <dfarrell07@gmail.com>
  136.  ---> Using cache
  137.  ---> ed3edfceb16a
  138. Step 2 : RUN apt-get update && apt-get install -y python-pip                                          libzmq-dev                                          python-zmq                                          python-dev                                          python-yaml                                          python                                          curl
  139.  ---> Using cache
  140.  ---> 12aef978d1c3
  141. Step 3 : RUN curl --silent --insecure -o requirements.txt "https://raw.githubusercontent.com/dfarrell07/PREAnalytics/docker/requirements.txt?token=AA1ukebXjgQAMQdi6VeE7YjbxFFhP-pyks5UyZcXwA%3D%3D" &&     pip install -r requirements.txt &&     rm requirements.txt
  142.  ---> Using cache
  143.  ---> 71dcc39a9dec
  144. Step 4 : ADD . /opt/preanalytics
  145.  ---> 22115c13d6db
  146. Removing intermediate container 7e7829dc0973
  147. Step 5 : WORKDIR /opt/preanalytics
  148.  ---> Running in fddb0456f1e1
  149.  ---> e0b36652e2e5
  150. Removing intermediate container fddb0456f1e1
  151. Successfully built e0b36652e2e5
  152. GLOB sdist-make: /opt/preanalytics/setup.py
  153. py27 create: /opt/preanalytics/.tox/py27
  154. py27 installdeps: -r/opt/preanalytics/requirements.txt
  155. py27 inst: /opt/preanalytics/.tox/dist/preanalytics-0.0.1.zip
  156. py27 runtests: PYTHONHASHSEED='3592427261'
  157. py27 runtests: commands[0] | python setup.py test
  158. <snip many tests>
  159. ok
  160.  
  161. ----------------------------------------------------------------------
  162. Ran 148 tests in 26.704s
  163.  
  164. OK (skipped=2)
  165. pep8 create: /opt/preanalytics/.tox/pep8
  166. pep8 installdeps: flake8
  167. pep8 inst: /opt/preanalytics/.tox/dist/preanalytics-0.0.1.zip
  168. pep8 runtests: PYTHONHASHSEED='3592427261'
  169. pep8 runtests: commands[0] | flake8
  170. ________________________________________ summary _________________________________________
  171.   py27: commands succeeded
  172.   pep8: commands succeeded
  173.   congratulations :)
  174. [~/preanalytics]$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement