Hi team, thank you for this amazing project! We ar...
# general
s
Hi team, thank you for this amazing project! We are new, learning 👖 and I have some questions related to docker compose, when developing python microservices under monorepo. For the CI purpose which we would like to connect to DB container, we currently use Docker compose + poetry. That is, • Github Actions uses docker compose commands. • docker compose is for (A) application and (B) DB. (A) depends_on (B) and I configure volume/network (port etc) in docker-compose.yaml • In the application container (A), I use something like (i) prepare.py and (ii) the pytest process. Makefile controls this multiple targets for the test. • poetry.lock is generated in local and copied into docker container (A). We are exploring the migration from poetry-based to pants-based to achieve the monorepo architecture for our codebase. However, what I understood from couple of github issues (for example, 17860, 16362, etc), is that the above cannot be achieved based on the current stable version 👖 2.20. Especially, missing parts are: • python_test can use docker_environment, but this is still in the preview phase and missing functionalities such as defining it using
docker_image
, and the environment depending on another docker image; which is necessary to achieve (A) -> (B) dependencies equivalent in compose. • Defining python_test calling (i) prepare.py before the pytest itself is not possible. Q1. Are the above understanding of mine correct? Assuming the above is correct, I have been thinking of a workaround, as we would like to setup the mono repository sometime soon. Possible workaround from my little knowledge could be, something like: • GHA uses docker compose commands, everything related to the denepdencies between (A) and (B) stay the same as before. • In the app container, we use pants' lock file instead of poetry lock file, and make sure the test works. The Dockerfile of the app will install 👖 and runs the test. -> But still, the (i) prepare.py before the pytest remains the problem in this case? And how we can ensure the path resolution from common libraries (under the same monorepo)? Q2. Could anyone advise me how we could achieve it? Or is there no way to do it for now? Thank you so much in advance 🙏