Commit graph

118 commits

Author SHA1 Message Date
Mike McLean
40660bbb42 call host.refuseTask when host check fails 2023-10-03 15:23:02 +02:00
Tomas Kopecek
be4e0cc44d Use old-style checkout for shortened refs
Related: https://pagure.io/koji/issue/3629
2022-12-19 09:43:15 +01:00
Tomas Kopecek
4cf59602f1 exception in case origin/ is part of ref 2022-11-08 12:15:57 +01:00
Tomas Kopecek
ab9d15b33d Enable fetching any ref from git repo
Related: https://pagure.io/koji/issue/3508
2022-11-08 12:15:57 +01:00
Alex Iribarren
9bc9680285 Fix parsing of URLs with port numbers 2022-03-25 15:37:37 +01:00
Jana Cupova
725c157fbd Allow password in SCM url with new builder option
Fixes: https://pagure.io/koji/issue/3179
2022-01-25 15:47:27 +01:00
Jana Cupova
6426ddced1 Allow user on git://, git+http://, git+https://, and git+rsync:// scheme
Fixes: https://pagure.io/koji/issue/2868
2021-10-26 11:14:40 +02:00
Yu Ming Zhu
bc272c0532 [doc][defining_hub_policies] update the doc 2021-08-18 09:47:10 +00:00
Yu Ming Zhu
cdbebd963d [hub] add non-host evalPolicy API 2021-08-16 17:55:26 +00:00
Yu Ming Zhu
601cd33902 use scm_ as the prefix instead of scm for scminfo 2021-08-16 17:55:26 +00:00
Yu Ming Zhu
a3f19e0f12 more reasonable parameter name, and more doc strs 2021-08-16 17:55:26 +00:00
Yu Ming Zhu
47c4b5d70b kojid: extend SCM.assert_allowed with hub policy
This is a simple extention of `SCM.assert_allowed`

- `assert_allowed_by_policy` will set the default "use_common" to False which is different to the old behavior
- `channel`, `user_id`, `scratch` are passed in the `policy_data` with scminfo right now.

This is a prototype for this change, and there are some other solutions could be implemented too

- Use a scmpolicy plugin as `postSCMCheckout` callback, the pro is that we can do more checks after the source is initialized on builder, meanwhile, the con is that the source will be downloaded even it is denied by policy. It might be a potential risk?
- Do the scm check in hub's `make_task`, this looks straightforward, but may lack some builder's information

fixes: #2757
2021-08-16 17:55:26 +00:00
Tomas Kopecek
258831d7e6 Revert "PR#2978: Don't take new tasks if we've 0.0 capacity available"
This reverts commit 5e9ca9366a, reversing
changes made to 59879c6e2c.
2021-08-16 13:34:54 +02:00
Tomas Kopecek
a537521ecd Don't take new tasks if we've 0.0 capacity available
If I've just started buildArch task with weight 1.5 on builder with 1.5
capacity, it can pick another one, as it is not over the builder's
capacity. This is wrong as there is no real capacity behind.
2021-08-11 12:43:12 +02:00
Tomas Kopecek
c6e69b4f8b backport py27 compatible file open with encoding
client and builder needs to run on py27 which doesn't support
open(encoding='utf-8')

Related: https://pagure.io/koji/issue/2641
2021-02-16 14:13:03 +01:00
Tomas Kopecek
96ae0ecef5 explicit encoding for text file operations
Fixes: https://pagure.io/koji/issue/2641
2021-01-26 13:36:25 +01:00
Tomas Kopecek
f674f554f8 builder: configurable TTL for buildroots
Fixes: https://pagure.io/koji/issue/2374
2020-09-17 14:16:02 +02:00
Yu Ming Zhu
54f047fc2a TaskManager: clean both result and results dirs
fixes: #1988
2020-07-21 23:29:13 -04:00
Tomas Kopecek
50bcb6f3bc replace md5 with sha256 2020-06-24 14:42:01 +02:00
Yu Ming Zhu
a893e8bf2b a wrapper ignoring FIPS for hashlib.md5 2020-06-24 14:42:00 +02:00
Tomas Kopecek
2b930de206 kojid: remove bootstrap dir
Fixes: https://pagure.io/koji/issue/1988
2020-06-05 14:06:03 +02:00
Tomas Kopecek
0132313f92 replace logging.warn with warning
call is deprected in python 3.7

