Thread
#prefect-community
    Alejandro Sanchez Losa

    Alejandro Sanchez Losa

    9 months ago
    I am trying to disengage tasks from the principal flow python file using ‘custom modules’ … following some public blog and code… I build a custom module to do that, when that flow are execute inside the github actions container as part of the ci/cd, works well, but when I try to start the flow from (example) prefect cloud … maybe because the flow use github store, when the agent try to run this flow just only get the file are reference by the store plugin … and avoid the module … so then fail … the questions is what other way will let me using github actions to register flows with custom modules and this will running well after ?
    Kevin Kho

    Kevin Kho

    9 months ago
    Hey @Alejandro Sanchez Losa, we’d appreciate it if you moved the picture in this thread just to keep the main channel a bit cleaner. I think there are two separate issues here. The first is how to run a Flow with a custom module. You have two options, the first one is to make sure the execution environment has access to the module. For example, you can start a Local Agent in the directory that has the module. You can configure a LocalRun to run a Flow in a working directory. The second option is to use Docker Storage where you can add those dependencies inside the container. This way, the Flow will have access to it. The second issue is registering a flow with CI/CD (Github Actions). I’ve personally used Github Actions just a bit, but you also need the dependencies in your action. If they are in the same repo, I don’t think it should be a problem since you can pip install the custom package and then you can import them. You can delay the imports by doing them inside tasks or functions so that they just get imported at runtime.
    Alejandro Sanchez Losa

    Alejandro Sanchez Losa

    9 months ago
    thanks so much; i am sorry about the pic, do you want I delete it ? by the way thanks so much for your help 🙂
    Kevin Kho

    Kevin Kho

    9 months ago
    No worries you can just move it to this thread