Commit Graph

1248 Commits

Author SHA1 Message Date
Christophe Monniez
037733335f [IMP] runbot: small view improvements 2022-07-08 16:34:06 +02:00
Xavier-Do
af8a5b8e8e [FIX] runbot: avoid error when there is no build 2022-07-08 15:53:43 +02:00
Christophe Monniez
e1161a03e6 [FIX] runbot: avoid sudo when using pip
In bd4cf76b7 a new argument `--progress-bar off` was added to the pip
command line. Unfortunately, it appears that this argument is not
available in some pip versions, typically the one from Ubuntu Bionic
(9.0.1) [0]. The argument appeared in version 10.0.0 [1].

Also, in the DockerFile, we allow the user to use `sudo` for
`/usr/bin/pip3` and the main reason for that was to avoid having `pip`
to re-install the packages that are pre-installed by the distribution
package manager.

That said, it appears that since pip 10.0.0 when installing packages
locally for the user, pip now properly detects distribution installed
packages.

So, as the solution to fix the progress bar issue is to upgrade pip to a
newer version, we can take advantage of it to get rid of the `sudo`.

Besides the fact that `--user` is the default on Debian based
distributions [2] , we enforce it in case another distribution is used
in the Dockerfile.

[0] https://packages.ubuntu.com/bionic-updates/python3-pip
[1] https://pip.pypa.io/en/stable/news/#id744
[2] https://wiki.debian.org/Python#Deviations_from_upstream
2022-07-06 09:48:20 +02:00
Xavier-Do
bd4cf76b76 [FIX] runbot: hide progressbar for pip 2022-07-01 15:47:13 +02:00
Xavier-Do
03732638f3 [IMP] runbot: add an automatic generated message for upgrade exceptions 2022-07-01 15:47:13 +02:00
Christophe Monniez
b25aa52fb9 [IMP] runbot: avoid core dumps in containers
In some conditions, the google-chrome crashes and a core dump is written
in the bind mounted directory.

With this commit, the core dumps are disabled in the containers.
2022-06-30 10:58:38 +02:00
Christophe Monniez
78697d2acb [IMP] runbot: use docker python lib
While using the docker cli as a subprocess was KISS and convenient,
the python Docker SDK is mature, easy to use, available as a Debian
package and much more powerful.

It will permit to monitor the containers memory consumption and will
help to spot memory leaks.
2022-06-30 10:58:38 +02:00
Christophe Monniez
9fb48f48cf [IMP] runbot: improve git gc warning 2022-06-27 09:11:02 +02:00
Christophe Monniez
3f042c44a8 [FIX] runbot: fix gc warning 2022-06-24 08:41:32 +02:00
Christophe Monniez
d027d1c7de [IMP] runbot: git gc only once a day 2022-06-23 09:45:47 +02:00
Christophe Monniez
c006bf953d [FIX] runbot: apply small fixes 2022-06-20 14:37:02 +02:00
Christophe Monniez
d534f5a5e2 [FIX] runbot: count only really active hosts 2022-06-20 10:32:10 +02:00
Christophe Monniez
250d48e266 [IMP] runbot: schedule git gc on repositories
On the actual runbot deployments, the `git gc` command is handled by a
unix cron. From time to time, some repositories get corrupted and we
suspect that some concurrent action may be involved as stated in
documentation [0].

For those reasons, with this commit, the `git gc` will be run by the
runbot clients themselves in order to avoid concurrent operations.

By default, the first gc will occur a few minutes after the start of the
client and the next gc are scheduled a two hours and a few minutes later.

Also, this commit ensures that the git config is written regularly in
case of change.

[0] https://git-scm.com/docs/git-gc
2022-06-20 10:32:10 +02:00
Xavier-Do
cdaae9b3ed [IMP] runbot: speedup get_refs
Regarding the number of refs in odoo repo (arround 18 million at this
time), the parsing of the date was significant when filtering old refs.

Using unix time allows a direct comparaison without parsing the date,
and improved performance, going from ~7 seconds to ~1.3 seconds.
2022-06-20 10:20:37 +02:00
Xavier-Do
cbfc8401a8 [FIX] runbot: various FIX 2022-06-17 13:52:37 +02:00
Xavier-Do
26a3ad20f1 [IMP] runbot: status management
The status are currently sent by leader when build are created and by
workers on post_commit.

If the leader fails during the preparing of a batch (while creating
builds) the transaction is rollbacked and the status are send again.

The number of status to send makes it quite slow, making the transaction
longuer, and the retry even more expensive. This leads to preparing time
being quite important, sometimes ten minutes after many retries.

