Hi, a quick question here. Would you be interested...
# development
r
Hi, a quick question here. Would you be interested by a development container for Pants? Dev containers can be pre-built with all the necessary tools, libraries and runtimes, making setting up a new development environment faster. This is especially useful for new team members joining a project who can quickly get started without spending time setting up their development environment. I'm not a Pant expert, and I'm sure that there are many improvements that could me made, but I have something working.
./cargo test
runs successfully most of the time. It sometimes gives me these errors:
Copy code
failures:
    channel::tests::plain_client_request_test
    channel::tests::tls_client_request_test
    channel::tests::tls_mtls_client_request_test
    tests::user_agent_is_set_correctly
    tls::test::test_client_auth_cert_resolver_is_configured
Some targets failed when running
./pants test ::
, mainly related to Python 3.8 requirements. Sometimes the process got killed by the OS with
Out of space Exception
. Probably because to my humble setup. You can review my work here: https://github.com/erjac77/pants/tree/feature/add-devcontainer/.devcontainer Let me know if you'd like me to open a pull request. Thank you.
h
Hi! Thanks for bringing this up. I haven’t had much of an opportunity to use devcontainers myself, but they are increasingly popular, so at first glance this seems like a good idea. And you are a data point in favor of the idea that some users would welcome this. I would recommend bringing it up in #C046T6T9U to gauge the potential user base for this, just to see if there are any thoughts/ideas around it. But I say go for it! My one question would be, how is this devcontainer distributed? Is it a repo the user clones, or is it published to dockerhub or wherever? This question is from a place of ignorance, not skepticism…
r
Hi Benjy. A Development Container uses a
devcontainer.json
file in the project to tell VS Code how to access (or create) a development container with a well-defined tool and runtime stack. No need to publish to dockerhub! You can learn more about Dev Containers here. I'll open a PR and post in #C046T6T9U for feedback.
And you can look at the readme to see what tools I included in the dev container.
h
I may have misunderstood the context. Is this a dev container suitable for developing pants itself?
r
That's right. This is my third contribution to Pants, and each time I have to rebuild my environment (for different reasons). I think a development container would be very handy for occasional contributors like me.
h
Ah, gotcha. In that case #C046T6T9U is less relevant, my bad.
And in that case, this seems very useful! Once it’s ready, we’d welcome a PR updating this page with explanation on how to use this (the source for that page is in the repo)
👍 1
r
Done! Working its way through CI now...
h
Merged! Thanks again
🎉 1