I'm working on a project that has many small tasks. Some of these tasks are related and require overlapping apis.
task_1/
main.py
task_2/
main.py
apis/
api_1/
api_2/
api_3/
test/
test_api_1.py
test_api_2.py
test_task_1.py
test_task_2.py
test_task_3.py
For example, task_1 needs api_1 and api_3, while task_2 needs api_1 and api_2. At first I tried using Google Cloud Functions to execute these tasks, but I ran into the issue that GCF needs local dependencies installed in the same folder as the task. This would mean duplicating the code from api_1 into task_1. Further, local testing would become more complicated because of the way GCF does imports (opposed to .mylocalpackage.myscript):
You can then use code from the local dependency, mylocalpackage:
from mylocalpackage.myscript import foo
Is there a way to structure my codebase to enable easier deployment of GCF? Due to my requirements, I cannot deploy each API as its own GCF. Will Google Cloud Run remedy my issues?
Thanks!