|
| 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. |
0 commit comments