-
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (82 loc) · 3.59 KB
/
weekly_routine.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Weekly routine Issue
on:
schedule:
- cron: "0 8 * * 1"
jobs:
job:
runs-on: ubuntu-22.04
steps:
- name: Create routine issue
shell: python
run: |
import datetime
import os
import re
import sys
import requests
payload = {
"title": f"Week {datetime.datetime.now().strftime('%W')} routine",
"body": os.getenv("ISSUE_BODY"),
"labels": re.sub(r"\s", "", os.getenv("LABELS", "")).split(",") or None,
"assignees": re.sub(r"\s", "", os.getenv("ASSIGNEES", "")).split(",") or None,
}
api_url = f"https://api.github.com/repos/{os.getenv('REPO')}/issues"
url = f"https://github.com/{os.getenv('REPO')}/issues"
headers = {
"Accept": "application/vnd.github.v3+json",
"Authorization": f"token {os.getenv('ACCESS_TOKEN')}",
}
resp = requests.get(api_url, headers=headers)
if resp.status_code != 200:
print(f"❌ Couldn't retrieve issues for {url} using {api_url}.")
print(f"HTTP {resp.status_code} {resp.reason} - {resp.text}")
print("Check your `ACCESS_TOKEN` secret.")
sys.exit(1)
resp = requests.post(api_url, headers=headers, json=payload)
if resp.status_code != 201:
print(f"❌ Couldn't create issue for {url}")
print(f"HTTP {resp.status_code} {resp.reason} - {resp.text}")
sys.exit(1)
print(f"✅ Issue successfully created at {url}/{resp.json().get('number')}")
sys.exit(0)
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
REPO: kiwix/k8s
LABELS: maint
ASSIGNEES: rgaudin,benoit74
ISSUE_BODY: |
## Infra
- [ ] Check nodes free space
```sh
df -h / && df -h /data
```
- [ ] Nodes and worker system upgrades
```sh
apt update && apt upgrade
```
- [ ] Ensure [all borg repositories](https://www.borgbase.com/) are being updated
- [ ] Check Pod errors
```sh
k get pods -A -o wide|grep Error
```
- [ ] Check Pod restarts
```sh
k get pods -A -o wide | pyp -i 'print("\n".join([line for line in l if re.split(r"\s+", line)[4] != "0"]))'
```
- [ ] Check if k8s should/could be upgraded
```sh
curl -s -H "X-Auth-Token: $SCW_SECRET_KEY" https://api.scaleway.com/k8s/v1/regions/fr-par/clusters/$KIWIX_PROD_CLUSTER|jq ".version,.upgrade_available"
curl -s -H "X-Auth-Token: $SCW_SECRET_KEY" https://api.scaleway.com/k8s/v1/regions/fr-par/versions|jq ".versions[].name"
```
- [ ] [Upgrade k8s](https://github.com/kiwix/k8s/wiki/Cluster-Setup#upgrading-kubernetes) if applicable
### Stats
- [ ] Ensure download.kiwix.org stats are being recorded
- [ ] Check whether [matomo](https://stats.kiwix.org) should be upgraded
## Projects
- [ ] UptimeRobot [has no alert](https://uptimerobot.com/dashboard#tvMode)
- [ ] [youzim.it backlog](https://farm.youzim.it/pipeline/filter-todo) is reasonable
- [ ] No [systematic failure](https://farm.youzim.it/pipeline/filter-failed) in tasks.
- [ ] [PRs awaiting your review](https://github.com/notifications?query=reason%3Areview-requested)
## Security
- [ ] Analyze/merge [dependabot PRs](https://github.com/notifications?query=author%3Adependabot[bot])
**Note**: this is an *automatic reminder* intended for the assignee(s).