List of commits:
Subject Hash Author Date (UTC)
Keep-alive mechanism for builder/worker 7e3add2ab41feefe37a858439934b8599fb30933 Catalin(ux) M. BOIE 2022-12-10 19:36:53
Bumped version to 0.76 09bb0cc92a9dfce513ce1289a22e71faf4ad1fe1 Catalin(ux) M. BOIE 2022-10-22 06:27:35
Cosmetic 45c59081c97489ccccd35efffa522607fee25a63 Catalin(ux) M. BOIE 2022-10-22 05:52:56
Mostly worker stuff ccf3a8d8da2ad1b0d97418fabb5028b40721835f Catalin(ux) M. BOIE 2022-10-22 05:50:04
wh: lambda: seems we cannot pass x-Amz-Client-Context header empty anymore 7f065b0fb6ceed5d2339afd7590f5a795ed3582e Catalin(ux) M. BOIE 2022-10-21 19:33:58
workers: wrong URL for delete a2b2ff5925b1ee9b4a033da93084c008b7af8c64 Catalin(ux) M. BOIE 2022-10-21 16:03:56
Typo 4557595fb985fb2a0a482a387ef0a61293b511ed Catalin(ux) M. BOIE 2022-03-29 17:06:57
Builder improvements 2c27620922c4990454dc3039b2f1c4a86388501f Catalin(ux) M. BOIE 2022-03-29 06:28:16
Extra space in debian/conffiles preventing Debian build 416ed9995151c29bffb4ca3f0f6901aab7cbaa8e Catalin(ux) M. BOIE 2022-03-28 19:36:06
Show global pkg sub repos; cosmetic 43f60158b760b2789261e703ff2fa0781f590e04 Catalin(ux) M. BOIE 2022-03-28 18:21:07
Cosmetic a60d33914b8a1754c84ddc5440533df9b89337ad Catalin(ux) M. BOIE 2022-03-16 07:40:37
Cosmetic 8bb684cb885e0ad0f24519990a564031ea0e43a9 Catalin(ux) M. BOIE 2022-02-19 08:12:45
Set install_id under lock to not get errors 46904e58621450cc164afe769a2aeb597fbaecd8 Catalin(ux) M. BOIE 2022-02-17 18:08:59
Cosmetic bc38d3b0196d5701f75209a3125543ba096fe340 Catalin(ux) M. BOIE 2022-02-16 19:45:29
Bumped version to 0.75 1341db08f1342e7a6838305e94d31849d6b583c4 Catalin(ux) M. BOIE 2022-02-16 18:58:45
Misc small fixes 7bc12d7ee158d99979dbb91f293162472917a2e2 Catalin(ux) M. BOIE 2022-02-16 18:58:18
We did not validated the plan id - now is fixed. 3786d759107c4028f181c7de77d39382d9f572bf Catalin(ux) M. BOIE 2022-02-16 18:55:05
Added build stats 3f574c94ad35d6f85ee37a4da410499f268e608f Catalin(ux) M. BOIE 2022-02-16 18:53:54
Cosmetic 548c8a909c994ef528c9910c625e6afb88beeead Catalin(ux) M. BOIE 2022-02-16 18:44:12
.deb support 722ca672abf6f28109e35f3573dca7e367d3b51a Catalin(ux) M. BOIE 2022-02-16 18:39:19
Commit 7e3add2ab41feefe37a858439934b8599fb30933 - Keep-alive mechanism for builder/worker
Author: Catalin(ux) M. BOIE
Author date (UTC): 2022-12-10 19:36
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2022-12-10 19:36
Parent(s): 09bb0cc92a9dfce513ce1289a22e71faf4ad1fe1
Signing key:
Tree: 77c7ae7a34df9922e7c08a638cbf3334f79ed7fe
File Lines added Lines deleted
TODO 0 3
scripts/builder.php 43 1
scripts/worker.php 11 0
File TODO changed (mode: 100644) (index a60015c..9914b9e)
... ... Seems we are cloning the namespace, before knowing if the user can push!
179 179 [ ] For http hooks, add a header to allow people to report abuses. [ ] For http hooks, add a header to allow people to report abuses.
180 180 Maybe directly a link which will lock the webhook and the Maybe directly a link which will lock the webhook and the
181 181 user ability to add more webhooks? user ability to add more webhooks?
182 [ ] builder on rg2 keeps saying "0 workers" till restart. worker restart does not help.
183 A keepalive machanism should be implemented? Already is.
184 Let's see if it is fixed with an update.
185 182 [ ] Build jobs must not be retried if the fail is in user area. [ ] Build jobs must not be retried if the fail is in user area.
186 183 [ ] job 1756: "Cannot execute" [ ] job 1756: "Cannot execute"
187 184 [ ] An internal error occurred. Please try again later. @@if("@@errmsg@@" != ""){{Details: @@errmsg@@}} [ ] An internal error occurred. Please try again later. @@if("@@errmsg@@" != ""){{Details: @@errmsg@@}}
File scripts/builder.php changed (mode: 100644) (index 1f3e824..7ed5438)
... ... function xnew($key, $arg)
61 61 global $features; global $features;
62 62 global $workers; global $workers;
63 63
64 $now = time();
65
64 66 $workers++; $workers++;
65 67
66 68 $s = &$rg_conns[$key]; $s = &$rg_conns[$key];
 
