Deploy Lift apps on top of Escalante to Red Hat's OpenShift cloud

294 views
Skip to first unread message

Galder Zamarreño

unread,
Oct 29, 2012, 6:30:11 AM10/29/12
to lif...@googlegroups.com
Hi all,

A few weeks ago I was posting about Escalante, a new Scala app server that we've built that comes with support for Lift applications.

Escalante vastly reduces size of Lift applications, making them faster to upload, and reduces memory consumption.

So now you can also deploy Lift applications on top of Escalante to Red Hat's OpenShift cloud environment. You can find all about it in my latest blog post:

If you have any questions, ping me on #escalante IRC channel of freenode, or post a question on StackOverflow with 'escalante' tag :)

Cheers,
--
Galder Zamarreño

Project Lead, Escalante

Diego Medina

unread,
Oct 29, 2012, 7:08:50 AM10/29/12
to lif...@googlegroups.com

Really cool!

Diego
Sent from my android cell

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
 
 

David Pollak

unread,
Oct 29, 2012, 2:24:29 PM10/29/12
to lif...@googlegroups.com
Galder,

This is indeed very cool. Is there an OpenShift AMI floating around Amazon EC2 so I can try booting an EC2 instance and deploying a Lift app?

Thanks,

David

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
 
 



--
Telegram, Simply Beautiful CMS https://telegr.am
Lift, the simply functional web framework http://liftweb.net

Galder Zamarreño

unread,
Oct 30, 2012, 2:54:17 PM10/30/12
to lif...@googlegroups.com
David,

Thanks for the reply.

OpenShift markets itself as a PaaS where you don't have to worry about the infrastructure itself, so tries to stay away from more traditional IaaS environments such as EC2.

In fact, it's most likely OpenShift is using EC2 behind to provide you with all you need.

Is there anything you miss from the OpenShift offer that makes you wanna have an OpenShift AMI?

From what I've seen, you can already build your own OpenShift PaaS on EC2, or any other environment following these instructions:

Your suggestion on having a ready to go AMI has also been raised, so maybe you can comment there too:

Hope this helps

Cheers,

David Pollak

unread,
Oct 30, 2012, 3:36:49 PM10/30/12
to lif...@googlegroups.com
On Tue, Oct 30, 2012 at 11:54 AM, Galder Zamarreño <gal...@zamarreno.com> wrote:
David,

Thanks for the reply.

OpenShift markets itself as a PaaS where you don't have to worry about the infrastructure itself, so tries to stay away from more traditional IaaS environments such as EC2.

In fact, it's most likely OpenShift is using EC2 behind to provide you with all you need.

Is there anything you miss from the OpenShift offer that makes you wanna have an OpenShift AMI?

Laziness. I'd like to try OpenShift, but am too lazy to do anything other than fire up an AMI and go.

I'll download fedora and try to create an OpenShift virtual machine locally.

Galder Zamarreño

unread,
Nov 1, 2012, 8:22:20 AM11/1/12
to lif...@googlegroups.com


On Tuesday, 30 October 2012 19:36:53 UTC, David Pollak wrote:


On Tue, Oct 30, 2012 at 11:54 AM, Galder Zamarreño <gal...@zamarreno.com> wrote:
David,

Thanks for the reply.

OpenShift markets itself as a PaaS where you don't have to worry about the infrastructure itself, so tries to stay away from more traditional IaaS environments such as EC2.

In fact, it's most likely OpenShift is using EC2 behind to provide you with all you need.

Is there anything you miss from the OpenShift offer that makes you wanna have an OpenShift AMI?

Laziness. I'd like to try OpenShift, but am too lazy to do anything other than fire up an AMI and go.

Fair enough... I must admit that getting started with OpenShift is fairly painless and you should be done in 5 mins :)
 

I'll download fedora and try to create an OpenShift virtual machine locally.

Keep me posted on how that goes!

David Pollak

unread,
Nov 1, 2012, 7:55:39 PM11/1/12
to lif...@googlegroups.com
Galder,

Ah hah!

OpenShift is like Heroku... sorry, I'm slow.

I've got my first app running: http://frog-bearfeeder.rhcloud.com/

OpenShift is pretty neat!

A couple of things:

  • Is there any chance of using Nginx rather than Apache as the front end? Apache doesn't deal well with lots of long polling requests.
  • When I tried to use Scala 2.9.2 and Lift 2.5-M1, there were some wacky runtime problems. Is Scala 2.9.1 and Lift 2.4 baked into Escalante?
  • Is there a way to not take down the application during compilation? Basically, it'd be cool if the app continued to run until the new version was ready to deploy.
  • How does OpenShift deal with session affinity?
