h

    Hagai Arad

    2 years ago
    Hi, I’m new to Prefect so maybe my question is dumb (hopes not 😅). How can I add to my flow an execution of .py files that are stored on Github or on my machine? The meaning is how to run code that is external to the flow I registered. I currently have everything running locally (I ran prefect backend server and prefect server start) and I successfully run simple flows. Thanks!
    nicholas

    nicholas

    2 years ago
    Hi @Hagai Arad - I'd encourage you to think about your flows and their execution the same way you would any script or file: externalities can always be run so long as they're available in the filesystem at runtime. What this means more specifically is you'll need to package external scripts with your flows such that when they're run in an environment that's not your local, there's a way for your runner to access them. This might mean importing them a build time using a custom Docker image for your flow's storage, or perhaps adding a task to your flow which clones the GitHub repo where your external scripts are stored. The method you use will vary based on your needs and the execution environment you choose.
    h

    Hagai Arad

    2 years ago
    @nicholas Thanks! that’s totally answer my question
    nicholas

    nicholas

    2 years ago
    Awesome!