List of commits:
Subject Hash Author Date (UTC)
We need .spec file before configure 840c7c3c0dd68c8ff6796b6494ca38afe8f4a5e6 Catalin(ux) M. BOIE 2021-10-24 14:28:59
rgfs: respect the requested size asked to be read f6f9e3f26e9c2bc98c38ded6a732cf53630d5688 Catalin(ux) M. BOIE 2021-10-24 09:25:51
builder: delay 5s if cannot contact the database b672b80542e80439243127aef2de4bda7d884e8a Catalin(ux) M. BOIE 2021-10-24 08:26:35
Cosmetic ea40e49373739590d9794d203ddd7e2b18464e29 Catalin(ux) M. BOIE 2021-10-23 15:35:34
Typo 7d156cc190c150239f16ea0b9807eb027f8cd79f Catalin(ux) M. BOIE 2021-10-22 17:41:34
worker: be more verbose 0f0e6216ad6f5923d08c10d7461d2259e92f69cd Catalin(ux) M. BOIE 2021-10-22 17:32:01
Add /etc/ssh files to spec 91c7c4f0bd30f01abe48e5c4f4c75857982a8f21 Catalin(ux) M. BOIE 2021-10-22 06:30:23
Removed Changelog file 8e42a6cb730000a104956bc7d265321d67d49bfe Catalin(ux) M. BOIE 2021-10-22 06:22:24
Do not store dependencies in a file but in a variable 13ba1da3a4a422e798393565e0a6941df660300a Catalin(ux) M. BOIE 2021-10-22 05:49:24
Forgot to create ssh dir for spec 1fd7185cdbf427451a7f4c5ada54e43febc5184f Catalin(ux) M. BOIE 2021-10-22 05:46:41
Still need to extract rpm info when switching users c4ddd883070d8fe48c876196dd3e4e08419745eb Catalin(ux) M. BOIE 2021-10-22 05:28:24
Add build_tools to the main script b0f721d9391a9cbe443a986f7d15cd8c052abd11 Catalin(ux) M. BOIE 2021-10-22 05:18:54
Again, first install the dependencies 919e46d2a71935451f576da32b61d2b6ecab126b Catalin(ux) M. BOIE 2021-10-22 05:02:50
Cosmetic cabc1c5cec8943d614b98b7f0ca8599cf5e2682c Catalin(ux) M. BOIE 2021-10-21 17:16:33
Install dependencies before trying to build the rpm 4df3dbf7e1f79b0c616d8dbeba8b1b30c9474f17 Catalin(ux) M. BOIE 2021-10-21 16:49:37
duilder fixes 2afa9250c1da72997092847df5a2a18cddb8ccb9 Catalin(ux) M. BOIE 2021-10-21 15:59:24
worker: move dependencies path 2e8902609a2d94e2eba5fb8ccda85de90ae23fb5 Catalin(ux) M. BOIE 2021-10-21 15:22:25
Lots of changes, too hard to split them; sorry about it 77c26d9ce82d452ebdc1b609d71c5e931768805c Catalin(ux) M. BOIE 2021-10-21 06:05:51
Lots of changes to the rg daemons 8b68e3967f650953d368dfb5ca5cdd2927e9c0de Catalin(ux) M. BOIE 2021-10-21 06:05:03
Hooks: Mostly cosmetic 3633af7d937f7c9c7c0c33cdc3ad9897aab8becd Catalin(ux) M. BOIE 2021-10-21 06:04:02
Commit 840c7c3c0dd68c8ff6796b6494ca38afe8f4a5e6 - We need .spec file before configure
Author: Catalin(ux) M. BOIE
Author date (UTC): 2021-10-24 14:28
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2021-10-24 14:28
Parent(s): f6f9e3f26e9c2bc98c38ded6a732cf53630d5688
Signer:
Signing key:
Signing status: N
Tree: 34fe81cfe3bd806d0d78d2f5a5bf3a2aa64f1f39
File Lines added Lines deleted
.gitignore 0 1
rocketgit.spec 41 42
scripts/builder.TODO 1 0
scripts/builder.php 11 4
scripts/worker.TODO 1 0
scripts/worker.php 5 2
File .gitignore changed (mode: 100644) (index eaeb7d7..3e2e24a)
... ... Makefile
4 4 cata/ cata/
5 5 *.tar.gz *.tar.gz
6 6 *.rpm *.rpm
7 *.spec
8 7 *.log *.log
9 8 *.out *.out
10 9 Changelog-last Changelog-last
File rocketgit.spec renamed from rocketgit.spec.in (similarity 63%) (mode: 100644) (index 9490b70..1ab789c)
5 5 %{?systemd_requires} %{?systemd_requires}
6 6
7 7 Summary: Light and fast Git hosting solution Summary: Light and fast Git hosting solution
8 Name: @PRJ@
9 Version: @VER@
10 Release: @REV@
8 Name: rocketgit
9 Version: 0.74
10 Release: 1
11 11 License: AGPLv3+ License: AGPLv3+
12 12 Group: Development/Tools Group: Development/Tools
13 13 Source: http://kernel.embedromix.ro/us/rocketgit/%{name}-%{version}.tar.gz Source: http://kernel.embedromix.ro/us/rocketgit/%{name}-%{version}.tar.gz
 