Anyway, I think what you've done is a wicked sweet thing and I'm looking forward to seeing how it evolves.

Thanks,

David

Galder Zamarreño

unread,
Nov 5, 2012, 4:49:39 AM11/5/12
to lif...@googlegroups.com
Hey David,

Thanks for trying it out! Glad you got the app working :)

Responses inline...


On Friday, 2 November 2012 00:55:45 UTC+1, David Pollak wrote:
Galder,

Ah hah!

OpenShift is like Heroku... sorry, I'm slow.

I've got my first app running: http://frog-bearfeeder.rhcloud.com/

OpenShift is pretty neat!

A couple of things:

  • Is there any chance of using Nginx rather than Apache as the front end? Apache doesn't deal well with lots of long polling requests.
Just had a look around and found:

Give it a go and let me know how that goes?
 
  • When I tried to use Scala 2.9.2 and Lift 2.5-M1, there were some wacky runtime problems. Is Scala 2.9.1 and Lift 2.4 baked into Escalante?

I've not started support for Lift 2.5 yet. At the moment I'm working on the integrating Escalante better into the tooling that Lift developers use to develop/run (i.e. SBT).

Support for Lift 2.5 is definitely in the cards, but at a later stage :)

The Lift/Scala versions currently supported for optimised deployment can be found in:

To remind you, you can define via a lift.xml which Lift + Scala versions you need (defaults are used if no versions defined in that file) and Escalante will bring in the dependencies, without bloating the war...etc. The use of an XML is temporary (I had to deal with XML for internal app server configuration), but I might likely end up having a simpler properties file (just like you have the db properties file).

Now, in theory, you could bundle up the Lift and Scala versions within the war, including Lift 2.5-M1 and make it work just as it'd do in any other servlet container (see http://escalante.io/docs/#standard_lift_application_support). That should work... but if you're having any issues, I can help :)

  • Is there a way to not take down the application during compilation? Basically, it'd be cool if the app continued to run until the new version was ready to deploy.

 
  • How does OpenShift deal with session affinity?

If you're using Apache + Mod_Cluster and Escalante, it should all be fairly straightforward, since both the server and load balancer have sticky sessions enabled by default. Mod_Cluster can dynamically discover Escalante or AS7 instances, but not sure if this works in OpenShift, since IIRC, this was multicast based.

I'm assuming you wanna use Nginx, but which load balancer are you gonna use? Does it come with one?

If you provide that info I can ask around to see what can be done.
Anyway, I think what you've done is a wicked sweet thing and I'm looking forward to seeing how it evolves.

Yeah, it's still early days, but thanks a lot for giving it a go and providing feedback :)

I'm hoping to do another blog post fairly soon showing how to develop Lift apps on Escalante to OpenShift using JBoss Developer Studio w/ Scala IDE.

Galder Zamarreño

unread,
Nov 5, 2012, 1:10:44 PM11/5/12
to lif...@googlegroups.com
Btw David, could you be more specific about Apache's long-polling issues?

I work alongside Apache httpd committers and I think it'd be very valuable to improve things both for Lift and Escalante's community.

Cheers,

On Friday, 2 November 2012 00:55:45 UTC+1, David Pollak wrote:

David Pollak

unread,
Nov 5, 2012, 1:29:28 PM11/5/12
to lif...@googlegroups.com
On Mon, Nov 5, 2012 at 10:10 AM, Galder Zamarreño <gal...@zamarreno.com> wrote:
Btw David, could you be more specific about Apache's long-polling issues?

