freezer.scheduler.freezer_scheduler module

class freezer.scheduler.freezer_scheduler.FreezerScheduler(apiclient, interval, job_path, concurrent_jobs=1, coordinator: SchedulerCoordinator | None = None)

Bases: object

create_job(job_doc)
end_session(session_id, job_id, session_tag, result)
filter_jobs(job_doc_list)

Filter jobs by supported capabilities.

Parameters:

job_doc_list (list[dict]) – list of jobs

Returns:

list of jobs

Return type:

list[dict]

get_jobs()
is_scheduled(job_id)
job_lock(job_id: str) AbstractContextManager[bool]

Always True in standalone mode; in clustered mode it reflects whether the per-job distributed lock was acquired.

owns_job(job_id: str) bool

Whether this scheduler should run the given job.

Always True in standalone mode. In clustered mode, only the member that owns the job on the coordination hash ring returns True.

poll()
reload()
start()
start_session(session_id, job_id, session_tag)
stop()
update_job(job_id, job_doc, user_credentials=None)
update_job_metadata(job_id, job_doc, user_credentials=None)

Pushes to the API the updates the job_schedule, session_id and session_tag information of the job_doc. This avoids sending job_actions and causing 409 conflicts.

Parameters:
  • job_id – id of the job to modify

  • job_doc – dict containing the job information

  • user_credentials – dict containing user credentials

Returns:

None

upload_metadata(metadata_doc, project_id=None, user_credentials=None)
freezer.scheduler.freezer_scheduler.main()
freezer.scheduler.freezer_scheduler.update_auth_options(conf, client_opts)

Map options from the service_auth group onto a flat Namespace for freezerclient. Values from [service_auth] in the config file are used; CLI/env-var values (already resolved by oslo_config onto CONF.service_auth) naturally take precedence because oslo_config resolves them first.