Commit graph

15 commits

Author SHA1 Message Date
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
Joey Orlando
ed4be171f6
add make command to configure mobile app feature (#988)
Adds a make command, `enable-mobile-app-feature-flags`, which sets the
backend feature flag in `./dev/.env.dev`, and updates a record in the
`base_dynamicsetting` database table, which are needed to enable the
mobile app backend features.
2022-12-14 09:36:35 +01:00
Joey Orlando
c08eeb72a3
add precommit rules for markdown/json files (#915)
* add markdownlint precommit steps + fix existing errors

* prettier json linting
2022-12-01 14:26:54 +01:00
Joey Orlando
9a7b8acd5a
centralize timezone validation + add serializer validation for on call shifts and schedules (#924)
* Centralize timezone validation into one spot + add serializer validation
for schedules and oncall shifts (both public and internal API)

* add engine-manage make command
2022-12-01 14:13:39 +01:00
Ildar Iskhakov
3198612c65
Add flag to debug logs (#912) 2022-11-29 11:16:42 +08:00
Jack Jackson
c517569108
Create generic Make command to run Django manage.py (#886)
See https://github.com/grafana/oncall/pull/868
2022-11-22 22:15:22 +01:00
Jack Jackson
491093100a
Note that Docker Compose >=v2.10 is required (#885)
See https://github.com/grafana/oncall/issues/846
2022-11-22 22:13:52 +01:00
Yulya Artyukhina
381520ee13
Get rid of installation token + add a bunch of tests (#624)
* Get rid of installation token (for OSS installations)

This is done by being required to supply the grafana API URL as an
environment variable on the backend. Additionally, optionally an OnCall
API URL environment variable can be passed in to the frontend (this basically
allows completely skipping the need to configure anything).
- deduplicated a lot of the sync logic on the frontend + made
error message more useful and consistent
- Split PluginConfigPage component into several subcomponents
(making it easier to test each individual component)
- Moved RootWithLoader (from plugin/GrafanaPluginRootPage) into its own
subcomponent (making it easier to test)
- Added tests for pre-existing components that were touched:
  - PluginConfigPage component (and its new subcomponents)
  - state/plugin and state/rootBaseStore functions
  - apps.grafana_plugin django app

Helm changes:
- add GRAFANA_API_URL to oncall.env
- some yaml autoformatting changes
- remove reference to python manage.py issue_invite_for_the_frontend --override

Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
2022-11-21 16:26:00 +01:00
Yulia Shanyrova
a53dc71883
developer readme has been updated: troubleshooting case (#859)
* developer readme has been updated: troubleshooting case

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2022-11-21 14:19:43 +01:00
Jack Jackson
0bb1a792ea Add documentation for issue make when CDPATH is set unusually
Note - you may be wondering "how could your system possibly function if
`.` is not part of `CDPATH`? Testing suggests that behaviour is
inconsistent between shells - `sh` will entirely ignore the current
directory if `.` is absent, but `zsh` will still attempt to search the
current directory even if `.` is not in `CDPATH`
2022-11-14 08:07:43 +01:00
Jack Jackson
8cdc1a76e3 Typo-fix 2022-11-14 08:06:17 +01:00
Jack Jackson
8b6bd3a32d Correct typos regarding COMPOSE_PROFILES
Proof:

```
$ grep 'COMPOSE' dev/.env.dev
COMPOSE_PROFILE=overriden_value_1
COMPOSE_PROFILES=overriden_value_2
$ make start
COMPOSE_PROFILES=overriden_value_2 [...]
```
2022-11-14 08:05:32 +01:00
Vadim Stepanov
d2243ba09b
Add Makefile command for rebuilding images (#817) 2022-11-09 15:43:12 +00:00
Joey Orlando
1177e44cc7
enterprise dev changes + few other small changes (#802)
* support enterprise development in docker

* fix flaky mysql healthcheck command

I was getting the mysql_to_create_grafana_db and oncall_db_migration prematurely starting up
this commit changes the healthcheck used here to
be the same as what is used in docker-compose-mysql-rabbitmq.yml

* upgrade docker-compose config files to 3.9

3.8 does not actually support the "long form" version of depends_on
see here for more info https://stackoverflow.com/a/54249757
https://docs.docker.com/compose/compose-file/compose-file-v3/#depends_on

* add make init command and update documentation

* cleanup gitignore files
2022-11-09 07:21:33 +01:00
Joey Orlando
78d01df864
One startup command to rule them all (#760)
* Modify `docker-compose-developer` configuration files, and `Makefile`
to support running everything in containers for local development

- Make use of the COMPOSE_PROFILES env var that is supported by
docker-compose to allow swapping-out/turning off certain docker-compose
services.
- add makefile cleanup command. Will remove all docker resources related
to running the project locally
- The "restart grafana container" issue, where users would need
to restart their grafana container when setting up the project for the
first time, is now fixed (make command now runs yarn build:dev before docker-compose startup;
this ensures grafana-plugin/dist is available for grafana container before it starts up)
- The DEVELOPER.md has been updated as well to reflect these new changes. It
has been moved to ./dev/README.md (and references to the old file have
been updated).
- The redis image that is referenced in the docker-compose files
has been pinned to v7.0.5 (latest version as of this commit) to avoid
any surprises w/ future releases.
- remove root .dockerignore in favour of individual .dockerignore files
in ./engine and ./grafana-plugin
2022-11-07 16:34:43 +01:00