production:shaman.ceph.com
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| production:shaman.ceph.com [2019/01/23 17:32] – djgalloway | production:shaman.ceph.com [2023/04/06 00:51] (current) – [Summary] dmick | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| There are three VMs in the [[https:// | There are three VMs in the [[https:// | ||
| - | * shaman.ceph.com is just a load balancing VM | + | * shaman.ceph.com is just a load balancing VM. Accesses are proxied to either 1.shaman.ceph.com or 2.shaman.ceph.com with an ' |
| * 1.shaman.ceph.com is the primary shaman node that has the postgres DB with all the repo information | * 1.shaman.ceph.com is the primary shaman node that has the postgres DB with all the repo information | ||
| * 2.shaman.ceph.com is a **READ ONLY** backup in the event 1.shaman.ceph.com goes down | * 2.shaman.ceph.com is a **READ ONLY** backup in the event 1.shaman.ceph.com goes down | ||
| + | * 2.shaman.ceph.com can handle write requests because pecan, the web framework, is also aware of the primary/hot standby configuration, | ||
| ===== User Access ===== | ===== User Access ===== | ||
| Line 39: | Line 40: | ||
| < | < | ||
| ansible-playbook --tags=" | ansible-playbook --tags=" | ||
| + | </ | ||
| + | |||
| + | ==== Pulling Slave Stats ==== | ||
| + | I needed to determine what percentage of jobs were running on static vs. ephemeral slaves. | ||
| + | |||
| + | Doing this on 2.shaman.ceph.com ensures you're in a read-only capacity. | ||
| + | |||
| + | - '' | ||
| + | - '' | ||
| + | - Copy the script below to '' | ||
| + | import datetime | ||
| + | |||
| + | from shaman import models | ||
| + | from shaman.models import Build, Project | ||
| + | models.start_read_only() | ||
| + | |||
| + | |||
| + | |||
| + | def report(): | ||
| + | two_weeks = datetime.datetime.utcnow() - datetime.timedelta(days=15) | ||
| + | | ||
| + | ceph_project = models.Project.filter_by(name=' | ||
| + | builds = Build.filter_by(project=ceph_project).filter(Build.completed > two_weeks).all() | ||
| + | |||
| + | ovh_builds = {} | ||
| + | irvingi_builds = {} | ||
| + | braggi_builds = {} | ||
| + | adami_builds = {} | ||
| + | rest_of_the_world = {} | ||
| + | ovh_count = 0 | ||
| + | irvingi_count = 0 | ||
| + | braggi_count = 0 | ||
| + | adami_count = 0 | ||
| + | |||
| + | for build in builds: | ||
| + | node_name = build.extra[' | ||
| + | if ' | ||
| + | mapping = ovh_builds | ||
| + | counter = ovh_count | ||
| + | elif ' | ||
| + | mapping = irvingi_builds | ||
| + | counter = irvingi_count | ||
| + | elif ' | ||
| + | mapping = braggi_builds | ||
| + | counter = braggi_count | ||
| + | elif ' | ||
| + | mapping = adami_builds | ||
| + | counter = adami_count | ||
| + | else: | ||
| + | mapping = rest_of_the_world | ||
| + | | ||
| + | try: | ||
| + | mapping[node_name] += 1 | ||
| + | except KeyError: | ||
| + | mapping[node_name] = 1 | ||
| + | | ||
| + | for mapping in [ovh_builds, | ||
| + | count = 0 | ||
| + | for key, value in mapping.items(): | ||
| + | print key, value | ||
| + | count += value | ||
| + | print " | ||
| + | print " | ||
| + | |||
| + | </ | ||
| + | - '' | ||
| + | - Then< | ||
| + | In [1]: from shaman import models | ||
| + | |||
| + | In [2]: models.start_read_only() | ||
| + | |||
| + | In [3]: import two_week_stats | ||
| + | |||
| + | In [4]: two_week_stats.report() | ||
| + | </ | ||
| + | |||
| + | ==== Delete builds/ | ||
| + | HYPOTHETICALLY ;-) if a repo/build got pushed to shaman that contains an embargoed security fix, you can delete the entries from shaman' | ||
| + | |||
| + | < | ||
| + | ssh 1.shaman.ceph.com | ||
| + | sudo su - postgres | ||
| + | |||
| + | postgres@1: | ||
| + | psql (9.5.23) | ||
| + | Type " | ||
| + | |||
| + | shaman=# \dt | ||
| + | List of relations | ||
| + | | ||
| + | --------+-----------------+-------+-------- | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | (6 rows) | ||
| + | |||
| + | shaman=# delete from public.builds where sha1 = ' | ||
| + | DELETE 6 | ||
| + | |||
| + | shaman=# select id from public.repos where sha1 = ' | ||
| + | | ||
| + | -------- | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | shaman=# delete from public.archs where repo_id = ' | ||
| + | DELETE 1 | ||
| + | shaman=# delete from public.archs where repo_id = ' | ||
| + | DELETE 2 | ||
| + | shaman=# delete from public.archs where repo_id = ' | ||
| + | DELETE 2 | ||
| + | shaman=# delete from public.archs where repo_id = ' | ||
| + | DELETE 2 | ||
| + | shaman=# delete from public.archs where repo_id = ' | ||
| + | DELETE 2 | ||
| + | shaman=# delete from public.archs where repo_id = ' | ||
| + | DELETE 1 | ||
| + | shaman=# delete from public.repos where sha1 = ' | ||
| + | DELETE 6 | ||
| </ | </ | ||
production/shaman.ceph.com.1548264731.txt.gz · Last modified: by djgalloway
