generated from opensafely-core/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document how the metrics app is deployed
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Metrics deployment instructions | ||
## Create app | ||
```bash | ||
dokku$ dokku apps:create metrics | ||
dokku$ dokku git:set metrics deploy-branch main | ||
``` | ||
|
||
## Configure app | ||
```bash | ||
dokku config:set metrics GITHUB_TOKEN'xxx' | ||
dokku config:set metrics SLACK_SIGNING_SECRET='xxx' | ||
dokku config:set metrics SLACK_TECH_SUPPORT_CHANNEL_ID='xxx' | ||
dokku config:set metrics SLACK_TOKEN='xxx' | ||
dokku config:set metrics TIMESCALEDB_URL='xxx' | ||
``` | ||
|
||
## Disable checks | ||
Dokku performs health checks on apps during deploy by sending requests to port 80. | ||
This tool isn't a web app does it can't accept requests on a port. | ||
Disable the checks so deploys can happen. | ||
```bash | ||
dokku$ dokku checks:disable metrics | ||
``` | ||
|
||
## Set up storage | ||
This is only needed for backfills which make use of a SQLite db cache. | ||
```bash | ||
# the metrics container runs as uid ??? (metrics) | ||
# the other dokku containers on dokku3 run as uid 1013 (dokku) | ||
# let's tell the container to run as 1013, then we can use the same file permissions | ||
dokku$ dokku docker-options:add grafana deploy "--user 1013" | ||
dokku$ dokku docker-options:add grafana run "--user 1013" | ||
|
||
dokku$ dokku storage:ensure-directory metrics | ||
dokku$ sudo chown -R dokku:dokku /var/lib/dokku/data/storage/metrics/ | ||
dokku$ dokku storage:mount metrics /var/lib/dokku/data/storage/metrics/:/storage | ||
``` | ||
|
||
## Manually pushing | ||
```bash | ||
local$ git clone [email protected]:ebmdatalab/metrics.git | ||
local$ cd metrics | ||
local$ git remote add dokku dokku@MYSERVER:metrics | ||
local$ git push dokku main | ||
``` | ||
|
||
## Ensure persistent logs | ||
```bash | ||
dokku$ sudo mkdir -p /var/log/journal | ||
``` |