Hello! I’m trying to figure out how to get a pytho...
# general
b
Hello! I’m trying to figure out how to get a python monorepo working within the context of an existing k8s cluster, specifically for development. Right now, at my company, we use k8s in prod and dev. In dev, we mount our host paths as volumes into our containers, so that we can dev locally, and the code is synced to the pod. I’m working on a python monorepo that will house all of our python projects and python libs. Right now I have a Dockerfile in each project’s directory, and that Dockerfile copies over its code to the docker image, and also copies over the shared libs code. Each project and lib uses poetry right now. Then I use a k8s volume to mount on top of that code, so that I can dev locally. I’ve been looking at pants as a way to simplify this process. Am I looking in the right direction?
h
Hi! I haven't fully wrapped my brain around your setup. In your current (pre-Pants) setup, what exactly gets synced to the pod, an sdist/wheel that you build natively, or the sources themselves? Basically, which steps happen where? Could you walk me through an example?
b
@happy-kitchen-89482 so, python is new to the mix. Everything else is Ruby and Node. But for all of it, python included, we copy the sources into the docker image, then mount the same code on top of it in a volume mount in k8s.
@happy-kitchen-89482 so, for production, obviously that does happen, but for dev, it lets us edit code and see the results immediately. For python, I’m using watchmedo to reload when it detects a file change
not at my computer or I would share some code