[copr] master: [backend] small cleanup, need more tests (3ae9913)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 3ae99137727e8a6173fe4f8ef393c5ec3c7ff997
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Fri Apr 24 14:24:15 2015 +0200
[backend] small cleanup, need more tests
>---------------------------------------------------------------
backend/backend/daemons/dispatcher.py | 8 +++++---
backend/backend/vm_manage/event_handle.py | 4 ++--
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/backend/backend/daemons/dispatcher.py b/backend/backend/daemons/dispatcher.py
index 8897aa8..66d1af8 100644
--- a/backend/backend/daemons/dispatcher.py
+++ b/backend/backend/daemons/dispatcher.py
@@ -386,6 +386,8 @@ class Worker(multiprocessing.Process):
self.rc.publish(JOB_GRAB_TASK_END_PUBSUB, json.dumps(request))
def acquire_vm_for_job(self, job):
+ # TODO: replace acquire/release with context manager
+
self.log.info("got job: {}, acquiring VM for build".format(str(job)))
start_vm_wait_time = time.time()
vmd = None
@@ -401,8 +403,6 @@ class Worker(multiprocessing.Process):
continue
except Exception as error:
self.log.exception("Unhandled exception during VM acquire :{}".format(error))
- self.notify_job_grab_about_task_end(job, do_reschedule=True)
- time.sleep(self.opts.sleeptime)
break
return vmd
@@ -420,7 +420,9 @@ class Worker(multiprocessing.Process):
vmd = self.acquire_vm_for_job(job)
- if vmd is not None:
+ if vmd is None:
+ self.notify_job_grab_about_task_end(job, do_reschedule=True)
+ else:
self.log.info("acquired VM: {} ip: {} for build {}".format(vmd.vm_name, vmd.vm_ip, job.task_id))
# TODO: store self.vmd = vmd and use it
self.vm_name = vmd.vm_name
diff --git a/backend/backend/vm_manage/event_handle.py b/backend/backend/vm_manage/event_handle.py
index c12076f..8c0b328 100644
--- a/backend/backend/vm_manage/event_handle.py
+++ b/backend/backend/vm_manage/event_handle.py
@@ -103,8 +103,8 @@ class EventHandler(Process):
else:
self.log.debug("recording check fail: {}".format(msg))
self.lua_scripts["record_failure"](keys=[vmd.vm_key])
- too_much_fails = int(vmd.get_field(self.vmm.rc, "check_fails") or 0) > Thresholds.max_check_fails
- if too_much_fails and vmd.state != VmStates.IN_USE:
+ fails_count = int(vmd.get_field(self.vmm.rc, "check_fails") or 0)
+ if fails_count > Thresholds.max_check_fails and vmd.state != VmStates.IN_USE:
self.log.info("check fail threshold reached: {}, terminating: {}"
.format(check_fails_count, msg))
self.vmm.start_vm_termination(vmd.vm_name)
8 years, 11 months
[copr] master: Automatic commit of package [copr-backend] release [1.61-1]. (c601b5e)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit c601b5e68d5f6902db46cd7dd204a101149d742e
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri May 15 11:07:05 2015 +0200
Automatic commit of package [copr-backend] release [1.61-1].
>---------------------------------------------------------------
backend/copr-backend.spec | 45 ++++++++++++++++++++++++++++++++++++++++-
rel-eng/packages/copr-backend | 2 +-
2 files changed, 45 insertions(+), 2 deletions(-)
diff --git a/backend/copr-backend.spec b/backend/copr-backend.spec
index 708a983..9c90db8 100644
--- a/backend/copr-backend.spec
+++ b/backend/copr-backend.spec
@@ -3,7 +3,7 @@
%endif
Name: copr-backend
-Version: 1.60
+Version: 1.61
Release: 1%{?dist}
Summary: Backend for Copr
@@ -239,6 +239,49 @@ useradd -r -g copr -G lighttpd -s /bin/bash -c "COPR user" copr
%exclude %{_pkgdocdir}/playbooks
%changelog
+* Fri May 15 2015 Miroslav Suchý <msuchy(a)redhat.com> 1.61-1
+- [backend] notify job_grab to remove job from added when start_job failed
+- [backend] [vmm] terminate VM with state IN_USE only when builder process is
+ missed
+- [backend] bugfix VMM.get_all_vm_in_group : VM could be removed before load
+ occures
+- [backend] job_grab: postpone build is we already serving more builds
+ than`max_vm_per_user` option
+- [backend] fix build logging
+- [backend] defer sending job to worker if job owner acquired too much VMs
+- [backend] replaced Thresholds.dirty_vm_terminating_timeout with config option
+ vm_dirty_terminating_timeout
+- [backend] Thread's doesn't have a pid
+- [backend] vm manage: user threading instead of multiprocessing
+- [backend] VMM aware cleunup_vm_nova
+- [backend] moving to nginx to serve results. lighttpd couldnt server pre-
+ compressed properly
+- [backend] script to clean up erred and forgotten VM's using python-novaclient
+- [backend] new documentation
+- [backend] repaired unittests
+- [backend] updated builder playbooks
+- [backend] updated example spawn playbook
+- [backend] don't provide logstash config directly, add only example to
+ documentation
+- [backend] do logging from multiply processes through redis pubsub; some fixes
+ to VM-management
+- [image_builder] initial release, due to OS bug, we cannot create snapshot
+ after provision through API, need to do it manually in the WebUI.
+- [backend] tests cleanup
+- [backend] ensure that prune script running under the copr user; simpler
+ `copr_find_obsolete_builds`
+- [backend] safer copr_prune_results script, unittests
+- [backend][frontend] Send for delete action only `src_pkg_name` instead of
+ original URL.
+- [backend] returned script to call createrepo from cli
+- [copr] don't allow acquire VMs that was last checked before server restart.
+- [backend] Added limit to acquire_vm based on VMs used by the same username at
+ the current moment.
+- New python dependencies
+- [backend] run tmp redis-server for tests
+- [backend] Dedicated and more complex management for builder machines.
+ [frontend] Now builds failed due to VM errors reschedulted faster.
+
* Fri Mar 20 2015 Valentin Gologuzov <vgologuz(a)redhat.com> 1.60-1
- [backend][spec] start/stop redis server during package build tests
diff --git a/rel-eng/packages/copr-backend b/rel-eng/packages/copr-backend
index 0b75fea..8109a76 100644
--- a/rel-eng/packages/copr-backend
+++ b/rel-eng/packages/copr-backend
@@ -1 +1 @@
-1.60-1 backend/
+1.61-1 backend/
8 years, 11 months
[copr] master: Add optional fedmenu resources to every page. (ae6fd5c)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit ae6fd5ca22319a31ee363fa871fa6e7620d3f301
Author: Ralph Bean <rbean(a)redhat.com>
Date: Wed Apr 22 10:51:21 2015 -0400
Add optional fedmenu resources to every page.
This is for https://fedoraproject.org/wiki/Fedora_Engineering/FY16_Plan
If the FEDMENU_URL and FEDMENU_DATA_URL options are left out of the
config, then nothing should change on the displayed page. If they are
included, then they will be pulled in at page load time to render little
menu buttons on the bottom right hand corner of the page.
There's an example up at http://threebean.org/fedmenu/
It will be a while until we are able to turn this on globally across all
our apps.
>---------------------------------------------------------------
frontend/coprs_frontend/config/copr.conf | 4 ++++
frontend/coprs_frontend/coprs/__init__.py | 2 +-
.../coprs_frontend/coprs/context_processors.py | 11 +++++++++++
.../coprs_frontend/coprs/templates/layout.html | 16 ++++++++++++++++
4 files changed, 32 insertions(+), 1 deletions(-)
diff --git a/frontend/coprs_frontend/config/copr.conf b/frontend/coprs_frontend/config/copr.conf
index ab4fb96..064baa4 100644
--- a/frontend/coprs_frontend/config/copr.conf
+++ b/frontend/coprs_frontend/config/copr.conf
@@ -45,6 +45,10 @@ SEND_EMAILS = True
## post-process url leading to frontend
# ENFORCE_PROTOCOL_FOR_FRONTEND_URL = "https"
+# URLs for fedmenu resources
+#FEDMENU_URL = "http://threebean.org/fedmenu/"
+#FEDMENU_DATA_URL = "http://threebean.org/fedmenu/dev-data.js"
+
# Kerberos authentication configuration. Example configuration abbreviated
# like 'RH' (should not changed once used, reflects what is stored in database).
# This requires mod_auth_kerb package (Fedora/RHEL) installed on your frontend
diff --git a/frontend/coprs_frontend/coprs/__init__.py b/frontend/coprs_frontend/coprs/__init__.py
index e86bb64..032ed4d 100644
--- a/frontend/coprs_frontend/coprs/__init__.py
+++ b/frontend/coprs_frontend/coprs/__init__.py
@@ -52,7 +52,7 @@ from coprs.views import recent_ns
from coprs.views.recent_ns import recent_general
from coprs.views.stats_ns import stats_receiver
-from .context_processors import include_banner
+from .context_processors import include_banner, inject_fedmenu
setup_log()
diff --git a/frontend/coprs_frontend/coprs/context_processors.py b/frontend/coprs_frontend/coprs/context_processors.py
index b84c241..895bb03 100644
--- a/frontend/coprs_frontend/coprs/context_processors.py
+++ b/frontend/coprs_frontend/coprs/context_processors.py
@@ -10,3 +10,14 @@ def include_banner():
return {"copr_banner": open(BANNER_LOCATION).read()}
else:
return {}
+
+
+(a)app.context_processor
+def inject_fedmenu():
+ """ Inject fedmenu url if available. """
+ if 'FEDMENU_URL' in app.config:
+ return dict(
+ fedmenu_url=app.config['FEDMENU_URL'],
+ fedmenu_data_url=app.config['FEDMENU_DATA_URL'],
+ )
+ return dict()
diff --git a/frontend/coprs_frontend/coprs/templates/layout.html b/frontend/coprs_frontend/coprs/templates/layout.html
index bef3fbf..f9981e9 100644
--- a/frontend/coprs_frontend/coprs/templates/layout.html
+++ b/frontend/coprs_frontend/coprs/templates/layout.html
@@ -58,5 +58,21 @@
</small>
</p>
</div>
+
+{% if fedmenu_url is defined %}
+<script src="{{fedmenu_url}}/js/fedora-libravatar.js"></script>
+<script src="{{fedmenu_url}}/js/fedmenu.js"></script>
+<script>
+ fedmenu({
+ 'url': '{{fedmenu_data_url}}',
+ 'mimeType': 'application/javascript',
+ 'position': 'bottom-right',
+ {% if copr is defined %}
+ 'user': '{{copr.owner.name}}',
+ {% endif %}
+ });
+</script>
+{% endif %}
+
</body>
</html>
8 years, 11 months