... ... for type in %{selinux_variants}
47 47 do do
48 48 [ -r /tmp/rgsdebug ] && echo "Installing module ${type}..." [ -r /tmp/rgsdebug ] && echo "Installing module ${type}..."
49 49 /usr/sbin/semodule -s ${type} -i \ /usr/sbin/semodule -s ${type} -i \
50 @USR_SHARE@/selinux/${type}/@PRJ@.pp &> /dev/null || :
50 /usr/share/selinux/${type}/rocketgit.pp &> /dev/null || :
51 51 done done
52 52 [ -r /tmp/rgsdebug ] && echo "fixfiles -R..." [ -r /tmp/rgsdebug ] && echo "fixfiles -R..."
53 /sbin/fixfiles -R @PRJ@ restore || :
53 /sbin/fixfiles -R rocketgit restore || :
54 54 # restorecon is needed because fixfiles -R will not restore the locks! # restorecon is needed because fixfiles -R will not restore the locks!
55 55 [ -r /tmp/rgsdebug ] && echo "restorecon -R..." [ -r /tmp/rgsdebug ] && echo "restorecon -R..."
56 /sbin/restorecon -R @VAR_LIB@/@PRJ@ || :
56 /sbin/restorecon -R /var/lib/rocketgit || :
57 57
58 58 if [ $1 -ne 0 ]; then if [ $1 -ne 0 ]; then
59 59 [ -r /tmp/rgsdebug ] && echo "Reloading xinetd..." [ -r /tmp/rgsdebug ] && echo "Reloading xinetd..."
60 60 /usr/bin/systemctl reload xinetd &>/dev/null || : /usr/bin/systemctl reload xinetd &>/dev/null || :
61 61 fi fi
62 62 [ -r /tmp/rgsdebug ] && echo "systemd_post fpm..." [ -r /tmp/rgsdebug ] && echo "systemd_post fpm..."
63 %systemd_post @PRJ@-fpm.service
63 %systemd_post rocketgit-fpm.service
64 64 [ -r /tmp/rgsdebug ] && echo "systemd_post builder..." [ -r /tmp/rgsdebug ] && echo "systemd_post builder..."
65 %systemd_post @PRJ@-builder.service
65 %systemd_post rocketgit-builder.service
66 66 [ -r /tmp/rgsdebug ] && echo "systemd_post fs..." [ -r /tmp/rgsdebug ] && echo "systemd_post fs..."
67 %systemd_post @PRJ@-fs.service
67 %systemd_post rocketgit-fs.service
68 68 [ -r /tmp/rgsdebug ] && echo "'post' done..." [ -r /tmp/rgsdebug ] && echo "'post' done..."
69 69
70 70 %preun %preun
71 %systemd_preun @PRJ@-fpm.service
72 %systemd_preun @PRJ@-builder.service
73 %systemd_preun @PRJ@-fs.service
74 %systemd_preun @PRJ@-worker@\*.service
71 %systemd_preun rocketgit-fpm.service
72 %systemd_preun rocketgit-builder.service
73 %systemd_preun rocketgit-fs.service
74 %systemd_preun rocketgit-worker@\*.service
75 75
76 76 %postun %postun
77 77 if [ $1 = 0 ]; then if [ $1 = 0 ]; then
78 78 for type in %{selinux_variants} for type in %{selinux_variants}
79 79 do do
80 /usr/sbin/semodule -s ${type} -r @PRJ@ &> /dev/null || :
80 /usr/sbin/semodule -s ${type} -r rocketgit &> /dev/null || :
81 81 done done
82 /sbin/fixfiles -R @PRJ@ restore || :
82 /sbin/fixfiles -R rocketgit restore || :
83 83 fi fi
84 %systemd_postun_with_restart @PRJ@-fpm.service
85 %systemd_postun_with_restart @PRJ@-builder.service
86 %systemd_postun_with_restart @PRJ@-fs.service
87 %systemd_postun_with_restart @PRJ@-worker@\*.service
84 %systemd_postun_with_restart rocketgit-fpm.service
85 %systemd_postun_with_restart rocketgit-builder.service
86 %systemd_postun_with_restart rocketgit-fs.service
87 %systemd_postun_with_restart rocketgit-worker@\*.service
88 88
89 89 %prep %prep
90 90 %setup -q %setup -q
 
