# prefect-community

Jan Nitschke

04/04/2022, 9:52 AM
Hi Prefect, I want to run a flow on ECS and use GitHub as storage. My python code imports modules. The flow definition looks something like:
Copy code
from tasks import my_task
from import GitHub
from prefect import Flow
from prefect.run_configs import ECSRun

storage = GitHub(
    repo="repo",  # name of repo
    path="path/to/",  # location of flow file in repo
    access_token_secret="GITHUB_ACCESS_KEY",  # name of personal access token secret

with Flow(name="foobar",
          storage=storage) as flow:
The problem seems to be that the GitHub storage only clones the single file and not the entire project which causes my import to fail. (
ModuleNotFoundError("No module named 'tasks'")
) I've seen that there has been some discussion around this issue but it hasn't really helped me to solve the issue.... Is my only option to clone the repo into the custom image that I use for my ECS task? But that would mean that I would have to rebuild that image every time I change something to my underlying modules, right?
ðŸĪŠ 1
✅ 1

Anna Geller

04/04/2022, 10:33 AM
Since ECS tasks run your flows within Docker containers, you would need to package your code into a Docker image. If you need an example of how you can package your custom modules within a Dockerfile and push it to ECR, check out this repo also this blog post

Jan Nitschke

04/04/2022, 10:57 AM
ok, thanks for the quick response and for the samples 🙂
👍 1