... ... function xnew($key, $arg)
69 71 $s['db'] = $arg; $s['db'] = $arg;
70 72 $s['auth'] = 0; $s['auth'] = 0;
71 73 $s['artifacts'] = array(); $s['artifacts'] = array();
74 $s['last_ping'] = $now;
75 $s['last_pong'] = $now;
72 76 unset($s); unset($s);
73 77
74 78 $f = array( $f = array(
 
... ... function xdispatch_one($key, $data)
199 203 $op = $u['op']; unset($u['op']); $op = $u['op']; unset($u['op']);
200 204 rg_log_debug($key . ': op=' . $op); rg_log_debug($key . ': op=' . $op);
201 205
206 if (strcmp($op, 'features') == 0) {
207 $rg_conns[$key]['feat'] = $u['features'];
208 rg_log('Client features: ' . rg_array2string($rg_conns[$key]['feat']));
209 break;
210 }
211
212 if (strcmp($op, 'pong') == 0) {
213 $rg_conns[$key]['last_pong'] = $now;
214 break;
215 }
216
202 217 if (strcmp($op, 'ANN') == 0) { if (strcmp($op, 'ANN') == 0) {
203 218 if (($u['boot_time'] < $now - 30) || ($u['boot_time'] > $now + 30)) { if (($u['boot_time'] < $now - 30) || ($u['boot_time'] > $now + 30)) {
204 219 $err = array( $err = array(
 
... ... $rg_conns['master']['func_new_arg'] = $db;
917 932 $features = array( $features = array(
918 933 'worker_stats' => 1, 'worker_stats' => 1,
919 934 'notify' => 1, 'notify' => 1,
920 'vm_stats' => 1);
935 'vm_stats' => 1,
936 'ping' => 1);
921 937 rg_log_debug('Supported features: ' . rg_array2string($features)); rg_log_debug('Supported features: ' . rg_array2string($features));
922 938
923 939 $workers = 0; $workers = 0;
924 940 $original_mtime = @filemtime(__FILE__); $original_mtime = @filemtime(__FILE__);
925 941 rg_log('Waiting first connection...'); rg_log('Waiting first connection...');
926 942 do { do {
943 $now = time();
944
945 // Check if we need to send pings or connections expired
946 foreach ($rg_conns as $_k => $_i) {
947 if (strcmp($_k, 'master') == 0)
948 continue;
949
950 if (!isset($_i['feat']))
951 continue;
952
953 if (!isset($_i['feat']['ping']))
954 continue;
955
956 if ($_i['last_ping'] + 10 < $now) {
957 //rg_log($_k . ': Sending ping');
958 $j = array('op' => 'ping');
959 rg_conn_enq($_k, json_encode($j) . "\n");
960 $rg_conns[$_k]['last_ping'] = $now;
961 }
962
963 if ($_i['last_pong'] + 30 < $now) {
964 rg_log($_k . ': Worker did not answer to ping! Close it!');
965 rg_conn_shutdown($_k, 2);
966 }
967 }
968
927 969 // Check our mtime so we can upgrade the software and this script // Check our mtime so we can upgrade the software and this script
928 970 // will restart. // will restart.
929 971 clearstatcache(); clearstatcache();
File scripts/worker.php changed (mode: 100644) (index 5f6ba09..d44167e)
... ... function xhandle_one($key, $data)
2074 2074 return; return;
2075 2075 } }
2076 2076
2077 if (strcmp($op, 'ping') == 0) {
2078 //rg_log('Received ping, sending pong');
2079 $j = array('op' => 'pong');
2080 rg_conn_enq('master', @json_encode($j) . "\n");
2081 return;
2082 }
2083
2077 2084 // From here, we require a jid // From here, we require a jid
2078 2085 if ($jid == 0) { if ($jid == 0) {
2079 2086 $err = array('errstr' => 'job id not specified'); $err = array('errstr' => 'job id not specified');
 
... ... function rg_worker_connect()
3002 3009 $rg_conns['master']['exit_on_close'] = 1; $rg_conns['master']['exit_on_close'] = 1;
3003 3010 $rg_conns['master']['func_data'] = 'xhandle'; $rg_conns['master']['func_data'] = 'xhandle';
3004 3011
3012 // Sending our features
3013 $j = array('op' => 'features', 'features' => array('ping' => 1));
3014 rg_conn_enq('master', @json_encode($j) . "\n");
3015
3005 3016 // announce ourselves // announce ourselves
3006 3017 $ann = $conf; $ann = $conf;
3007 3018 unset($ann['key']); unset($ann['key']);
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/catalinux/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/catalinux/rocketgit

Clone this repository using git:
git clone git://git.rocketgit.com/user/catalinux/rocketgit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main