Skip to content

Commit

Permalink
SIO-1925 Remove outdated things related to evalmgr
Browse files Browse the repository at this point in the history
Change-Id: I8df4ee0961e4b18ecad48132240240c5c6dda42d
  • Loading branch information
teqwve committed May 9, 2017
1 parent 3f5a887 commit 7eb988c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 40 deletions.
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,10 @@ List of changes since the *CONFIG_VERSION* numbering was introduced:
# to distinguish OIOIOI instances.
SITE_NAME = 'OIOIOI'

#. * Removed *CeleryBackend* from sioworkers backends, *SioworkersdBackend*
set as new default backend. Removed *[program:sioworkers]* entry from
*deployment/supervisord.conf*.

Usage
-----

Expand Down
4 changes: 2 additions & 2 deletions oioioi/default_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import oioioi
from oioioi.contests.current_contest import ContestMode

INSTALLATION_CONFIG_VERSION = 12
INSTALLATION_CONFIG_VERSION = 13

DEBUG = False
TEMPLATE_DEBUG = DEBUG
Expand Down Expand Up @@ -224,7 +224,7 @@
'-a!broken,!slow',
)

SIOWORKERS_BACKEND = 'oioioi.sioworkers.backends.CeleryBackend'
SIOWORKERS_BACKEND = 'oioioi.sioworkers.backends.SioworkersdBackend'
FILETRACKER_CLIENT_FACTORY = 'oioioi.filetracker.client.media_root_factory'
DEFAULT_FILE_STORAGE = 'oioioi.filetracker.storage.FiletrackerStorage'

Expand Down
8 changes: 0 additions & 8 deletions oioioi/deployment/supervisord.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,6 @@ redirect_stderr=true
stdout_logfile={{ PROJECT_DIR }}/logs/prizesmgr.log
{% if 'oioioi.prizes' not in settings.INSTALLED_APPS %}exclude=true{% endif %}

[program:sioworkers]
command={{ PYTHON }} {{ PROJECT_DIR }}/manage.py celeryd -E -l info -Q sioworkers -c 1
startretries=0
stopwaitsecs=15
redirect_stderr=true
stdout_logfile={{ PROJECT_DIR }}/logs/sioworkers.log
{% if not settings.RUN_LOCAL_WORKERS or settings.SIOWORKERS_BACKEND != 'oioioi.sioworkers.backends.CeleryBackend' %}exclude=true{% endif %}

[program:filetracker-server]
command=filetracker-server -L /dev/stderr -d {{ settings.MEDIA_ROOT }} -l {{ settings.FILETRACKER_LISTEN_ADDR }} -p {{ settings.FILETRACKER_LISTEN_PORT }} -D
redirect_stderr=true
Expand Down
30 changes: 0 additions & 30 deletions oioioi/sioworkers/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,36 +45,6 @@ def send_async_jobs(self, env, **kwargs):
oioioi.evalmgr.delay_environ(env)


class CeleryBackend(object):
"""A backend which uses Celery for sioworkers jobs."""

def _delayed_job(self, job, **kwargs):
return sio.celery.job.sioworkers_job.apply_async(args=[job], **kwargs)

def run_job(self, job, **kwargs):
return self._delayed_job(job, **kwargs).get()

def run_jobs(self, dict_of_jobs, **kwargs):
async_jobs = dict()
for key, env in dict_of_jobs.iteritems():
async_jobs[key] = sio.celery.job.sioworkers_job.apply_async(
args=[env], **kwargs)
results = dict()
for key, async_job in async_jobs.iteritems():
results[key] = async_job.get()
return results

def send_async_jobs(self, env, **kwargs):
res = self.run_jobs(env['workers_jobs'],
**(env.get('workers_jobs.extra_args', dict())))
env['workers_jobs.results'] = res
del env["workers_jobs"]
if 'workers_jobs.extra_args' in env:
del env['workers_jobs.extra_args']
with transaction.atomic():
oioioi.evalmgr.delay_environ(env)


class SioworkersdBackend(object):
"""A backend which collaborates with sioworkersd"""
server = Server(settings.SIOWORKERSD_URL, allow_none=True)
Expand Down

0 comments on commit 7eb988c

Please sign in to comment.