Ruby on Jets 6.0: Rails Support
Jets 6.0 is a Deployment Service. Jets makes it easy to deploy and run your app on Serverless. It packages up your code and runs it on AWS Lambda. Jets can deploy Rails, Sinatra, Hanami, and any Rack app.
Rails Support
The biggest news in this release is Rails support. To deploy your Rails app, Jets uses your code to build a Docker image and deploy it to AWS Lambda.
The steps to deploy your app are minimal. Add this to your Gemfile.
Gemfile
gem "jets", ">= 6.0"
gem "jets-rails", ">= 1.0"
And run
jets init
jets deploy
That’s it.
Customization and Hooks
Though the steps above for getting started are simple, Jets is highly customizable. You can configure a plethora of options to control the build process. The settings will be in your config/jets folder. You can also hook into the Docker build process with different hooks like Heroku’s familiar release phase hook. That’s one small hook, Jets has many more powerful hooks.
Ultimately, Jets builds your app and the resources required as infrastructure-as-code. It’s all self-contained, making it easy to create extra environments on the fly. It’s a thing of beauty.
Features
There are too many features to cover in this blog post. We’ll highlight some of them.
- Docker: Jets supports using Docker. Jets generates a managed Dockerfile to build and ship your app. You can customize the Dockefile with a plethora of options. You can use your own custom Docker if needed.
- CloudFront CDN: Jets can automatically create CloudFront Distribution for your Lambda Functions, Assets Serving, and File Uploads. Assets are precompiled and uploaded as part of the deploy process. The file uploads CDN is configured with reasonable default settings.
- Lambda Function URL: Jets uses the Lambda Function URL service to route web requests to your app. You can think of it as a Load Balancer that routes your requests to concurrent Lambda Functions.
- Prewarming: Prewarm your app at regular frequencies to mitigate cold-starts.
- Provisioned Concurrency: Use provisioned concurrency to avoid Lambda cold-starts altogether.
- Reserved Concurrency: Jets configures reasonable defaults to prevent your app from scaling out of control. This helps to avoid a surprise Serverless bill. Ironically, with Serverless you worry about scaling too much instead of not scaling enough. The defaults are all overridable.
- ActiveJob Support: Jets supports a
jets_jobs
ActiveJob adapter. Jets will deploy Serverless resources like SQS Queues and Lambda Functions to process your Rails Jobs. It allows Rails Jobs to run on Serverless resources. Jets can also take your Sidekiq jobs and scheduler and convert them to Serverless resources on-the-fly. - CI: Continuous Integration is baked in and supported. Jets can build a CodeBuild project dedicated to CI. It deploys on
git push
and also can deploy on a scheduled basis. - WAF: Jets supports Web Application Firewall to provide additional protection. A Jets Blanket Rate Limiter WAF Rule provides fundamental protection against DDOS attacks.
- Remote Runner: A CodeBuild remote runner provides a consistent build environment with the necessary tooling.
- Jets Exec REPL: A
jets exec
command allows you to run commands on AWS Lambda to explore and debug your app. - Release History and Rollback Ability: You can use
jets release:history
andjets rollback
for this. - Events: Jets is a powerful glue framework that can be used to wire Serverless resources together.
Again, this is just the tip of the Jets iceberg.
Jets Account
To use Jets, you need a Jets account. You can sign up at www.rubyonjets.com and create an API token key there. There is a 2-week free usage period for your AWS account. After that, a paid plan is required. You pay a flat monthly price for each stack. Here’s the pricing.
Summary
Jets 6.0 is a game-changer. It allows you to run your existing Rails, Sinatra, Hanami, and any Rack app on AWS Lambda Serverless with minimal effort.
We’ve been running it on our production Rails apps for over a month. There’s more than a half dozen. Here’s are some live sites deployed with Jets.
Here are also video tutorials, guides, and demos:
- Serverless Rails on AWS Lambda with Jets
- CloudFront CDN for Lambda Function URL
- How AWS Lambda Scaling Works: jets concurrency
Hope you enjoy Jets 6.
Thanks for reading this far. If you found this article useful, I'd really appreciate it if you share this article so others can find it too! Thanks 😁 Also follow me on Twitter.
Got questions? Check out BoltOps.
You might also like
More tools:
-
Kubes
Kubes: Kubernetes Deployment Tool
Kubes is a Kubernetes Deployment Tool. It builds the docker image, creates the Kubernetes YAML, and runs kubectl apply. It automates the deployment process and saves you precious finger-typing energy.
-
Jets
Jets: The Ruby Serverless Framework
Ruby on Jets allows you to create and deploy serverless services with ease, and to seamlessly glue AWS services together with the most beautiful dynamic language: Ruby. It includes everything you need to build an API and deploy it to AWS Lambda. Jets leverages the power of Ruby to make serverless joyful for everyone.
-
Lono
Lono: The CloudFormation Framework
Building infrastructure-as-code is challenging. Lono makes it much easier and fun. It includes everything you need to manage and deploy infrastructure-as-code.