Vladyslav Ivanov
06/02/2022, 1:46 PMfrom dagster import job, op
@op
def get_name():
return "dagster"
@op
def hello(name: str):
print(f"Hello, {name}!")
@job
def hello_dagster():
hello(get_name())
If I want to run hello_dagster() every minute, what should I do? I've tried:
basic_schedule = ScheduleDefinition(job=hello_dagster, cron_schedule="* * * * *")
and then created a repo and ran dagster-daemon. Would love to learn how to do this properly. Thank you!Stephen Bailey
06/02/2022, 2:13 PMVladyslav Ivanov
06/02/2022, 2:51 PMStephen Bailey
06/02/2022, 2:55 PMdagit -f my_file.py
-- you'll see warning flags on the "schedules" and "sensors" part of the UI. so you have to also run the dagster-daemon
. It's kind of a pain because you also have to set up a dagster.yaml
and workspaces.yaml
file for local development.
I would recommend getting this `docker compose` example running locally, then editing the repo.py
file to play around with the scheduling stuff.Stephen Bailey
06/02/2022, 2:56 PMVladyslav Ivanov
06/02/2022, 2:57 PMStephen Bailey
06/02/2022, 2:58 PMVladyslav Ivanov
06/02/2022, 2:59 PMStephen Bailey
06/02/2022, 2:59 PMVladyslav Ivanov
06/02/2022, 3:00 PMStephen Bailey
06/02/2022, 4:21 PMsensor
, which is also run by the daemon. the way i think of it -- might not be 100% right -- is this:
1. write code
2. dagit reads code and parses objects from repos -- jobs, ops, schedules, sensors
3. daemon takes any parsed schedules, sensors and starts evaluating them every N secondsVladyslav Ivanov
06/02/2022, 5:08 PM