Changeset View
Changeset View
Standalone View
Standalone View
docs/sections/intro_tutorial/scheduler.rst
- This file was moved from docs/sections/learn/tutorial/scheduler.rst.
Show All 13 Lines | .. code-block:: shell | ||||
$ pip install dagster-cron | $ pip install dagster-cron | ||||
You must also ensure that ``cron`` is installed on the machine you're running the scheduler on. | You must also ensure that ``cron`` is installed on the machine you're running the scheduler on. | ||||
Pipeline | Pipeline | ||||
^^^^^^^^ | ^^^^^^^^ | ||||
.. literalinclude:: ../../../../examples/dagster_examples/intro_tutorial/scheduler.py | .. literalinclude:: ../../../examples/dagster_examples/intro_tutorial/scheduler.py | ||||
:linenos: | :linenos: | ||||
:lines: 1-34 | :lines: 1-34 | ||||
:caption: scheduler.py | :caption: scheduler.py | ||||
As before, we've defined some solids, a pipeline, and a repository. | As before, we've defined some solids, a pipeline, and a repository. | ||||
Defining the scheduler | Defining the scheduler | ||||
^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^ | ||||
Show All 20 Lines | |||||
Now we'll write a :py:class:`ScheduleDefinition <dagster.ScheduleDefinition>` to define the schedule | Now we'll write a :py:class:`ScheduleDefinition <dagster.ScheduleDefinition>` to define the schedule | ||||
we want. We pass the ``cron_schedule`` parameter to this class to define when the pipeline should run | we want. We pass the ``cron_schedule`` parameter to this class to define when the pipeline should run | ||||
using the standard cron syntax; the other parameters determine other familiar aspects of how the | using the standard cron syntax; the other parameters determine other familiar aspects of how the | ||||
pipeline will run, such as its config. | pipeline will run, such as its config. | ||||
We wrap the schedule definition in a function decorated with | We wrap the schedule definition in a function decorated with | ||||
:py:class:`@schedules <dagster.schedules>`: | :py:class:`@schedules <dagster.schedules>`: | ||||
.. literalinclude:: ../../../../examples/dagster_examples/intro_tutorial/scheduler.py | .. literalinclude:: ../../../examples/dagster_examples/intro_tutorial/scheduler.py | ||||
:linenos: | :linenos: | ||||
:lines: 36-45 | :lines: 36-45 | ||||
:lineno-start: 38 | :lineno-start: 38 | ||||
:caption: scheduler.py | :caption: scheduler.py | ||||
To complete the picture, we'll need to extend the ``repository.yaml`` structure we've met before | To complete the picture, we'll need to extend the ``repository.yaml`` structure we've met before | ||||
with a new key, ``scheduler``. | with a new key, ``scheduler``. | ||||
.. literalinclude:: ../../../../examples/dagster_examples/intro_tutorial/scheduler.yaml | .. literalinclude:: ../../../examples/dagster_examples/intro_tutorial/scheduler.yaml | ||||
:linenos: | :linenos: | ||||
:caption: scheduler.yaml | :caption: scheduler.yaml | ||||
Starting schedules | Starting schedules | ||||
^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^ | ||||
Whenever we make changes to schedule definitions using the ``SystemCronScheduler``, we need to run | Whenever we make changes to schedule definitions using the ``SystemCronScheduler``, we need to run | ||||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |