danilobellini / dose

Traffic light/signal/semaphore GUI showing the result of a test command job triggered by a file modification
GNU General Public License v3.0
44 stars 8 forks source link

Maybe make easy for use dose GUI inside a container #7

Open rogeriopradoj opened 8 years ago

rogeriopradoj commented 8 years ago

Hello, @danilobellini , how are you?

I read this blog post Running GUI apps with Docker and got wondering if it could help making this project more used nowadays!

I don't know if you remember that times when we went often to Coding Dojos here in São Paulo, and I already was a big fan of Vagrant. Because of this, I tried to keep all dojo environments inside a Vagrantfile, but I couldn't put dose for work with that setup (as dose is a GUI program, and Vagrant by default only manage cli and service things).

I remember you saying something about connecting "X" of guest to the host order to make it works however I think you never finished that "dream" ;-)

I think this blog post above could be that start! It could be used for Vagrant, Docker or anything related I guess. What do you say?

See ya!

danilobellini commented 8 years ago

I remember that as well. =)

I'm aware that would be a major enhancement for this project.

As it seems, based on the link you sent, it'll need a specific configuration file (Dockerfile), a "build/install/configure" call and a "run" call (script(s)).

The dose script is already a shell script that calls the main() in dose.py, but it's generated by setup.py on installing the package:

metadata["entry_points"] = {"console_scripts": ["dose=dose:main"]}

http://python-packaging.readthedocs.org/en/latest/command-line-scripts.html

For that enhancement, dose would need new scripts for Vagrant/Docker (a call to dose_vagrant, dose_docker, etc.), or a changed dose shell script with a "first parameter" like --vagrant or --docker when using these (and perhaps a --vagrant-build and a --docker-build, if needed).

dose --docker-build # Don't open dose, just build whatever needed
dose --docker <call_command_and_parameters>

There's another issue concerning the directory to be given to the watchdog and to call the given command. Perhaps the --*-build should have extra configuration parameters to be saved on .dose.conf... and probably there are several other problems concerning distro specificities. Perhaps the call command should be part of the build line (to create a configuration file ending with CMD dose <call_command_and_parameters>)... maybe there's no need for calling dose twice, I'm not really sure about that (but I think waiting an apt-get update all the time wouldn't be fair).

If you wish, feel free to enhance dose this way, I'll be waiting the pull request. =) Probably there would be no extra dependency for that, just a new dose shell script and a "boilerplate" configuration file for each VM/container, besides minimum changes in setup.py for using the new dose script file... unless I'm missing something... what do you think?

After a first version that actually works, distro/install/VM generalization comes, that shouldn't worry anyone by now unless you've already thought on such and want to introduce that here. =)