mbtest icon indicating copy to clipboard operation
mbtest copied to clipboard

[Discussion] Dockerised development flow

Open garry-jeromson opened this issue 4 years ago • 7 comments

This is far from complete, and is meant to serve as a starting point for discussion.

A Dockerized development setup has the advantage that all the developer needs to have installed is make and Docker - all the Python stuff is containerised, making it more accessible (and hopefully, because of that, more "developable"). This, however, is a departure from the current project setup based on tox.

Tox and Docker are two difference approaches to the same problem (testing with multiple Python versions) - it doesn't really make sense to run tox commands within a Docker container, and it may be tricky to support both development approaches simultaneously.

This commit forms the basis of my suggested initial approach:

  • Development requirements should be specified in a requirements-dev.txt file, to allow easy installation outside of tox
  • Runtime requirements should ideally be specified in requirements.txt, to be available outside of setup.py (assuming tox and setup.py can then reference it, to avoid maintaining duplicate lists of the same dependencies)
  • The Dockerfile for the development image takes the Python version as a build argument, to allow easily adding new versions.

garry-jeromson avatar May 15 '20 16:05 garry-jeromson

I'd say we're cooking with gas on this now - all that's left to do is to bring the Docker Makefile to feature parity with the tox one, and update the docs.

garry-jeromson avatar May 18 '20 09:05 garry-jeromson

Can you add a travis target, so we can see if anything breaks the docker build?

brunns avatar May 18 '20 09:05 brunns

Is the Makefile rename necessary? I'd like to continue to be able to just run make precommit before committing.

brunns avatar May 18 '20 10:05 brunns

Is the Makefile rename necessary? I'd like to continue to be able to just run make precommit before committing.

Have changed it back and added an easy way to switch between the two from the command line.

Can you add a travis target, so we can see if anything breaks the docker build?

I'm a Travis noob - not sure if what I added is in the right place.

garry-jeromson avatar May 18 '20 15:05 garry-jeromson

How are we going with this? BTW, I came across https://github.com/kudulab/dojo which might be useful...

brunns avatar Jun 01 '20 06:06 brunns

Coming back to this after a loooong time with fresh eyes; I wonder if it's actually going to be useful to anyone. The tox-based workflow isn't really a hurdle at all if you know what you're doing, and the Docker stuff adds complexity - if it's not gonna be used by other folks, perhaps we should just can it?

garry-jeromson avatar Nov 10 '20 11:11 garry-jeromson

Perhaps. I won't be using it myself, put perhaps it'll be useful to some folks?

brunns avatar Nov 13 '20 10:11 brunns