Skip to content

Commit fe6c53b

Browse files
committed
Add docs on the LIVE_DEPLOY setup
1 parent e2947c5 commit fe6c53b

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

LIVE_DEPLOY.md

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Live Deploy
2+
3+
Current deployment details for https://perl5.test-smoke.org/ are as follows, this project is
4+
currently hosted by the MetaCPAN team.
5+
6+
## Contacts:
7+
8+
- irc.perl.org - #smoke and #metacpan channels
9+
10+
## K8s setup
11+
12+
- [K8s setup](https://github.com/metacpan/metacpan-k8s/tree/main/apps/test-smoke)
13+
- [Container deployments](https://github.com/metacpan/metacpan-k8s/blob/main/apps/test-smoke/base/deployment.yaml), one for `API` and one for `web` front end.
14+
- Github actions build the containers from the relevant web/api repo
15+
- [Ingress setup](https://github.com/metacpan/metacpan-k8s/blob/main/apps/test-smoke/environments/prod/ingress.yaml) notes:
16+
- Special `proxy-body-size: 8m` rule to allow up to 8mg report payloads, otherwise nginx returns a 413 (Content too large)
17+
- `/api/` url used to send to API service/deployment
18+
19+
## Important Notes:
20+
21+
### SQL:
22+
23+
- DB name: coresmokedb
24+
- DB user: coresmokedb
25+
- Schema: public
26+
27+
Deploy a fresh DB from either the backup
28+
or [coresmokedb.sql](https://github.com/metacpan/Perl5-CoreSmokeDB/blob/main/coresmokedb.sql) - you should make sure to use the latter to create the indexes
29+
30+
### Old API /reports vs new api /api/reports
31+
32+
Most users are on versions of [Test::Smoke](https://metacpan.org/pod/Test::Smoke)
33+
less than 1.81 (released 2023-10-27) with no way to contact them. This means they
34+
use the old `/report` URL and not `/api/report`.
35+
36+
This was a problem because the way we direct traffic to the API
37+
container in k8s is by looking for `/api` in the url path. This is solved by using Fastly CDN and the following VCL snippet:
38+
39+
```vcl
40+
# Backwards compatability with old clients
41+
if (req.url.path ~ "^/report" && req.method == "POST") {
42+
set req.url = regsub(req.url, "^/report", "/api/old_format_reports");
43+
}
44+
```
45+
46+
If this service is deployed in any other way this issue will have to be resolved differently.
47+
48+
### Database Backups
49+
50+
- The MetaCPAN team takes nightly database backups and saves to https://backblaze.com - storing the last 5 days before rotating.
51+
52+
### Logs
53+
54+
- Fastly (CDN) logs are streamed to [Honeycomb](https://ui.honeycomb.io/metacpan/environments/testsmoke/datasets/testsmokelivedata/overview) which the MetaCPAN team has access to. NOTE: we can see which version of `Test::Smoke` is submitting each request, and indeed it's logged in the DB as well.

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ Perl5::CoreSmokeDB - API server for the VueJS frontend
88
This software is the backend for the Single Page Application frontend written
99
in VueJS 3.
1010

11-
# INSTALLING
11+
# DEPLOYING
12+
13+
Details of the [live deploy setup](./LIVE_DEPLOY.md) for https://perl5.test-smoke.org/
14+
15+
# INSTALLING LOCALLY
1216

1317
Basic installation for try-out:
1418

0 commit comments

Comments
 (0)