oncall-engine/engine/apps
Joey Orlando 7ebc9cbbf7
modify push notification settings + use fcm-django library (#998)
- swaps out `django-push-notifications` for
[`fcm-django`](https://github.com/grafana/fcm-django). Again.. this is a
fork of the parent repo for exactly the same reason.. the migrations
point to `auth_user` without letting us use our own user model, this has
been patched in the `grafana` fork. The reason why we are using
`fcm-django` vs `django-push-notifications` is that the latter does not
support the new FCM API, only the "legacy" API. The legacy FCM API does
not support certain push notification settings that we would like to
use.
- modifies the iOS/Android specific push notification settings
- adds a `flower` pod in the `docker-compose-developer.yml`, useful for
debugging tasks locally
- sets the mobile app verification token TTL to 5 minutes when
developing locally. The default of 1 minute makes working with device
emulators really tricky..

This PR also swaps out the base image in `engine/Dockerfile` from
`python:3.9-alpine3.16` to `python:3.9-slim-buster`.

As to why.. in short, with the introduction of the `fcm-django` library
there is now a peer-dependency on
[`grpcio`](https://github.com/grpc/grpc) (which is used by
`firebase_admin`.. which I am using in this PR to interact directly with
Firebase Cloud Messaging (FCM)). `grpcio` does not publish wheels (read:
compiled binaries) for the Alpine distro. It does publish wheels for
Debian and hence `pip install -r requirements.txt` does not need to
build this library from the source distribution.

This is a [known
"issue"](https://github.com/grpc/grpc/issues/22815#issuecomment-1107874367)
and the recommended solution in the community is to.. not use alpine.

These were the numbers, when building the image locally, in terms of
image size and build time:

| | Local image size (uncompressed | Build time (may differ based on
your network speed) |
| ------------------------- | -------------------------------------- |
---------- |
| `python:3.9-alpine3.16`   | 785MB  | 320s |
| `python:3.9-slim-buster` | 1.05GB  | 90s   |

Co-authored-by: Salvatore Giordano <salvatoregiordanoo@gmail.com>
2022-12-20 12:41:34 +01:00
..
alerts Speedup seach alertgroup 2022-12-17 19:34:13 +08:00
api remove apns + fix django-push-notifications migrations (#984) 2022-12-13 13:00:59 +01:00
api_for_grafana_incident World, meet OnCall! 2022-06-03 08:09:47 -06:00
auth_token Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
base Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
email Allow no-auth SMTP connection for email notifications (#759) 2022-11-03 16:18:37 +00:00
grafana_plugin remove is_rbac_permissions_enabled logic from check_gcom_permission function (#976) 2022-12-12 17:05:44 +01:00
heartbeat Insight logs (#348) 2022-08-24 12:04:44 +05:00
integrations Check id instead of object to avoid unnecessary query 2022-10-28 15:45:51 -06:00
mobile_app modify push notification settings + use fcm-django library (#998) 2022-12-20 12:41:34 +01:00
oss_installation Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
public_api add permalinks.web attribute to alert group internal/public api response (#953) 2022-12-06 11:06:05 +01:00
schedules centralize timezone validation + add serializer validation for on call shifts and schedules (#924) 2022-12-01 14:13:39 +01:00
slack Add additional logging info for slack API event endpoint requests 2022-12-12 15:41:48 -03:00
social_auth Support of oncall-gw (#741) 2022-11-08 14:43:22 +08:00
telegram Shorten telegram callback data (#959) 2022-12-07 23:54:29 +08:00
twilioapp Add simple check if using API key instead of AUTH token 2022-11-09 21:52:42 -07:00
user_management fix sync.. again (#978) 2022-12-12 18:48:26 +01:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00