https://dagster.io/ logo
c

Cris

05/06/2020, 5:10 AM
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

sashank

05/06/2020, 1:13 PM
Hey! Feel free to ask here or DM me
c

Cris

05/06/2020, 2:24 PM
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

sashank

05/06/2020, 2:33 PM
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

Cris

05/06/2020, 2:35 PM
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

sashank

05/06/2020, 2:38 PM
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

Cris

05/06/2020, 2:40 PM
Haha so you can just get the dict
s

sashank

05/06/2020, 2:41 PM
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

Cris

05/06/2020, 2:43 PM
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

sashank

05/06/2020, 2:44 PM
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

Cris

05/06/2020, 2:45 PM
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

sashank

05/08/2020, 12:37 AM
Hey @Cris, were you able to find the issue?
c

Cris

05/08/2020, 1:10 AM
yes, it was a issue with an environment variable i was using that was not read. Your advise was quite useful, thanks!
s

sashank

05/08/2020, 1:19 AM
awesome, great to hear. please let us know if you run into any more issues