... ... rm -rf ${RPM_BUILD_ROOT}
104 104
105 105 %files %files
106 106 %defattr (-,root,root,0755) %defattr (-,root,root,0755)
107 %dir @USR_SHARE@/@PRJ@
108 %doc README LICENSE TODO selinux/@PRJ@.* samples/*
109 %attr(0700,rocketgit,rocketgit) %dir @ETC@/@PRJ@
110 @ETC@/@PRJ@/config.php.sample
111 @ETC@/httpd/conf.d/rocketgit.conf.sample
112 @ETC@/nginx/conf.d/rocketgit.conf.sample
113 @ETC@/@PRJ@/worker-main.conf.sample
114 %config(noreplace) @ETC@/@PRJ@/config.php
115 %config(noreplace) @ETC@/@PRJ@/php-fpm.conf
116 %config(noreplace) @ETC@/@PRJ@/pool.conf
117 %config(noreplace) @ETC@/cron.d/rocketgit
118 %config(noreplace) @ETC@/xinetd.d/rocketgit
119 %config(noreplace) @ETC@/ssh/sshd_config.d/*
120 %attr(0700,rocketgit,rocketgit) %dir @VAR_LOG@/@PRJ@
121 %attr(0771,rocketgit,rocketgit) %dir @VAR_LIB@/@PRJ@
122 %attr(0700,rocketgit,rocketgit) %dir @VAR_LIB@/@PRJ@/locks
123 %attr(0700,rocketgit,rocketgit) %dir @VAR_LIB@/@PRJ@/repos
124 %attr(0700,rocketgit,rocketgit) %dir @VAR_LIB@/@PRJ@/q_merge_requests
125 %attr(0700,rocketgit,rocketgit) %dir @VAR_LIB@/@PRJ@/sockets
126 %attr(0700,rocketgit,rocketgit) %dir @VAR_LIB@/@PRJ@/tmp
127 %attr(0755,root,root) @USR_SBIN@/*
128 @USR_SHARE@/@PRJ@/*
129 @USR_SHARE@/selinux/*/@PRJ@.pp
107 %dir /usr/share/rocketgit
108 %doc README LICENSE Changelog TODO selinux/rocketgit.* samples/*
109 %attr(0700,rocketgit,rocketgit) %dir /etc/rocketgit
110 /etc/rocketgit/config.php.sample
111 /etc/httpd/conf.d/rocketgit.conf.sample
112 /etc/nginx/conf.d/rocketgit.conf.sample
113 /etc/rocketgit/worker-main.conf.sample
114 %config(noreplace) /etc/rocketgit/config.php
115 %config(noreplace) /etc/rocketgit/php-fpm.conf
116 %config(noreplace) /etc/rocketgit/pool.conf
117 %config(noreplace) /etc/cron.d/rocketgit
118 %config(noreplace) /etc/xinetd.d/rocketgit
119 %attr(0700,rocketgit,rocketgit) %dir /var/log/rocketgit
120 %attr(0771,rocketgit,rocketgit) %dir /var/lib/rocketgit
121 %attr(0700,rocketgit,rocketgit) %dir /var/lib/rocketgit/locks
122 %attr(0700,rocketgit,rocketgit) %dir /var/lib/rocketgit/repos
123 %attr(0700,rocketgit,rocketgit) %dir /var/lib/rocketgit/q_merge_requests
124 %attr(0700,rocketgit,rocketgit) %dir /var/lib/rocketgit/sockets
125 %attr(0700,rocketgit,rocketgit) %dir /var/lib/rocketgit/tmp
126 %attr(0755,root,root) /usr/sbin/*
127 /usr/share/rocketgit/*
128 /usr/share/selinux/*/rocketgit.pp
130 129 %{_unitdir}/*.service %{_unitdir}/*.service
131 130
132 131 %changelog %changelog
File scripts/builder.TODO changed (mode: 100644) (index bb4d3f5..90f3cc2)
22 22 [ ] Show in the web interface what worker built a job? Already done? [ ] Show in the web interface what worker built a job? Already done?
23 23 [ ] sent_jobs: shouldn't we save this information to be able to recover? [ ] sent_jobs: shouldn't we save this information to be able to recover?
24 24 [ ] We need to store in meta info also the job_id, to check all details about that build. [ ] We need to store in meta info also the job_id, to check all details about that build.
25 [ ] If no worker is available, do not try to call process_job (pollutes the log).
25 26 [ ] [ ]
File scripts/builder.php changed (mode: 100644) (index 2ff2c06..87fedca)
... ... function xdispatch($key, $data)
694 694 return $ret; return $ret;
695 695 } }
696 696
697 /*
698 * Returns TRUE if we should try to continue finding a worker.
699 * Returns FALSE if we should not continue.
700 */
697 701 function rg_process_job($db, &$job) function rg_process_job($db, &$job)
698 702 { {
699 703 global $rg_conns; global $rg_conns;
 
... ... function rg_process_job($db, &$job)
705 709 //rg_log($jid . ': job is already assigned to' //rg_log($jid . ': job is already assigned to'
706 710 // . ' worker [' . $job['worker_name'] . ']' // . ' worker [' . $job['worker_name'] . ']'
707 711 // . ' (id ' . $job['worker_id'] . '); skip it'); // . ' (id ' . $job['worker_id'] . '); skip it');
708 return;
712 return FALSE;
709 713 } }
710 714
711 715 // Should we delay because of a previous fail? // Should we delay because of a previous fail?
712 716 if (isset($job['next_try']) && ($job['next_try'] > time())) { if (isset($job['next_try']) && ($job['next_try'] > time())) {
713 717 rg_log($jid . ': job is suspended till ' rg_log($jid . ': job is suspended till '
714 718 . date('Y-m-d H:i:s', $job['next_try'])); . date('Y-m-d H:i:s', $job['next_try']));
715 return;
719 return FALSE;
716 720 } }
717 721
718 722 rg_log_ml($jid . ': processing job...'); rg_log_ml($jid . ': processing job...');
 
