Skip to content

Commit 8393733

Browse files
authored
Merge pull request #714 from grafana/dev
Merge dev to main
2 parents f4be298 + ae65f9b commit 8393733

File tree

206 files changed

+1241
-1609
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+1241
-1609
lines changed

.pre-commit-config.yaml

+15-3
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,26 @@ repos:
2323
- flake8-tidy-imports
2424

2525
- repo: https://github.com/pre-commit/mirrors-eslint
26-
rev: v7.21.0
26+
rev: v8.25.0
2727
hooks:
2828
- id: eslint
29-
entry: bash -c 'cd grafana-plugin && eslint --fix ${@/grafana-plugin\//}' --
29+
entry: bash -c 'cd grafana-plugin && eslint --max-warnings=0 --fix ${@/grafana-plugin\//}' --
3030
types: [file]
3131
files: ^grafana-plugin/src/.*\.(js|jsx|ts|tsx)$
3232
additional_dependencies:
33-
- eslint@7.21.0
33+
- eslint@^8.25.0
3434
- eslint-plugin-import@^2.25.4
3535
- eslint-plugin-rulesdir@^0.2.1
36+
- "@grafana/eslint-config@^5.0.0"
37+
38+
- repo: https://github.com/pre-commit/mirrors-prettier
39+
rev: "v2.7.1"
40+
hooks:
41+
- id: prettier
42+
types_or: [css, javascript, jsx, ts, tsx, json]
43+
files: ^grafana-plugin/src
44+
additional_dependencies:
45+
- prettier@^2.7.1
3646

3747
- repo: https://github.com/thibaudcolas/pre-commit-stylelint
3848
rev: v13.13.1
@@ -43,4 +53,6 @@ repos:
4353
files: ^grafana-plugin/src/.*\.css$
4454
additional_dependencies:
4555
- stylelint@^13.13.1
56+
- stylelint-prettier@^2.0.0
4657
- stylelint-config-standard@^22.0.0
58+
- stylelint-config-prettier@^9.0.3

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
## v1.0.43 (2022-10-25)
4+
- Bug fixes
5+
36
## v1.0.42 (2022-10-24)
47
- Fix posting resolution notes to Slack
58

README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Developer-friendly incident response with brilliant Slack integration.
2020

