Alexandru Anghel
11/04/2022, 8:34 PMdef get_schedule(schedule: str):
return Schedule(clocks=[DatesClock([pendulum.now().add(seconds=10)])]) if schedule == "one time" else CronSchedule(cron=schedule)
Thanks!Mason Menges
11/04/2022, 9:07 PMAlexandru Anghel
11/04/2022, 9:24 PMMason Menges
11/04/2022, 10:00 PMAlexandru Anghel
11/04/2022, 10:13 PMInvalid RRule string "FREQ=DAILY;COUNT=1;DTSTART=20221104T220851Z": unknown parameter 'DTSTART' (type=value_error)
Edit: Nevermind, i've added by mistake dtstart in the rrule stringdef get_schedule(schedule: str):
dtstart = datetime.now() + timedelta(0,10)
return IntervalSchedule(interval=timedelta(days=9999), anchor_date = dtstart, timezone='UTC') if schedule == "one time" else CronSchedule(cron=schedule, timezone='UTC')
Going back to your proposal of setting the parameters directly to the flow run, i'm not sure this will work for my use case. I'm using dask runner and relying heavily on flow templates. Finally, i'm declaring the flows through kubernetes manifests.
It would be really helpful to be able to specify a particular timestamp directly to the schedule, like we used to have in Prefect 1.x.Nate
11/05/2022, 12:35 AMrun_deployment
in your CI/CD (which is not a task so it doesn't need to be in a flow) to trigger a given deployment some amount of time after the deployment is applied
from prefect.deployments import run_deployment
...
my_deployment.apply()
sleep(10)
run_deployment(name="myDeployment", params=dict(...))
Alexandru Anghel
11/07/2022, 11:11 AMNate
11/07/2022, 2:54 PMrun_deployment(name="xxx/xxx", timeout=0)
to avoid waiting for the referenced deployment to run