Metadata-Version: 2.1
Name: reliably-app
Version: 0.2.0
Summary: Reliably - Resilience and Chaos Engineering Platform
Author-Email: Sylvain Hellegouarch <sylvain@rebound.how>
License: Apache-2.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Framework :: FastAPI
Classifier: Framework :: Pydantic :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Project-URL: Homepage, https://reliably.com/
Project-URL: Documentation, https://reliably.com/docs/
Project-URL: Source, https://github.com/rebound-how/reliably
Requires-Python: >=3.12
Requires-Dist: pydantic>=2.1.1
Requires-Dist: authlib>=1.2.1
Requires-Dist: httpx[http2]>=0.24.1
Requires-Dist: anyio>=3.7.1
Requires-Dist: itsdangerous>=2.1.2
Requires-Dist: asyncpg>=0.28.0
Requires-Dist: sqlalchemy[asyncio]>=1.4.49
Requires-Dist: fastapi>=0.100.1
Requires-Dist: opentelemetry-api>=1.19.0
Requires-Dist: opentelemetry-sdk>=1.19.0
Requires-Dist: opentelemetry-instrumentation-fastapi>=0.40b0
Requires-Dist: opentelemetry-instrumentation-sqlalchemy>=0.40b0
Requires-Dist: opentelemetry-instrumentation-httpx>=0.40b0
Requires-Dist: opentelemetry-instrumentation-logging>=0.40b0
Requires-Dist: opentelemetry-instrumentation-asyncpg>=0.40b0
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.19.0
Requires-Dist: opentelemetry-propagator-b3>=1.19.0
Requires-Dist: opentelemetry-semantic-conventions>=0.40b0
Requires-Dist: python-json-logger>=2.0.7
Requires-Dist: cryptography>=41.0.2
Requires-Dist: ruamel-yaml>=0.17.32
Requires-Dist: greenlet>=2.0.2
Requires-Dist: orjson>=3.9.2
Requires-Dist: uvicorn>=0.23.2
Requires-Dist: httptools>=0.6.0
Requires-Dist: uvloop>=0.17.0
Requires-Dist: typer>=0.9.0
Requires-Dist: argon2-cffi>=21.3.0
Requires-Dist: docker>=6.1.3
Requires-Dist: croniter>=1.4.1
Requires-Dist: cron-validator>=1.0.8
Requires-Dist: kubernetes>=32.0.1
Requires-Dist: pydantic-settings>=2.0.2
Requires-Dist: pytz>=2023.3
Requires-Dist: certifi>=2023.7.22
Requires-Dist: magentic>=0.11.1
Requires-Dist: lueur>=0.1.0
Requires-Dist: python-jsonpath>=1.1.1
Requires-Dist: msgspec>=0.19.0
Requires-Dist: tenacity>=9.0.0
Requires-Dist: Secweb>=1.18.1
Requires-Dist: instructor>=1.7.2
Requires-Dist: alembic>=1.9.0
Requires-Dist: rich>=13.4.2
Requires-Dist: platformdirs>=4.3.6
Requires-Dist: tzlocal>=5.2
Requires-Dist: boto3>=1.36.18
Provides-Extra: gcp
Requires-Dist: google-crc32c>=1.5.0; extra == "gcp"
Requires-Dist: opentelemetry-exporter-gcp-trace>=1.4.0; extra == "gcp"
Requires-Dist: opentelemetry-resourcedetector-gcp>=1.4.0a0; extra == "gcp"
Requires-Dist: opentelemetry-propagator-gcp>=1.4.0; extra == "gcp"
Requires-Dist: google-cloud-kms>=2.13.0; extra == "gcp"
Requires-Dist: google-auth>=2.30.0; extra == "gcp"
Requires-Dist: grpcio>=1.70.0; extra == "gcp"
Provides-Extra: full
Requires-Dist: chaostoolkit>=1.19.0; extra == "full"
Requires-Dist: chaostoolkit-lib>=1.44.0; extra == "full"
Requires-Dist: chaostoolkit-aws>=0.35.1; extra == "full"
Requires-Dist: chaostoolkit-kubernetes>=0.39.0; extra == "full"
Requires-Dist: chaostoolkit-opentracing>=0.17.0; extra == "full"
Requires-Dist: chaostoolkit-wiremock>=0.1.2; extra == "full"
Requires-Dist: chaostoolkit-gandi>=0.2.0; extra == "full"
Requires-Dist: chaostoolkit-dynatrace>=0.2.0; extra == "full"
Requires-Dist: chaostoolkit-reliably>=0.79.0; extra == "full"
Requires-Dist: chaostoolkit-addons>=0.11.0; extra == "full"
Requires-Dist: chaostoolkit-grafana>=0.2.0; extra == "full"
Requires-Dist: chaostoolkit-slack>=0.10.0; extra == "full"
Requires-Dist: aws-az-failure-chaostoolkit>=0.1.10; extra == "full"
Requires-Dist: opentelemetry-api>=1.30.0; extra == "full"
Requires-Dist: opentelemetry-sdk>=1.30.0; extra == "full"
Requires-Dist: opentelemetry-instrumentation-httpx>=0.51b0; extra == "full"
Requires-Dist: opentelemetry-instrumentation-logging>=0.51b0; extra == "full"
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.30.0; extra == "full"
Requires-Dist: opentelemetry-opentracing-shim>=0.51b0; extra == "full"
Requires-Dist: opentelemetry-propagator-b3>=1.30.0; extra == "full"
Requires-Dist: opentelemetry-semantic-conventions>=0.51b0; extra == "full"
Requires-Dist: opentelemetry-exporter-gcp-trace>=1.9.0; extra == "full"
Requires-Dist: opentelemetry-resourcedetector-gcp>=1.9.0a0; extra == "full"
Requires-Dist: opentelemetry-propagator-gcp>=1.9.0; extra == "full"
Requires-Dist: httpx[http2]>=0.28.1; extra == "full"
Requires-Dist: jsonpath2>=0.4.5; extra == "full"
Requires-Dist: reliably-cli>=0.28.1; extra == "full"
Requires-Dist: chaostoolkit-honeycomb>=0.6.2; extra == "full"
Requires-Dist: awscli>=1.37.26; extra == "full"
Requires-Dist: chaostoolkit-google-cloud-platform>=0.37.0; extra == "full"
Requires-Dist: slack-sdk>=3.34.0; extra == "full"
Requires-Dist: chaostoolkit-fault>=0.1.1; extra == "full"
Description-Content-Type: text/markdown