2121
We prepared multiple environments: [production](https://grafana.com/docs/grafana-cloud/oncall/open-source/#production-environment), [developer](DEVELOPER.md) and hobby:
2222

23-
1. Download docker-compose.yaml:
23+
1. Download [`docker-compose.yml`](docker-compose.yml):
2424

2525
```bash
2626
curl -fsSL https://raw.githubusercontent.com/grafana/oncall/dev/docker-compose.yml -o docker-compose.yml
@@ -31,9 +31,7 @@ curl -fsSL https://raw.githubusercontent.com/grafana/oncall/dev/docker-compose.y
3131
```bash
3232
echo "DOMAIN=http://localhost:8080
3333
COMPOSE_PROFILES=with_grafana # Remove this line if you want to use existing grafana
34-
SECRET_KEY=my_random_secret_must_be_more_than_32_characters_long
35-
RABBITMQ_PASSWORD=rabbitmq_secret_pw
36-
MYSQL_PASSWORD=mysql_secret_pw" > .env
34+
SECRET_KEY=my_random_secret_must_be_more_than_32_characters_long" > .env
3735
```
3836

3937
3. Launch services:

docker-compose-mysql-rabbitmq.yml

+162
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
version: "3.8"
2+
3+
x-environment:
4+
&oncall-environment
5+
BASE_URL: $DOMAIN
6+
SECRET_KEY: $SECRET_KEY
7+
RABBITMQ_USERNAME: "rabbitmq"
8+
RABBITMQ_PASSWORD: $RABBITMQ_PASSWORD
9+
RABBITMQ_HOST: "rabbitmq"
10+
RABBITMQ_PORT: "5672"
11+
RABBITMQ_DEFAULT_VHOST: "/"
12+
MYSQL_PASSWORD: $MYSQL_PASSWORD
13+
MYSQL_DB_NAME: oncall_hobby
14+
MYSQL_USER: ${MYSQL_USER:-root}
15+
MYSQL_HOST: ${MYSQL_HOST:-mysql}
16+
MYSQL_PORT: 3306
17+
REDIS_URI: redis://redis:6379/0
18+
DJANGO_SETTINGS_MODULE: settings.hobby
19+
CELERY_WORKER_QUEUE: "default,critical,long,slack,telegram,webhook,retry,celery"
20+
CELERY_WORKER_CONCURRENCY: "1"
21+
CELERY_WORKER_MAX_TASKS_PER_CHILD: "100"
22+
CELERY_WORKER_SHUTDOWN_INTERVAL: "65m"
23+
CELERY_WORKER_BEAT_ENABLED: "True"
24+
25+
services:
26+
engine:
27+
image: grafana/oncall
28+
restart: always
29+
ports:
30+
- "8080:8080"
31+
command: >
32+
sh -c "uwsgi --ini uwsgi.ini"
33+
environment: *oncall-environment
34+
depends_on:
35+
mysql:
36+
condition: service_healthy
37+
oncall_db_migration:
38+
condition: service_completed_successfully
39+
rabbitmq:
40+
condition: service_healthy
41+
redis:
42+
condition: service_started
43+
44+
celery:
45+
image: grafana/oncall
46+
restart: always
47+
command: sh -c "./celery_with_exporter.sh"
48+
environment: *oncall-environment
49+
depends_on:
50+
mysql:
51+
condition: service_healthy
52+
oncall_db_migration:
53+
condition: service_completed_successfully
54+
rabbitmq:
55+
condition: service_healthy
56+
redis:
57+
condition: service_started
58+
59+
oncall_db_migration:
60+
image: grafana/oncall
61+
command: python manage.py migrate --noinput
62+
environment: *oncall-environment
63+
depends_on:
64+
mysql:
65+
condition: service_healthy
66+
rabbitmq:
67+
condition: service_healthy
68+
69+
mysql:
70+
image: mysql:5.7
71+
platform: linux/x86_64
72+
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
73+
restart: always
74+
expose:
75+
- 3306
76+
volumes:
77+
- dbdata:/var/lib/mysql
78+
environment:
79+
MYSQL_ROOT_PASSWORD: $MYSQL_PASSWORD
80+
MYSQL_DATABASE: oncall_hobby
81+
deploy:
82+
resources:
83+
limits:
84+
memory: 500m
85+
cpus: '0.5'
86+
healthcheck:
87+
test: "mysql -uroot -p$MYSQL_PASSWORD oncall_hobby -e 'select 1'"
88+
timeout: 20s
89+
retries: 10
90+
91+
redis:
92+
image: redis
93+
restart: always
94+
expose:
95+
- 6379
96+
deploy:
97+
resources:
98+
limits:
99+
memory: 100m
100+
cpus: '0.1'
101+
102+
rabbitmq:
103+
image: "rabbitmq:3.7.15-management"
104+
restart: always
105+
hostname: rabbitmq
106+
volumes:
107+
- rabbitmqdata:/var/lib/rabbitmq
108+
environment:
109+
RABBITMQ_DEFAULT_USER: "rabbitmq"
110+
RABBITMQ_DEFAULT_PASS: $RABBITMQ_PASSWORD
111+
RABBITMQ_DEFAULT_VHOST: "/"
112+
deploy:
113+
resources:
114+
limits:
115+
memory: 1000m
116+
cpus: '0.5'
117+
healthcheck:
118+
test: rabbitmq-diagnostics -q ping
119+
interval: 30s
120+
timeout: 30s
121+
retries: 3
122+
123+
mysql_to_create_grafana_db:
124+
image: mysql:5.7
125+
platform: linux/x86_64
126+
command: bash -c "mysql -h ${MYSQL_HOST:-mysql} -uroot -p${MYSQL_PASSWORD:?err} -e 'CREATE DATABASE IF NOT EXISTS grafana CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'"
127+
depends_on:
128+
mysql:
129+
condition: service_healthy
130+
profiles:
131+
- with_grafana
132+
133+
grafana:
134+
image: "grafana/grafana:9.0.0-beta3"
135+
restart: always
136+
ports:
137+
- "3000:3000"
138+
environment:
139+
GF_DATABASE_TYPE: mysql
140+
GF_DATABASE_HOST: ${MYSQL_HOST:-mysql}
141+
GF_DATABASE_USER: ${MYSQL_USER:-root}
142+
GF_DATABASE_PASSWORD: ${MYSQL_PASSWORD:?err}
143+
GF_SECURITY_ADMIN_USER: ${GRAFANA_USER:-admin}
144+
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD:-admin}
145+
GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS: grafana-oncall-app
146+
GF_INSTALL_PLUGINS: grafana-oncall-app
147+
deploy:
148+
resources:
149+
limits:
150+
memory: 500m
151+
cpus: '0.5'
152+
depends_on:
153+
mysql_to_create_grafana_db:
154+
condition: service_completed_successfully
155+
mysql:
156+
condition: service_healthy
157+
profiles:
158+
- with_grafana
159+
160+
volumes:
161+
dbdata:
162+
rabbitmqdata:

0 commit comments

Comments
 (0)