copr: backend: hotfix https://pagure.io/copr/copr/pull-request/1172
This commit is contained in:
parent
cddf37c65b
commit
e369176ea4
3 changed files with 79 additions and 0 deletions
|
@ -0,0 +1,24 @@
|
||||||
|
commit 6277990348da43d446468fbe9f3d47ef787e588e (HEAD -> separate-fc-for-worker, praiskup/separate-fc-for-worker)
|
||||||
|
Author: Pavel Raiskup <praiskup@redhat.com>
|
||||||
|
AuthorDate: Thu Jan 2 17:09:18 2020 +0100
|
||||||
|
Commit: Pavel Raiskup <praiskup@redhat.com>
|
||||||
|
CommitDate: Thu Jan 2 17:12:28 2020 +0100
|
||||||
|
|
||||||
|
backend: separate frontend_client for each Worker process
|
||||||
|
|
||||||
|
Because we shared FrontendClient object with BuildDispatcher, we for
|
||||||
|
some reason weren't able to communicate with RedisLogHandler and some
|
||||||
|
log entries were lost.
|
||||||
|
|
||||||
|
diff --git a/backend/backend/daemons/build_dispatcher.py b/backend/backend/daemons/build_dispatcher.py
|
||||||
|
index 4546ca74..af7e0654 100644
|
||||||
|
--- a/backend/backend/daemons/build_dispatcher.py
|
||||||
|
+++ b/backend/backend/daemons/build_dispatcher.py
|
||||||
|
@@ -126,7 +126,6 @@ class BuildDispatcher(multiprocessing.Process):
|
||||||
|
def start_worker(self, vm, job, reattach=False):
|
||||||
|
worker = Worker(
|
||||||
|
opts=self.opts,
|
||||||
|
- frontend_client=self.frontend_client,
|
||||||
|
vm_manager=self.vm_manager,
|
||||||
|
worker_id=self.next_worker_id,
|
||||||
|
vm=vm, job=job, reattach=reattach
|
45
roles/copr/backend/files/patches/fc-client-for-worker.patch
Normal file
45
roles/copr/backend/files/patches/fc-client-for-worker.patch
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
commit 6277990348da43d446468fbe9f3d47ef787e588e (HEAD -> separate-fc-for-worker, praiskup/separate-fc-for-worker)
|
||||||
|
Author: Pavel Raiskup <praiskup@redhat.com>
|
||||||
|
AuthorDate: Thu Jan 2 17:09:18 2020 +0100
|
||||||
|
Commit: Pavel Raiskup <praiskup@redhat.com>
|
||||||
|
CommitDate: Thu Jan 2 17:12:28 2020 +0100
|
||||||
|
|
||||||
|
backend: separate frontend_client for each Worker process
|
||||||
|
|
||||||
|
Because we shared FrontendClient object with BuildDispatcher, we for
|
||||||
|
some reason weren't able to communicate with RedisLogHandler and some
|
||||||
|
log entries were lost.
|
||||||
|
|
||||||
|
diff --git a/backend/backend/daemons/worker.py b/backend/backend/daemons/worker.py
|
||||||
|
index f679a1a8..001283e8 100644
|
||||||
|
--- a/backend/backend/daemons/worker.py
|
||||||
|
+++ b/backend/backend/daemons/worker.py
|
||||||
|
@@ -12,6 +12,7 @@ from ..mockremote import MockRemote
|
||||||
|
from ..constants import BuildStatus, build_log_format
|
||||||
|
from ..helpers import register_build_result, get_redis_logger, \
|
||||||
|
local_file_logger, run_cmd, pkg_name_evr
|
||||||
|
+from ..frontend import FrontendClient
|
||||||
|
|
||||||
|
from ..msgbus import (
|
||||||
|
MsgBusStomp,
|
||||||
|
@@ -26,11 +27,10 @@ from ..sshcmd import SSHConnectionError
|
||||||
|
class Worker(multiprocessing.Process):
|
||||||
|
msg_buses = []
|
||||||
|
|
||||||
|
- def __init__(self, opts, frontend_client, vm_manager, worker_id, vm, job, reattach=False):
|
||||||
|
+ def __init__(self, opts, vm_manager, worker_id, vm, job, reattach=False):
|
||||||
|
multiprocessing.Process.__init__(self, name="worker-{}".format(worker_id))
|
||||||
|
|
||||||
|
self.opts = opts
|
||||||
|
- self.frontend_client = frontend_client
|
||||||
|
self.vm_manager = vm_manager
|
||||||
|
self.worker_id = worker_id
|
||||||
|
self.vm = vm
|
||||||
|
@@ -38,6 +38,7 @@ class Worker(multiprocessing.Process):
|
||||||
|
self.reattach = reattach
|
||||||
|
|
||||||
|
self.log = get_redis_logger(self.opts, self.name, "worker")
|
||||||
|
+ self.frontend_client = FrontendClient(self.opts, self.log)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def name(self):
|
|
@ -33,6 +33,16 @@
|
||||||
dest=/usr/bin/prunerepo
|
dest=/usr/bin/prunerepo
|
||||||
tags: patches
|
tags: patches
|
||||||
|
|
||||||
|
- name: patch 1 for https://pagure.io/copr/copr/pull-request/1172
|
||||||
|
patch: src=patches/fc-client-for-worker.patch
|
||||||
|
dest=/usr/share/copr/backend/daemons/worker.py
|
||||||
|
tags: patches
|
||||||
|
|
||||||
|
- name: patch 2 for https://pagure.io/copr/copr/pull-request/1172
|
||||||
|
patch: src=patches/fc-client-for-worker-bd.patch
|
||||||
|
dest=/usr/share/copr/backend/daemons/build_dispatcher.py
|
||||||
|
tags: patches
|
||||||
|
|
||||||
- name: install openstackclient for image preparation
|
- name: install openstackclient for image preparation
|
||||||
dnf: state=present name=python3-openstackclient
|
dnf: state=present name=python3-openstackclient
|
||||||
when: devel|bool
|
when: devel|bool
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue