buildfoundation / mainframer

Tool for remote builds. Sync project to remote machine, execute command, sync back.
Apache License 2.0
1.73k stars 162 forks source link

Add "fallback to local execution" feature. #176

Open artem-zinnatullin opened 7 years ago

artem-zinnatullin commented 7 years ago

So I was thinking about smooth experience of using Mainframer with and without connection to remote machine.

In many cases Mainframer is used as performance boost for local machine, while at the same time local machine is also configured enough to perform the task. So maybe we can add fallback_to_local_machine/etc option to the config?

i.e. you don't have internet connection and initial rsync localremote machine is not passing (we would need to parse rsync error though) because of network issue then Mainframer prints warning and falls back to local execution.

How does that sound? cc @ming13, @yunikkk, @dmitry-novikov

arturdryomov commented 7 years ago

Sounds fine to me, but we need to investigate rsync capabilities regarding this. But we can just do ssh -q user@host exit and check its result, moving on to localhost if it fails.

PaulWoitaschek commented 7 years ago

Do you want to make this the default?

I really don't want my local machine to build in any case. Instead of waiting for about 12 minutes, I want it to fail quickly so I know and can turn my remote machine on.

arturdryomov commented 7 years ago

It will be totally optional.

artem-zinnatullin commented 7 years ago

I would actually do this by default, but highlight in the docs that this behavior can be disabled.

The reason for that is to make more smooth experience without forcing user to switch run configs in IDE and running different commands in terminal :)

@ming13 I'd prefer to not do separate ssh -q user@host exit calls to save execution time and instead try to parse initial rsync call output

arturdryomov commented 7 years ago

Actually, regarding the IDE — IJ plugin can fallback to local execution using a single button.

BTW it is kind of dangerous to fallback to local by default. In theory I would want to process 1 TB of video on a remote machine and suddenly I realize my Macbook burnt a table underneath. Not a nice thing.

There are two use cases from my point of view.

Seems predictable and follows tool-just-do-one-single-job principle.

artem-zinnatullin commented 7 years ago

Hm, okay, I agree with you-had-one-job principle, so it might be a feature request for IntelliJ plugin.

Let's create feature request in https://github.com/elpassion/mainframer-intellij-plugin then and close this one?