This commit proposes to send status in another dedicated transaction.
Since status are sent in batch, we can also try to use a unique session,
and uniquify commit+context status.

This allows to remove the postcommit logic

A further improvement would be to wait before sending status in order to
skip the pending status if the build is verry fast.

An option is also added on the remote to skip the status: if the remote
is a fork, sending the satus on the main remote should be enough.
2022-06-17 12:32:14 +02:00
Christophe Monniez
b997119588 [FIX] runbot: avoid children in team errors
When an error is assigned to a team and the error is a child of another
one, the two errors are displayed on the team dashboard and adds
confusion.
2022-06-17 10:40:57 +02:00
Christophe Monniez
69cd228b6b [IMP] runbot: use the lovely boolean_toggle widget 2022-06-16 13:39:46 +02:00
Xavier-Do
47c12fe00b [FIX] runbot: add MULTILINE to ReProxy 2022-06-15 12:30:41 +02:00
Xavier-Do
bf0df23a3d [FIX] runbot: add findall to ReProxy 2022-06-15 12:13:34 +02:00
Xavier-Do
15e4fa76c5 [FIX] runbot: add VERBOSE to ReProxy 2022-06-15 09:12:17 +02:00
Xavier-Do
2ac70f5ab4 [FIX] runbot: fix test_all test for restore 2022-06-13 14:03:16 +02:00
Xavier-Do
d466887f08 [REF] runbot: adapt statistic models
Initial model was a (build_id, key, value) where key is in fact a two
part information: `category.key` (where key is usually a module)

This means that for each module, we will have one entry per
modules*category.
We have between 200 and 400 modules per build * 4 keys -> around 1000
entries per build.

The hudge amount of total entries lead to a fast overflow of the table
sequence + this create important indexes.

Also, most of the time, the js will manage the display of stats meaning
that python will transform
(build_id, category.key, value)
into
(build_id, {key: value}) for one category

A new model makes use of a json field to store values for different
modules in a json dict, on entry per category*build. (4 entry per build)

The table will be renamed and migrate later
2022-06-13 12:42:13 +02:00
Xavier-Do
87366de213 [IMP] runbot: add log on separator 2022-06-10 14:56:13 +02:00
Xavier-Do
77f8c29091 [IMP] runbot: check restore result 2022-06-10 14:02:58 +02:00
Xavier-Do
1879f2c235 [IMP] runbot: forced host improvement 2022-06-10 13:26:47 +02:00
Xavier-Do
f654738b04 [FIX] runbot: fix nginx static 2022-06-09 15:53:41 +02:00
Xavier-Do
a6fa7b8023 [FIX] runbot: fix leader pull_info_failures
The initial pull_info_failures feature was introduced before the separate
process for the leader. Since this is here for a rare case, this
wasn't tested since then.

Testing the new infrastructure without token, there was many
pull_info_failure, leading to an error on cleanup.
2022-06-09 08:43:28 +02:00
Christophe Monniez
33ab9cdce6 [FIX] runbot: open nginx file as text
Continuation of previous fix 6902a7e24.
2022-06-08 15:33:26 +02:00
Christophe Monniez
6902a7e242 [FIX] runbot: cast markup into str before saving
When rendering templates for git configuration and nginx configuration,
the templates are rendered as Markup, while a byte-like object was
expected for the saving.

With this commit, the Markup is casted into str and the files are saved
as text files.
2022-06-08 15:19:08 +02:00
Christophe Monniez
a051568213 [FIX] runbot: avoid werkzeug deprecated escape
The `utils.escape` utility was deprecated in werkzeug 2.0.0, so it can
be replaced with our `html_escape` which is itself `markupsafe.escape`.