... ... function rg_process_job($db, &$job)
728 732 if ($workers_list === FALSE) { if ($workers_list === FALSE) {
729 733 rg_log($jid . ': cannot load workers list: ' . rg_worker_error()); rg_log($jid . ': cannot load workers list: ' . rg_worker_error());
730 734 $job['next_try'] = time() + 60; $job['next_try'] = time() + 60;
731 return;
735 return TRUE;
732 736 } }
733 737 //rg_log_debug('workers list: ' . rg_array2string($workers_list)); //rg_log_debug('workers list: ' . rg_array2string($workers_list));
734 738
 
... ... function rg_process_job($db, &$job)
821 825 // duplicate work // duplicate work
822 826 rg_log($key . ': ' . $jid . ': job sent to worker [' . $name . ']'); rg_log($key . ': ' . $jid . ': job sent to worker [' . $name . ']');
823 827 rg_log_debug('sent job: ' . rg_array2string($job2)); rg_log_debug('sent job: ' . rg_array2string($job2));
824 return;
828 return FALSE;
825 829 } }
826 830 unset($i); unset($i);
827 831
832 // TODO: we should signal this and prevent the call if the list of
833 // workers does not change.
828 834 rg_log('No workers found!'); rg_log('No workers found!');
835 return TRUE;
829 836 } }
830 837
831 838
File scripts/worker.TODO changed (mode: 100644) (index 84602e7..6d0931c)
133 133 [ ] We may have a permanent machine which just rebuilds the subrepos. [ ] We may have a permanent machine which just rebuilds the subrepos.
134 134 [ ] We must let the user restrict the architectures and major and arch! [ ] We must let the user restrict the architectures and major and arch!
135 135 [ ] We must prevent a parallel schedule of a pkg_subrepo. [ ] We must prevent a parallel schedule of a pkg_subrepo.
136 [ ] When building dotrepo, should we still respect webbok specified packages?
136 137 [ ] [ ]
File scripts/worker.php changed (mode: 100644) (index f3ac73b..b238d58)
... ... function start_worker_build_rgfs($job, &$reason, &$reason2)
735 735 . ' exit 0' . "\n" . ' exit 0' . "\n"
736 736 . 'fi' . "\n" . 'fi' . "\n"
737 737 . "\n" . "\n"
738 . 'git clone https://rocketgit.com/user/catalinux/rgfs' . "\n"
738 . 'git clone -b main https://rocketgit.com/user/catalinux/rgfs' . "\n"
739 739 . 'cd rgfs' . "\n" . 'cd rgfs' . "\n"
740 740 . './configure' . "\n" . './configure' . "\n"
741 741 . 'make' . "\n" . 'make' . "\n"
 
