Skip to content

Commit

Permalink
Adds deployment cookbook with a set of examples/instructions
Browse files Browse the repository at this point in the history
It also has a few issues that function as placeholders. We'll want to
centralize this more as we get more tooling in Burr itself.

Note this deletes a few files that were duplicates of READMEs in the
examples.

These:
- https://github.com/DAGWorks-Inc/burr/tree/a1a0b3bcb0f64790615042527c0e173a6c436083/examples/deployment/aws/lambda
- https://github.com/DAGWorks-Inc/burr/tree/main/examples/web-server
  • Loading branch information
elijahbenizzy committed Oct 15, 2024
1 parent a1a0b3b commit a012757
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 334 deletions.
2 changes: 2 additions & 0 deletions docs/contributing/contributing.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _contributing:

============
Contributing
============
Expand Down
Binary file removed docs/examples/deployment/_web-server.png
Binary file not shown.
101 changes: 0 additions & 101 deletions docs/examples/deployment/aws.md

This file was deleted.

9 changes: 0 additions & 9 deletions docs/examples/deployment/index.rst

This file was deleted.

8 changes: 8 additions & 0 deletions docs/examples/deployment/infrastructure.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-------------------------------------
Provisioning Infrastructure/Deploying
-------------------------------------

Burr is not opinionated about the method of deployment/cloud one uses. Any method that can run a python server will work
(AWS, vercel, etc...). Note we aim to have more examples here -- see `this issue <https://github.com/DAGWorks-Inc/burr/issues/390>`_ to track!

- `Deploying Burr in an AWS lambda function <https://github.com/DAGWorks-Inc/burr/tree/main/examples/deployment/aws/lambda>`_
24 changes: 24 additions & 0 deletions docs/examples/deployment/monitoring.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
------------------------
Monitoring in Production
------------------------

Burr's telemetry UI is meant both for debugging and running in production. It can consume `OpenTelemetry traces <https://burr.dagworks.io/reference/integrations/opentelemetry/>`_,
and has a suite of useful capabilities for debugging Burr applications.

It has two (current) implementations:

1. `Local (filesystem) tracking <https://burr.dagworks.io/concepts/tracking/>`_ (default, for debugging or lower-scale production use-cases with a distributed file-system)
2. `S3-based tracking <https://github.com/DAGWorks-Inc/burr/blob/main/burr/tracking/server/s3/README.md>`_ (meant for production use-cases)

Which each come with an implementation of data storage on the server.

To deploy these in production, you can follow the following examples:

1. `Burr + FastAPI + docker <https://github.com/mdrideout/burr-fastapi-docker-compose>`_ by `Matthew Rideout <https://github.com/mdrideout>`_. This contains a sample API + UI + tracking server all bundled in one!
2. `Docker compose + nginx proxy <https://github.com/DAGWorks-Inc/burr/tree/main/examples/email-assistant#running-the-ui-with-email-server-backend-in-a-docker-container>`_ by `Aditha Kaushik <https://github.com/97k>`_ for the email assistant example, demonstrates running the docker image with the tracking server.

We also have a few issues to document deploying Burr's monitoring system in production:

- `deploy on AWS <https://github.com/DAGWorks-Inc/burr/issues/391>`_
- `deploy on GCP <https://github.com/DAGWorks-Inc/burr/issues/392>`_
- `deploy on Azure <https://github.com/DAGWorks-Inc/burr/issues/393>`_
224 changes: 0 additions & 224 deletions docs/examples/deployment/web-server.md

This file was deleted.

22 changes: 22 additions & 0 deletions docs/examples/deployment/web-server.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--------------------
Burr in a web server
--------------------

We largely use `fastAPI <https://fastapi.tiangolo.com/>`_ as our web server, but Burr can work with any python-friendly server framework
(`django <https://www.djangoproject.com>`_, `flask <https://flask.palletsprojects.com/>`_, etc...).

To run Burr in a FastAPI server, see the following examples:

- `Human in the loop FastAPI server <https://github.com/DAGWorks-Inc/burr/tree/main/examples/web-server>`_ (`TDS blog post <https://towardsdatascience.com/building-an-email-assistant-application-with-burr-324bc34c547d>`__ )
- `OpenAI-compatible agent with FastAPI <https://github.com/DAGWorks-Inc/burr/tree/main/examples/openai-compatible-agent>`_
- `Streaming server using SSE + FastAPI <https://github.com/DAGWorks-Inc/burr/tree/main/examples/streaming-fastapi>`_ (`TDS blog post <https://towardsdatascience.com/how-to-build-a-streaming-agent-with-burr-fastapi-and-react-e2459ef527a8>`__ )
- `Use typed state with Pydantic + FastAPI <https://github.com/DAGWorks-Inc/burr/tree/main/examples/typed-state>`_

Connecting to a database
------------------------

To connect Burr to a database, you can use one of the provided persisters, or build your own:

- :ref:`Documentation on persistence <state-persistence>`
- :ref:`Set of available persisters <persistersref>`
- `Simple chatbot intro with persistence to SQLLite <https://github.com/DAGWorks-Inc/burr/blob/main/examples/simple-chatbot-intro/notebook.ipynb>`_

0 comments on commit a012757

Please sign in to comment.