As of 2 years ago (I don't know about now), Apache required one thread per open HTTP request. This was fine before the days of long poling because it was unlikely that you'd have hundreds of open HTTP requests. But with Lift long polling, it's not uncommon to have thousands of open connections to a single server.

Apache's default configuration has a pretty short timeout for open HTTP connections (30 seconds if memory serves) and only allows a few (< 200) open HTTP connections. The last time I configured Apache as a Lift front-end, it took a fair amount of configuration to get the long polling to work correctly and the configuration could not handle very much traffic.

Nginx has a very efficient reverse proxy mode. It can handle thousands of open HTTP connections because it uses select() or epoll() or whatever so that threads in Nginx are only used when data is ready to ship around.

Basically, Nginx just decodes SSL/HTTP and moves bytes around. That makes it better suited than Apache as a front end to Lift apps.

If I'm wrong about the way the current versions of Apache works, please let me know.

Thanks,

David

Galder Zamarreño

unread,
Nov 5, 2012, 1:58:06 PM11/5/12
to lif...@googlegroups.com
Ok, I'm checking with my colleagues to see whether the situations has improved.

Out of curiosity, which was the servlet container you used?

Cheers,

David Pollak

unread,
Nov 5, 2012, 2:02:29 PM11/5/12
to lif...@googlegroups.com
On Mon, Nov 5, 2012 at 10:58 AM, Galder Zamarreño <gal...@zamarreno.com> wrote:
Ok, I'm checking with my colleagues to see whether the situations has improved.

Out of curiosity, which was the servlet container you used?

My default has been Jetty. Jetty had continuation/async support before any other container, so it was my default. Plus the Mortbay guys gave great Lift support in the early days.

Now that Lift supports Servlet 3.0 containers and autodetects their async support.

I really wish JBoss was lighter weight so we could just jboss:start/jboss:stop from SBT. 

Galder Zamarreño

unread,
Nov 6, 2012, 4:10:24 AM11/6/12
to lif...@googlegroups.com


On Monday, 5 November 2012 20:02:33 UTC+1, David Pollak wrote:


On Mon, Nov 5, 2012 at 10:58 AM, Galder Zamarreño <gal...@zamarreno.com> wrote:
Ok, I'm checking with my colleagues to see whether the situations has improved.

Out of curiosity, which was the servlet container you used?

My default has been Jetty. Jetty had continuation/async support before any other container, so it was my default. Plus the Mortbay guys gave great Lift support in the early days.

Now that Lift supports Servlet 3.0 containers and autodetects their async support.

Thanks for the info.
 

I really wish JBoss was lighter weight so we could just jboss:start/jboss:stop from SBT. 

^ This is precisely what I'm working on right now ;)

I need Escalante (which is JBoss AS7 (or 8) underneath) to better integrate with SBT to increase adoption.

And, I wanna be able to run Escalante on the same VM, without a separate process being kicked off.

The use of modular classloader within the AS inners of Escalante is what makes it a bit tricky, but we've made a breakthrough and I hope to have this integration in asap.

Trust me, when it's ready I'll announce it here :)
 
 

Cheers ,

Galder Zamarreño

unread,
Nov 6, 2012, 12:58:09 PM11/6/12
to lif...@googlegroups.com
Btw, out of curiosity, I saw that you presented at Devoxx last year.

Are you going to Devoxx this year too?

I'll be presenting there next week, on JBoss Polyglot effort which obviously includes Escalante/Scala stuff :)


If you also happen to be there it'd be great to meet up!

David Pollak

unread,
Nov 6, 2012, 1:06:55 PM11/6/12
to lif...@googlegroups.com
On Tue, Nov 6, 2012 at 9:58 AM, Galder Zamarreño <gal...@zamarreno.com> wrote:
Btw, out of curiosity, I saw that you presented at Devoxx last year.

I didn't present due to some changes the Devoxx people made in the flight reimbursement rules... given that I wasn't going to be reimbursed for my travel, I decided to eat the cost of the flight I had already paid for and stay at home for Thanksgiving with my family.
 

Are you going to Devoxx this year too?

It's unlikely that I'll ever go to Devoxx.
 

I'll be presenting there next week, on JBoss Polyglot effort which obviously includes Escalante/Scala stuff :)

Cool. Hope your presentation goes very 

Galder Zamarreño

unread,
Dec 26, 2012, 10:48:37 AM12/26/12
to lif...@googlegroups.com
Hey David,

Initial support for Escalante on SBT is almost ready, so you'll soon be able to deploy Lift apps to Escalante via SBT :))

This, and other bits, including support for latest 2.5-M release will also be included.

I'll keep you posted.

Cheers,

Galder Zamarreño

unread,
Apr 11, 2013, 3:39:52 AM4/11/13
to lif...@googlegroups.com
Hey Florian,

Session affinity should just work with Escalante, since it's on by default :). Are you planning to create a cluster of Escalante instances?

For long polling performance, I don't know how it compares with other solutions yet, but we're making improvements in the underlying web engine for JBoss AS8, upon which Escalante will be based in next versions.

The current OpenShift instructions for using Escalante are based on an earlier version. I'm hoping to update them in the next few weeks once v0.3 is released.

Cheers,

On Tuesday, 9 April 2013 16:41:15 UTC+2, florian...@gmail.com wrote:
Hello David, Galder,

I want to try Lift for my next web application.

To be sure I will have no problems with scaling it, I'm looking for a scalable hosting platform that supports all of Lift's requirements, especially the session affinity and good long polling performance.

Do these features work well in Escalante on OpenShift?

If not, can you please recommend any other scalable hosting? For example, does Lift work and scale well on CloudFoundry/www.appfog.com?

Thanks,

Florian
Reply all
Reply to author
Forward
0 new messages