|
71 | 71 | |:---------|:------------|---------| |
72 | 72 | | `LOG_LEVEL` | Logging level, Valid values are: `"DEBUG"`, `"INFO"`, `"WARN"`, `"ERROR"` | `"INFO"` | |
73 | 73 | | `KCP_BROKERS` | Kafka consumer/producer brokers list, comma separated | `"127.0.0.1:9094"` | |
74 | | -| `KC_TOPIC_GITHUB` | Topic name for GitHub webhook consumer | `github` | |
| 74 | +| `KC_TOPIC_GITHUB` | Topic name for GitHub webhook consumer | `""` | |
| 75 | +| `KCG_NAME` | Kafka consumer group name | `""` | |
75 | 76 | | `KC_PARTITION` | Consumer partition number | `0` | |
76 | 77 | | `KC_DIAL_TIMEOUT` | Initial connection timeout used by broker (shared with consumer) | "`30s`" (seconds) | |
77 | 78 | | `KC_READ_TIMEOUT` | Response timeout used by broker (shared with consumer) | "`30s`" (seconds) | |
@@ -154,8 +155,11 @@ export KP_GITHUB_MESSAGE_QUEUE_SIZE=100 |
154 | 155 | # export KP_BACKOFF="2s" |
155 | 156 | # export KP_MAX_RETRIES="10" |
156 | 157 |
|
157 | | -# kafka github consumer optional values. |
158 | | -# export KC_TOPIC_GITHUB="github" |
| 158 | +# kafka github consumer group values. |
| 159 | +export KC_TOPIC_GITHUB="github" |
| 160 | +export KCG_NAME="github-group" |
| 161 | +
|
| 162 | +# kafka github consumer group optional values. |
159 | 163 | # export KC_PARTITION="0" |
160 | 164 | # export KC_DIAL_TIMEOUT="30s" |
161 | 165 | # export KC_READ_TIMEOUT="30s" |
@@ -212,31 +216,27 @@ of `rake tasks`: |
212 | 216 | ```bash |
213 | 217 | rake -T |
214 | 218 |
|
215 | | -rake db:init # init database |
216 | | -rake db:migrate # runs rake db:migrate up (shortcut) |
217 | | -rake db:migrate:down # run migrate down |
218 | | -rake db:migrate:goto[index] # go to migration |
219 | | -rake db:migrate:up # run migrate up |
220 | | -rake db:psql # connect local db with psql |
221 | | -rake db:reset # reset database (drop and create) |
222 | | -rake default # default task, runs server |
223 | | -rake docker:build:github_consumer # build github consumer |
224 | | -rake docker:build:migrator # build migrator |
225 | | -rake docker:build:server # build server |
226 | | -rake docker:compose:infra:down # stop the infra with all components |
227 | | -rake docker:compose:infra:up # run the infra with all components |
228 | | -rake docker:compose:kafka:down # stop the kafka and kafka-ui only |
229 | | -rake docker:compose:kafka:up # run the kafka and kafka-ui only |
230 | | -rake docker:run:github_consumer # run github consumer |
231 | | -rake docker:run:migrator # run migrator |
232 | | -rake docker:run:server # run server |
233 | | -rake lint # run golang-ci linter |
234 | | -rake rubocop:autofix # lint ruby and autofix |
235 | | -rake rubocop:lint # lint ruby |
236 | | -rake run:kafka:github:consumer # run kafka github consumer |
237 | | -rake run:server # run server |
238 | | -rake test # runs tests (shortcut) |
239 | | -rake test:coverage # run tests and show coverage |
| 219 | +rake db:init # init database |
| 220 | +rake db:migrate # runs rake db:migrate up (shortcut) |
| 221 | +rake db:migrate:down # run migrate down |
| 222 | +rake db:migrate:goto[index] # go to migration |
| 223 | +rake db:migrate:up # run migrate up |
| 224 | +rake db:psql # connect local db with psql |
| 225 | +rake db:reset # reset database (drop and create) |
| 226 | +rake default # default task, runs server |
| 227 | +rake docker:compose:infra:down # stop the infra with all components |
| 228 | +rake docker:compose:infra:up # run the infra with all components |
| 229 | +rake docker:compose:kafka:down # stop the kafka and kafka-ui only |
| 230 | +rake docker:compose:kafka:up # run the kafka and kafka-ui only |
| 231 | +rake lint # run golang-ci linter |
| 232 | +rake psql:infra # connect to infra database with psql |
| 233 | +rake rubocop:autofix # lint ruby and autofix |
| 234 | +rake rubocop:lint # lint ruby |
| 235 | +rake run:kafka:github:consumer # run kafka github consumer |
| 236 | +rake run:kafka:github:consumer_group # run kafka github consumer group |
| 237 | +rake run:server # run server |
| 238 | +rake test # runs tests (shortcut) |
| 239 | +rake test:coverage # run tests and show coverage |
240 | 240 | ``` |
241 | 241 |
|
242 | 242 | You can run tests: |
@@ -347,24 +347,12 @@ rake rubocop:autofix # lints ruby code and auto fixes. |
347 | 347 | ```bash |
348 | 348 | rake -T "docker:" |
349 | 349 |
|
350 | | -rake docker:build:github_consumer # build github consumer |
351 | | -rake docker:build:migrator # build migrator |
352 | | -rake docker:build:server # build server |
353 | | - |
354 | | -rake docker:compose:infra:down # stop the infra with all components |
355 | | -rake docker:compose:infra:up # run the infra with all components |
356 | | -rake docker:compose:kafka:down # stop the kafka and kafka-ui only |
357 | | -rake docker:compose:kafka:up # run the kafka and kafka-ui only |
358 | | - |
359 | | -rake docker:run:github_consumer # run github consumer |
360 | | -rake docker:run:migrator # run migrator |
361 | | -rake docker:run:server # run server |
| 350 | +rake docker:compose:infra:down # stop the infra with all components |
| 351 | +rake docker:compose:infra:up # run the infra with all components |
| 352 | +rake docker:compose:kafka:down # stop the kafka and kafka-ui only |
| 353 | +rake docker:compose:kafka:up # run the kafka and kafka-ui only |
362 | 354 | ``` |
363 | 355 |
|
364 | | -- `docker:build:*`: builds images locally, testing purposes. |
365 | | -- `docker:run:*`: runs containers locally, testing purposes. |
366 | | -- `docker:compose:*`: ups or downs whole infrastructure with services. |
367 | | - |
368 | 356 | --- |
369 | 357 |
|
370 | 358 | ## Infrastructure Diagram |
@@ -406,10 +394,10 @@ Now you can access: |
406 | 394 |
|
407 | 395 | - Kafka UI: `http://127.0.0.1:8080/` |
408 | 396 | - Ngrok: `http://127.0.0.1:4040` |
409 | | -- PostgreSQL: `PGPASSWORD="${POSTGRES_PASSWORD}" psql -h localhost -p 5433 -U postgres -d devchain_webhook` |
| 397 | +- PostgreSQL: `PGOPTIONS="--search_path=cauldron,public" PGPASSWORD="${POSTGRES_PASSWORD}" psql -h localhost -p 5433 -U postgres -d devchain_webhook` |
410 | 398 |
|
411 | 399 | For PostgreSQL, `5433` is exposed in container to avoid conflicts with the |
412 | | -local PostgreSQL instance. |
| 400 | +local PostgreSQL instance. Use `rake psql:infra` to connect your infra database. |
413 | 401 |
|
414 | 402 | Logging for **kafka** and **kafka-ui** is set to `error` only. Due to development |
415 | 403 | purposes, both were producing too much information, little clean up required. |
|
0 commit comments