eloots / Pi-Akka-Cluster

Apache License 2.0
124 stars 33 forks source link

Move deployment/run logic to sbt #121

Open agolubev opened 5 years ago

agolubev commented 5 years ago

Basically what I'm seeing is to have "sbt run" and this will do assembly, copy jar to nodes and start app across all nodes. Perhaps "sbt run 0" would be helpful as well I see we should add:

For this case, "run" means opening ssh session and run app in background with console output to file (with ability to tail -f from this file). Still, node located run script is still valuable as it allows us to see logs right away so perhaps this should stay. CC: @eloots @kikiya

eloots commented 5 years ago

@agolubev I've been reflecting on this (by the way, I moved to the sbt native packager from sbt assembly) and it would be great if that could be achieved as a plugin. There's one difficult problem to solve; you will probably end-up executing commands on the remote system (e.g. for the run command or the new version of the copy command; however, if a user hasn't configured password-less login, remote commands will hang as it will prompt for a password. Not a huge deal, but annoying... WDYT?

agolubev commented 5 years ago

There are several options here. I'm thinking that there is no reason for avoiding password less step in the configuration as there should be no security concerns around approach. From personal experience, this saves time a lot. Still, if this is the case we can show some warning or, perhaps, prompt for a password. Maybe we should still have run script on a node side to be able to run it from there and see output.

eloots commented 4 years ago

@agolubev I'm not concerned about security issues— after all this is a playground. What I'm saying is that, in case password-less setup hasn't been done by the user, password prompting will happen and this will mess-up things. For example, artefacts will have to be copied from the laptop to the nodes. This will be done using scp which will be executed using the scala Process API (scala.sys.process.Process). With the switch to the sbt native packager (from sbt assembly), the currently used copy script executes a number of scp/ssh commands already. Each one would trigger a password prompt.