Hi, we are using pantsbuild for our development an...
# general
b
Hi, we are using pantsbuild for our development and I have questions.. can I ask here..? 1. where should we store dockerfile and k8s manifests and Jenkinsfile? Now we put those under the
build-support
..is that appropriate? or
(%build-root)s/src/jenkins
2. also, where should I put pants plugin written in python?
src/python/pants
or
build-support/plugin/python
…?
a
i'm glad you're using pants!! will try to answer: 1. pants usually doesn't require you to put things in certain places -- at twitter we use many different arrangements in the monorepo, including having
resource()
targets in
src/resources
, or in a
/resources
subdirectory of their subproject. what are you looking to do with these files? 2. conventionally, we put these in
pants-plugins/
, but that's also just a convention, so you are allowed to put them wherever
b
thanks for your kindness answer! 1. I see. we are using jenkinsfiles for monorepo status checking (CI) and CD, and also cronjob related to our product. k8s manifests and dockerfile are used for just deploying our product. I guess if it’s related to monorepo, an appropriate better place is
build-support
but if it’s just application or related to our product, it should be is better to put under
src/resources
. is this right…? 2. I see. then we will keep put them under the
src/python
. (or contlib🙂)
a
1. yes, that seems quite reasonable! let us know if you can think of a way pants would be more helpful with kubernetes + dockerfiles -- we are moving to using these at twitter and i'd love to know anything you come up with! please feel free to ask slack or make a github issue! 2. great! although, i would note that
contrib/
is used in the pants repo as an abbreviation for "contributed", as in, contributed by non-pants devs, or not related to normal pants code, or some other reason. if you're not an open-source project, i don't know if that quite makes sense, but it's your repo, so you can choose! however, i might suggest, for the same reason as you described for (1), to use
build-support/
over
src/resources
-- to show that that code is separate from your application code.
🙂 1
b
Thanks a lot!
😎 1
👖 1
h
To chime in on this: • We put our custom pants plugins under
src/python/toolchain/pants
. • We reserve
build-support
for things that pants itself needs (e.g., configuration files for tools that pants invokes). We generally put things like Dockerfiles under, e.g.,
prod/docker/
, k8s files under
prod/kubernetes/
and so on.
But you can pretty much do whatever you want, Pants doesn't require any particular structure.