Fixes: https://pagure.io/koji/issue/2135
2020-04-22 13:47:15 +02:00
Tomas Kopecek
f60fe79379 remove unneeded condition 2020-03-30 16:48:43 +02:00
Tomas Kopecek
79f6333629 delete main part of data 2020-03-30 16:48:43 +02:00
Tomas Kopecek
e3b7f326ef add real delete 2020-03-30 16:48:43 +02:00
Tomas Kopecek
98d25bf384 delete oldest failed buildroot, when there is no space
Fixes: https://pagure.io/koji/issue/1913
2020-03-30 16:48:43 +02:00
Yuming Zhu
d21083a11b still use BaseException for logging purpose 2020-03-03 21:38:22 +08:00
Yuming Zhu
cf34706f04 use Exception instead of BaseException for bare expection 2020-03-03 21:38:22 +08:00
Yuming Zhu
c5db34a8e1 flake8: apply E501 with max-line-length=99 2020-03-03 21:38:22 +08:00
Yuming Zhu
f1ba6cefd7 flake8: apply all rest E7 rules 2020-03-03 21:38:22 +08:00
Yuming Zhu
6dd77e0fa4 flake8: apply E502 rule 2020-03-03 21:38:22 +08:00
Yuming Zhu
0f727a2ab4 flake8: apply E3 rules 2020-03-03 21:38:22 +08:00
Yuming Zhu
05340b146b flake8: apply E2 rules except E266 2020-03-03 21:38:21 +08:00
Yuming Zhu
ce1f9928af flake8: apply E1 rules 2020-03-03 21:38:21 +08:00
Yu Ming Zhu
49504073b1 refine import style 2020-03-03 21:35:08 +08:00
Yuming Zhu
97cfaa4fcf flake8: follow E265 rule 2020-03-03 21:35:08 +08:00
Yuming Zhu
642508ccf6 flake8: follow all F rules 2020-03-03 21:35:08 +08:00
Yu Ming Zhu
4d29a87e9b sort imports in koji 2019-12-12 11:00:57 +00:00
Tomas Kopecek
208ecca37f continue instead of exiting
Fixes: https://pagure.io/koji/issue/1840
2019-11-27 16:33:41 -05:00
Tomas Kopecek
b35499cdb4 fix time type for restartHosts
Fixes: https://pagure.io/koji/issue/1825
2019-11-25 11:54:18 +01:00
Ken Dreyer
95fcac7ca5 builder: log insufficent disk space location
When creating a builder with the default settings and a small root
partition "/", kojid will fail to come up because /var/lib/mock is on
the root partition.

Prior to this change, kojid would log a messages to the systemd journal
about the insufficent disk space, but it did not make it obvious which
directory should have more disk space. Add the buildroot location to
this log message, so the administrator can more easily understand what
to change.
2019-09-26 17:42:09 +02:00
Tomas Kopecek
dfbe322222 deprecate sha1/md5_constructor from koji.util
These functions are now fully provided by hashlib. Commit removes their
usage from koji's codebase and leaves deprecation message in lib.

Final removal from lib is scheduled to 1.21.

Fixes: https://pagure.io/koji/issue/1487
2019-08-12 16:07:55 -04:00
Mike McLean
7c416d68d1 tweak rank calculation 2019-04-09 15:40:00 -04:00
Mike McLean
c4f7724647 scale task_avail_delay based on bin rank 2019-04-09 15:40:00 -04:00
Tomas Kopecek
613d1587a6 fix typo 2019-03-04 10:13:51 -05:00
Mike McLean
01b0a41639 fix file open mode 2019-03-04 09:28:39 -05:00
Mike McLean
24f9cb60ba use base64encode most places 2019-03-04 09:28:39 -05:00
Tomas Kopecek
86f3c5b095 decode Popen.communicate result under py3
Fixes: https://pagure.io/koji/issue/1270
2019-02-20 15:30:01 -05:00
Tomas Kopecek
ccf1c41274 fixes 2019-02-12 16:09:19 -05:00
Tomas Kopecek
426a8c2b16 rpm builds 2019-02-12 16:06:00 -05:00