JRuby deployment options that support multiple versions of JRuby - rvm

I'm looking for a way to deploy multiple JRuby apps on a single server, the apps are in different stages and hence use different versions of JRuby, in the long term it would be pretty complicated to try and sync all of the applications with all of the application servers, so I'm looking something akin to Phusion Passenger 4 in the Javaland.
Apparently Passenger allows something like this, but there's no documentation available how such a setup should work. Torquebox doesn't mention this use case in their docs.
Bonus points for:
solutions that allow git pull deployment
solutions that are rvm friendly
solutions that are not Tomcat based
solutions that are clustering friendly
solutions that handle daemonization, routing, resource management and monitoring on their own
solutions that are mature and actively supported
So far everything I've looked at failed on some of the points, torquebox doesn't seem to support multiple jruby versions, trinidad is tomcat, puma requires some of hand-holding (process monitoring, reverse proxy, ....) etc

probably your best choice would be to do it the "Java-way" using https://github.com/jruby/warbler
you'll end up with a .war that packs the JRuby's jars in the archive thus each app will have it's own version of JRuby. this of course requires you to setup a Java application server (such as Tomcat), the deployment process would usually mean copying the packaged .war into the server's deployment folder.
be aware that this will likely require a lot of memory since none of the libraries JRuby uses will be shared (also with some servers you need to make sure the class-loader does look at the war's jars first during a specific deployment configuration option)

In the end I opted for a reverse proxy + puma + a process monitoring tool, but it feels like this must be simpler somehow - without three distinct pieces of software working together to make it happen.
Pros are that it's rvm compatible, can support multiple rubies through multiple puma processes and allows git pull deployments
There's also jetpack as an alternative, but I haven't had a chance to play with it

Related

How to avoid deployment of apps and adapters twice on Mobilefirst?

We have developed multiple apps and adapters as part of our project
We have written little ant scripts to deploy the 'apps' and 'adapters',
Prior executing 'ant tasks' we want to know whether the apps and adapters were already deployed or not
Can I use the tables 'PROJECT_ADAPTERS' and 'PROJECT_APPLICATIONS' to avoid the duplicate deployment? (or) What will happen if try to deploy same 'apps' and 'adapters' twice by mistake ?
You should treat the worklight server as a black-box, although in purely technical terms you can investigate the database and deduce information in doing so you are not using a formal API and hence anything you do is unsupported and may become invalid in future product releases.
However there are published ant tasks for retrieving the list of deployed applications and adapters, so in principle you can use those. However I query the wisdom of doing so. My primary concern is that I don't see how knowing that some version of your artefact is deployed is significant. Suppose you have changed the source, don't you want to deploy anyway?
The ant tasks are documented in the InfoCentre. Search for the topic Administering MobileFirst Applications through ant. Here's a link that works today.
As Idan has indicated there is some degree of cleverness in the build tools to avoid redundant deployment. I suggest you just use the tools as they stand rather than try to circumvent them via back-door approaches.
Nothing bad will happen by re-deploying an adapter or application.
In fact, if the checksum is identical between the already-deployed .wlapp/.adapter and the to-be deployed .wlapp/.adapter, it may not get deployed at all. And if they do get deployed, twice, and it's exactly the same apps and adapters (no code changes), then they'll just be deployed again (they will not be duplicated).

A rack-supporting webserver that runs in JRuby and supports SSL and streaming

I'm having issues looking for a rack supporting webserver in Ruby that meets our requirements. What we've coded already is using Sinatra, so that's what we're aiming to run.
The webservice must:
Run in JRuby
Support SSL
support streaming of files. It's much more important to be memory-efficient than performant.
Be Multiplatform (Windows and Linux flavours)
As lightweight as possible - links back to memory efficiency
We're currently using WEBrick, but it can't handle streaming, so we're looking for alternatives. I've been looking around myself, but I'm having real difficulty finding documentation about what various rack webservers can and can't do. The services I've looked at are:
WEBrick - doesn't support streaming
Thin - depends on C code, so doesn't run in JRuby
Passenger - ditto Thin (C Code)
Unicorn - ditto Thin (C Code)
We're aware that it could be deployed J2EE container, but as that would require distributing the container around with it, we'd rather not go down that approach if we can avoid it (as it would be a heavier weight solution).
Thanks in advance for any help people can give.
Does Puma meet your requirements? It supports JRuby, SSL, Windows + Linux, and advertises itself as lightweight. I'm afraid I haven't tried it out, nor do I know if it streams files.
For anyone who finds this question and wants to know what we used in the end: we went with Trinidad as it met all the requirements we needed.
It was quite a simple job to strip out the original WEBrick server we were using and replace it with Trinidad, while still using Sinatra. We then used JRuby to wrap it all up into a Jar and run it in the JVM as a self contained web-service package.

TRAC host that allows plugin customisation

My research and development environment calls for a heavily customised TRAC with a corresponding subversion repository and a binary file store (e.g. WebDAV).
I have my eye on at least 10 plugins that I would like to use (from integration with time tracking software, to specialist mathematics/code rendering). I'd also like to write my own plugins.
I am looking for a commercial host that will allow me to self-manage my TRAC plugins. I've looked into (and contacted) a few of the commercial providers from the TRAC Commercial Services list, including:
Project Locker
Repository Hosting
SVN Repository
Project Locker have described that they do a code review of plugin requests and handle it on their end (unspecified time period). Repository Hosting have said that they "will probably not add support for that in the near future". SVN Repository have said "you won't be able to install any new plugins" and have suggested one of their VPS accounts instead.
Short of managing my own VPS or dedicated server, does anybody know of a commercial SVN/TRAC host who allows paying customers to install their own plugins? I would have thought a chroot environment would have made this a no-brainer!
(Note: this was originally posted on programmers but was down-voted and I was advised to move it here. Quoting from their FAQ: implementation issues or programming tools (ask on Stack Overflow instead))
You'll probably find a hard time finding what you're looking for because as Craig mentioned in his comment, the concept of commercial hosting services typically revolves around limiting a customer's ability to customize. Keeping things relatively uniform means that the hosting company can manage systems and deploy automated updates much more easily and won't have to worry about their scripts breaking because of something odd that one customer installed or re-configured.
If you want to be able to install and configure plugins at will, I highly recommend going the VPS route and managing the server yourself. It's easier than you might expect (I was thrown into this situation and was pleasantly surprised). You can start with something like the Bitnami Trac stack, which is a virtual machine image that has a Linux OS plus Trac and all of the support tools (database, webserver, etc) set up and ready to go. If you use that as a starting point, all you should have to do is customize your Trac settings and install your plugins.
If you really don't want to have anything to do with the management aspect, remember that you can always go the VPS route and contract out the administration work separately. It might be easier if the hosting provider and the system admin come from the same company, but it's not a requirement. Given the flexibility and customization that you need, this might be a more realistic option.

Jruby Warble executable performance

I am developing a JRuby on Rails app that needs to be deployed to clients servers. We want be able to compile the app so that the source can not be read and copied (easily). From what I've read Warbler seems to be the way to go.
My concern is the performance of the app in standalone mode. Meaning just runing as "java -jar MyApp.war" as opposed to using Glassfish..Tomcat..etc. The distributed app wont be high traffic, maybe 20-30 users max. If anything it'd be more heavy on the db side which is a separate issue.
So how does this type of scenario compare performance wise with running with an actual server?
Using Glassfish, Tomcat JBoss (or Torquebox) will perform just as good as long as the JVM has enough memory.
You will need to tweak loading\compiling the assets depending on the deployment server.
If it's supposed to be a web app then you will need the war\tomcat. If it should be a desktop app then just use the jar version.

Suggestions for software to ease setting up a build server

I'm currently setting up a new build server and I'm interested in any suggestions the community may have about software such as Hudson or CruiseControl.NET that may simplify and add additional value to the build process.
Previously I had a build server set up using custom batch files which would run msbuild and other such tools and these were triggered by subversion hooks to allow for a continuous builds to be done per branch. The idea was that eventually we would also execute automated tests and/or static analysis although we never really got that far. This server also acted as our source code repository, a test machine for web project builds, and a web server for custom dashboard and portal for developers on the team.
At this point my thoughts are to separate some of the responsibilities of the old build server and at least a Build Server which is responsible only for creating builds, a web server which is responsible for acting as the intranet style dashboard site for developers, and perhaps an additional web server as the Subversion repository. If it turns out to be better or easier to keep the Subversion code on the same server as SvnServe then I'll probably opt to place the Subversion repository on the web server but still keep the build server separate. Having no personal experience with any of the popular build server and CI solutions out there I'm curious how CruiseControl.NET, Hudson or other solutions would fit into this type of configuration. It appears that both of CC.NET and Hudson have web interfaces for example but the documentation doesn't clearly layout how this plays out with different hardware/system configurations so I'm not sure if either requires the web portion to be on the build server itself or not.
As far as technologies I'm dealing with .NET/C# based code which is a mix of Web/WinForms/WPF and we use a few separate Subversion repositories to host these projects. Additionally it would be nice to support Visual FoxPro and Visual Source Safe for some legacy applications. I would also like to get more team members involved in monitoring builds and would like to eventual have developers create build setups for their own projects as well with as much simplicity as possible. Also I should mention that I have no experience setting up a Java based web application in IIS but I do have quite a bit of experience setting up and managing ASP.NET applications so if that may make .NET based products more favorable unless I can be convinced otherwise.
UPDATE (after researching Hudson): After all the recommendations for Hudson I started looking into what is involved to get it up and running on my two Windows 2008 servers. From what I can gather the web portion (master) would run on my webserver but it seems that IIS isn't supported so this would greatly complicate things since I want to host it on the same machine as my other web applications. On the build server, I would be installing a second copy of Hudson that would act as a slave and only perform builds that are delegated to it by the master. To get this to work I would be installing Hudson as a Windows Service and would also need to install some unix compatibility utilities. Unfortunately the UnxUtils download link appears to be broken when I checked as well so I can't really move forward until I get that resolved. All of this is really sounding just as complex if not more complex than installing CruseControl.NET. For now this unfortunately leaves me to looking into CruiseControl.NET and TeamCity.
UPDATE (about TeamCity): After looking into TeamCity a little closer I realized that at least the server portion is also written in Java and is deployed in a manner very similar to Hudson. Fortunately it appears that Tomcat can be used to host servlets inside IIS although I can't find a good straight forward guide to describe how to actually do accomplish this. So skipping that for now I looked further when I ran into what looks like what might be a major snag.
TeamCity Professional edition only
supports TeamCity Default
Authentication and does not support
changing the authentication scheme.
Since windows authentication is likely the direction we will want to go, it's now looking like it might be back to evaluating CruiseControl.NET or possibly Hudson if I can get my hands on the UnxUtils and also find out more about how I can host the dashboard portion of Hudson within my existing IIS configuration. Any pointers?
UPDATE (about Jenkins): I ended up experimenting enough with Hudson that I ended up with a reasonable build server setup that I'm happy with and that can be extended to do much more if I need. Of course I went the rout of converting to Jenkins once Oracle took over Hudson and Jenkins is what I'm using today with little bits of powershell to help tie things together. I'm very happy with this approach right now and besides being Java based, Jenkins has quite a bit of support for other development environments such as .NET and MSBuild.
I'd vote for TeamCity here. Its is very, very easy to get stood up and running, integrates with all your .NET stuff without any trouble. The builds themselves are run by agents which can be on the build server or another machine depending on requirements--they could even be on a machine running an entirely different OS on a different network in a different country.
I highly recommend using Hudson. Not only will it allow you to build .NET applications on a continual basis, but you can also run code analysis and unit tests as well. It's easy to install (just deploy a WAR file to a web server such as Tomcat) and has many configuration options. There is also a large number of plugins available that you can use, many written by other Hudson users. Best of all, it is free and actively supported.
For our decision making process we started with following overview.
http://confluence.public.thoughtworks.org/display/CC/CI+Feature+Matrix
Our main objective was java, easy to configure/use even after nobody created a job for 6 months. We moved away from a old version of Cruise Control, since nobody really knew how to use it. Some of the commercial products are nice if you want to go beyond just continuous integration. Have a look and decide for yourself.
Be careful, I don't know how up to date this matrix is. So some of the projects might have implemented more functions right now.
An interesting alternative could be Jira studio by Atlasian. If you use the hosted version you don't have much on support issues and it comes with subversion, bamboo, and goodies (jira+greenhopper, confluence, crucible, fisheye). http://www.atlassian.com/hosted/studio/
I agree with Wyatt Barnett. TeamCity is the best choice. It is very easy to configure and use. Moreover, TeamCity has a Free Professional Edition. Previously we used CruiseControl.NET on our project. This is also a powerful tool, but it is very complicated and hard to understand.
What s.ermakovich said: Both TeamCity and Hudson separate the web UI from build agents. You shouldn't need to install IIS on a build agent. You'd need to install a JVM and the agent software on any build node - very straightforward.