![](./banner.png)

# Reliably Application server

Welcome to Reliably. This is the application server which serves the reliably
API used by Reliably services.

## Requirements

This application requires the following to run:

* A modern Linux distribution with systemd
* Python 3.12+
* Access to a PostgreSQL 14+ database
* Docker available to run the plans

## Getting Started

### Install the application

Run following command:

```bash
pip install \
    -U \
    --disable-pip-version-check \
    --prefer-binary \
    --no-cache-dir \
    reliably-app
```

The username and password should have been given to you by Reliably staff
as well. You may save them in your keyring but make sure they are
properly secured.

You may use the same command to update Reliably.

### View the version

Run the following command:

```bash
reliably-server version
```

This may be handy when interacting with Reliably staff.

### View this Readme

Run the following command:

```bash
reliably-server doc show-readme
```

### Initializating a configuration file

Run the following command:

```bash
reliably-server config init --interactive
```

This will populate a `.env` file in the current directory with good default
values. It will prompt you for some additional information.

Feel free to review and edit that file.

### Populating the database

The first task is to ensure your database is properly populated. Once done,
this should be seldom required, only reliably informs you the schema has been
changed.

Run the following command:

```bash
reliably-server db migrate
```

You can ask for the current moigration revision:

```bash
reliably-server db revision
```

If you created two different PostgreSQL users with different roles, you
need to create a new `.env` file (you can simply duplicate the application
one created in the previous section) and change the database credentials
accordingly.

Then run:

```bash
reliably-server db migrate --env-file .migrate.env
```

This will use this configuration to create the database schema.

## Run Reliably

You can run the `reliably-server` process manually or via systemd. We will
focus on first running it manually and explain the systemd supervision in a
following section.

In the directory containing your `.env` file, run the following command:

```bash
reliably-server run
```

By default, Reliably creates a pidfile to track the running process.
You can change the path of the pidfile or also disable the pidfile with
the appropriate command line argument.

## Stop Reliably

You can stop the server with the following command:

```bash
reliably-server stop
```

## Where to go next?

At this stage, Reliably is now running and can be used. Let's see what else
you may need to do.

## Appendices

### Database

#### Version

Reliably only works with a PostgreSQL database and expects a recent version
(at least version 14).

#### Access to a PostgreSQL 14+ database

For quick start, you may run a PostgreSQL locally in a container as follows:

```bash
docker run \
    --name postgres \
    -e POSTGRES_USER=test \
    -e POSTGRES_PASSWORD=secret \
    -e POSTGRES_DB=reliably \
    -p 5432:5432 \
    --rm \
    postgres
```

#### Users and their roles

The `reliably-server` process expects a non-admin user but with the following
privileges:

* `"CONNECT"`, `"TEMPORARY"` on the database
* `"ALL"` on the `public.table`

In addition, to run the migration script that populates and keep the schema
up to date, you need one user with the following privileges:

* `"CREATE"`, `"CONNECT"`, `"TEMPORARY"` on the database
* `"EXECUTE"` on the `function.table`
* `"EXECUTE"` on the `procedure.table`
* `"ALL"` on the `public.sequence`
* `"SELECT"`, `"INSERT"`, `"DELETE"`, `"UPDATE"`, `"TRUNCATE"`, `"TRIGGER"`, `"REFERENCES"` on the `public.table`

We suggest you create two distinct users but you don't have to.


### Supervision

#### Systemd

You may want to ensure it is supervised properly by the system in case it goes
down. If you run on a modern Linux system, you probably have systemd installed.
You can therefore install a systemd unit service that will ensure systemd
takes care of the process.

To do that, run the following command:

```bash
reliably-server system systemd create-unit-service
```

This will generate a `reliably.service` file that can be installed as a system
service following the instructions given by the command.
