Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kalaspuff/tomodachi
Browse files Browse the repository at this point in the history
  • Loading branch information
kalaspuff committed May 18, 2018
2 parents d646118 + 6b107f6 commit 7ee79de
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,17 @@ Run the service 😎
.. code:: bash
  # cli alias is set up if installed via pip
  local ~/src/service$ tomodachi run service.py
  local ~/code/service$ tomodachi run service.py
# example if cloned from repo
local ~/src/tomodachi$ python tomodachi.py run example/http_service.py
local ~/code/tomodachi$ python tomodachi.py run example/http_simple_service.py
*Defaults to output information on stdout.*

.. code:: console
.. code:: bash
  $ tomodachi run service.py
  local ~/code/service$ tomodachi run service.py
tomodachi/X.X.XX
October 02, 2017 - 13:38:00,481516
Expand All @@ -146,9 +146,9 @@ Run the service 😎
*HTTP service acts like a normal web server.*

.. code:: console
.. code:: bash
$ curl -v "http://127.0.0.1:9700/resource/1234"
local ~$ curl -v "http://127.0.0.1:9700/resource/1234"
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=utf-8
Expand Down Expand Up @@ -207,22 +207,22 @@ for the microservice, ``service.py``.
*Building and running the container, forwarding host's port 31337 to port 80.*

.. code:: console
.. code:: bash
  $ docker build . -t tomodachi-microservice
  local ~/code/service$ docker build . -t tomodachi-microservice
.. code:: console
.. code:: bash
  $ docker run -ti -p 31337:80 tomodachi-microservice
  local ~/code/service$ docker run -ti -p 31337:80 tomodachi-microservice
2017-10-02 13:38:01,234 (services.service): Initializing service "example" [id: <uuid>]
2017-10-02 13:38:01,248 (transport.http): Listening [http] on http://127.0.0.1:8080/
2017-10-02 13:38:01,248 (services.service): Started service "example" [id: <uuid>]
*Making requests to the running container.*

.. code:: console
.. code:: bash
$ curl http://127.0.0.1:31337/
local ~$ curl http://127.0.0.1:31337/
friends forever!
Expand Down Expand Up @@ -254,22 +254,30 @@ Offered under the `MIT license <https://github.com/kalaspuff/tomodachi/blob/mast

Source code 🦄
--------------
The latest developer version of tomodachi is available at the GitHub repo https://github.com/kalaspuff/tomodachi
The latest developer version of ``tomodachi`` is available at the GitHub repo https://github.com/kalaspuff/tomodachi


Any questions?
==============
What is the best way to run a ``tomodachi`` service?
There is no way to tell you how to orchestrate your infrastructure. Some people may run it containerized in a Docker environment, deployed via Terraform / Nomad / Kubernetes and some may run several services on the same environment, on the same machine. There may be best practices but theres no way telling you how to orchestrate your application environment.

Personally I would currently go for a Dockerized environment with nginx proxy in front of the service to handle all the weirdness of the web, TLS, black magic and improved upgrades for WebSockets. Take a look at my `kalaspuff/docker-python-nginx-proxy <https://github.com/kalaspuff/docker-python-nginx-proxy>`_ base-image to get your code up and running in minutes.

Are there any more example services?
There are a few examples in the `examples <https://github.com/kalaspuff/tomodachi/blob/master/examples>`_ folder, including examples to publish events/messages to an AWS SNS topic and subscribe to an AWS SQS queue. There's also a similar example of how to work with pub-sub for RabbitMQ via AMQP transport protocol.

Why should I use this?
``tomodachi`` is a perfect place to start when experimenting with your architecture or trying out a concept for a new service. It may not have all the features you desire and it may never do, but I believe it's great for bootstrapping microservices in async Python.

Should I run this in production?
The library is proviedd as is and update schedules are unregular. It's all still highly experimental and it depends on other experimental projects, so you have to be in charge here and decide for yourself. Let me know if you do however!
Yes? No? There are some projects that already have live versions in production. The library is provided as is with an unregular release schedule. It's all still highly experimental and it depends on other experimental projects, so you have to be in charge here and decide for yourself. Let me know if you do however!

Another good idea is to drop in Sentry or other exception debugging solutions for when invoked functions raises unhandled exceptions.

Who built this and why?
My name is **Carl Oscar Aaro** and I'm a coder from Sweden. I simply wanted to learn more about asyncio and needed a constructive off-work project to experiment with – and here we are. 🎉
My name is **Carl Oscar Aaro** [`@kalaspuff <https://github.com/kalaspuff>`_] and I'm a coder from Sweden. I simply wanted to learn more about asyncio and needed a constructive off-work project to experiment with – and here we are. Nowadays I use ``tomodachi`` as a base for many smaller projects where I just want to be able to focus on the application itself, while still having the power of building distributed systems. 🎉


* https://github.com/kalaspuff
* https://www.linkedin.com/in/carloscaraaro/

0 comments on commit 7ee79de

Please sign in to comment.