[copr] master: [logrotate] rotate every week unconditionally (d18b66d)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit d18b66defd2d8f690b734da0f3ba8213a9c70067
Author: Miroslav Suchý <miroslav(a)suchy.cz>
Date: Mon Dec 30 14:09:52 2013 +0100
[logrotate] rotate every week unconditionally
>---------------------------------------------------------------
logrotate/copr-backend | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/logrotate/copr-backend b/logrotate/copr-backend
index 0c4fe10..54fe114 100644
--- a/logrotate/copr-backend
+++ b/logrotate/copr-backend
@@ -7,7 +7,6 @@
compress
notifempty
missingok
- size=10M
create 640 copr copr
}
@@ -18,6 +17,5 @@
compress
notifempty
missingok
- size=10M
create 640 copr copr
}
10 years, 3 months
[copr] master: [backend] do not traceback if jobfile is mangled (6734441)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 673444173f97245e2c260187e1a3a5a014812fa4
Author: Miroslav Suchý <miroslav(a)suchy.cz>
Date: Mon Dec 30 14:09:09 2013 +0100
[backend] do not traceback if jobfile is mangled
in my case was zero sized which raised ValueError exception
>---------------------------------------------------------------
backend/dispatcher.py | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/backend/dispatcher.py b/backend/dispatcher.py
index ee2dc86..16adfdb 100644
--- a/backend/dispatcher.py
+++ b/backend/dispatcher.py
@@ -215,7 +215,11 @@ class Worker(multiprocessing.Process):
def parse_job(self, jobfile):
# read the json of the job in
# break out what we need return a bunch of the info we need
- build = json.load(open(jobfile))
+ try:
+ build = json.load(open(jobfile))
+ except ValueError:
+ # empty file?
+ return None
jobdata = Bunch()
jobdata.pkgs = build['pkgs'].split(' ')
jobdata.repos = [r for r in build['repos'].split(' ') if r.strip() ]
@@ -298,6 +302,10 @@ class Worker(multiprocessing.Process):
# parse the job json into our info
job = self.parse_job(jobfile)
+ if job is None:
+ self.callback.log('jobfile %s is mangled, please investigate' % jobfile)
+ time.sleep(self.opts.sleeptime)
+ continue
# FIXME
# this is our best place to sanity check the job before starting
# up any longer process
10 years, 3 months
[copr] master: [backend] print error messages to stderr (4beb54b)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 4beb54b7f7be19c90302558838ead3ec5f22ae91
Author: Miroslav Suchý <miroslav(a)suchy.cz>
Date: Mon Dec 30 13:43:12 2013 +0100
[backend] print error messages to stderr
because stdout can be closed, if running as daemon
addressing:
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
>---------------------------------------------------------------
backend/dispatcher.py | 2 +-
backend/mockremote.py | 10 +++++-----
copr-be.py | 6 +++---
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/backend/dispatcher.py b/backend/dispatcher.py
index 915ac81..ee2dc86 100644
--- a/backend/dispatcher.py
+++ b/backend/dispatcher.py
@@ -51,7 +51,7 @@ class SilentPlaybookCallbacks(callbacks.PlaybookCallbacks):
def on_vars_prompt(self, varname, private=True, prompt=None, encrypt=None, confirm=False, salt_size=None, salt=None):
result = None
- print "***** VARS_PROMPT WILL NOT BE RUN IN THIS KIND OF PLAYBOOK *****"
+ sys.stderr.write("***** VARS_PROMPT WILL NOT BE RUN IN THIS KIND OF PLAYBOOK *****\n")
callbacks.call_callback_module('playbook_on_vars_prompt', varname, private=private, prompt=prompt, encrypt=encrypt, confirm=confirm, salt_size=salt_size, salt=None)
return result
diff --git a/backend/mockremote.py b/backend/mockremote.py
index 2e53416..a0c39e8 100755
--- a/backend/mockremote.py
+++ b/backend/mockremote.py
@@ -86,7 +86,7 @@ def log(lf, msg):
try:
open(lf, 'a').write(str(now) + ':' + msg + '\n')
except (IOError, OSError), e:
- print 'Could not write to logfile %s - %s' % (lf, str(e))
+ sys.stderr.write('Could not write to logfile %s - %s\n' % (lf, str(e)))
print msg
def get_ans_results(results, hostname):
@@ -604,7 +604,7 @@ def parse_args(args):
opts, args = parser.parse_args(args)
if not opts.builder:
- print "Must specify a system to build on"
+ sys.stderr.write("Must specify a system to build on")
sys.exit(1)
if opts.packages_file and os.path.exists(opts.packages_file):
@@ -614,16 +614,16 @@ def parse_args(args):
# :(
if not args:
- print "Must specify at least one pkg to build"
+ sys.stderr.write("Must specify at least one pkg to build")
sys.exit(1)
if not opts.chroot:
- print "Must specify a mock chroot"
+ sys.stderr.write("Must specify a mock chroot")
sys.exit(1)
for url in opts.repos:
if not (url.startswith('http://') or url.startswith('https://') or url.startswith('file://')):
- print "Only http[s] or file urls allowed for repos"
+ sys.stderr.write("Only http[s] or file urls allowed for repos")
sys.exit(1)
return opts, args
diff --git a/copr-be.py b/copr-be.py
index 24126c1..4c636ed 100755
--- a/copr-be.py
+++ b/copr-be.py
@@ -257,7 +257,7 @@ def parse_args(args):
opts, args = parser.parse_args(args)
if not os.path.exists(opts.config_file):
- print "No config file found at: %s" % opts.config_file
+ sys.stderr.write("No config file found at: %s\n" % opts.config_file)
sys.exit(1)
opts.config_file = os.path.abspath(opts.config_file)
@@ -289,7 +289,7 @@ def main(args):
cbe = CoprBackend(opts.config_file, ext_opts=opts)
cbe.run()
except Exception:
- print 'Killing/Dying'
+ sys.stderr.write("Killing/Dying\n")
if 'cbe' in locals():
cbe.terminate()
raise
@@ -298,5 +298,5 @@ if __name__ == '__main__':
try:
main(sys.argv[1:])
except KeyboardInterrupt:
- print "\nUser cancelled, may need cleanup\n"
+ sys.stderr.write("\nUser cancelled, may need cleanup\n")
sys.exit(0)
10 years, 3 months
[copr] master: [cli] do not require additional arguments for --nowait (501e808)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 501e8085eb388316bb2be764dacdea035405100e
Author: Miroslav Suchý <miroslav(a)suchy.cz>
Date: Sun Dec 29 19:06:24 2013 +0100
[cli] do not require additional arguments for --nowait
>---------------------------------------------------------------
copr_cli/main.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/copr_cli/main.py b/copr_cli/main.py
index 47359e8..a83d3f0 100644
--- a/copr_cli/main.py
+++ b/copr_cli/main.py
@@ -101,7 +101,7 @@ def setup_parser():
help="")
parser_build.add_argument('--timeout', dest='timeout',
help="")
- parser_build.add_argument('--nowait',
+ parser_build.add_argument('--nowait', action="store_true", default=False, const=True,
help="Don't wait for build")
parser_build.set_defaults(func=action_build)
10 years, 3 months
[copr] master: [backend] replace procname with setproctitle (45bc95e)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 45bc95e272c3b65b412d5596709424bb75699edb
Author: Miroslav Suchý <miroslav(a)suchy.cz>
Date: Sun Dec 22 19:02:51 2013 +0100
[backend] replace procname with setproctitle
setproctitle is packaged for Fedora and works on Python3
>---------------------------------------------------------------
backend/dispatcher.py | 7 ++-----
copr-be.py | 13 +++----------
copr.spec | 1 +
3 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/backend/dispatcher.py b/backend/dispatcher.py
index 86bbbfc..915ac81 100644
--- a/backend/dispatcher.py
+++ b/backend/dispatcher.py
@@ -16,6 +16,7 @@ from ansible import callbacks
import requests
import subprocess
import string
+import setproctitle
from IPy import IP
try:
@@ -287,11 +288,7 @@ class Worker(multiprocessing.Process):
terminate the instance
"""
- try:
- import procname
- procname.setprocname("worker")
- except ImportError:
- pass
+ setproctitle.setproctitle("worker")
while not self.kill_received:
try:
jobfile = self.jobs.get()
diff --git a/copr-be.py b/copr-be.py
index 4d3cb68..24126c1 100755
--- a/copr-be.py
+++ b/copr-be.py
@@ -17,6 +17,7 @@ import optparse
import os
import pwd
import requests
+import setproctitle
import signal
import sys
import time
@@ -76,11 +77,7 @@ class CoprJobGrab(multiprocessing.Process):
ao.run()
def run(self):
- try:
- import procname
- procname.setprocname("CoprJobGrab")
- except ImportError:
- pass
+ setproctitle.setproctitle("CoprJobGrab")
abort = False
while not abort:
self.fetch_jobs()
@@ -122,11 +119,7 @@ class CoprLog(multiprocessing.Process):
# event format is a dict {when:time, who:[worker|logger|job|main], what:str}
def run(self):
- try:
- import procname
- procname.setprocname("CoprLog")
- except ImportError:
- pass
+ setproctitle.setproctitle("CoprLog")
abort = False
while not abort:
e = self.events.get()
diff --git a/copr.spec b/copr.spec
index ab44d92..c2b94e4 100644
--- a/copr.spec
+++ b/copr.spec
@@ -58,6 +58,7 @@ Requires: python-bunch
Requires: python-daemon
Requires: python-lockfile
Requires: python-requests
+Requires: python-setproctitle
Requires: logrotate
Requires: fedmsg
Requires: gawk
10 years, 4 months
[copr] master: [frontend] show monitor even if last build have been canceled (9399e71)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 9399e71a78ffb50a256b504b04f0ca6e8c91a68c
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Dec 19 16:28:39 2013 +0100
[frontend] show monitor even if last build have been canceled
addressing:
1 create build
2 cancel build
3 look on monitor (nothing there)
4 submit build (can be even different package)
5 look on monitor (all packages are there)
>---------------------------------------------------------------
.../coprs/templates/coprs/detail/monitor.html | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/coprs_frontend/coprs/templates/coprs/detail/monitor.html b/coprs_frontend/coprs/templates/coprs/detail/monitor.html
index ed8585d..dea1c1c 100644
--- a/coprs_frontend/coprs/templates/coprs/detail/monitor.html
+++ b/coprs_frontend/coprs/templates/coprs/detail/monitor.html
@@ -8,7 +8,6 @@
Latest build status:
<strong>{{ build.state }}</strong>
</p>
- {% if not build.canceled %}
<table class="monitor">
<tr>
<th>Package</th>
@@ -27,7 +26,6 @@
</tr>
{% endfor %}
</table>
- {% endif %}
{% else %}
<h2>No builds so far.</h2>
{% endif %}
10 years, 4 months
[copr] master: Revert "foo" (2a83e27)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 2a83e275b356a6fefa16462e32750dde5a74fbe0
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Dec 19 12:01:13 2013 +0100
Revert "foo"
This reverts commit 171e3c5e6a692b934b56da5a7edae3964acfe032.
>---------------------------------------------------------------
copr.spec | 3 -
.../coprs/templates/coprs/repository.spec | 43 --------------------
2 files changed, 0 insertions(+), 46 deletions(-)
diff --git a/copr.spec b/copr.spec
index db977c7..ab44d92 100644
--- a/copr.spec
+++ b/copr.spec
@@ -89,8 +89,6 @@ Requires: python-markdown
Requires: python-psycopg2
Requires: python-pylibravatar
Requires: python-whoosh >= 2.5.3
-Requires(pre): rpmdevtools
-Requires: rpm-build
# for tests:
Requires: pytest
Requires: python-flexmock
@@ -292,7 +290,6 @@ getent group copr-fe >/dev/null || groupadd -r copr-fe
getent passwd copr-fe >/dev/null || \
useradd -r -g copr-fe -G copr-fe -d %{_datadir}/copr/coprs_frontend -s /bin/bash -c "COPR frontend user" copr-fe
/usr/bin/passwd -l copr-fe >/dev/null
-runuser -c "rpmdev-setuptree" copr-fe
%post frontend
service httpd condrestart
diff --git a/coprs_frontend/coprs/templates/coprs/repository.spec b/coprs_frontend/coprs/templates/coprs/repository.spec
deleted file mode 100644
index 74ab219..0000000
--- a/coprs_frontend/coprs/templates/coprs/repository.spec
+++ /dev/null
@@ -1,43 +0,0 @@
-%global date %(date '+%a %b %d %Y')
-
-Name: %{username}-%{projectname}
-Version: 1
-Release: 1%{?dist}
-Summary: %{username}-%{projectname} yum repository
-
-Group: System Environment/Base
-License: WTFPL
-URL: http://copr.fedoraproject.org/coprs/%{username}/%{projectname}
-BuildArch: noarch
-
-# whatever provides /etc/yum.repos.d/
-Requires: system-release
-
-%description
-%{copr_description}
-
-%prep
-#nothing to do here
-
-%build
-cat <<EOF >%{username}-%{projectname}.repo
-[%{username}-%{projectname}]
-name=Copr repo for %{projectname} owned by %{username}
-description=%{copr_description}
-baseurl=%{baseurl}
-skip_if_unavailable=True
-gpgcheck=0
-enabled=1
-EOF
-
-%install
-mkdir -p %{buildroot}%{_sysconfdir}/yum.repos.d
-cp %{username}-%{projectname}.repo %{buildroot}%{_sysconfdir}/yum.repos.d
-
-%files
-%{_sysconfdir}/yum.repos.d/%{username}-%{projectname}.repo
-
-
-%changelog
-* %{date} Copr build system - %{version}-%{release}
-- automaticaly generated by Copr
10 years, 4 months
[copr] master: [backend] call correct function (bd4d7c3)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit bd4d7c3631343d31b5c1f3e66bef30f2f9c10053
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Dec 19 11:28:59 2013 +0100
[backend] call correct function
addressing:
Traceback (most recent call last):
File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/share/copr/copr-be.py", line 86, in run
self.fetch_jobs()
File "/usr/share/copr/copr-be.py", line 76, in fetch_jobs
ao.run()
File "/usr/share/copr/backend/actions.py", line 29, in run
self.events('Removing %s' % path)
TypeError: 'Queue' object is not callable
>---------------------------------------------------------------
backend/actions.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/backend/actions.py b/backend/actions.py
index 30cdb31..b2bb6ab 100644
--- a/backend/actions.py
+++ b/backend/actions.py
@@ -26,7 +26,7 @@ class Action(object):
project = self.data['old_value']
path = os.path.normpath(self.destdir + '/' + project)
if os.path.exists(path):
- self.events('Removing %s' % path)
+ self.event('Removing %s' % path)
shutil.rmtree(path)
result.job_ended_on = time.time()
result.result = 1 # success
10 years, 4 months
[copr] master: foo (171e3c5)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 171e3c5e6a692b934b56da5a7edae3964acfe032
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Dec 18 14:38:39 2013 +0100
foo
>---------------------------------------------------------------
copr.spec | 3 +
.../coprs/templates/coprs/repository.spec | 43 ++++++++++++++++++++
2 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/copr.spec b/copr.spec
index ab44d92..db977c7 100644
--- a/copr.spec
+++ b/copr.spec
@@ -89,6 +89,8 @@ Requires: python-markdown
Requires: python-psycopg2
Requires: python-pylibravatar
Requires: python-whoosh >= 2.5.3
+Requires(pre): rpmdevtools
+Requires: rpm-build
# for tests:
Requires: pytest
Requires: python-flexmock
@@ -290,6 +292,7 @@ getent group copr-fe >/dev/null || groupadd -r copr-fe
getent passwd copr-fe >/dev/null || \
useradd -r -g copr-fe -G copr-fe -d %{_datadir}/copr/coprs_frontend -s /bin/bash -c "COPR frontend user" copr-fe
/usr/bin/passwd -l copr-fe >/dev/null
+runuser -c "rpmdev-setuptree" copr-fe
%post frontend
service httpd condrestart
diff --git a/coprs_frontend/coprs/templates/coprs/repository.spec b/coprs_frontend/coprs/templates/coprs/repository.spec
new file mode 100644
index 0000000..74ab219
--- /dev/null
+++ b/coprs_frontend/coprs/templates/coprs/repository.spec
@@ -0,0 +1,43 @@
+%global date %(date '+%a %b %d %Y')
+
+Name: %{username}-%{projectname}
+Version: 1
+Release: 1%{?dist}
+Summary: %{username}-%{projectname} yum repository
+
+Group: System Environment/Base
+License: WTFPL
+URL: http://copr.fedoraproject.org/coprs/%{username}/%{projectname}
+BuildArch: noarch
+
+# whatever provides /etc/yum.repos.d/
+Requires: system-release
+
+%description
+%{copr_description}
+
+%prep
+#nothing to do here
+
+%build
+cat <<EOF >%{username}-%{projectname}.repo
+[%{username}-%{projectname}]
+name=Copr repo for %{projectname} owned by %{username}
+description=%{copr_description}
+baseurl=%{baseurl}
+skip_if_unavailable=True
+gpgcheck=0
+enabled=1
+EOF
+
+%install
+mkdir -p %{buildroot}%{_sysconfdir}/yum.repos.d
+cp %{username}-%{projectname}.repo %{buildroot}%{_sysconfdir}/yum.repos.d
+
+%files
+%{_sysconfdir}/yum.repos.d/%{username}-%{projectname}.repo
+
+
+%changelog
+* %{date} Copr build system - %{version}-%{release}
+- automaticaly generated by Copr
10 years, 4 months