simplify architecture

This commit is contained in:
Andre Medeiros 2022-11-02 01:08:33 -04:00
parent bf84f75be4
commit 6310d51eae

View file

@ -89,107 +89,21 @@ services:
buildCommand: go install github.com/bugsnag/panic-monitor@latest && go build ./cmd/apollo
startCommand: panic-monitor ./apollo api
# Notifications
# Worker
- type: worker
name: worker.notifications
name: worker
env: go
plan: starter
envVars:
- fromGroup: env-settings
- key: BUGSNAG_APP_TYPE
value: worker
- key: BUGSNAG_METADATA_QUEUE
value: notifications
scaling:
minInstances: 10
maxInstances: 30
targetCPUPercent: 80
buildCommand: go install github.com/bugsnag/panic-monitor@latest && go build ./cmd/apollo
startCommand: panic-monitor ./apollo worker --queue NotificationCheckJob --consumers 256
# Stuck Notifications Checker
- type: worker
name: worker.notifications.stuck
env: go
plan: starter
envVars:
- fromGroup: env-settings
- key: BUGSNAG_APP_TYPE
value: worker
- key: BUGSNAG_METADATA_QUEUE
value: stuck
scaling:
minInstances: 2
maxInstances: 10
targetCPUPercent: 80
buildCommand: go install github.com/bugsnag/panic-monitor@latest && go build ./cmd/apollo
startCommand: panic-monitor ./apollo worker --queue StuckNotificationsJob --consumers 64
# Scheduler
- type: worker
name: app.scheduler
env: go
plan: starter
envVars:
- fromGroup: env-settings
- key: BUGSNAG_APP_TYPE
value: scheduler
buildCommand: go install github.com/bugsnag/panic-monitor@latest && go build ./cmd/apollo
startCommand: panic-monitor ./apollo scheduler
# Subreddit Watcher
- type: worker
name: worker.watcher.subreddits
env: go
plan: standard
envVars:
- fromGroup: env-settings
- key: BUGSNAG_APP_TYPE
value: worker
- key: BUGSNAG_METADATA_QUEUE
value: subreddits
scaling:
minInstances: 2
maxInstances: 10
targetCPUPercent: 80
buildCommand: go install github.com/bugsnag/panic-monitor@latest && go build ./cmd/apollo
startCommand: panic-monitor ./apollo worker --queue SubredditWatcherJob
# Trending Posts Watcher
- type: worker
name: worker.watcher.trending
env: go
plan: starter
envVars:
- fromGroup: env-settings
- key: BUGSNAG_APP_TYPE
value: worker
- key: BUGSNAG_METADATA_QUEUE
value: trending
scaling:
minInstances: 2
maxInstances: 10
targetCPUPercent: 80
buildCommand: go install github.com/bugsnag/panic-monitor@latest && go build ./cmd/apollo
startCommand: panic-monitor ./apollo worker --queue SubredditTrendingJob
# Live Activities
- type: worker
name: worker.live-activities
env: go
plan: starter
envVars:
- fromGroup: env-settings
- key: BUGSNAG_APP_TYPE
value: worker
- key: BUGSNAG_METADATA_QUEUE
value: live-activities
scaling:
minInstances: 1
maxInstances: 10
targetCPUPercent: 80
buildCommand: go install github.com/bugsnag/panic-monitor@latest && go build ./cmd/apollo
startCommand: panic-monitor ./apollo worker --queue LiveActivityJob
startCommand: panic-monitor ./apollo worker --consumers 256
envVarGroups:
# Environment