petabridge/lighthouse

Create installer for lighthouse

Closed this issue · 11 comments

  1. The idea is to make lighthouse working as fully configurable command line tool. Instead of configuring it through app.config each time we want to use it, we should be able to start it with something like: lighthouse.exe mycluster -port=4053, where mycluster is name of the cluster actor system to be initialized, followed by list of settings applied to it - formal list of arguments should be defined.
  2. It also should support option of installing the cluster seed in form of windows service.
  3. Finally, to make this easier to use we should create a predefined installer for it. Using Chocolatey seems to be the best idea.

+1

I wouldn't mind taking a stab at this. My initial thoughts at approach are

  • change TopShelf configuration to use custom service so you can pass in cmd line params to LighthouseService constructor, and eventually to LighthouseFactory.LaunchLighthouse
  • use the FluentCommandLineParse library (nuget pkg) (https://github.com/fclp/fluent-command-line-parser) to set up the cmd line params
  • have cmd line params take precedence over configuration (or vice versa, not sure which order makes most sense)

Concerns

  • cmd line parameter clashing with topshelf. would need to test with combination of both topshelf and service args
  • not familiar with the choco installation

If you're okay with that, next step would be define your cmd line parameters

@wshirey - as I mentioned in the gitter I had started on the command line aspect of this here but broke something in the process and am not in a position to work on it too much in the near future, so go ahead and take anything useful from the small changes there.

Again as mentioned in the chat - I found that TopShelf really really seems to want to handle command line arguments; I read somewhere that it checks Environment.Commandline which is readonly, so it's difficult to prevent. TopShelf panics when it hits an argument it wasn't expecting, so working in a third party parsing lib might be difficult (it was my original choice too!).

I also took the approach of preferring command line args over configuration, except for roles and seed-nodes where I took the union of both - I was planning to discuss whether that was sensible here.

Regarding parameters: I had mentioned to @Aaronontheweb in the gitter a while back - system, publicHostName, port, seed-nodes, roles, but also best to confirm that here 😄

Regarding parameters: I had mentioned to @Aaronontheweb in the gitter a while back - system, publicHostName, port, seed-nodes, roles, but also best to confirm that here

👍 - those parameters sound good to me.

system refers to the name of the ActorSystem, FYI

Has this progressed, how about using Windows Installer xml/WixSharp for installation, that way the installer can be written in c# code. Rather than requiring choco, as things like AWS ElasticBeanstalk can directly run msi's. I'm happy to work on this part, then we could have the parameters set by a dialog or commandline parameters to the msi if operating in silent mode.
Any thoughts?

@SeanFarrow I'd say, go for it

Any progress?

I did just a little research and it seems like the newer Topshelf supports custom command parameters. What looks like it is still a little iffy is the installer since one of the contributors was not comfortable changing the image path.

https://stackoverflow.com/questions/15004212/how-can-i-use-commandline-arguments-that-is-not-recognized-by-topshelf

Sorry. Didn't look at @rdavisau code before posting.

So most of the recent effort around Lighthouse and giving it an "out of the box experience" has been centered around our Docker support, which you can access here: https://hub.docker.com/r/petabridge/lighthouse/ - documentation is non-existent at the moment as it's brand new, but it's coming.

So despite having access to that, do you guys still want a stand-alone installer for Windows Services running TopShelf?

I think the ecosystem for .NET has changed a lot since this post was originally created - namely the introduction of .NET Core and Docker for Windows.

Lighthouse can still be installed as a Windows service and can be configured using environment variables (see the latest README for details) - I'm going to consider this issue closed as I don't see a need for Windows Installer or anything of that sort. Definitely made a lot of sense in 2015, but not so much these days given the trajectory of .NET as an x-plat development platform.