diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c0878023..5823b464 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,22 +3,38 @@ "image": "mcr.microsoft.com/devcontainers/base:1-jammy", "features": { "ghcr.io/devcontainers/features/python": { - "version": "3.11" + "version": "3.11", + "installTools": false }, "ghcr.io/devcontainers/features/docker-in-docker": {}, "ghcr.io/devcontainers/features/github-cli:1": {}, "ghcr.io/devcontainers/features/sshd:1": {}, "ghcr.io/devcontainers-contrib/features/poetry:2": {}, - "ghcr.io/trunk-io/devcontainer-feature/trunk:1": {} + "ghcr.io/trunk-io/devcontainer-feature/trunk:1": {}, + "ghcr.io/devcontainers/features/common-utils:2": { + "configureZshAsDefaultShell": true, + "username": "vscode", + "uid": 1000, + "gid": 1000 + } }, "customizations": { "vscode": { - "extensions": ["bungcip.better-toml", "GitHub.copilot"] + "extensions": [ + "GitHub.copilot", + "bierner.markdown-mermaid", + "tamasfe.even-better-toml" + ], + "settings": { + "python.analysis.typeCheckingMode": "basic", + "python.defaultInterpreterPath": ".venv/bin/python" + } } }, + "remoteUser": "vscode", "postCreateCommand": "poetry install --no-interaction --no-ansi --no-root", - "postStartCommand": { - "compose": "docker compose up --build", + "postAttachCommand": { + "compose": "docker compose --profile develop up --build", "watch": "docker compose alpha watch" }, "portsAttributes": { @@ -29,6 +45,14 @@ "8001": { "label": "redis-insight", "onAutoForward": "openPreview" + }, + "8000": { + "label": "runner-manager", + "onAutoForward": "silent" + }, + "4010": { + "label": "github-mock", + "onAutoForward": "silent" } } } diff --git a/.dockerignore b/.dockerignore index 6b8710a7..b435bd2e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,8 @@ .git +tests +.devcontainer +.github +.pytest_cache +.trunk +.venv +.hypothesis diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 00000000..fe4c2e54 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,25 @@ +--- +name: tests + +on: pull_request + +permissions: + contents: read + +jobs: + unit: + runs-on: ubuntu-latest + services: + redis: + image: redis/redis-stack + ports: + - 6379:6379 + steps: + - uses: actions/checkout@v3 + - run: pipx install poetry + - uses: actions/setup-python@v4 + with: + python-version: 3.11 + cache: poetry + - run: poetry install + - run: poetry run pytest tests/unit diff --git a/.gitignore b/.gitignore index 9f7550b1..be47b67f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ __pycache__ .venv +.pytest_cache +.hypothesis diff --git a/.trunk/.gitignore b/.trunk/.gitignore index d65ead72..695b5190 100644 --- a/.trunk/.gitignore +++ b/.trunk/.gitignore @@ -5,6 +5,4 @@ plugins user_trunk.yaml user.yaml -# TODO(lauri): Remove shims after a release or two -shims tools diff --git a/.trunk/configs/.markdownlint.yaml b/.trunk/configs/.markdownlint.yaml index fb940393..62dcaac3 100644 --- a/.trunk/configs/.markdownlint.yaml +++ b/.trunk/configs/.markdownlint.yaml @@ -8,3 +8,5 @@ line_length: false spaces: false url: false whitespace: false + +MD046: false diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index b0a625f0..61f006b0 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -1,30 +1,39 @@ version: 0.1 cli: - version: 1.12.0 + version: 1.13.0 plugins: sources: - id: trunk - ref: v0.0.22 + ref: v1.0.0 uri: https://github.com/trunk-io/plugins lint: enabled: - black@23.7.0 - isort@5.12.0 - - ruff@0.0.278 - - taplo@0.7.0 + - ruff@0.0.280 + - taplo@0.8.1 - actionlint@1.6.25 - - checkov@2.3.327 + - checkov@2.3.340 - git-diff-check - markdownlint@0.35.0 - prettier@3.0.0 - trufflehog@3.44.0 - yamllint@1.32.0 - - pyright@1.1.317 + - pyright@1.1.318 + - hadolint@2.12.0 + disabled: + - bandit + - osv-scanner + - trivy + - terrascan runtimes: enabled: - node@18.12.1 - python@3.10.8 actions: + disabled: + - trunk-check-pre-push + - trunk-fmt-pre-commit enabled: - trunk-announce - trunk-upgrade-available diff --git a/Dockerfile b/Dockerfile index 847ee6a9..83249f87 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.11-slim EXPOSE 8000 +HEALTHCHECK NONE # install poetry ARG POETRY_VERSION=1.5.1 @@ -8,11 +9,18 @@ ENV POETRY_VERSION=${POETRY_VERSION} \ POETRY_NO_INTERACTION=1 \ POETRY_NO_ANSI=1 -RUN pip install poetry==$POETRY_VERSION +RUN pip install --no-cache-dir poetry==$POETRY_VERSION + +# Create a runner-manager group and user +RUN groupadd -r runner-manager && \ + useradd --no-log-init -r -g runner-manager runner-manager && \ + mkdir -p /home/runner-manager && \ + chown -R runner-manager:runner-manager /home/runner-manager # copy project requirement files here to ensure they will be cached. WORKDIR /app -COPY poetry.lock pyproject.toml /app/ + +COPY --chown=runner-manager:runner-manager poetry.lock pyproject.toml /app/ # install project dependencies RUN poetry config virtualenvs.create false \ @@ -21,5 +29,7 @@ RUN poetry config virtualenvs.create false \ # copy project COPY . /app +USER runner-manager + # run entrypoint.sh -CMD ["uvicorn", "runner_manager.main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "runner_manager.main:app", "--host", "0.0.0.0", "--port", "8000"] diff --git a/docker-compose.yaml b/docker-compose.yaml index 0da7d2bd..cef8b860 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -15,15 +15,32 @@ services: - 8000:8000 environment: REDIS_OM_URL: redis://redis:6379 + command: uvicorn runner_manager.main:app --host 0.0.0.0 --port 8000 --reload + volumes: + - ./runner_manager:/app/runner_manager x-develop: watch: - - action: sync - path: ./runner_manager - target: /app/runner_manager - action: rebuild - path: . - target: /app - + path: poetry.lock + - action: rebuild + path: docker-compose.yaml + worker: + build: . + command: rq worker -c runner_manager.jobs.settings + volumes: + - .:/app + environment: + REDIS_OM_URL: redis://redis:6379 + github-mock: + profiles: + - develop + build: tests/images/github-mock + ports: + - 4010:4010 + x-develop: + watch: + - action: rebuild + path: tests/images/github-mock volumes: redis_data: diff --git a/docs/development/code.md b/docs/development/code.md new file mode 100644 index 00000000..744c63e3 --- /dev/null +++ b/docs/development/code.md @@ -0,0 +1,39 @@ +# Code + +The Runner Manager is written in Python, typing will be used and enforced +by [pyright](https://github.com/microsoft/pyright). + +All libraries must be compatible with [Pydantic](https://docs.pydantic.dev/). +This requirement will allow to have a nice developer experience +especially when combined with [Fastapi](#fastapi). + +## Dependencies + +The main dependencies are described below along with the reason why they were chosen. + +### Fastapi + +[Fastapi](https://fastapi.tiangolo.com/) will be used as a web framework to +expose the API of the runner manager. + +### GitHubKit + +[GitHubKit](https://github.com/yanyongyu/githubkit) is a GitHub API client for +Python that works exactly like the official GitHub API client for JavaScript, Octokit. + +Its code is generated from the OpenAPI specification of the GitHub API. + +### Redis-om + +[Redis-om](https://github.com/redis/redis-om-python) is a Redis Object Mapper +that allows to store and retrieve Python Pydantic objects in Redis. + +This enable fastapi objects to be stored in Redis and retrieved +without having to write boilerplate code. + +### RQ + +[RQ](https://python-rq.org/) is a simple Python library for queueing jobs and +processing them in the background with workers. + +It will be used to process the jobs that will be created by the runner manager. diff --git a/docs/development/concepts.md b/docs/development/concepts.md new file mode 100644 index 00000000..ebb996c0 --- /dev/null +++ b/docs/development/concepts.md @@ -0,0 +1,71 @@ +# Concepts + +Described below are the concepts that are used in the runner manager. +They should help to understand the rest of the documentation. + +## Runners + +A runner is a machine that is used to run jobs in [GitHub Actions]. +By default, GitHub provides runners that are hosted by them, they +are called [GitHub-hosted runners]. + +[GitHub Actions] also supports [self-hosted runners], the difference +being that they are managed and hosted by the user. +They will be the focus of the runner manager, and will be referred +to as runners. + +## Runner groups + +The [runner groups] are a way to organize runners in [GitHub Actions]. +In the runner manager, runner groups are used to configure +the specification of the runners that will be created. + +Each group will be matched with its appropriate runner group +in the GitHub organization or repository. + +!!! note + + We use the term [runner groups] for consistency with [GitHub Actions] API. + +More information about the [runner groups] configuration can be found in the +[configuration documentation](./configuration.md#runner-groups). + +## Backends + +The runner manager supports multiple backends, which are responsible +for hosting the runners. The following backends will be supported: + +- GCP. +- AWS. +- Docker (For local functional testing). +- FakeBackend (For local unit testing). + +## Database + +The runner manager is stateful and needs to gather information that comes from both +GitHub and the backend that has been configured. + +This data needs ideally to be persistent, so that the runner manager can +recover from a reboot or crash and not lose track of the runners +that are currently running. + +Redis will be used as a database to store the state of the runners. + +## Jobs + +The runner manager will be responsible for jobs that are triggered +by events coming from GitHub as well as health checks that are +triggered periodically. + +A proper queue needs to be used to ensure that tasks are: + +- Not lost if the runner manager crashes. +- Properly distributed between multiple runner manager instances. + +Redis is used as a task queue backend, so that only one database server +is required. + +[Runner groups]: https://docs.github.com/en/enterprise-cloud@latest/actions/hosting-your-own-runners/managing-self-hosted-runners/managing-access-to-self-hosted-runners-using-groups#about-runner-groups +[GitHub-hosted runners]: https://docs.github.com/en/enterprise-cloud@latest/actions/using-github-hosted-runners/about-github-hosted-runners +[self-hosted runners]: https://docs.github.com/en/enterprise-cloud@latest/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners +[GitHub Actions]: https://docs.github.com/en/actions diff --git a/docs/development/configuration.md b/docs/development/configuration.md new file mode 100644 index 00000000..32c53d51 --- /dev/null +++ b/docs/development/configuration.md @@ -0,0 +1,52 @@ +# Configuration + +The runner manager can be configured as a GitHub Application +(recommended for production) +but also with a GitHub Personal Access Token (recommended for development). + +The configuration of the runner will be done through a YAML file and +a combination of environment variables for secrets. + +## Global configuration + +The global configuration will contain the following information: + +- A name for the runner manager. (default: runner-manager) + It will be used as a metadata or prefix which will allow the runner to identify + the owner of each resources, avoiding conflicts with other runner managers or users. +- The GitHub Authentication parameters. (Required) + - For GitHub Application: The GitHub Application ID, Installation ID and Private Key. (Required) + - For GitHub Personal Access Token: The GitHub Personal Access Token. (Required) +- The Redis connection parameters. (Required) +- The backends configuration. (Required) +- The webhook secret. (Required) +- The runner groups. (Required) +- The health check interval. (Default: 10 minutes) +- The runner's time to start. (Default: 10 minutes) +- The runner's time to live. (Default: 12 hours) + +## Runner groups + +A list of runner groups will be configured into the runner manager +settings file. +The following information will be configured for each runner group: + +- Name of the group. (Required) +- Name of the GitHub Organization in which the runner and group will be created. (Required) +- Name of the GitHub Repository in which the runner and group will be created. (Optional) +- Repository access: + - A list of selected repositories. (Default: All repositories) + - Allow public repositories. (Default: True) +- Workflow access: a comma separated list of the workflows that can access the runner group. + For example: + ```shell + octo-org/octo-repo/.github/workflows/build.yml@v2, + octo-org/octo-repo/.github/workflows/deploy.yml@d6dc6c96df4f32fa27b039f2084f576ed2c5c2a5, + monalisa/octo-test/.github/workflows/test.yml@main + ``` +- The name of the workflow that will be used to run the jobs. (Optional) +- The maximum number of runners that can run simultaneously. (Default: 20) +- The minimum number of runners that must be available. (Default: 0) +- The runner labels that will be attached to the runners of the group. (Required) +- The runner backend that will be used to host the runners of the group. (Required) +- The runner's instance specifications (CPU, RAM, disk, etc). (Required) diff --git a/docs/development/environment.md b/docs/development/environment.md new file mode 100644 index 00000000..c4551734 --- /dev/null +++ b/docs/development/environment.md @@ -0,0 +1,7 @@ +# Developer Environment + +A devcontainer is provided to ease the development of the runner manager. +It can be used with GitHub's Codespaces or Visual Studio Code. + +It is to be considered as the only supported development environment +for ease of support and reproducibility. diff --git a/docs/development/index.md b/docs/development/index.md new file mode 100644 index 00000000..257fbc76 --- /dev/null +++ b/docs/development/index.md @@ -0,0 +1,12 @@ +# Development + +Information needed to develop and contribute to the project. + +## Table of Contents + +- [Concepts](./concepts.md). +- [Workflows](./workflows.md). +- [Configuration](./configuration.md). +- [Code](./code.md). +- [Testing](./testing.md). +- [Local environment](./environment.md). diff --git a/docs/development/testing.md b/docs/development/testing.md new file mode 100644 index 00000000..2354e4e4 --- /dev/null +++ b/docs/development/testing.md @@ -0,0 +1,130 @@ +# Testing + +Tests will be written using [pytest](https://docs.pytest.org/en/stable/). + +The following type of tests wil be written: + +- Unit tests. +- API tests. +- Functional tests. + +Python dependencies for testing will be configured in the `dev` poetry group: + +```shell +# Install all dependencies. +poetry install +# Install only dev dependencies. +poetry install --only dev +# Add new dev dependency. +poetry add --group dev +# Update dev dependencies. +poetry update --only dev +``` + +Each type of test shall generate a coverage report that will be +later used with services like [codecov](https://codecov.io/) to +ensure that the code is properly tested. + +## Mocking servers + +For the ease of setup and local development, mocking servers will be used +mostly to test interactions with external services. + +### GitHub's API + +To mock GitHub's API we will use the openapi specification of the API +to generate a mock server that will be used in the unit tests. + +The mock server will be generated using [prism](https://github.com/stoplightio/prism) +and will be run in a docker container. + +Here's an example of a curl command that will create a new repository to a prism mock server: + +```shell +curl -L \ + -X POST \ + -H "Content-Type: application/json" \ + "http://localhost:4010/orgs/scality/repos" \ + -d '{ + "name":"hello-world", + "description":"This your first repo!", + "homepage":"https://github.com", + "private":false, + "has_issues":true, + "has_projects":true, + "has_wiki":true +}' +``` + +## Unit tests + +Unit tests of methods and functions. + +The test environment will be configured with: + +- Ideally a fakeredis backend, but a real redis server can be used. +- A mock backend, no real runners will be created. +- A mocked queue, no real rq are required. + +## API tests + +Will make use of the [fastapi test client](https://fastapi.tiangolo.com/advanced/testing/) +to test the runner-manager behavior from the API point of view. + +The test environment will be configured with: + +- A real redis server. +- A real rq worker to process the jobs. +- A mock backend, no real runners will be created. +- [GitHub's API mock](#githubs-api). + +## Functional tests + +The functional tests of the runner-manager will be done with no mocking, it will: + +- Interact with the real GitHub API. +- Execute a real workflow using [GitHub Actions] triggered by a workflow dispatch. +- Receive webhooks notification from GitHub, thanks to the integration of webhook redirection in `gh` cli. +- Have `docker` configured as a backend to host the runners. + +The test environment will be configured with: + +- A real redis server. +- A real rq worker to process the jobs. +- The runner manager running as a server but it must still produce a coverage report: + +```python +# Here's a code example of how one might do it. +# This code remains to be tested. +import coverage +import os + +from fastapi import FastAPI + +app = FastAPI() +cov = coverage.Coverage() + +@app.on_event("startup") +def startup_event(): + if os.environ.get("CI"): + cov.start() + +@app.on_event("shutdown") +def shutdown_event(): + if os.environ.get("CI"): + cov.stop() + cov.save() +``` + +Pytest parameters will be made available to run the functional tests with different configurations: + +- `--backend`: The backend that will be used to host the runners. (Default: docker) +- `--config`: The path to the configuration file. (Default: .config.yaml) + +The goal of having those parameters is to allow to run the functional tests +with different configurations, for example: + +- `--backend=gcloud --config=.config.yaml`: Run the functional tests with `gcloud` as a backend. +- `--backend=aws --config=.config.yaml`: Run the functional tests with `aws` as a backend. + +It is meant to be used by developers to help with the development of backend integrations. diff --git a/docs/development/workflows.md b/docs/development/workflows.md new file mode 100644 index 00000000..24938dcb --- /dev/null +++ b/docs/development/workflows.md @@ -0,0 +1,77 @@ +# Workflows + +A high level description of the runner manager workflows. + +## Webhook events + +Webhook events are sent by GitHub on selected events, such as: + +- Push to a repository. +- Pull requests is merged. +- A workflow is triggered. + +In the case of the runner manager, we are interested in `workflow_job` events +that are triggered when a job is queued, running or completed. + +Here's a description of the workflow that is triggered by a `workflow_job` event: + +```mermaid +sequenceDiagram + actor Developer + Developer ->> GitHub: Pushes code + GitHub ->> GitHub: Triggers a GitHub Actions workflow + GitHub ->> Runner Manager: Sends webhook event for workflow jobs + alt The job status is queued + Runner Manager ->> Runner Manager: Checks how many runners are authorized to run simultaneously + alt The maximum number of runners is not reached + Runner Manager ->> Backend: Request a new runner + participant Runner as Self-hosted Runner + Backend ->> Runner: Creates a new runner + activate Runner + Runner ->> GitHub: Connects to GitHub Actions + else The maximum number of runners is reached + Runner Manager ->> Runner Manager: Try again later + end + else The job status is running + Runner Manager ->> Backend: Update the runner status and metadata + else The job status is completed + Runner Manager ->> Backend: Delete the runner + Backend ->> Runner: Deletes the runner + deactivate Runner + end +``` + +## Health checks + +It will also periodically check the health of the runners and +perform actions based on their status. + +```mermaid +sequenceDiagram + participant Runner Manager + participant Redis + participant Queue + participant Job + participant GitHub + participant Backend + Runner Manager ->> Redis: Request the list of runners groups + loop for every runner group + Runner Manager ->> Queue: Create a job to check the group's health + Job ->> Redis: Request the list of runners for the group + loop for every runner + Job ->> GitHub: Get the runner status + Job ->> Backend: Get the runner status + alt The runner's time to start has expired + Job ->> Queue: Create a job to re-create the runner. + else The runner's time to live has expired + Job ->> Queue: Create a job to delete the runner. + end + Job ->> Redis: Update the runner and group information. + end + Job ->> Queue: Wait for all created jobs to finish + Job ->> Redis: Update the runner group information + alt minimum number of runners is not reached + Runner Manager ->> Queue: Create a job to create a new runner + end + end +``` diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..61408d09 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,13 @@ +# Runner Manager + +By default, GitHub Actions runners are hosted by GitHub, but it is also +possible to host them on your own infrastructure, with [self-hosted runners]. +The Runner Manager is a tool to handle the process of creating, +deleting and managing the state of self-hosted runners. + +It is very similar to the [Actions Runner Controller (ARK)] with the +difference being that instead of focusing on Kubernetes (containers) as +backend to host the runners, it focuses on virtual machines. + +[Actions Runner Controller (ARK)]: https://github.com/actions/actions-runner-controller/ +[self-hosted runners]: https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners diff --git a/poetry.lock b/poetry.lock index e2f53589..9cfe6c09 100644 --- a/poetry.lock +++ b/poetry.lock @@ -31,15 +31,33 @@ files = [ {file = "async_timeout-4.0.2-py3-none-any.whl", hash = "sha256:8ca1e4fcf50d07413d66d1a5e416e42cfdf5851c981d679a09851a6853383b3c"}, ] +[[package]] +name = "attrs" +version = "23.1.0" +description = "Classes Without Boilerplate" +optional = false +python-versions = ">=3.7" +files = [ + {file = "attrs-23.1.0-py3-none-any.whl", hash = "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04"}, + {file = "attrs-23.1.0.tar.gz", hash = "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"}, +] + +[package.extras] +cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] +dev = ["attrs[docs,tests]", "pre-commit"] +docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] +tests = ["attrs[tests-no-zope]", "zope-interface"] +tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] + [[package]] name = "certifi" -version = "2023.5.7" +version = "2023.7.22" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2023.5.7-py3-none-any.whl", hash = "sha256:c6c2e98f5c7869efca1f8916fed228dd91539f9f1b444c314c06eef02980c716"}, - {file = "certifi-2023.5.7.tar.gz", hash = "sha256:0f0d56dc5a6ad56fd4ba36484d6cc34451e1c6548c61daad8c320169f91eddc7"}, + {file = "certifi-2023.7.22-py3-none-any.whl", hash = "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9"}, + {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, ] [[package]] @@ -204,18 +222,33 @@ files = [ [[package]] name = "click" -version = "8.1.5" +version = "8.1.6" description = "Composable command line interface toolkit" optional = false python-versions = ">=3.7" files = [ - {file = "click-8.1.5-py3-none-any.whl", hash = "sha256:e576aa487d679441d7d30abb87e1b43d24fc53bffb8758443b1a9e1cee504548"}, - {file = "click-8.1.5.tar.gz", hash = "sha256:4be4b1af8d665c6d942909916d31a213a106800c47d0eeba73d34da3cbc11367"}, + {file = "click-8.1.6-py3-none-any.whl", hash = "sha256:fa244bb30b3b5ee2cae3da8f55c9e5e0c0e86093306301fb418eb9dc40fbded5"}, + {file = "click-8.1.6.tar.gz", hash = "sha256:48ee849951919527a045bfe3bf7baa8a959c423134e1a5b98c05c20ba75a1cbd"}, ] [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} +[[package]] +name = "clickclick" +version = "20.10.2" +description = "Click utility functions" +optional = false +python-versions = "*" +files = [ + {file = "clickclick-20.10.2-py2.py3-none-any.whl", hash = "sha256:c8f33e6d9ec83f68416dd2136a7950125bd256ec39ccc9a85c6e280a16be2bb5"}, + {file = "clickclick-20.10.2.tar.gz", hash = "sha256:4efb13e62353e34c5eef7ed6582c4920b418d7dedc86d819e22ee089ba01802c"}, +] + +[package.dependencies] +click = ">=4.0" +PyYAML = ">=3.11" + [[package]] name = "colorama" version = "0.4.6" @@ -227,6 +260,35 @@ files = [ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +[[package]] +name = "connexion" +version = "2.14.2" +description = "Connexion - API first applications with OpenAPI/Swagger and Flask" +optional = false +python-versions = ">=3.6" +files = [ + {file = "connexion-2.14.2-py2.py3-none-any.whl", hash = "sha256:a73b96a0e07b16979a42cde7c7e26afe8548099e352cf350f80c57185e0e0b36"}, + {file = "connexion-2.14.2.tar.gz", hash = "sha256:dbc06f52ebeebcf045c9904d570f24377e8bbd5a6521caef15a06f634cf85646"}, +] + +[package.dependencies] +clickclick = ">=1.2,<21" +flask = ">=1.0.4,<2.3" +inflection = ">=0.3.1,<0.6" +itsdangerous = ">=0.24" +jsonschema = ">=2.5.1,<5" +packaging = ">=20" +PyYAML = ">=5.1,<7" +requests = ">=2.9.1,<3" +werkzeug = ">=1.0,<2.3" + +[package.extras] +aiohttp = ["MarkupSafe (>=0.23)", "aiohttp (>=2.3.10,<4)", "aiohttp-jinja2 (>=0.14.0,<2)"] +docs = ["sphinx-autoapi (==1.8.1)"] +flask = ["flask (>=1.0.4,<2.3)", "itsdangerous (>=0.24)"] +swagger-ui = ["swagger-ui-bundle (>=0.0.2,<0.1)"] +tests = ["MarkupSafe (>=0.23)", "aiohttp (>=2.3.10,<4)", "aiohttp-jinja2 (>=0.14.0,<2)", "aiohttp-remotes", "decorator (>=5,<6)", "flask (>=1.0.4,<2.3)", "itsdangerous (>=0.24)", "pytest (>=6,<7)", "pytest-aiohttp", "pytest-cov (>=2,<3)", "swagger-ui-bundle (>=0.0.2,<0.1)", "testfixtures (>=6,<7)"] + [[package]] name = "cryptography" version = "41.0.2" @@ -291,6 +353,27 @@ typing-extensions = ">=4.5.0" [package.extras] all = ["email-validator (>=2.0.0)", "httpx (>=0.23.0)", "itsdangerous (>=1.1.0)", "jinja2 (>=2.11.2)", "orjson (>=3.2.1)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.5)", "pyyaml (>=5.3.1)", "ujson (>=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0)", "uvicorn[standard] (>=0.12.0)"] +[[package]] +name = "flask" +version = "2.2.5" +description = "A simple framework for building complex web applications." +optional = false +python-versions = ">=3.7" +files = [ + {file = "Flask-2.2.5-py3-none-any.whl", hash = "sha256:58107ed83443e86067e41eff4631b058178191a355886f8e479e347fa1285fdf"}, + {file = "Flask-2.2.5.tar.gz", hash = "sha256:edee9b0a7ff26621bd5a8c10ff484ae28737a2410d99b0bb9a6850c7fb977aa0"}, +] + +[package.dependencies] +click = ">=8.0" +itsdangerous = ">=2.0" +Jinja2 = ">=3.0" +Werkzeug = ">=2.2.2" + +[package.extras] +async = ["asgiref (>=3.2)"] +dotenv = ["python-dotenv"] + [[package]] name = "ghp-import" version = "2.1.0" @@ -531,6 +614,37 @@ cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] +[[package]] +name = "hypothesis" +version = "6.82.0" +description = "A library for property-based testing" +optional = false +python-versions = ">=3.8" +files = [ + {file = "hypothesis-6.82.0-py3-none-any.whl", hash = "sha256:fa8eee429b99f7d3c953fb2b57de415fd39b472b09328b86c1978f12669ef395"}, + {file = "hypothesis-6.82.0.tar.gz", hash = "sha256:ffece8e40a34329e7112f7408f2c45fe587761978fdbc6f4f91bf0d683a7d4d9"}, +] + +[package.dependencies] +attrs = ">=19.2.0" +sortedcontainers = ">=2.1.0,<3.0.0" + +[package.extras] +all = ["backports.zoneinfo (>=0.2.1)", "black (>=19.10b0)", "click (>=7.0)", "django (>=3.2)", "dpcontracts (>=0.4)", "lark (>=0.10.1)", "libcst (>=0.3.16)", "numpy (>=1.17.3)", "pandas (>=1.1)", "pytest (>=4.6)", "python-dateutil (>=1.4)", "pytz (>=2014.1)", "redis (>=3.0.0)", "rich (>=9.0.0)", "tzdata (>=2023.3)"] +cli = ["black (>=19.10b0)", "click (>=7.0)", "rich (>=9.0.0)"] +codemods = ["libcst (>=0.3.16)"] +dateutil = ["python-dateutil (>=1.4)"] +django = ["django (>=3.2)"] +dpcontracts = ["dpcontracts (>=0.4)"] +ghostwriter = ["black (>=19.10b0)"] +lark = ["lark (>=0.10.1)"] +numpy = ["numpy (>=1.17.3)"] +pandas = ["pandas (>=1.1)"] +pytest = ["pytest (>=4.6)"] +pytz = ["pytz (>=2014.1)"] +redis = ["redis (>=3.0.0)"] +zoneinfo = ["backports.zoneinfo (>=0.2.1)", "tzdata (>=2023.3)"] + [[package]] name = "idna" version = "3.4" @@ -542,6 +656,39 @@ files = [ {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, ] +[[package]] +name = "inflection" +version = "0.5.1" +description = "A port of Ruby on Rails inflector to Python" +optional = false +python-versions = ">=3.5" +files = [ + {file = "inflection-0.5.1-py2.py3-none-any.whl", hash = "sha256:f38b2b640938a4f35ade69ac3d053042959b62a0f1076a5bbaa1b9526605a8a2"}, + {file = "inflection-0.5.1.tar.gz", hash = "sha256:1a29730d366e996aaacffb2f1f1cb9593dc38e2ddd30c91250c6dde09ea9b417"}, +] + +[[package]] +name = "iniconfig" +version = "2.0.0" +description = "brain-dead simple config-ini parsing" +optional = false +python-versions = ">=3.7" +files = [ + {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, + {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, +] + +[[package]] +name = "itsdangerous" +version = "2.1.2" +description = "Safely pass data to untrusted environments and back." +optional = false +python-versions = ">=3.7" +files = [ + {file = "itsdangerous-2.1.2-py3-none-any.whl", hash = "sha256:2c2349112351b88699d8d4b6b075022c0808887cb7ad10069318a8b0bc88db44"}, + {file = "itsdangerous-2.1.2.tar.gz", hash = "sha256:5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a"}, +] + [[package]] name = "jinja2" version = "3.1.2" @@ -559,6 +706,41 @@ MarkupSafe = ">=2.0" [package.extras] i18n = ["Babel (>=2.7)"] +[[package]] +name = "jsonschema" +version = "4.18.4" +description = "An implementation of JSON Schema validation for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "jsonschema-4.18.4-py3-none-any.whl", hash = "sha256:971be834317c22daaa9132340a51c01b50910724082c2c1a2ac87eeec153a3fe"}, + {file = "jsonschema-4.18.4.tar.gz", hash = "sha256:fb3642735399fa958c0d2aad7057901554596c63349f4f6b283c493cf692a25d"}, +] + +[package.dependencies] +attrs = ">=22.2.0" +jsonschema-specifications = ">=2023.03.6" +referencing = ">=0.28.4" +rpds-py = ">=0.7.1" + +[package.extras] +format = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3987", "uri-template", "webcolors (>=1.11)"] +format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3986-validator (>0.1.0)", "uri-template", "webcolors (>=1.11)"] + +[[package]] +name = "jsonschema-specifications" +version = "2023.7.1" +description = "The JSON Schema meta-schemas and vocabularies, exposed as a Registry" +optional = false +python-versions = ">=3.8" +files = [ + {file = "jsonschema_specifications-2023.7.1-py3-none-any.whl", hash = "sha256:05adf340b659828a004220a9613be00fa3f223f2b82002e273dee62fd50524b1"}, + {file = "jsonschema_specifications-2023.7.1.tar.gz", hash = "sha256:c91a50404e88a1f6ba40636778e2ee08f6e24c5613fe4c53ac24578a5a7f72bb"}, +] + +[package.dependencies] +referencing = ">=0.28.0" + [[package]] name = "markdown" version = "3.3.7" @@ -725,6 +907,21 @@ files = [ {file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"}, ] +[[package]] +name = "pluggy" +version = "1.2.0" +description = "plugin and hook calling mechanisms for python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pluggy-1.2.0-py3-none-any.whl", hash = "sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849"}, + {file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + [[package]] name = "pycparser" version = "2.21" @@ -738,47 +935,47 @@ files = [ [[package]] name = "pydantic" -version = "1.10.11" +version = "1.10.12" description = "Data validation and settings management using python type hints" optional = false python-versions = ">=3.7" files = [ - {file = "pydantic-1.10.11-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ff44c5e89315b15ff1f7fdaf9853770b810936d6b01a7bcecaa227d2f8fe444f"}, - {file = "pydantic-1.10.11-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a6c098d4ab5e2d5b3984d3cb2527e2d6099d3de85630c8934efcfdc348a9760e"}, - {file = "pydantic-1.10.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:16928fdc9cb273c6af00d9d5045434c39afba5f42325fb990add2c241402d151"}, - {file = "pydantic-1.10.11-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0588788a9a85f3e5e9ebca14211a496409cb3deca5b6971ff37c556d581854e7"}, - {file = "pydantic-1.10.11-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e9baf78b31da2dc3d3f346ef18e58ec5f12f5aaa17ac517e2ffd026a92a87588"}, - {file = "pydantic-1.10.11-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:373c0840f5c2b5b1ccadd9286782852b901055998136287828731868027a724f"}, - {file = "pydantic-1.10.11-cp310-cp310-win_amd64.whl", hash = "sha256:c3339a46bbe6013ef7bdd2844679bfe500347ac5742cd4019a88312aa58a9847"}, - {file = "pydantic-1.10.11-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:08a6c32e1c3809fbc49debb96bf833164f3438b3696abf0fbeceb417d123e6eb"}, - {file = "pydantic-1.10.11-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a451ccab49971af043ec4e0d207cbc8cbe53dbf148ef9f19599024076fe9c25b"}, - {file = "pydantic-1.10.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5b02d24f7b2b365fed586ed73582c20f353a4c50e4be9ba2c57ab96f8091ddae"}, - {file = "pydantic-1.10.11-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3f34739a89260dfa420aa3cbd069fbcc794b25bbe5c0a214f8fb29e363484b66"}, - {file = "pydantic-1.10.11-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:e297897eb4bebde985f72a46a7552a7556a3dd11e7f76acda0c1093e3dbcf216"}, - {file = "pydantic-1.10.11-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d185819a7a059550ecb85d5134e7d40f2565f3dd94cfd870132c5f91a89cf58c"}, - {file = "pydantic-1.10.11-cp311-cp311-win_amd64.whl", hash = "sha256:4400015f15c9b464c9db2d5d951b6a780102cfa5870f2c036d37c23b56f7fc1b"}, - {file = "pydantic-1.10.11-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2417de68290434461a266271fc57274a138510dca19982336639484c73a07af6"}, - {file = "pydantic-1.10.11-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:331c031ba1554b974c98679bd0780d89670d6fd6f53f5d70b10bdc9addee1713"}, - {file = "pydantic-1.10.11-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8268a735a14c308923e8958363e3a3404f6834bb98c11f5ab43251a4e410170c"}, - {file = "pydantic-1.10.11-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:44e51ba599c3ef227e168424e220cd3e544288c57829520dc90ea9cb190c3248"}, - {file = "pydantic-1.10.11-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:d7781f1d13b19700b7949c5a639c764a077cbbdd4322ed505b449d3ca8edcb36"}, - {file = "pydantic-1.10.11-cp37-cp37m-win_amd64.whl", hash = "sha256:7522a7666157aa22b812ce14c827574ddccc94f361237ca6ea8bb0d5c38f1629"}, - {file = "pydantic-1.10.11-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:bc64eab9b19cd794a380179ac0e6752335e9555d214cfcb755820333c0784cb3"}, - {file = "pydantic-1.10.11-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:8dc77064471780262b6a68fe67e013298d130414d5aaf9b562c33987dbd2cf4f"}, - {file = "pydantic-1.10.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fe429898f2c9dd209bd0632a606bddc06f8bce081bbd03d1c775a45886e2c1cb"}, - {file = "pydantic-1.10.11-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:192c608ad002a748e4a0bed2ddbcd98f9b56df50a7c24d9a931a8c5dd053bd3d"}, - {file = "pydantic-1.10.11-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:ef55392ec4bb5721f4ded1096241e4b7151ba6d50a50a80a2526c854f42e6a2f"}, - {file = "pydantic-1.10.11-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:41e0bb6efe86281623abbeeb0be64eab740c865388ee934cd3e6a358784aca6e"}, - {file = "pydantic-1.10.11-cp38-cp38-win_amd64.whl", hash = "sha256:265a60da42f9f27e0b1014eab8acd3e53bd0bad5c5b4884e98a55f8f596b2c19"}, - {file = "pydantic-1.10.11-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:469adf96c8e2c2bbfa655fc7735a2a82f4c543d9fee97bd113a7fb509bf5e622"}, - {file = "pydantic-1.10.11-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e6cbfbd010b14c8a905a7b10f9fe090068d1744d46f9e0c021db28daeb8b6de1"}, - {file = "pydantic-1.10.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:abade85268cc92dff86d6effcd917893130f0ff516f3d637f50dadc22ae93999"}, - {file = "pydantic-1.10.11-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e9738b0f2e6c70f44ee0de53f2089d6002b10c33264abee07bdb5c7f03038303"}, - {file = "pydantic-1.10.11-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:787cf23e5a0cde753f2eabac1b2e73ae3844eb873fd1f5bdbff3048d8dbb7604"}, - {file = "pydantic-1.10.11-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:174899023337b9fc685ac8adaa7b047050616136ccd30e9070627c1aaab53a13"}, - {file = "pydantic-1.10.11-cp39-cp39-win_amd64.whl", hash = "sha256:1954f8778489a04b245a1e7b8b22a9d3ea8ef49337285693cf6959e4b757535e"}, - {file = "pydantic-1.10.11-py3-none-any.whl", hash = "sha256:008c5e266c8aada206d0627a011504e14268a62091450210eda7c07fabe6963e"}, - {file = "pydantic-1.10.11.tar.gz", hash = "sha256:f66d479cf7eb331372c470614be6511eae96f1f120344c25f3f9bb59fb1b5528"}, + {file = "pydantic-1.10.12-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a1fcb59f2f355ec350073af41d927bf83a63b50e640f4dbaa01053a28b7a7718"}, + {file = "pydantic-1.10.12-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:b7ccf02d7eb340b216ec33e53a3a629856afe1c6e0ef91d84a4e6f2fb2ca70fe"}, + {file = "pydantic-1.10.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8fb2aa3ab3728d950bcc885a2e9eff6c8fc40bc0b7bb434e555c215491bcf48b"}, + {file = "pydantic-1.10.12-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:771735dc43cf8383959dc9b90aa281f0b6092321ca98677c5fb6125a6f56d58d"}, + {file = "pydantic-1.10.12-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:ca48477862372ac3770969b9d75f1bf66131d386dba79506c46d75e6b48c1e09"}, + {file = "pydantic-1.10.12-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a5e7add47a5b5a40c49b3036d464e3c7802f8ae0d1e66035ea16aa5b7a3923ed"}, + {file = "pydantic-1.10.12-cp310-cp310-win_amd64.whl", hash = "sha256:e4129b528c6baa99a429f97ce733fff478ec955513630e61b49804b6cf9b224a"}, + {file = "pydantic-1.10.12-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b0d191db0f92dfcb1dec210ca244fdae5cbe918c6050b342d619c09d31eea0cc"}, + {file = "pydantic-1.10.12-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:795e34e6cc065f8f498c89b894a3c6da294a936ee71e644e4bd44de048af1405"}, + {file = "pydantic-1.10.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:69328e15cfda2c392da4e713443c7dbffa1505bc9d566e71e55abe14c97ddc62"}, + {file = "pydantic-1.10.12-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2031de0967c279df0d8a1c72b4ffc411ecd06bac607a212892757db7462fc494"}, + {file = "pydantic-1.10.12-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:ba5b2e6fe6ca2b7e013398bc7d7b170e21cce322d266ffcd57cca313e54fb246"}, + {file = "pydantic-1.10.12-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:2a7bac939fa326db1ab741c9d7f44c565a1d1e80908b3797f7f81a4f86bc8d33"}, + {file = "pydantic-1.10.12-cp311-cp311-win_amd64.whl", hash = "sha256:87afda5539d5140cb8ba9e8b8c8865cb5b1463924d38490d73d3ccfd80896b3f"}, + {file = "pydantic-1.10.12-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:549a8e3d81df0a85226963611950b12d2d334f214436a19537b2efed61b7639a"}, + {file = "pydantic-1.10.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:598da88dfa127b666852bef6d0d796573a8cf5009ffd62104094a4fe39599565"}, + {file = "pydantic-1.10.12-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ba5c4a8552bff16c61882db58544116d021d0b31ee7c66958d14cf386a5b5350"}, + {file = "pydantic-1.10.12-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c79e6a11a07da7374f46970410b41d5e266f7f38f6a17a9c4823db80dadf4303"}, + {file = "pydantic-1.10.12-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ab26038b8375581dc832a63c948f261ae0aa21f1d34c1293469f135fa92972a5"}, + {file = "pydantic-1.10.12-cp37-cp37m-win_amd64.whl", hash = "sha256:e0a16d274b588767602b7646fa05af2782576a6cf1022f4ba74cbb4db66f6ca8"}, + {file = "pydantic-1.10.12-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6a9dfa722316f4acf4460afdf5d41d5246a80e249c7ff475c43a3a1e9d75cf62"}, + {file = "pydantic-1.10.12-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a73f489aebd0c2121ed974054cb2759af8a9f747de120acd2c3394cf84176ccb"}, + {file = "pydantic-1.10.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b30bcb8cbfccfcf02acb8f1a261143fab622831d9c0989707e0e659f77a18e0"}, + {file = "pydantic-1.10.12-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2fcfb5296d7877af406ba1547dfde9943b1256d8928732267e2653c26938cd9c"}, + {file = "pydantic-1.10.12-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:2f9a6fab5f82ada41d56b0602606a5506aab165ca54e52bc4545028382ef1c5d"}, + {file = "pydantic-1.10.12-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:dea7adcc33d5d105896401a1f37d56b47d443a2b2605ff8a969a0ed5543f7e33"}, + {file = "pydantic-1.10.12-cp38-cp38-win_amd64.whl", hash = "sha256:1eb2085c13bce1612da8537b2d90f549c8cbb05c67e8f22854e201bde5d98a47"}, + {file = "pydantic-1.10.12-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ef6c96b2baa2100ec91a4b428f80d8f28a3c9e53568219b6c298c1125572ebc6"}, + {file = "pydantic-1.10.12-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6c076be61cd0177a8433c0adcb03475baf4ee91edf5a4e550161ad57fc90f523"}, + {file = "pydantic-1.10.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2d5a58feb9a39f481eda4d5ca220aa8b9d4f21a41274760b9bc66bfd72595b86"}, + {file = "pydantic-1.10.12-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e5f805d2d5d0a41633651a73fa4ecdd0b3d7a49de4ec3fadf062fe16501ddbf1"}, + {file = "pydantic-1.10.12-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:1289c180abd4bd4555bb927c42ee42abc3aee02b0fb2d1223fb7c6e5bef87dbe"}, + {file = "pydantic-1.10.12-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5d1197e462e0364906cbc19681605cb7c036f2475c899b6f296104ad42b9f5fb"}, + {file = "pydantic-1.10.12-cp39-cp39-win_amd64.whl", hash = "sha256:fdbdd1d630195689f325c9ef1a12900524dceb503b00a987663ff4f58669b93d"}, + {file = "pydantic-1.10.12-py3-none-any.whl", hash = "sha256:b749a43aa51e32839c9d71dc67eb1e4221bb04af1033a32e3923d46f9effa942"}, + {file = "pydantic-1.10.12.tar.gz", hash = "sha256:0fe8a415cea8f340e7a9af9c54fc71a649b43e8ca3cc732986116b3cb135d303"}, ] [package.dependencies] @@ -817,6 +1014,26 @@ files = [ markdown = ">=3.2" pyyaml = "*" +[[package]] +name = "pytest" +version = "7.4.0" +description = "pytest: simple powerful testing with Python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-7.4.0-py3-none-any.whl", hash = "sha256:78bf16451a2eb8c7a2ea98e32dc119fd2aa758f1d5d66dbf0a59d69a3969df32"}, + {file = "pytest-7.4.0.tar.gz", hash = "sha256:b4bf8c45bd59934ed84001ad51e11b4ee40d40a1229d2c79f9c592b0a3f6bd8a"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=0.12,<2.0" + +[package.extras] +testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] + [[package]] name = "python-dateutil" version = "2.8.2" @@ -858,24 +1075,51 @@ files = [ [[package]] name = "pyyaml" -version = "5.3.1" +version = "6.0.1" description = "YAML parser and emitter for Python" optional = false -python-versions = "*" +python-versions = ">=3.6" files = [ - {file = "PyYAML-5.3.1-cp27-cp27m-win32.whl", hash = "sha256:74809a57b329d6cc0fdccee6318f44b9b8649961fa73144a98735b0aaf029f1f"}, - {file = "PyYAML-5.3.1-cp27-cp27m-win_amd64.whl", hash = "sha256:240097ff019d7c70a4922b6869d8a86407758333f02203e0fc6ff79c5dcede76"}, - {file = "PyYAML-5.3.1-cp35-cp35m-win32.whl", hash = "sha256:4f4b913ca1a7319b33cfb1369e91e50354d6f07a135f3b901aca02aa95940bd2"}, - {file = "PyYAML-5.3.1-cp35-cp35m-win_amd64.whl", hash = "sha256:cc8955cfbfc7a115fa81d85284ee61147059a753344bc51098f3ccd69b0d7e0c"}, - {file = "PyYAML-5.3.1-cp36-cp36m-win32.whl", hash = "sha256:7739fc0fa8205b3ee8808aea45e968bc90082c10aef6ea95e855e10abf4a37b2"}, - {file = "PyYAML-5.3.1-cp36-cp36m-win_amd64.whl", hash = "sha256:69f00dca373f240f842b2931fb2c7e14ddbacd1397d57157a9b005a6a9942648"}, - {file = "PyYAML-5.3.1-cp37-cp37m-win32.whl", hash = "sha256:d13155f591e6fcc1ec3b30685d50bf0711574e2c0dfffd7644babf8b5102ca1a"}, - {file = "PyYAML-5.3.1-cp37-cp37m-win_amd64.whl", hash = "sha256:73f099454b799e05e5ab51423c7bcf361c58d3206fa7b0d555426b1f4d9a3eaf"}, - {file = "PyYAML-5.3.1-cp38-cp38-win32.whl", hash = "sha256:06a0d7ba600ce0b2d2fe2e78453a470b5a6e000a985dd4a4e54e436cc36b0e97"}, - {file = "PyYAML-5.3.1-cp38-cp38-win_amd64.whl", hash = "sha256:95f71d2af0ff4227885f7a6605c37fd53d3a106fcab511b8860ecca9fcf400ee"}, - {file = "PyYAML-5.3.1-cp39-cp39-win32.whl", hash = "sha256:ad9c67312c84def58f3c04504727ca879cb0013b2517c85a9a253f0cb6380c0a"}, - {file = "PyYAML-5.3.1-cp39-cp39-win_amd64.whl", hash = "sha256:6034f55dab5fea9e53f436aa68fa3ace2634918e8b5994d82f3621c04ff5ed2e"}, - {file = "PyYAML-5.3.1.tar.gz", hash = "sha256:b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d"}, + {file = "PyYAML-6.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a"}, + {file = "PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, + {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, + {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, + {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, + {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, + {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win32.whl", hash = "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa"}, + {file = "PyYAML-6.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win32.whl", hash = "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867"}, + {file = "PyYAML-6.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, + {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, + {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, + {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, + {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, + {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, ] [[package]] @@ -931,6 +1175,21 @@ redis = ">=3.5.3,<5.0.0" types-redis = ">=3.5.9,<5.0.0" typing-extensions = ">=4.4.0,<5.0.0" +[[package]] +name = "referencing" +version = "0.30.0" +description = "JSON Referencing + Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "referencing-0.30.0-py3-none-any.whl", hash = "sha256:c257b08a399b6c2f5a3510a50d28ab5dbc7bbde049bcaf954d43c446f83ab548"}, + {file = "referencing-0.30.0.tar.gz", hash = "sha256:47237742e990457f7512c7d27486394a9aadaf876cbfaa4be65b27b4f4d47c6b"}, +] + +[package.dependencies] +attrs = ">=22.2.0" +rpds-py = ">=0.7.0" + [[package]] name = "regex" version = "2023.6.3" @@ -1049,6 +1308,127 @@ urllib3 = ">=1.21.1,<3" socks = ["PySocks (>=1.5.6,!=1.5.7)"] use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] +[[package]] +name = "rpds-py" +version = "0.9.2" +description = "Python bindings to Rust's persistent data structures (rpds)" +optional = false +python-versions = ">=3.8" +files = [ + {file = "rpds_py-0.9.2-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:ab6919a09c055c9b092798ce18c6c4adf49d24d4d9e43a92b257e3f2548231e7"}, + {file = "rpds_py-0.9.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d55777a80f78dd09410bd84ff8c95ee05519f41113b2df90a69622f5540c4f8b"}, + {file = "rpds_py-0.9.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a216b26e5af0a8e265d4efd65d3bcec5fba6b26909014effe20cd302fd1138fa"}, + {file = "rpds_py-0.9.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:29cd8bfb2d716366a035913ced99188a79b623a3512292963d84d3e06e63b496"}, + {file = "rpds_py-0.9.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:44659b1f326214950a8204a248ca6199535e73a694be8d3e0e869f820767f12f"}, + {file = "rpds_py-0.9.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:745f5a43fdd7d6d25a53ab1a99979e7f8ea419dfefebcab0a5a1e9095490ee5e"}, + {file = "rpds_py-0.9.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a987578ac5214f18b99d1f2a3851cba5b09f4a689818a106c23dbad0dfeb760f"}, + {file = "rpds_py-0.9.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bf4151acb541b6e895354f6ff9ac06995ad9e4175cbc6d30aaed08856558201f"}, + {file = "rpds_py-0.9.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:03421628f0dc10a4119d714a17f646e2837126a25ac7a256bdf7c3943400f67f"}, + {file = "rpds_py-0.9.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:13b602dc3e8dff3063734f02dcf05111e887f301fdda74151a93dbbc249930fe"}, + {file = "rpds_py-0.9.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:fae5cb554b604b3f9e2c608241b5d8d303e410d7dfb6d397c335f983495ce7f6"}, + {file = "rpds_py-0.9.2-cp310-none-win32.whl", hash = "sha256:47c5f58a8e0c2c920cc7783113df2fc4ff12bf3a411d985012f145e9242a2764"}, + {file = "rpds_py-0.9.2-cp310-none-win_amd64.whl", hash = "sha256:4ea6b73c22d8182dff91155af018b11aac9ff7eca085750455c5990cb1cfae6e"}, + {file = "rpds_py-0.9.2-cp311-cp311-macosx_10_7_x86_64.whl", hash = "sha256:e564d2238512c5ef5e9d79338ab77f1cbbda6c2d541ad41b2af445fb200385e3"}, + {file = "rpds_py-0.9.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f411330a6376fb50e5b7a3e66894e4a39e60ca2e17dce258d53768fea06a37bd"}, + {file = "rpds_py-0.9.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0e7521f5af0233e89939ad626b15278c71b69dc1dfccaa7b97bd4cdf96536bb7"}, + {file = "rpds_py-0.9.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8d3335c03100a073883857e91db9f2e0ef8a1cf42dc0369cbb9151c149dbbc1b"}, + {file = "rpds_py-0.9.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d25b1c1096ef0447355f7293fbe9ad740f7c47ae032c2884113f8e87660d8f6e"}, + {file = "rpds_py-0.9.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6a5d3fbd02efd9cf6a8ffc2f17b53a33542f6b154e88dd7b42ef4a4c0700fdad"}, + {file = "rpds_py-0.9.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c5934e2833afeaf36bd1eadb57256239785f5af0220ed8d21c2896ec4d3a765f"}, + {file = "rpds_py-0.9.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:095b460e117685867d45548fbd8598a8d9999227e9061ee7f012d9d264e6048d"}, + {file = "rpds_py-0.9.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:91378d9f4151adc223d584489591dbb79f78814c0734a7c3bfa9c9e09978121c"}, + {file = "rpds_py-0.9.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:24a81c177379300220e907e9b864107614b144f6c2a15ed5c3450e19cf536fae"}, + {file = "rpds_py-0.9.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:de0b6eceb46141984671802d412568d22c6bacc9b230174f9e55fc72ef4f57de"}, + {file = "rpds_py-0.9.2-cp311-none-win32.whl", hash = "sha256:700375326ed641f3d9d32060a91513ad668bcb7e2cffb18415c399acb25de2ab"}, + {file = "rpds_py-0.9.2-cp311-none-win_amd64.whl", hash = "sha256:0766babfcf941db8607bdaf82569ec38107dbb03c7f0b72604a0b346b6eb3298"}, + {file = "rpds_py-0.9.2-cp312-cp312-macosx_10_7_x86_64.whl", hash = "sha256:b1440c291db3f98a914e1afd9d6541e8fc60b4c3aab1a9008d03da4651e67386"}, + {file = "rpds_py-0.9.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0f2996fbac8e0b77fd67102becb9229986396e051f33dbceada3debaacc7033f"}, + {file = "rpds_py-0.9.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9f30d205755566a25f2ae0382944fcae2f350500ae4df4e795efa9e850821d82"}, + {file = "rpds_py-0.9.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:159fba751a1e6b1c69244e23ba6c28f879a8758a3e992ed056d86d74a194a0f3"}, + {file = "rpds_py-0.9.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a1f044792e1adcea82468a72310c66a7f08728d72a244730d14880cd1dabe36b"}, + {file = "rpds_py-0.9.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9251eb8aa82e6cf88510530b29eef4fac825a2b709baf5b94a6094894f252387"}, + {file = "rpds_py-0.9.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:01899794b654e616c8625b194ddd1e5b51ef5b60ed61baa7a2d9c2ad7b2a4238"}, + {file = "rpds_py-0.9.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b0c43f8ae8f6be1d605b0465671124aa8d6a0e40f1fb81dcea28b7e3d87ca1e1"}, + {file = "rpds_py-0.9.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:207f57c402d1f8712618f737356e4b6f35253b6d20a324d9a47cb9f38ee43a6b"}, + {file = "rpds_py-0.9.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:b52e7c5ae35b00566d244ffefba0f46bb6bec749a50412acf42b1c3f402e2c90"}, + {file = "rpds_py-0.9.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:978fa96dbb005d599ec4fd9ed301b1cc45f1a8f7982d4793faf20b404b56677d"}, + {file = "rpds_py-0.9.2-cp38-cp38-macosx_10_7_x86_64.whl", hash = "sha256:6aa8326a4a608e1c28da191edd7c924dff445251b94653988efb059b16577a4d"}, + {file = "rpds_py-0.9.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:aad51239bee6bff6823bbbdc8ad85136c6125542bbc609e035ab98ca1e32a192"}, + {file = "rpds_py-0.9.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4bd4dc3602370679c2dfb818d9c97b1137d4dd412230cfecd3c66a1bf388a196"}, + {file = "rpds_py-0.9.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:dd9da77c6ec1f258387957b754f0df60766ac23ed698b61941ba9acccd3284d1"}, + {file = "rpds_py-0.9.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:190ca6f55042ea4649ed19c9093a9be9d63cd8a97880106747d7147f88a49d18"}, + {file = "rpds_py-0.9.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:876bf9ed62323bc7dcfc261dbc5572c996ef26fe6406b0ff985cbcf460fc8a4c"}, + {file = "rpds_py-0.9.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fa2818759aba55df50592ecbc95ebcdc99917fa7b55cc6796235b04193eb3c55"}, + {file = "rpds_py-0.9.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9ea4d00850ef1e917815e59b078ecb338f6a8efda23369677c54a5825dbebb55"}, + {file = "rpds_py-0.9.2-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:5855c85eb8b8a968a74dc7fb014c9166a05e7e7a8377fb91d78512900aadd13d"}, + {file = "rpds_py-0.9.2-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:14c408e9d1a80dcb45c05a5149e5961aadb912fff42ca1dd9b68c0044904eb32"}, + {file = "rpds_py-0.9.2-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:65a0583c43d9f22cb2130c7b110e695fff834fd5e832a776a107197e59a1898e"}, + {file = "rpds_py-0.9.2-cp38-none-win32.whl", hash = "sha256:71f2f7715935a61fa3e4ae91d91b67e571aeb5cb5d10331ab681256bda2ad920"}, + {file = "rpds_py-0.9.2-cp38-none-win_amd64.whl", hash = "sha256:674c704605092e3ebbbd13687b09c9f78c362a4bc710343efe37a91457123044"}, + {file = "rpds_py-0.9.2-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:07e2c54bef6838fa44c48dfbc8234e8e2466d851124b551fc4e07a1cfeb37260"}, + {file = "rpds_py-0.9.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f7fdf55283ad38c33e35e2855565361f4bf0abd02470b8ab28d499c663bc5d7c"}, + {file = "rpds_py-0.9.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:890ba852c16ace6ed9f90e8670f2c1c178d96510a21b06d2fa12d8783a905193"}, + {file = "rpds_py-0.9.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:50025635ba8b629a86d9d5474e650da304cb46bbb4d18690532dd79341467846"}, + {file = "rpds_py-0.9.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:517cbf6e67ae3623c5127206489d69eb2bdb27239a3c3cc559350ef52a3bbf0b"}, + {file = "rpds_py-0.9.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0836d71ca19071090d524739420a61580f3f894618d10b666cf3d9a1688355b1"}, + {file = "rpds_py-0.9.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c439fd54b2b9053717cca3de9583be6584b384d88d045f97d409f0ca867d80f"}, + {file = "rpds_py-0.9.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f68996a3b3dc9335037f82754f9cdbe3a95db42bde571d8c3be26cc6245f2324"}, + {file = "rpds_py-0.9.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:7d68dc8acded354c972116f59b5eb2e5864432948e098c19fe6994926d8e15c3"}, + {file = "rpds_py-0.9.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:f963c6b1218b96db85fc37a9f0851eaf8b9040aa46dec112611697a7023da535"}, + {file = "rpds_py-0.9.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:5a46859d7f947061b4010e554ccd1791467d1b1759f2dc2ec9055fa239f1bc26"}, + {file = "rpds_py-0.9.2-cp39-none-win32.whl", hash = "sha256:e07e5dbf8a83c66783a9fe2d4566968ea8c161199680e8ad38d53e075df5f0d0"}, + {file = "rpds_py-0.9.2-cp39-none-win_amd64.whl", hash = "sha256:682726178138ea45a0766907957b60f3a1bf3acdf212436be9733f28b6c5af3c"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-macosx_10_7_x86_64.whl", hash = "sha256:196cb208825a8b9c8fc360dc0f87993b8b260038615230242bf18ec84447c08d"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:c7671d45530fcb6d5e22fd40c97e1e1e01965fc298cbda523bb640f3d923b387"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:83b32f0940adec65099f3b1c215ef7f1d025d13ff947975a055989cb7fd019a4"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7f67da97f5b9eac838b6980fc6da268622e91f8960e083a34533ca710bec8611"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:03975db5f103997904c37e804e5f340c8fdabbb5883f26ee50a255d664eed58c"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:987b06d1cdb28f88a42e4fb8a87f094e43f3c435ed8e486533aea0bf2e53d931"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c861a7e4aef15ff91233751619ce3a3d2b9e5877e0fcd76f9ea4f6847183aa16"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:02938432352359805b6da099c9c95c8a0547fe4b274ce8f1a91677401bb9a45f"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:ef1f08f2a924837e112cba2953e15aacfccbbfcd773b4b9b4723f8f2ddded08e"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-musllinux_1_2_i686.whl", hash = "sha256:35da5cc5cb37c04c4ee03128ad59b8c3941a1e5cd398d78c37f716f32a9b7f67"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:141acb9d4ccc04e704e5992d35472f78c35af047fa0cfae2923835d153f091be"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-macosx_10_7_x86_64.whl", hash = "sha256:79f594919d2c1a0cc17d1988a6adaf9a2f000d2e1048f71f298b056b1018e872"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:a06418fe1155e72e16dddc68bb3780ae44cebb2912fbd8bb6ff9161de56e1798"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8b2eb034c94b0b96d5eddb290b7b5198460e2d5d0c421751713953a9c4e47d10"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8b08605d248b974eb02f40bdcd1a35d3924c83a2a5e8f5d0fa5af852c4d960af"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a0805911caedfe2736935250be5008b261f10a729a303f676d3d5fea6900c96a"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ab2299e3f92aa5417d5e16bb45bb4586171c1327568f638e8453c9f8d9e0f020"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c8d7594e38cf98d8a7df25b440f684b510cf4627fe038c297a87496d10a174f"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8b9ec12ad5f0a4625db34db7e0005be2632c1013b253a4a60e8302ad4d462afd"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:1fcdee18fea97238ed17ab6478c66b2095e4ae7177e35fb71fbe561a27adf620"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-musllinux_1_2_i686.whl", hash = "sha256:933a7d5cd4b84f959aedeb84f2030f0a01d63ae6cf256629af3081cf3e3426e8"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:686ba516e02db6d6f8c279d1641f7067ebb5dc58b1d0536c4aaebb7bf01cdc5d"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-macosx_10_7_x86_64.whl", hash = "sha256:0173c0444bec0a3d7d848eaeca2d8bd32a1b43f3d3fde6617aac3731fa4be05f"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:d576c3ef8c7b2d560e301eb33891d1944d965a4d7a2eacb6332eee8a71827db6"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed89861ee8c8c47d6beb742a602f912b1bb64f598b1e2f3d758948721d44d468"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1054a08e818f8e18910f1bee731583fe8f899b0a0a5044c6e680ceea34f93876"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:99e7c4bb27ff1aab90dcc3e9d37ee5af0231ed98d99cb6f5250de28889a3d502"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c545d9d14d47be716495076b659db179206e3fd997769bc01e2d550eeb685596"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9039a11bca3c41be5a58282ed81ae422fa680409022b996032a43badef2a3752"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fb39aca7a64ad0c9490adfa719dbeeb87d13be137ca189d2564e596f8ba32c07"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:2d8b3b3a2ce0eaa00c5bbbb60b6713e94e7e0becab7b3db6c5c77f979e8ed1f1"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-musllinux_1_2_i686.whl", hash = "sha256:99b1c16f732b3a9971406fbfe18468592c5a3529585a45a35adbc1389a529a03"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:c27ee01a6c3223025f4badd533bea5e87c988cb0ba2811b690395dfe16088cfe"}, + {file = "rpds_py-0.9.2.tar.gz", hash = "sha256:8d70e8f14900f2657c249ea4def963bed86a29b81f81f5b76b5a9215680de945"}, +] + +[[package]] +name = "rq" +version = "1.15.1" +description = "RQ is a simple, lightweight, library for creating background jobs, and processing them." +optional = false +python-versions = ">=3.6" +files = [ + {file = "rq-1.15.1-py2.py3-none-any.whl", hash = "sha256:6e243d8d9c4af4686ded4b01b25ea1ff4bac4fc260b02638fbe9c8c17b004bd1"}, + {file = "rq-1.15.1.tar.gz", hash = "sha256:1f49f4ac1a084044bb8e95b3f305c0bf17e55618b08c18e0b60c080f12d6f008"}, +] + +[package.dependencies] +click = ">=5.0.0" +redis = ">=4.0.0" + [[package]] name = "six" version = "1.16.0" @@ -1071,6 +1451,17 @@ files = [ {file = "sniffio-1.3.0.tar.gz", hash = "sha256:e60305c5e5d314f5389259b7f22aaa33d8f7dee49763119234af3755c55b9101"}, ] +[[package]] +name = "sortedcontainers" +version = "2.4.0" +description = "Sorted Containers -- Sorted List, Sorted Dict, Sorted Set" +optional = false +python-versions = "*" +files = [ + {file = "sortedcontainers-2.4.0-py2.py3-none-any.whl", hash = "sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0"}, + {file = "sortedcontainers-2.4.0.tar.gz", hash = "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88"}, +] + [[package]] name = "starlette" version = "0.27.0" @@ -1090,13 +1481,13 @@ full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart", "pyyam [[package]] name = "types-pyopenssl" -version = "23.2.0.1" +version = "23.2.0.2" description = "Typing stubs for pyOpenSSL" optional = false python-versions = "*" files = [ - {file = "types-pyOpenSSL-23.2.0.1.tar.gz", hash = "sha256:beeb5d22704c625a1e4b6dc756355c5b4af0b980138b702a9d9f932acf020903"}, - {file = "types_pyOpenSSL-23.2.0.1-py3-none-any.whl", hash = "sha256:0568553f104466f1b8e0db3360fbe6770137d02e21a1a45c209bf2b1b03d90d4"}, + {file = "types-pyOpenSSL-23.2.0.2.tar.gz", hash = "sha256:6a010dac9ecd42b582d7dd2cc3e9e40486b79b3b64bb2fffba1474ff96af906d"}, + {file = "types_pyOpenSSL-23.2.0.2-py3-none-any.whl", hash = "sha256:19536aa3debfbe25a918cf0d898e9f5fbbe6f3594a429da7914bf331deb1b342"}, ] [package.dependencies] @@ -1104,13 +1495,13 @@ cryptography = ">=35.0.0" [[package]] name = "types-redis" -version = "4.6.0.2" +version = "4.6.0.3" description = "Typing stubs for redis" optional = false python-versions = "*" files = [ - {file = "types-redis-4.6.0.2.tar.gz", hash = "sha256:d0efcd96f65fd2036437c29d8c12566cfdc549345d73eddacb0488b81aff9f9e"}, - {file = "types_redis-4.6.0.2-py3-none-any.whl", hash = "sha256:a98f3386f44d045057696f3efc8869c53dda0060610e0fe3d8a4d391e2a8916a"}, + {file = "types-redis-4.6.0.3.tar.gz", hash = "sha256:efdef37dc0c04bf5786195651fd694f8bfdd693eac09ec4af46d90f72652558f"}, + {file = "types_redis-4.6.0.3-py3-none-any.whl", hash = "sha256:67c44c14369c33c2a300da2a50b5607c0fc888f7b85eeb7c73e15c78a0f05edd"}, ] [package.dependencies] @@ -1130,13 +1521,13 @@ files = [ [[package]] name = "urllib3" -version = "2.0.3" +version = "2.0.4" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.7" files = [ - {file = "urllib3-2.0.3-py3-none-any.whl", hash = "sha256:48e7fafa40319d358848e1bc6809b208340fafe2096f1725d05d67443d0483d1"}, - {file = "urllib3-2.0.3.tar.gz", hash = "sha256:bee28b5e56addb8226c96f7f13ac28cb4c301dd5ea8a6ca179c0b9835e032825"}, + {file = "urllib3-2.0.4-py3-none-any.whl", hash = "sha256:de7df1803967d2c2a98e4b11bb7d6bd9210474c46e8a0401514e3a42a75ebde4"}, + {file = "urllib3-2.0.4.tar.gz", hash = "sha256:8d22f86aae8ef5e410d4f539fde9ce6b2113a001bb4d189e0aed70642d602b11"}, ] [package.extras] @@ -1366,7 +1757,24 @@ files = [ {file = "websockets-11.0.3.tar.gz", hash = "sha256:88fc51d9a26b10fc331be344f1781224a375b78488fc343620184e95a4b27016"}, ] +[[package]] +name = "werkzeug" +version = "2.2.3" +description = "The comprehensive WSGI web application library." +optional = false +python-versions = ">=3.7" +files = [ + {file = "Werkzeug-2.2.3-py3-none-any.whl", hash = "sha256:56433961bc1f12533306c624f3be5e744389ac61d722175d543e1751285da612"}, + {file = "Werkzeug-2.2.3.tar.gz", hash = "sha256:2e1ccc9417d4da358b9de6f174e3ac094391ea1d4fbef2d667865d819dfd0afe"}, +] + +[package.dependencies] +MarkupSafe = ">=2.1.1" + +[package.extras] +watchdog = ["watchdog"] + [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "153c8da162f590d55787e104edf56c2c2c5b2dd8f0f3ea77106c408d2d58f3cd" +content-hash = "f5b10fcc5dcdd2d68b173db4217f7cf3b34a4d46def09c5c4c5417018911cdb9" diff --git a/poetry.toml b/poetry.toml new file mode 100644 index 00000000..ab1033bd --- /dev/null +++ b/poetry.toml @@ -0,0 +1,2 @@ +[virtualenvs] +in-project = true diff --git a/pyproject.toml b/pyproject.toml index c617bcb4..a596f6ec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,15 +14,29 @@ uvicorn = { extras = ["standard"], version = "^0.23.0" } pydantic = ">=1.10.2,<2.0" redis-om = "^0.1.3" githubkit = "^0.10.6" +rq = "^1.15.1" +pyyaml = "^6.0.1" +redis = "^4.6.0" [tool.poetry.group.docs.dependencies] mkdocs-material = "^9.1.19" + +[tool.poetry.group.dev.dependencies] +connexion = "^2.14.2" +pytest = "^7.4.0" +hypothesis = "^6.82.0" + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.pyright] -reportMissingImports = false include = ["runner_manager"] +exclude = ["**/__pycache__", "__pypackages__", "**/node_modules", "./dist"] +venv = ".venv" +venvPath = "." +stubPath = "./typings" +reportMissingImports = false +reportMissingModuleSource = false typeCheckingMode = "basic" diff --git a/runner_manager/__init__.py b/runner_manager/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/runner_manager/backend/__init__.py b/runner_manager/backend/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/runner_manager/backend/base.py b/runner_manager/backend/base.py new file mode 100644 index 00000000..c61850e6 --- /dev/null +++ b/runner_manager/backend/base.py @@ -0,0 +1,54 @@ +from abc import ABC +from typing import List + +from runner_manager.models.runner import Runner + + +class BackendBase(ABC): + """Base class for runners backend. + + Runners backend are responsible for managing runners instances. + """ + + def create(self, runner: Runner) -> Runner: + """Create a runner instance. + + Args: + runner (Runner): Runner instance to be created. + """ + raise NotImplementedError + + def delete(self, runner: Runner) -> Runner: + """Delete a runner instance. + + Args: + runner (Runner): Runner instance to be deleted. + """ + raise NotImplementedError + + def update(self, runner: Runner) -> Runner: + """Update a runner instance. + + Args: + runner (Runner): Runner instance to be updated. + """ + raise NotImplementedError + + def get(self, instance_id: int) -> Runner: + """Get a runner instance. + + Args: + instance_id (int): Runner instance id. + + Returns: + Runner: Runner instance. + """ + raise NotImplementedError + + def list(self) -> List[Runner]: + """List all runner instances. + + Returns: + list: List of runner instances. + """ + raise NotImplementedError diff --git a/runner_manager/dependencies.py b/runner_manager/dependencies.py new file mode 100644 index 00000000..00c2fc61 --- /dev/null +++ b/runner_manager/dependencies.py @@ -0,0 +1,20 @@ +from functools import lru_cache + +from redis import Redis +from redis_om import get_redis_connection +from rq import Queue + +from runner_manager.models.settings import Settings + + +@lru_cache() +def get_settings() -> Settings: + return Settings() + + +def get_redis() -> Redis: + return get_redis_connection(url=get_settings().redis_om_url, decode_responses=True) + + +def get_queue() -> Queue: + return Queue(connection=get_redis()) diff --git a/runner_manager/jobs/__init__.py b/runner_manager/jobs/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/runner_manager/jobs/runner.py b/runner_manager/jobs/runner.py new file mode 100644 index 00000000..ccefb000 --- /dev/null +++ b/runner_manager/jobs/runner.py @@ -0,0 +1,5 @@ +from runner_manager.models.runner import Runner + + +def create_runner(runner: Runner) -> Runner: + return runner.save() diff --git a/runner_manager/jobs/settings.py b/runner_manager/jobs/settings.py new file mode 100644 index 00000000..646bbcbc --- /dev/null +++ b/runner_manager/jobs/settings.py @@ -0,0 +1,8 @@ +from pydantic import RedisDsn + +from runner_manager.dependencies import get_settings +from runner_manager.models.settings import Settings + +settings: Settings = get_settings() + +REDIS_URL: RedisDsn | None = settings.redis_om_url diff --git a/runner_manager/jobs/startup.py b/runner_manager/jobs/startup.py new file mode 100644 index 00000000..550cbb99 --- /dev/null +++ b/runner_manager/jobs/startup.py @@ -0,0 +1,7 @@ +"""Jobs to run on startup.""" + +from redis_om import Migrator + + +def startup(): + return Migrator().run() diff --git a/runner_manager/main.py b/runner_manager/main.py index 90055120..6216fdcc 100644 --- a/runner_manager/main.py +++ b/runner_manager/main.py @@ -1,10 +1,23 @@ -from fastapi import FastAPI +import logging -from runner_manager.models.runner import Runner +from fastapi import FastAPI, Response + +from runner_manager.dependencies import get_queue +from runner_manager.jobs.startup import startup + +log = logging.getLogger(__name__) app = FastAPI() -@app.put("/runner") -def create_runner(runner: Runner) -> Runner: - return runner.save() +@app.on_event("startup") +def startup_event(): + queue = get_queue() + job = queue.enqueue(startup) + status = job.get_status() + log.info(f"Startup job is {status}") + + +@app.get("/_health") +def health(): + return Response(status_code=200) diff --git a/runner_manager/models/__init__.py b/runner_manager/models/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/runner_manager/models/base.py b/runner_manager/models/base.py new file mode 100644 index 00000000..90beb51c --- /dev/null +++ b/runner_manager/models/base.py @@ -0,0 +1,16 @@ +from abc import ABC + +from redis_om import JsonModel + +from runner_manager.dependencies import get_redis, get_settings + +redis = get_redis() +settings = get_settings() + + +class BaseModel(JsonModel, ABC): + class Meta: + database = redis + global_key_prefix = settings.name + abstract = True + model_key_prefix = __build_class__.__name__.lower() diff --git a/runner_manager/models/runner.py b/runner_manager/models/runner.py index 3bb401d1..cbc08046 100644 --- a/runner_manager/models/runner.py +++ b/runner_manager/models/runner.py @@ -1,6 +1,34 @@ -from githubkit.rest.models import Runner as GithubRunner -from redis_om import JsonModel +from datetime import datetime +from enum import Enum +from typing import Optional +from redis_om import Field -class Runner(JsonModel, GithubRunner): - pass +from runner_manager.models.base import BaseModel + +# Ideally the runner model would have been inherited +# from githubkit.rest.models.Runner, like the following: +# class Runner(BaseModel, githubkit.rest.models.Runner): +# However, to make use of redis' search capability, we +# have to use Field(index=True), and there was some +# issue with the search when doing so. +# Until we figure out the issue, we will have to +# manually define the fields here. + + +class RunnerStatus(str, Enum): + online = "online" + idle = "idle" + offline = "offline" + + +class Runner(BaseModel): + name: str = Field(index=True) + runner_group_id: int = Field(ge=0, index=True) + instance_id: Optional[int] = Field(ge=0, index=True) + status: RunnerStatus = Field( + default=RunnerStatus.offline, index=True, full_text_search=True + ) + busy: bool + created_at: Optional[datetime] + updated_at: Optional[datetime] diff --git a/runner_manager/models/runnergroup.py b/runner_manager/models/runnergroup.py new file mode 100644 index 00000000..e69de29b diff --git a/runner_manager/models/settings.py b/runner_manager/models/settings.py new file mode 100644 index 00000000..f731bb35 --- /dev/null +++ b/runner_manager/models/settings.py @@ -0,0 +1,44 @@ +from pathlib import Path +from typing import Any, Dict, Optional + +import yaml +from pydantic import BaseSettings, RedisDsn + + +def yaml_config_settings_source(settings: BaseSettings) -> Dict[str, Any]: + """ + A simple settings source that loads variables from a yaml file + + """ + config_file: Path = settings.__config__.config.config_file + if config_file: + return yaml.full_load(config_file.read_text()) + return {} + + +class ConfigFile(BaseSettings): + config_file: Optional[Path] + + +class Settings(BaseSettings): + name: str = "runner-manager" + redis_om_url: Optional[RedisDsn] = None + + class Config: + config: ConfigFile = ConfigFile() + env_file = ".env" + env_file_encoding = "utf-8" + + @classmethod + def customise_sources( + cls, + init_settings, + env_settings, + file_secret_settings, + ): + return ( + init_settings, + yaml_config_settings_source, + env_settings, + file_secret_settings, + ) diff --git a/runner_manager/py.typed b/runner_manager/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/tests/images/github-mock/Dockerfile b/tests/images/github-mock/Dockerfile new file mode 100644 index 00000000..2972c60c --- /dev/null +++ b/tests/images/github-mock/Dockerfile @@ -0,0 +1,9 @@ +FROM ghcr.io/stoplightio/prism/prism:master + +HEALTHCHECK NONE + +USER node + +EXPOSE 4010 + +CMD ["mock", "https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/ghec/ghec.2022-11-28.json", "-h", "0.0.0.0"] diff --git a/tests/unit/models/conftest.py b/tests/unit/models/conftest.py new file mode 100644 index 00000000..2b2e99e9 --- /dev/null +++ b/tests/unit/models/conftest.py @@ -0,0 +1,32 @@ +from pytest import fixture +from redis_om import Migrator, get_redis_connection + +from runner_manager.dependencies import get_settings +from runner_manager.models.runner import Runner +from runner_manager.models.settings import Settings + + +@fixture(scope="session", autouse=True) +def settings() -> Settings: + settings = get_settings() + return settings + + +@fixture(scope="session", autouse=True) +def redis(settings): + """Flush redis before tests.""" + + redis_connection = get_redis_connection( + url=settings.redis_om_url, decode_responses=True + ) + redis_connection.flushall() + + Migrator().run() + yield redis_connection + + +@fixture() +def runner() -> Runner: + runner = Runner(name="test", runner_group_id=1, status="online", busy=False) + Runner.delete(runner.pk) + return runner diff --git a/tests/unit/models/test_runner.py b/tests/unit/models/test_runner.py new file mode 100644 index 00000000..775842a9 --- /dev/null +++ b/tests/unit/models/test_runner.py @@ -0,0 +1,38 @@ +import pytest +from hypothesis import given +from hypothesis import strategies as st +from redis_om import Migrator, NotFoundError + +from runner_manager.models.runner import Runner + + +@given(st.builds(Runner)) +def test_validate_runner(instance: Runner): + assert instance.name is not None + assert instance.runner_group_id >= 0 + assert instance.status in ["online", "offline", "idle"] + assert isinstance(instance.busy, bool) + + +def test_runner_create_delete(runner: Runner): + runner.save() + assert Runner.get(runner.pk) == runner + Runner.delete(runner.pk) + with pytest.raises(NotFoundError): + Runner.get(runner.pk) + + +def test_find_runner(runner: Runner): + runner.save() + Migrator().run() + runners = Runner.find().all() + assert runner in runners + + assert runner == Runner.find(Runner.name == runner.name).first() + assert ( + runner == Runner.find(Runner.runner_group_id == runner.runner_group_id).first() + ) + assert runner == Runner.find(Runner.status == runner.status).first() + Runner.delete(runner.pk) + with pytest.raises(NotFoundError): + Runner.find(Runner.name == runner.name).first()