Coder Social home page Coder Social logo

mojolingo / adam.snark.rabbit Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 114.7 MB

Snark is my middle name

Home Page: http://mojolingo.com

License: GNU Affero General Public License v3.0

Ruby 44.61% Shell 0.39% JavaScript 47.04% CoffeeScript 0.03% CSS 0.69% Makefile 0.23% Gherkin 0.38% HTML 6.64%

adam.snark.rabbit's People

Contributors

benlangfeld avatar bklang avatar bryanrite avatar malakada avatar wdrexler avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adam.snark.rabbit's Issues

Brain should have a look-up service

In a large multi-user environment, it's going to be important that a single Brain entity handles all requests for a given user during a session. It may be that the user provides inputs via IM and receives outputs via Audio, or vice versa. As such, we want to keep that state within a single brain. To achieve this at scale, we will need to be able to dynamically start a Brain for a user on any available host when the first request comes in. If the user has an existing session, we should route all messages to the running Brain appropriate for that user.

The implementation of the lookup service can be made very thin. Some ideas:

  • Use DNS to publish the location of the currently running Brain
  • Use a consistent hashing algorithm to determine the correct running node for a Brain (see: Memcached)

Bad messages should not cause brain death

Example message:

[2013-12-14 09:41:22] INFO  Brain: Message was received: #<AdamSignals::Message {:source_type=>:phone, :source_address=>"dcb4f57a-64e6-11e3-9abb-f7c4684a9128", :auth_address=>"[email protected]", :body=>"translate", :user=>nil}>

Causes exception:

[2013-12-14 09:41:22] ERROR App: <NoMethodError> undefined method `[]' for nil:NilClass
    /srv/adam/releases/be810027f6fccf40ca4f7c1304738aba42d05ebe/brain/lib/brain.rb:26:in `handle'

Which in turn causes:

[2013-12-14 09:41:22] FATAL App: AMQP connection failed. Going down.
[2013-12-14 09:41:22] INFO  Adhearsion::Process: Transitioning from booting to stopped with 0 active calls due to stop event.
[2013-12-14 09:41:22] INFO  App: Shutting down while connecting. Breaking the connection block.
[2013-12-14 09:41:22] INFO  Adhearsion::Process: Adhearsion shut down
[2013-12-14 09:41:22] DEBUG Celluloid: Terminating 4 actors...

Circular dependency in build/test/deployment pipeline

adam_cookbook is supposed to be an installer, based on Chef, for Adam Snark Rabbit and his dependencies, either as an all-in-one or selecting individual components. There are several problems with this, and one is a circular dependency.

Adam has two types of dependencies:

  • Internal (Ruby, gem installation, etc)
  • External (XMPP/RabbitMQ/FreeSWITCH/nginx)

Currently the app project uses the cookbook to provision development/testing environments for the following reasons:

  • Local development requires the ability to run the full application in an isolated, provisioned environment and thus requires both internal and external dependencies.
  • The applications' test suites require internal and external dependencies both locally both in CI.

The installer, of course, also relies on the content of the application repository in order to actually install it. This means coordination overhead between the two projects and being circular this is tricky.

Ideally, the close concerns for testing the apps should be contained with the apps themselves, and the apps should be packaged in such a way that they have no internal dependencies that require separate installation, making deployment easier. The external test dependencies should be provided independently from the installer, either composition of sub-projects or as loosely-related resources provided either by the CI system itself or by other means.

AMQP dis/reconnections should be graceful

[2013-12-13 16:24:58] FATAL App: AMQP connection failed. Going down.
[2013-12-13 16:24:58] INFO  Adhearsion::Process: Transitioning from booting to stopped with 0 active calls due to stop event.
[2013-12-13 16:24:58] INFO  App: Shutting down while connecting. Breaking the connection block.
[2013-12-13 16:24:58] INFO  Adhearsion::Process: Adhearsion shut down
[2013-12-13 16:24:58] DEBUG Celluloid: Terminating 4 actors...

BRAIN DEATH!

Brain should speak Rayo natively

As we discussed at the last Convocation, I have some thoughts that the Brain should be a direct Rayo client. For much of the rich interactions we want to do, the Brain will need to be able to execute apps and have fine-grain control over the inputs and outputs to do so. THe job of Ears or Fingers should probably be limited to reading input and output in the native form (XMPP, SIP) and sending the messages to the brain (Rayo). Without this, we end up simply using AMQP as a carrier channel for the Rayo messages anyway.

This also means figuring out how input grammars apply to IM.

We still need AMQP, but mostly so we can easily plug in neurons.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.