j

    Jelle Vegter

    5 months ago
    Hi, do jobs sent to a local agent run in the terminal the agent is listening from? Meaning the job can access a cli authentication and environment variables?
    Kevin Kho

    Kevin Kho

    5 months ago
    Yes but you can also pass in env vars through the agent using the
    --env VAR=VALUE
    flag when spinning the agent up
    j

    Jelle Vegter

    5 months ago
    thanks
    I’m asking because I have a flow which imports a main function from a local package
    I put the entire main function in a task and schedule that through prefect cloud
    If I run the function from the terminal where the agent listens from the main function works fine. However when I schedule it, it doesn’t run
    The function takes ~20 minutes. I get this error:
    Any tips?
    Anna Geller

    Anna Geller

    5 months ago
    you can attach a path to your agent this way:
    prefect agent local start -p /Users/your_username/path/to/your_modules
    for more information on this, check this Discourse topic https://discourse.prefect.io/t/when-i-run-my-flow-i-see-an-error-failed-to-load-and-exe[…]derror-no-module-named-users-username-what-is-happening/33
    j

    Jelle Vegter

    5 months ago
    I have no issues importing local modules (I use Poetry as package manager)
    Anna Geller

    Anna Geller

    5 months ago
    and regarding the heartbeat error, this topic shows some steps you may take to fix it https://discourse.prefect.io/t/flow-is-failing-with-an-error-message-no-heartbeat-detected-from-the-remote-task/79
    j

    Jelle Vegter

    5 months ago
    Great, thanks!