We (~150 eng) build microservices in a polyglot environment (mostly Python, JS, and Go), all in a monorepo! We also build + deploy in containers with Jenkins, etc.
The structure looks something like this:
|-- third_party (third party libs)
`-- python
|-- libs (internally-written, common dependencies)
`-- application_name
|-- client (react app, connects to flask)
|-- server (flask app, connects to services)
`-- services (microservices)
We use a dependency-management + build tool (https://www.pantsbuild.org/index.html, we started before Bazel was public) to manage dependencies. Without pants, our repo would be a mess.
Let me know if you have any questions, I'm happy to answer them! I'm super happy about our setup and eager to share it :)
Hahaha, because pants is a bad tool? Or because it sounds funny? I’m sympathetic to both :)
In defense of pants, I meant that our repo would be a mess without a versioned dependency graph + reproducible builds. Of course other tools give you that too, and definitely do it better than pants does.
I guess I should have said “without some build tool”, our repo would be a mess.
Hierarchical layout demands choices be made, but there are advantages in grouping source packages by language:
1) can naturally reflect object packaging models of target language (eg python, jvm).
2) this can encourage reuse of packages across projects.
I agree with the GP that it seems weird, and with you that it has its benefits. Of course, other approaches have their own benefits.
Personally, I feel like the top-level directory ordering for a monorepo is somewhat arbitrary, in that you can argue for anything, but it probably doesn’t matter; especially if you have a decent build tool.
The structure looks something like this:
We use a dependency-management + build tool (https://www.pantsbuild.org/index.html, we started before Bazel was public) to manage dependencies. Without pants, our repo would be a mess.Let me know if you have any questions, I'm happy to answer them! I'm super happy about our setup and eager to share it :)