oncall-engine/engine/apps/mobile_app
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
..
migrations Mobile app messaging backend (#874) 2022-11-23 15:56:43 +00:00
__init__.py Mobile app messaging backend (#874) 2022-11-23 15:56:43 +00:00
alert_rendering.py Mobile app messaging backend (#874) 2022-11-23 15:56:43 +00:00
auth.py Mobile app messaging backend (#874) 2022-11-23 15:56:43 +00:00
backend.py modify push notification settings + use fcm-django library (#998) 2022-12-20 12:41:34 +01:00
fcm_relay.py modify push notification settings + use fcm-django library (#998) 2022-12-20 12:41:34 +01:00
models.py modify push notification settings + use fcm-django library (#998) 2022-12-20 12:41:34 +01:00
tasks.py modify push notification settings + use fcm-django library (#998) 2022-12-20 12:41:34 +01:00
urls.py remove apns + fix django-push-notifications migrations (#984) 2022-12-13 13:00:59 +01:00
views.py modify push notification settings + use fcm-django library (#998) 2022-12-20 12:41:34 +01:00