Hello! I was wondering where could be the best pla...
# announcements
c
Hello! I was wondering where could be the best place to get some advise and ask some questions I came across while setting up scheduling
s
Hey! Feel free to ask here or DM me
c
Thanks for your time! I was wondering two things 1. How can I diagnose why scheduled jobs are not starting. I configured a job to run every five minutes but it does not execute, there's no trace of execution in the logs either and it the dagit server runningdoes not indicate any errors. 2. Do scheduled jobs start with the preset definitions of the pipeline? how can I specify which preset to use?
s
For 1) it’s most likely a module/import error. To see the error, just edit your crontab (using
crontab -e
), and redirect the output of the command that runs to a file: For example:
Copy code
* * * * * ~/dagster/scripts/repo.sched.sh >> ~/log.txt 2>&1 # dagster-schedule: repo.test
We should have automatic reporting of this soon
2) If you’re using one of the schedule decorators (
@schedule
,
@daily_schedule
, etc), the config returned from that function will be used for the scheduled job
c
thanks, ill check the error logs to see whats happening
Also, if i already have a preset definition, using environments from pkg and keys, is it possible to reuse this preset definition for the cron?
I guess my question would be how to transfor a preset def to a regular dict that the cron could use
s
2) If you’re using one of the schedule decorators (
@schedule
,
@daily_schedule
, etc), the config returned from that function will be used for the scheduled job. If you want to use a preset, just grab the preset and return the environment_dict of the preset. Also, make sure to set the mode and solid_subset:
Copy code
@daily_schedule(pipeline_name="my_pipeline", mode=preset.mode, solid_subset=preset.solid_subset):
def my_daily_schedule(_):
    return preset.environment_dict
c
Haha so you can just get the dict
s
Yup, and if you defined your presets inline with your pipeline and don’t have them as a separate variable, you can grab them from your pipeline using
pipeline.get_preset('preset_name')
c
Wow nice, thats completely unknown for me, many thanks for your support. There are some pretty useful stuff that has been tricky to find in the docs, at least not explicitly. Maybe I can help documentation of these things after I understand how to setup this project I've been working on correctly.
s
Sorry about that, we definitely need to do a better job surfacing these things in docs. Should hopefully have a better experience for you soon
c
nah no problem, you have helped me plenty. I think soon it's my turn to help at least with this kind of stuff
s
Hey @Cris, were you able to find the issue?
c
yes, it was a issue with an environment variable i was using that was not read. Your advise was quite useful, thanks!
s
awesome, great to hear. please let us know if you run into any more issues