... ... function start_worker($job)
1143 1143
1144 1144 rg_exec('umount ' . $emain . '/root', '', FALSE, FALSE, FALSE); rg_exec('umount ' . $emain . '/root', '', FALSE, FALSE, FALSE);
1145 1145
1146 rg_log_debug('Cleaning dir ' . $job['main']);
1146 1147 $r = rg_del_tree($job['main']); $r = rg_del_tree($job['main']);
1147 1148 if ($r === FALSE) { if ($r === FALSE) {
1148 1149 $reason = 'cannot delete main dir'; $reason = 'cannot delete main dir';
 
... ... function start_worker($job)
1335 1336 . ' >>/mnt/status/RG_LABELS' . "\n"; . ' >>/mnt/status/RG_LABELS' . "\n";
1336 1337
1337 1338 $s .= 'date +%s > ' . $prefix . '.start' . "\n" $s .= 'date +%s > ' . $prefix . '.start' . "\n"
1339 . '# i: ' . json_encode($i) . "\n"
1338 1340 . 'echo "Executing [' . $i['cmd'] . ']"' . "\n" . 'echo "Executing [' . $i['cmd'] . ']"' . "\n"
1339 1341 . '(' . $i['cmd'] . ') &>' . $prefix . '.log' . "\n" . '(' . $i['cmd'] . ') &>' . $prefix . '.log' . "\n"
1340 1342 . 'E=${?}' . "\n" . 'E=${?}' . "\n"
1341 1343 . 'echo ${E} > ' . $prefix . ".status\n" . 'echo ${E} > ' . $prefix . ".status\n"
1342 1344 . 'date +%s > ' . $prefix . '.done' . "\n" . 'date +%s > ' . $prefix . '.done' . "\n"
1343 1345 . 'if [ "${E}" != "0" ]; then' . "\n" . 'if [ "${E}" != "0" ]; then' . "\n"
1346 . ' echo "Command failed with code ${E}"' . "\n"
1344 1347 . $lnok . $lnok
1345 . ($i['abort'] ? ' exit 1' . "\n" : '')
1348 . ($i['abort'] ? ' exit ${E}' . "\n" : '')
1346 1349 . 'else' . "\n" . 'else' . "\n"
1347 1350 . $lok . $lok
1348 1351 . 'fi' . "\n\n"; . 'fi' . "\n\n";
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