diff --git a/.rbtrc b/.rbtrc index e98a2f5..52a55e7 100644 --- a/.rbtrc +++ b/.rbtrc @@ -19,3 +19,23 @@ dev run --application=backend/src/main.py # When expunging, expunge that state we've saved. dev expunge --name=chat + +# Set the application name for commands that require it. +cloud up --name=chat +cloud down --name=chat +serve run --name=chat + +# Tell `rbt serve` that this is a Python application. +serve run --python + +# The number of partitions of our data to create. Each partition runs as a +# separate process, and so increasing the partition count requires more +# cores but also allows the application to use more cores. +serve run --partitions=4 + +# Leave TLS termination to the external load balancer; expose a non-SSL port to +# that loadbalancer. +serve run --tls=external + +# Run the application! +serve run --application=backend/src/main.py \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4379c05 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM ghcr.io/reboot-dev/reboot-base:0.33.0 + +WORKDIR /app + +# First ONLY copy and install the requirements, so that changes outside +# `requirements.txt` don't force a re-install of all dependencies. +COPY requirements.lock requirements.txt +RUN pip install -r requirements.txt + +# Next, copy the API definition and generate Reboot code. This step is also +# separate so it is only repeated if the `api/` code changes. +COPY api/ api/ +COPY .rbtrc .rbtrc + +# Run the Reboot code generators. We did copy all of `api/`, possibly +# including generated code, but it's not certain that `rbt generate` was run in +# that folder before this build was started. +RUN rbt generate + +# Now copy the rest of the source code. +COPY backend/ backend/ + +CMD ["rbt", "serve", "run"] diff --git a/requirements.lock b/requirements.lock new file mode 100644 index 0000000..b168ca6 --- /dev/null +++ b/requirements.lock @@ -0,0 +1,303 @@ +# This file was autogenerated by uv via the following command: +# uv pip compile pyproject.toml -o requirements.lock +aiofiles==23.2.1 + # via reboot +aiohappyeyeballs==2.6.1 + # via aiohttp +aiohttp==3.10.5 + # via + # kubernetes-asyncio + # reboot +aiosignal==1.4.0 + # via aiohttp +annotated-types==0.7.0 + # via pydantic +anthropic==0.63.0 + # via langchain-anthropic +anyio==4.10.0 + # via + # anthropic + # httpx + # starlette +async-timeout==4.0.3 + # via + # aiohttp + # langchain +attrs==25.3.0 + # via aiohttp +certifi==2025.8.3 + # via + # httpcore + # httpx + # kubernetes-asyncio + # requests +cffi==1.17.1 + # via + # cryptography + # reboot +charset-normalizer==3.4.3 + # via requests +click==8.2.1 + # via uvicorn +colorama==0.4.6 + # via reboot +cryptography==44.0.0 + # via reboot +deprecated==1.2.18 + # via + # opentelemetry-api + # opentelemetry-exporter-otlp-proto-grpc + # opentelemetry-semantic-conventions +distro==1.9.0 + # via anthropic +exceptiongroup==1.3.0 + # via anyio +fastapi==0.115.12 + # via reboot +frozenlist==1.7.0 + # via + # aiohttp + # aiosignal +googleapis-common-protos==1.65.0 + # via + # grpcio-status + # opentelemetry-exporter-otlp-proto-grpc + # reboot +greenlet==3.2.4 + # via sqlalchemy +grpc-interceptor==0.15.4 + # via reboot +grpcio==1.64.3 + # via + # grpc-interceptor + # grpcio-health-checking + # grpcio-reflection + # grpcio-status + # grpcio-tools + # opentelemetry-exporter-otlp-proto-grpc + # reboot +grpcio-health-checking==1.64.3 + # via reboot +grpcio-reflection==1.64.3 + # via reboot +grpcio-status==1.64.3 + # via reboot +grpcio-tools==1.64.3 + # via reboot +h11==0.16.0 + # via + # httpcore + # uvicorn +httpcore==1.0.9 + # via httpx +httpx==0.28.1 + # via + # anthropic + # langsmith +idna==3.10 + # via + # anyio + # httpx + # requests + # yarl +importlib-metadata==8.5.0 + # via opentelemetry-api +jinja2==3.1.2 + # via + # jinja2-strcase + # reboot +jinja2-strcase==0.0.2 + # via reboot +jiter==0.10.0 + # via anthropic +jsonpatch==1.33 + # via langchain-core +jsonpointer==3.0.0 + # via jsonpatch +kubernetes-asyncio==31.1.0 + # via reboot +langchain==0.3.27 + # via kcdc-2025 (pyproject.toml) +langchain-anthropic==0.3.18 + # via kcdc-2025 (pyproject.toml) +langchain-core==0.3.74 + # via + # langchain + # langchain-anthropic + # langchain-text-splitters +langchain-text-splitters==0.3.9 + # via langchain +langsmith==0.4.14 + # via + # langchain + # langchain-core +markupsafe==3.0.2 + # via jinja2 +multidict==6.6.4 + # via + # aiohttp + # yarl +mypy==1.2.0 + # via kcdc-2025 (pyproject.toml) +mypy-extensions==1.1.0 + # via mypy +mypy-protobuf==3.5.0 + # via reboot +opentelemetry-api==1.28.1 + # via + # opentelemetry-exporter-otlp-proto-grpc + # opentelemetry-instrumentation + # opentelemetry-instrumentation-grpc + # opentelemetry-sdk + # opentelemetry-semantic-conventions + # reboot +opentelemetry-exporter-otlp-proto-common==1.28.1 + # via opentelemetry-exporter-otlp-proto-grpc +opentelemetry-exporter-otlp-proto-grpc==1.28.1 + # via reboot +opentelemetry-instrumentation==0.49b1 + # via opentelemetry-instrumentation-grpc +opentelemetry-instrumentation-grpc==0.49b1 + # via reboot +opentelemetry-proto==1.28.1 + # via + # opentelemetry-exporter-otlp-proto-common + # opentelemetry-exporter-otlp-proto-grpc +opentelemetry-sdk==1.28.1 + # via + # opentelemetry-exporter-otlp-proto-grpc + # reboot +opentelemetry-semantic-conventions==0.49b1 + # via + # opentelemetry-instrumentation + # opentelemetry-instrumentation-grpc + # opentelemetry-sdk +orjson==3.11.2 + # via langsmith +packaging==25.0 + # via + # langchain-core + # langsmith + # opentelemetry-instrumentation + # reboot +pathspec==0.12.1 + # via reboot +propcache==0.3.2 + # via yarl +protobuf==5.28.3 + # via + # googleapis-common-protos + # grpcio-health-checking + # grpcio-reflection + # grpcio-status + # grpcio-tools + # mypy-protobuf + # opentelemetry-proto + # reboot +psutil==6.0.0 + # via reboot +pycparser==2.22 + # via cffi +pydantic==2.11.7 + # via + # anthropic + # fastapi + # langchain + # langchain-anthropic + # langchain-core + # langsmith + # reboot +pydantic-core==2.33.2 + # via pydantic +pyjwt==2.8.0 + # via reboot +pyprctl==0.1.3 + # via reboot +python-dateutil==2.9.0.post0 + # via kubernetes-asyncio +pyyaml==6.0.2 + # via + # kubernetes-asyncio + # langchain + # langchain-core + # reboot +reboot==0.33.0 + # via kcdc-2025 (pyproject.toml) +requests==2.32.4 + # via + # langchain + # langsmith + # requests-toolbelt +requests-toolbelt==1.0.0 + # via langsmith +setuptools==80.9.0 + # via grpcio-tools +six==1.17.0 + # via + # kubernetes-asyncio + # python-dateutil +sniffio==1.3.1 + # via + # anthropic + # anyio +sortedcontainers==2.4.0 + # via reboot +sqlalchemy==2.0.43 + # via langchain +starlette==0.46.2 + # via fastapi +tabulate==0.9.0 + # via reboot +tenacity==9.1.2 + # via langchain-core +tomli==2.2.1 + # via mypy +types-protobuf==6.30.2.20250809 + # via + # kcdc-2025 (pyproject.toml) + # mypy-protobuf +typing-extensions==4.14.1 + # via + # aiosignal + # anthropic + # anyio + # exceptiongroup + # fastapi + # langchain-core + # multidict + # mypy + # opentelemetry-sdk + # pydantic + # pydantic-core + # reboot + # sqlalchemy + # typing-inspection + # uvicorn +typing-inspection==0.4.1 + # via pydantic +tzlocal==5.3 + # via reboot +urllib3==1.26.15 + # via + # kubernetes-asyncio + # reboot + # requests +uuid7-standard==1.1.0 + # via reboot +uvicorn==0.34.0 + # via reboot +watchdog==6.0.0 + # via reboot +websockets==13.1 + # via reboot +wrapt==1.17.3 + # via + # deprecated + # opentelemetry-instrumentation + # opentelemetry-instrumentation-grpc +yarl==1.20.1 + # via aiohttp +zipp==3.23.0 + # via importlib-metadata +zstandard==0.23.0 + # via langsmith