2019-08-23 21:16:30 +07:00
|
|
|
<odoo>
|
|
|
|
<record model="ir.cron" id="port_forward">
|
|
|
|
<field name="name">Check if there are merged PRs to port</field>
|
|
|
|
<field name="model_id" ref="model_forwardport_batches"/>
|
|
|
|
<field name="state">code</field>
|
|
|
|
<field name="code">model._process()</field>
|
|
|
|
<field name="interval_number">1</field>
|
|
|
|
<field name="interval_type">minutes</field>
|
|
|
|
<field name="numbercall">-1</field>
|
|
|
|
<field name="doall" eval="False"/>
|
|
|
|
</record>
|
|
|
|
|
|
|
|
<record model="ir.cron" id="updates">
|
|
|
|
<field name="name">Update followup FP PRs</field>
|
|
|
|
<field name="model_id" ref="model_forwardport_updates"/>
|
|
|
|
<field name="state">code</field>
|
|
|
|
<field name="code">model._process()</field>
|
|
|
|
<field name="interval_number">1</field>
|
|
|
|
<field name="interval_type">minutes</field>
|
|
|
|
<field name="numbercall">-1</field>
|
|
|
|
<field name="doall" eval="False"/>
|
|
|
|
</record>
|
|
|
|
|
|
|
|
<record model="ir.cron" id="reminder">
|
|
|
|
<field name="name">Remind open PR</field>
|
2019-10-10 17:07:57 +07:00
|
|
|
<field name="model_id" ref="model_runbot_merge_pull_requests"/>
|
2019-08-23 21:16:30 +07:00
|
|
|
<field name="state">code</field>
|
2019-10-10 17:07:57 +07:00
|
|
|
<field name="code">model._reminder()</field>
|
2019-08-23 21:16:30 +07:00
|
|
|
<field name="interval_number">1</field>
|
2019-09-16 20:28:03 +07:00
|
|
|
<field name="interval_type">days</field>
|
2019-08-23 21:16:30 +07:00
|
|
|
<field name="numbercall">-1</field>
|
|
|
|
<field name="doall" eval="False"/>
|
|
|
|
</record>
|
2019-10-16 19:41:26 +07:00
|
|
|
|
|
|
|
<record model="ir.cron" id="remover">
|
|
|
|
<field name="name">Remove branches of merged PRs</field>
|
|
|
|
<field name="model_id" ref="model_forwardport_branch_remover"/>
|
|
|
|
<field name="state">code</field>
|
|
|
|
<field name="code">model._process()</field>
|
|
|
|
<field name="interval_number">1</field>
|
|
|
|
<field name="interval_type">hours</field>
|
|
|
|
<field name="numbercall">-1</field>
|
|
|
|
<field name="doall" eval="False"/>
|
|
|
|
</record>
|
[IMP] forwardport: gc/maintenance of local repo caches
The current system makes / lets GC run during fetching. This has a few
issues:
- the autogc consumes resources during the forward-porting
process (not that it's hugely urgent but it seems unnecessary)
- the autogc commonly fails due to the combination of large repository
(odoo/odoo) and low memory limits (hardmem for odoo, which get
translated into soft ulimits)
As a result, the garbage collection of the repository sometimes stops
entirely, leading to an increase in repository size and a decrease in
performances.
To mitigate this issue, disable the automagic gc and maintenance
during normal operation, and instead add a weekly cron which runs an
aggressive GC with memory limits disabled (as far as they can get, if
the limits are imposed externally there's nothing to be done).
The maintenance is implemented using a full lockout of the
forward-port cron and an in-place GC rather than a copy/gc/swap, as
doing this maintenance at the small hours of the week-end (sat-sun
night) seems like a non-issue: currently an aggressive GC of odoo/odoo
(using the default aggressive options) takes a total of 2:30 wallclock
(5h user) on a fairly elderly machine (it's closer to 20mn wallclock
and 2h user on my local machine, also turns out the cache repos are
kinda badly configured leading to ~30% more objects than necessary
which doesn't help).
For the record, a fresh checkout of odoo/odoo right now yields:
| Overall repository size | |
| * Commits | |
| * Count | 199 k |
| * Total size | 102 MiB |
| * Trees | |
| * Count | 1.60 M |
| * Total size | 2.67 GiB |
| * Total tree entries | 74.1 M |
| * Blobs | |
| * Count | 1.69 M |
| * Total size | 72.4 GiB |
If this still proves insufficient, a further option would be to deploy
a "generational repacking" strategy:
https://gitlab.com/gitlab-org/gitaly/-/issues/2861 (though apparently
it's not yet been implemented / deployed on gitlab so...).
But for now we'll see how it shakes out.
Close #489
2022-11-07 15:53:11 +07:00
|
|
|
|
|
|
|
<record model="ir.cron" id="maintenance">
|
|
|
|
<field name="name">Maintenance of repo cache</field>
|
|
|
|
<field name="model_id" ref="model_forwardport_maintenance"/>
|
|
|
|
<field name="state">code</field>
|
|
|
|
<field name="code">model._run()</field>
|
|
|
|
<!-- run sunday morning as it can take a while, unlikely someone will need to forward-port stuff at that point -->
|
|
|
|
<field name="nextcall" eval="datetime.utcnow() + relativedelta(weekday=6, hour=2, minute=0, second=0, microsecond=0)"/>
|
|
|
|
<field name="interval_number">1</field>
|
|
|
|
<field name="interval_type">weeks</field>
|
|
|
|
<field name="numbercall">-1</field>
|
|
|
|
<field name="doall" eval="False"/>
|
|
|
|
</record>
|
2019-08-23 21:16:30 +07:00
|
|
|
</odoo>
|