Application Configuration
Scheduling
YAML Configuration
Path: applications.(app).instances.(instance).schedules : array
schedules:
- days: '*'
timeZone: Australia/Melbourne
priority: 1
parameter: active
value: "N"
- days: '*'
startTime: 11:00:00
endTime: 15:00:00
timeZone: Australia/Melbourne
priority: 2
parameter: active
value: "Y"
days
(string)
# All days
days: *
# Specific days
days: MON,WED,FRI
The day the schedule applies to. Either *
to mark all days or a comma-separated string of short-form days to mark the exact days.
timeZone
(string / tzdata format)
timeZone: America/New_York
The timezone which the schedule applies for. A list of timezones can be found here.
startTime
(string /HH:MM:SS format)
Default: 00:00:00
startTime: 13:30:45
The time when the schedule becomes active.
endTime
(string /HH:MM:SS format)
Default: 23:59:59
endTime: 13:30:45
The time when the schedule is de-activated.
priority
(integer)
Default: 64
Range: 1 to 255 (inclusive)
endTime: 13:30:45
The priority of the schedule in case there's an overlapping schedule.
parameter
(string)
parameter: active
The type of schedule. This is used by applications to determine the behaviour the schedule applies to.
value
(string)
value: "Y"
The value relating to the parameter. This is fed into applications to assess the current state of the schedule.
Application Integration
Riberry provides two built-in dynamic schedulers: DynamicQueues
and DynamicConcurrency
.
DynamicQueues
Class path: riberry.celery.client.dynamic.parameters.DynamicQueues
Parameter: active
(overridable)
The DynamicQueues
class can dynamically enable and disable specific Celery queues. The class only functions on the defined scalable Celery queues (Workflow.scalable_queues
):
from riberry.celery.client.dynamic.parameters import DynamicQueues
workflow = Workflow(
...
scalable_queues=['celery', 'event'],
dynamic_parameters=[DynamicQueues()]
)
If an instance has a schedule with parameter active
and the value is "N"
, the queues will be disabled. If all queues for the worker are disabled, the concurrency count will also be reduced to 0
. This can provide considerable memory improvements, so it may be best to seperate out your scalable queues to separate workers.
DynamicConcurrency
Class path: riberry.celery.client.dynamic.parameters.DynamicConcurrency
Parameter: concurrency
(overridable)
The DynamicConcurrency
class can dynamically scale the concurrency of a worker. The class only functions on workers which have one or more the defined scalable Celery queues (Workflow.scalable_queues
):
from riberry.celery.client.dynamic.parameters import DynamicConcurrency
workflow = Workflow(
...
scalable_queues=['celery', 'event'],
dynamic_parameters=[DynamicConcurrency()]
)