Also, with this change, the double quotes are now escaped in `"`
instead of `"`, so we fix the test too.
2022-06-08 10:53:50 +02:00
Xavier-Do
ca1246b87a [FIX] runbot: fix pseudo_markdown 2022-06-07 15:56:26 +02:00
Xavier-Do
bf4167670d [IMP] runbot: cleanup 2022-06-07 11:18:34 +02:00
Xavier-Do
6b79d5b96c [REM] runbot: remove runbot_domain
This parameter can be replaced by web.base.url when needed.
2022-06-07 10:54:48 +02:00
Xavier-Do
272096b810 [REM] runbot: remove non nginx support
Some non tested code was making running build available without
an nginx config (using port and local address instead of using a proper
dns/nginx config).
Removing this part to reduce complexity.
2022-06-07 10:31:09 +02:00
Xavier-Do
02cbc0d090 [FIX] runbot: adapt for jammy 2022-06-03 14:51:49 +02:00
Xavier-Do
3071f5a6db [IMP] runbot: adapt for odoo 15.0 2022-06-02 10:50:42 +02:00
Xavier-Do
78f050b132 [IMP] runbot: adapt for 14.0 2022-03-23 09:49:53 +01:00
Xavier-Do
eda014f724 [DEL] runbot: remove old upgrade scripts 2022-03-18 11:09:58 +01:00
Xavier-Do
8c120ac0d9 [FIX] runbot: don't log invalid bases on autorebase 2022-03-17 09:30:03 +01:00
Xavier-Do
c4d0b56972 [FIX] runbot: dont duplicate export
Even if it isn't really problematic, avoiding to duplicate exports
will make the table slighly smaller, especially when considering running
builds.
2022-03-16 09:44:58 +01:00
Xavier-Do
3985332a34 [IMP] runbot: commit exports
Source cleanup will check in multiple place for potentially used
commits. This maked the cleanup logic complex, plus limit the usable
commits in python steps. The current use case is to export the mergebase
commits.

The poposed solution is to save the exported commit and clean this list
when the build is done. All commit in this list cannot be cleaned.
2022-03-16 09:05:39 +01:00
Xavier-Do
ea3191a8d0 [IMP] runbot: add javascript support for JsonDictFields
The main motivation is to be able to see existing config_data on params
and edit configuration on triggers.

A simple version would be to use the `FieldChar` with a simple
`JSON.stringify` formater, but having some indent on field make it
easier to read and edit.

The multiline need make it closet to the `FieldText` than the `FieldChar`
but the reset makes the browser freeze.
2022-03-14 15:27:11 +01:00
Xavier-Do
623255b0d8 [IMP] runbot: reorganize menus
and add missing fields...
2022-03-11 15:12:36 +01:00
Xavier-Do
45cc0b1675 [REF] runbot: remove useless names 2022-03-11 15:12:36 +01:00
Xavier-Do
ca8ee428f8 [REF] runbot: move all menu to a single file 2022-03-11 15:12:36 +01:00
Xavier-Do
4e6ae00f23 [IMP] runbot: custom trigger wizard
The actual way to add a custom multibuild on a dev bundle will be:
- use the multibuild wizard to create 2 configs and 2 steps
- add this config on the bundle
- customize this config to make it fatser by installing/restoring...

The usefull parameters are the number of build, the test tags and
modules to install.

Another usefull operation is to restore a dump instead of installing,
especially for post install test only breaking on full databases.

This commit proposes to replace the multi build wizard with a custom
trigger wizard. The main idea is to have generic config, parametrized by
config_data. The wizard will only help to generate the corresponding
config_data.
2022-03-11 14:00:47 +01:00
Xavier Morel
2337bd8518 [FIX] forwardport: chain crash on insert in forward-port cron
On two of the freezes, thereafter the logs showed serial crashes in
the forwardport cron when trying to find the insertion point for a new
forward-port.

The first time was not really diagnosed, the second time the cause was
found to be a retargeted PR which led to a failure of the "insertion"
forward port, which did not take that possibility in account (it
assumed -- sensibly I believed -- that an intermediate FP following a
branch insertion would always succeed, sadly the malevolent universe
had other plans).

So only insert the new forward port inside its sequence (if necessary)
if the forward port actually succeeded, otherwise ignore it.

Fixes #551
2022-02-10 13:51:33 +01:00
Xavier Morel
2898c7edd4 [FIX] runbot_merge: updating of commit date on rebase
On #509, the rebasing process was changed to forcefully update the
commit date of the commits, in order to force trigger builds.

However when squashing was re-enabled for #539 for some fool reason it
implemented its own bespoke rebasing (despite that not actually saving
any API call that I can see), meaning it did *not* update the commit
date. As such, an old commit being squashed would not get picked up by
the runbot, which is what happened to odoo/documentation#1226 (which
ultimately had to be hand-rebased after some confusion as to why it
did not work).

Update `_stage_squash` to go through `rebase` the normal way, also
update `rebase` to pop the commit date entirely instead of setting it
manually, and update the squashing test to check that the commit date
gets properly updated.

Fixes #579, closes #582
2022-02-10 13:51:08 +01:00
Xavier Morel
2285965e22 [MRG] runbot_merge, forwardport: multiple fixes to freeze wizard
Multiple fixes to various issues of the freeze wizard.

Some of the less fix-oriented sub-tasks were moved to #586 for discussion instead.

Closes #559, #587
2022-02-10 13:50:21 +01:00