Squarebot
Squarebot is the nexus service for ChatOps and event-driven bots for Rubin Observatory. As a Slack app, Squarebot receives events from Slack and publishes them into specific Square Events Kafka topics in the Roundtable Kubernetes cluster. Other applications on Roundtable can consume these events and act on them, such as by posting messages back to Slack or by performing some other background automation.
flowchart LR
subgraph Slack
message[Slack message]
interaction[Slack interaction]
end
subgraph sqrbot ["Squarebot"]
eventapi["/slack/event"]
interactionapi["/slack/interaction"]
message -->|HTTP POST| eventapi
interaction -->|HTTP POST| interactionapi
end
subgraph kafka ["Kafka Topics"]
topicmention["lsst.square-events.squarebot.slack.app.mention"]
topicchannel["lsst.square-events.squarebot.slack.message.channel"]
topicgroup["lsst.square-events.squarebot.slack.message.group"]
topicim["lsst.square-events.squarebot.slack.message.im"]
topicmpim["lsst.square-events.squarebot.slack.message.mpim"]
topicinteraction["lsst.square-events.squarebot.slack.interaction"]
end
eventapi --> topicmention
eventapi --> topicchannel
eventapi --> topicgroup
eventapi --> topicim
eventapi --> topicmpim
interactionapi --> topicinteraction
subgraph backends ["Backends"]
backend1["Backend 1"]
backend2["Backend 2"]
end
topicchannel --> backend1
topicgroup --> backend1
topicmention --> backend2
topicinteraction --> backend2
Slack integration is implemented at the time. We plan to add support for other event sources, such as GitHub, in the future.
Squarebot is built on top of FastAPI, a modern Python web framework, with the Rubin/SQuaRE Safir library. Squarebot uses FastStream to publish messages to Kafka with the aiokafka library.
Development set up
Squarebot uses Python 3.12 or later.
You'll need nox to run the development environment:
pip install nox
Then you can set up a virtual environment with the development dependencies:
nox -s venv-init`
(If you already have a virtual environment, you can activate it and run nox -s init instead).
The tests require a local Kafka broker. If you have Docker, you can deploy a Kafka broker with Docker Compose:
docker-compose -f kafka-compose.yaml up
To run all linters, type checking, and tests, run:
nox
While developing and running tests, you can inspect messages produced to Kafka with Kafdrop at http://localhost:9000.
You can run individual sessions with nox -s <session-name>.
See nox -l for a list of available sessions.
To tear down the Kafka broker, run:
docker-compose -f kafka-compose.yaml down
Metadata
Release files for rubin-squarebot 0.10.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rubin_squarebot-0.10.6.tar.gz | 13.8 kB | Without provenance | Details for rubin_squarebot-0.10.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rubin_squarebot-0.10.6-py3-none-any.whl | Python 3 | none | any | Details for rubin_squarebot-0.10.6-py3-none-any.whl |
Total release size: 24.0 kB
Release files / rubin_squarebot-0.10.6.tar.gz
| Download URL | rubin_squarebot-0.10.6.tar.gz |
|---|---|
| Size | 13.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
36b3496cacc273baedc78461407350ae69efd931e048a65c7a5b9ae931de7d29
|
|
BLAKE2b-256 checksum How to use checksums |
a51154a7f8012122d249dc91bd4be306b6620196a897e41fb4e6c7373546da60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / rubin_squarebot-0.10.6-py3-none-any.whl
| Download URL | rubin_squarebot-0.10.6-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
471c21dd6d238ac92ad702e93fcd3e56747cf31a8e556a974f9e34038781ced4
|
|
BLAKE2b-256 checksum How to use checksums |
09590919a38afeee71624846f90225de130579bb61c8b23f1ce46325fedfd647
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for rubin-squarebot 0.10.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.