YD
08/15/2021, 2:15 AMNo heartbeat detected from the remote task; retrying the run.This will be retry 1 of 2
I also have a flow that I started manually, but it does not start, even though I have no other flows running.
in general, if I have a flow that I need to ensure is running at an exact time (no more than few seconds off) , is it good to use Prefect for this, or is it better to use cron job ?YD
08/15/2021, 2:30 AMYD
08/15/2021, 5:17 PMYD
08/15/2021, 7:17 PMYD
08/16/2021, 3:38 AMKevin Kho
YD
08/16/2021, 6:49 AMKevin Kho
Dustin Ngo
08/16/2021, 6:03 PMYD
08/16/2021, 6:23 PMYD
08/16/2021, 7:17 PMKevin Kho
YD
08/16/2021, 7:34 PMKevin Kho
YD
08/16/2021, 8:02 PMYD
08/16/2021, 8:02 PMYD
08/16/2021, 8:03 PMKevin Kho
prefect agent local start --no-hostname-label
YD
08/16/2021, 8:09 PMprefect agent local start
Kevin Kho
YD
08/16/2021, 8:12 PMflow.register
from)
on that machine I added the cloud Key to the .prefect/config.toml file
is this what you are asking?Kevin Kho
YD
08/16/2021, 8:20 PMfrom prefect import task, Flow
from prefect.executors import LocalDaskExecutor
from prefect.schedules import Schedule
from prefect.schedules.clocks import CronClock
import pendulum
@task(...)
def my_task()
def main():
start_date = pendulum.datetime(2019, 1, 1, tz="America/New_York")
schedule = Schedule(clocks=[CronClock('2 9 * * mon-fri', start_date=start_date)])
with Flow("my flow name", schedule=schedule, executor=LocalDaskExecutor()) as flow:
my_task()
flow.register(project_name='my project name')
if __name__ == "__main__":
main()
Kevin Kho
YD
08/16/2021, 8:22 PMKevin Kho
YD
08/16/2021, 8:29 PMKevin Kho
YD
08/16/2021, 9:14 PMKevin Kho
YD
08/16/2021, 11:38 PMKevin Kho
YD
08/16/2021, 11:55 PMYD
08/16/2021, 11:56 PMKevin Kho
YD
08/17/2021, 12:10 AMKevin Kho
YD
08/17/2021, 12:11 AMnohup prefect agent local start --no-hostname-label > ~/tmp/prefect_agent.log &
then deleting all flow
and re-registering themKevin Kho
--no-hostname-label
. Either way just note the labels for the flowsYD
08/17/2021, 12:17 AMnohup prefect agent local start -l aws > ~/tmp/prefect_agent.log &
and in the code
use flow.register(project_name='my flow name', labels=['aws'])
Kevin Kho
YD
08/30/2021, 2:54 PMYD
08/30/2021, 2:55 PMKevin Kho
YD
08/30/2021, 2:57 PMYD
08/30/2021, 3:01 PMnohup prefect agent local start -l aws --agent-config-id <instance-id> > ~/tmp/prefect_agent.log &
YD
08/30/2021, 3:01 PM@reboot nohup prefect agent local start -l aws --agent-config-id <instance-id> > ~/tmp/prefect_agent.log &
YD
08/30/2021, 3:02 PMYD
08/30/2021, 3:04 PMKevin Kho
@reboot
to run something when the machine reboots? I guess this won’t restart the process if it just dies but the machine doesn’t start? We have this section in our docs about using supervisor
here to always run the agent. Did that agent config work previously for you?YD
08/30/2021, 3:25 PMKevin Kho
YD
08/30/2021, 3:29 PM