oio.xcute package

Submodules

oio.xcute.client module

class oio.xcute.client.XcuteClient(conf, endpoint=None, proxy_endpoint=None, refresh_delay=3600.0, logger=None, **kwargs)[source]

Bases: oio.api.base.HttpApi

Simple client API for the xcute service.

job_create(job_type, job_config=None)[source]
job_delete(job_id)[source]
job_list(limit=None, marker=None)[source]
job_pause(job_id)[source]
job_resume(job_id)[source]
job_show(job_id)[source]
lock_list()[source]
lock_show(lock)[source]
xcute_request(method, action, params=None, **kwargs)[source]

Make a request to the xcute service.

oio.xcute.orchestrator module

class oio.xcute.orchestrator.XcuteOrchestrator(conf, logger=None)[source]

Bases: object

DEFAULT_DISPATCHER_TIMEOUT = 2
DEFAULT_MAX_JOBS_PER_BEANSTALKD = 1024
DEFAULT_REFRESH_TIME_BEANSTALKD_WORKERS = 30
compute_total_tasks(job_id, job_type, job_info, job)[source]
dispatch_tasks(job_id, job_type, job_info, job)[source]
dispatch_tasks_batch(beanstalkd_workers, job_id, job_type, job_config, tasks)[source]

Try sending a task until it’s ok

exit_gracefully(*args, **kwargs)[source]
get_beanstalkd_workers()[source]

Yield beanstalkd workers following a loadbalancing strategy

handle_backend_errors(func, *args, **kwargs)[source]
handle_running_job(job_id, job_type, job_info)[source]

First launch the computation of total number of tasks, then launch the dispatchnig of all tasks across the platform.

listen_beanstalkd_reply_forever()[source]

Process this orchestrator’s job replies

listen_loop(listener)[source]

One iteration of the listening loop

make_beanstalkd_payload(job_id, job_type, job_config, tasks)[source]
process_reply(beanstalkd_job_id, encoded_reply)[source]
refresh_beanstalkd_workers_forever()[source]

Refresh beanstalkd workers by looking at the score, existing tubes and tube statistics.

run_forever()[source]

Take jobs from the queue and spawn threads to dispatch them

safe_compute_total_tasks(job_id, job_type, job_info, job)[source]

Compute the total number of tasks and update the backend.

safe_dispatch_tasks(job_id, job_type, job_info, job)[source]

Dispatch all tasks across the platform and update the backend.

safe_handle_running_job(job_info)[source]
safe_run_forever()[source]

oio.xcute.server module

class oio.xcute.server.XcuteServer(conf, logger=None)[source]

Bases: oio.common.wsgi.WerkzeugApp

on_job_create(req, *args, **kwargs)[source]
on_job_delete(req, *args, **kwargs)[source]
on_job_list(req, *args, **kwargs)[source]
on_job_pause(req, *args, **kwargs)[source]
on_job_resume(req, *args, **kwargs)[source]
on_job_show(req, *args, **kwargs)[source]
on_lock_list(req, *args, **kwargs)[source]
on_lock_show(req, *args, **kwargs)[source]
on_status(*args, **kwargs)[source]
oio.xcute.server.access_log(func)[source]
oio.xcute.server.create_app(conf)[source]
oio.xcute.server.handle_exceptions(func)[source]

Module contents