rubin-squarebot


Namerubin-squarebot JSON
Version 0.8.0 PyPI version JSON
download
home_page
SummaryClient library for the Rubin Observatory Squarebot
upload_time2024-02-28 21:36:04
maintainer
docs_urlNone
author
requires_python>=3.11
licenseThe MIT License (MIT) Copyright (c) 2018-2023 Association of Universities for Research in Astronomy, Inc. (AURA) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords rubin lsst
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://phalanx.lsst.io/environments/roundtable-prod/index.html).
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.

```mermaid
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](https://fastapi.tiangolo.com/), a modern Python web framework, with the Rubin/SQuaRE [Safir](https://safir.lsst.io) library.
Squarebot uses [FastStream](https://faststream.airt.ai/latest/) to publish messages to Kafka with the [aiokafka](https://aiokafka.readthedocs.io/en/stable/) library.

## Development set up

Squarebot uses Python 3.12 or later.

You'll need [nox](https://nox.thea.codes/en/stable/) to run the development environment:

```bash
pip install nox
```

Then you can set up a virtual environment with the development dependencies:

```bash
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:

```bash
docker-compose -f kafka-compose.yaml up
```

To run all linters, type checking, and tests, run:

```bash
nox
```

While developing and running tests, you can inspect messages produced to Kafka with Kafdrop at [http://localhost:9000](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:

```bash
docker-compose -f kafka-compose.yaml down
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "rubin-squarebot",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "",
    "keywords": "rubin,lsst",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/4b/9a/b7df52b99d037b6e976a2fb0c8d309f18bc870c536fdc099a746437734e1/rubin-squarebot-0.8.0.tar.gz",
    "platform": null,
    "description": "# Squarebot\n\nSquarebot is the nexus service for ChatOps and event-driven bots for Rubin Observatory.\nAs a Slack app, Squarebot receives events from Slack and publishes them into specific _Square Events_ Kafka topics in the [Roundtable Kubernetes cluster](https://phalanx.lsst.io/environments/roundtable-prod/index.html).\nOther 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.\n\n```mermaid\nflowchart LR\n    subgraph Slack\n    message[Slack message]\n    interaction[Slack interaction]\n    end\n    subgraph sqrbot [\"Squarebot\"]\n    eventapi[\"/slack/event\"]\n    interactionapi[\"/slack/interaction\"]\n    message -->|HTTP POST| eventapi\n    interaction -->|HTTP POST| interactionapi\n    end\n    subgraph kafka [\"Kafka Topics\"]\n    topicmention[\"lsst.square-events.squarebot.slack.app.mention\"]\n    topicchannel[\"lsst.square-events.squarebot.slack.message.channel\"]\n    topicgroup[\"lsst.square-events.squarebot.slack.message.group\"]\n    topicim[\"lsst.square-events.squarebot.slack.message.im\"]\n    topicmpim[\"lsst.square-events.squarebot.slack.message.mpim\"]\n    topicinteraction[\"lsst.square-events.squarebot.slack.interaction\"]\n    end\n    eventapi --> topicmention\n    eventapi --> topicchannel\n    eventapi --> topicgroup\n    eventapi --> topicim\n    eventapi --> topicmpim\n    interactionapi --> topicinteraction\n    subgraph backends [\"Backends\"]\n    backend1[\"Backend 1\"]\n    backend2[\"Backend 2\"]\n    end\n    topicchannel --> backend1\n    topicgroup --> backend1\n    topicmention --> backend2\n    topicinteraction --> backend2\n```\n\nSlack integration is implemented at the time.\nWe plan to add support for other event sources, such as GitHub, in the future.\n\nSquarebot is built on top of [FastAPI](https://fastapi.tiangolo.com/), a modern Python web framework, with the Rubin/SQuaRE [Safir](https://safir.lsst.io) library.\nSquarebot uses [FastStream](https://faststream.airt.ai/latest/) to publish messages to Kafka with the [aiokafka](https://aiokafka.readthedocs.io/en/stable/) library.\n\n## Development set up\n\nSquarebot uses Python 3.12 or later.\n\nYou'll need [nox](https://nox.thea.codes/en/stable/) to run the development environment:\n\n```bash\npip install nox\n```\n\nThen you can set up a virtual environment with the development dependencies:\n\n```bash\nnox -s venv-init`\n```\n\n(If you already have a virtual environment, you can activate it and run `nox -s init` instead).\n\nThe tests require a local Kafka broker.\nIf you have Docker, you can deploy a Kafka broker with Docker Compose:\n\n```bash\ndocker-compose -f kafka-compose.yaml up\n```\n\nTo run all linters, type checking, and tests, run:\n\n```bash\nnox\n```\n\nWhile developing and running tests, you can inspect messages produced to Kafka with Kafdrop at [http://localhost:9000](http://localhost:9000).\n\nYou can run individual sessions with `nox -s <session-name>`.\nSee `nox -l` for a list of available sessions.\n\nTo tear down the Kafka broker, run:\n\n```bash\ndocker-compose -f kafka-compose.yaml down\n```\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)  Copyright (c) 2018-2023 Association of Universities for Research in Astronomy, Inc. (AURA)  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Client library for the Rubin Observatory Squarebot",
    "version": "0.8.0",
    "project_urls": {
        "Homepage": "https://github.com/lsst-sqre/squarebot",
        "Source": "https://github.com/lsst-sqre/squarebot"
    },
    "split_keywords": [
        "rubin",
        "lsst"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "89e5235f42298eb529ba5dc6d9ea55a6568dbbfd35aded4736715f9f9c8c8df5",
                "md5": "b4ef3f26eb0a89f047cdefa890bbaa79",
                "sha256": "a8a671cc8cb6eb59af923bd42eb2dd0bbb145f6b7aaf9c27f9fa554fee28299c"
            },
            "downloads": -1,
            "filename": "rubin_squarebot-0.8.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b4ef3f26eb0a89f047cdefa890bbaa79",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 7762,
            "upload_time": "2024-02-28T21:35:57",
            "upload_time_iso_8601": "2024-02-28T21:35:57.928834Z",
            "url": "https://files.pythonhosted.org/packages/89/e5/235f42298eb529ba5dc6d9ea55a6568dbbfd35aded4736715f9f9c8c8df5/rubin_squarebot-0.8.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4b9ab7df52b99d037b6e976a2fb0c8d309f18bc870c536fdc099a746437734e1",
                "md5": "b2e6be16dab5d95ffc1542648d1caddd",
                "sha256": "c05de27b886d47324bf258f5db4876312bebea09bcdf17b795387017ab1bd1a4"
            },
            "downloads": -1,
            "filename": "rubin-squarebot-0.8.0.tar.gz",
            "has_sig": false,
            "md5_digest": "b2e6be16dab5d95ffc1542648d1caddd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 8966,
            "upload_time": "2024-02-28T21:36:04",
            "upload_time_iso_8601": "2024-02-28T21:36:04.819803Z",
            "url": "https://files.pythonhosted.org/packages/4b/9a/b7df52b99d037b6e976a2fb0c8d309f18bc870c536fdc099a746437734e1/rubin-squarebot-0.8.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-28 21:36:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lsst-sqre",
    "github_project": "squarebot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "rubin-squarebot"
}
        
Elapsed time: 0.22431s