SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Downloaden Sie, um offline zu lesen
Cameron C. Dutro
Kuby: ActiveDeployment forRails Apps
Welcome!
Who is this guy?
• Cameron Dutro


• I work at GitHub


• He/him/his


• Go Seahawks!
Rails is awesome
• Easy for beginners!


• Simple database tools!


• Super-fast development experience!


• A right place for every
fi
le!


• Generators! Gems! Community!


• Take that, Java!
“OOPS!”
Time to deploy!
Rails has no official tool orguide to aide in
deploying an app into production.
THE UNFORTUNATE TRUTH IS,
RR 403: Rails Needs Active Deployment
with Stefan Wintermeyer
March 12th, 2019
“ ”
In my experience, deployment is one of
the major problems of normal Rails
users… it is a big pain to set up a
deployment system for a Rails application,
and I don’t see anything out there that
makes it easier.
- Stefan Wintermeyer
RR 403: Rails Needs Active Deployment
with Stefan Wintermeyer
March 12th, 2019
“ ”
I believe that we lose quite a lot of
companies and new developers on this
step. Because everything else [is] so much
easier with Rails… but that last step - and
it’s a super important step - is still super
complicated.
- Stefan Wintermeyer
Our options
• Heroku? Expensive


• EC2 instance + capistrano? Dif
fi
cult


• EC2 instance + Chef/Puppet/Ansible? So much to learn


• Render, Fly, Cloud 66 Easy but vendor lock-in
Today’s journey
Cameron circa 2000
• What do we mean by “deployment”?


• How deployment has changed in the last
~20 years


• The state-of-the-art in Rails land


• ActiveDeployment (a.k.a. Kuby)
What is deployment?
• You’ve built a great website and you want to put it online


• Need a computer to run it on


• (Ideally not your laptop)


• Need to install software that listens for requests, invokes
your code, and sends back the response


• Might need a domain name (mycoolsite.com)


• Might need persistent storage like a database
CCM Glass
• In 2002 I built my
fi
rst website


• Pure hand-coded HTML


• Deployed to free hosting provider


• Free hosting, powered by ads


• Files deployed via FTP
PHP (2004 - 2010)
• More dynamic


• Able to store and retrieve data from MySQL


• Still deploying via FTP
Fluther (2010)
• First job out of college


• Django app (Python)


• MySQL database


• Solr full-text search


• Deployed using Capistrano
“Dr. Jelly”
Twitter (2011)
• Thousands of app servers


• Deployments too slow using Capistrano


• Wrote our own deployment tool


• Servers pull code from each other via BitTorrent


• First server seeds new version
Twitter
• In 2013, Twitter switched to Apache Mesos


• “Program against your datacenter like it’s a single pool of resources”


• Many distinct services (geolocation, photos, twitter.com, etc)


• Services isolated from each other on the same host


• Resource allocation, ports, etc con
fi
gured declaratively
Lumos Labs
• 2014: VPSes in Softlayer


• Bespoke Capistrano setup + Chef


• Deployed via in-house web app called Catapult


• 2015: EC2 instances in AWS, still Capistrano


• 2016: Docker + ECS (Elastic Container Service)


• Deployed using in-house tool called Broadside


• 2017: Kubernetes
GitHub (2022)
• Dotcom


• Kubernetes, deployed via chat-ops


• Other services


• Self-service Kubernetes-based framework called Moda


• Kubernetes is the platform


• Tooling abstracts away the details
2O YEARS
FTP Docker + Kubernetes
Rails has no official tool orguide to aide in
deploying an app into production.
TO REITERATE,
ActiveRecord
ActionText
ActiveJob
ActionMailbox
ActiveStorage
ActionCable
ActiveDeployment
? ?
?
?
What I want from ActiveDeployment
• Launches my app. Runs my app on a remote server


• Ease of use. Con
fi
g should be easy to grok


• BYOS. Bring our own servers


• Endemicity. Rails-native
These would be nice too
• SSL/TLS certi
fi
cates installed/rotated automatically


• Managed database instance


• Sidekiq workers


• Static asset server


• No vendor lock-in
as turnkey as Heroku, as unrestricted as
Capistrano
BASICALLY I WANT IT TO BE
Planet Argon’s Ruby Community Survey Results, 2020
Who here uses Capistrano?
🙋
Capistrano
• Server automation tool written in Ruby


• Servers managed via remote SSH connections


• Uses Rake tasks under the hood
Why Capistrano?
• Simple. It’s just rake tasks + SSH


• Flexible. No limits on what you can do


• Established. We’ve got years of prior art to guide us


• Independent. No vendor lock-in


• Ruby. Written in the language we all love
Why not Capistrano?
• Bespoke. You have to do a lot of things yourself


• Imperative. Is your server really in the state you think it’s in?


• Not portable. Does everything still work if you upgrade the OS?


• Server-focused. Thinks of servers as individual machines
Layers of abstraction
WE ARE
HERE
FTP + SSH
Capistrano
Chef/Puppet
Docker
Kubernetes
Layers of abstraction
WE


COULD BE
HERE
FTP + SSH
Capistrano
Chef/Puppet
Docker
Kubernetes
Why Kubernetes?
• Extensible. Provides a true platform


• Declarative. Tell Kubernetes what, not how


• Portable. Deploy to any cloud provider with no con
fi
g changes


• Cluster-focused. Servers are treated collectively as a single resource


• Resilient. Restarts failed processes automatically


• Scalable. Can scale on-demand
Introducing Kuby
+ =
Introducing Kuby
• Kuby is ActiveDeployment for Rails apps


• Packages and deploys your app into a Kubernetes cluster


• Minimal, easy-to-read con
fi
guration


• Supports major cloud providers


• DigitalOcean, Linode, EKS (Amazon), Azure
Introducing Kuby
• Rails-native


• Deploys the secrets in credentials.yml


• Automatically provisions a database instance


• Creates a static asset server


• Acquires SSL/TLS certi
fi
cates for your domain
Starter config
Kuby.define('Railsconf') do
environment(:production) do
docker do
credentials do
username app_creds[:DOCKER_USERNAME]
password app_creds[:DOCKER_PASSWORD]
email app_creds[:DOCKER_EMAIL]
end
image_url "docker.pkg.github.com/camertron/railsconf/railsconf"
end
kubernetes do
add_plugin :rails_app
provider :linode do
cluster_id app_creds[:LINODE_CLUSTER_ID]
access_token app_creds[:LINODE_ACCESS_TOKEN]
end
end
end
end
Your first deploy
$> bundle exec kuby -e production build
$> bundle exec kuby -e production push
$> bundle exec kuby -e production deploy
$> bundle exec kuby -e production setup
Kubernetes is a true platform
BUT REMEMBER,
Plugins
• kuby-redis: stand up Redis instances


• kuby-sidekiq: easily add background job workers


• kuby-prebundler: speed up bundle install


• kuby-previews: deploy a copy of your app per pull request


• kuby-anycable: deploys anycable’s go-based RPC components
Add Sidekiq
require "kuby/sidekiq"

add_plugin(:sidekiq) do
replicas 2 # run two workers
end
In your Kuby con
fi
g:
Add Sidekiq
if Rails.env.production
?

Sidekiq.configure_server do |config
|

config.redis = Kuby.environment.kubernetes.plugin(:sidekiq).connection_param
s

end
Sidekiq.configure_client do |config
|

config.redis = Kuby.environment.kubernetes.plugin(:sidekiq).connection_param
s

end
end
In con
fi
g/initializers/sidekiq.rb:
Deploy Sidekiq
$> bundle exec kuby -e production build
$> bundle exec kuby -e production push
$> bundle exec kuby -e production deploy
$> bundle exec kuby -e production setup
(because we added a plugin)
The Platform
• Capistrano:


• Machine running FTP server or SSH daemon


• Kubernetes:


• Container scheduler, scaling, fault tolerance


• Networking, load-balancing, ingress/egress


• Persistent storage


• Role-based access control
Other things you can do
• kuby logs: Get logs from a web pod


• kuby remote shell: Like SSH - start an interactive shell in a web pod


• kuby remote console: Like rails console


• kuby remote dbconsole: Like rails dbconsole


• kuby kubectl: Run arbitrary kubectl commands


• … and much more
Resources
• getkuby.io


• github.com/getkuby


• github.com/getkuby/kuby-core
Also, I need help! Let’s make Kuby awesome together.
Thank you!
Questions?

Weitere ähnliche Inhalte

Ähnlich wie Kuby, ActiveDeployment for Rails Apps

Cloud Native Camel Riding
Cloud Native Camel RidingCloud Native Camel Riding
Cloud Native Camel RidingChristian Posta
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2Docker, Inc.
 
PowerPoint Presentation
PowerPoint PresentationPowerPoint Presentation
PowerPoint Presentationlalitjangra9
 
Greenfields tech decisions
Greenfields tech decisionsGreenfields tech decisions
Greenfields tech decisionsTrent Hornibrook
 
JAX 2014 - The PaaS to a better IT architecture.
JAX 2014 - The PaaS to a better IT architecture.JAX 2014 - The PaaS to a better IT architecture.
JAX 2014 - The PaaS to a better IT architecture.Sebastian Faulhaber
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQLKonstantin Gredeskoul
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013dotCloud
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java3Pillar Global
 
Modern websites in 2020 and Joomla
Modern websites in 2020 and JoomlaModern websites in 2020 and Joomla
Modern websites in 2020 and JoomlaGeorge Wilson
 
Netflix oss season 2 episode 1 - meetup Lightning talks
Netflix oss   season 2 episode 1 - meetup Lightning talksNetflix oss   season 2 episode 1 - meetup Lightning talks
Netflix oss season 2 episode 1 - meetup Lightning talksRuslan Meshenberg
 
Taking Spinnaker for a spin @ London DevOps Meetup 36
Taking Spinnaker for a spin @ London DevOps Meetup 36Taking Spinnaker for a spin @ London DevOps Meetup 36
Taking Spinnaker for a spin @ London DevOps Meetup 36aleonhardt
 
Rami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerRami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerWeb à Québec
 
Container Orchestration for .NET Developers
Container Orchestration for .NET DevelopersContainer Orchestration for .NET Developers
Container Orchestration for .NET DevelopersMike Melusky
 

Ähnlich wie Kuby, ActiveDeployment for Rails Apps (20)

Stackato v5
Stackato v5Stackato v5
Stackato v5
 
Cloud Native Camel Riding
Cloud Native Camel RidingCloud Native Camel Riding
Cloud Native Camel Riding
 
Stackato
StackatoStackato
Stackato
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
 
PowerPoint Presentation
PowerPoint PresentationPowerPoint Presentation
PowerPoint Presentation
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
 
Greenfields tech decisions
Greenfields tech decisionsGreenfields tech decisions
Greenfields tech decisions
 
JAX 2014 - The PaaS to a better IT architecture.
JAX 2014 - The PaaS to a better IT architecture.JAX 2014 - The PaaS to a better IT architecture.
JAX 2014 - The PaaS to a better IT architecture.
 
Stackato v4
Stackato v4Stackato v4
Stackato v4
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java
 
OpenStack Summit
OpenStack SummitOpenStack Summit
OpenStack Summit
 
Modern websites in 2020 and Joomla
Modern websites in 2020 and JoomlaModern websites in 2020 and Joomla
Modern websites in 2020 and Joomla
 
Netflix oss season 2 episode 1 - meetup Lightning talks
Netflix oss   season 2 episode 1 - meetup Lightning talksNetflix oss   season 2 episode 1 - meetup Lightning talks
Netflix oss season 2 episode 1 - meetup Lightning talks
 
Taking Spinnaker for a spin @ London DevOps Meetup 36
Taking Spinnaker for a spin @ London DevOps Meetup 36Taking Spinnaker for a spin @ London DevOps Meetup 36
Taking Spinnaker for a spin @ London DevOps Meetup 36
 
Rami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerRami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with Docker
 
From Heroku to Amazon AWS
From Heroku to Amazon AWSFrom Heroku to Amazon AWS
From Heroku to Amazon AWS
 
Container Orchestration for .NET Developers
Container Orchestration for .NET DevelopersContainer Orchestration for .NET Developers
Container Orchestration for .NET Developers
 
Dockerize or die
Dockerize or dieDockerize or die
Dockerize or die
 

Kürzlich hochgeladen

pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfJOHNBEBONYAP1
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdfMatthew Sinclair
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge GraphsEleniIlkou
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...kumargunjan9515
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.krishnachandrapal52
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样ayvbos
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoilmeghakumariji156
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查ydyuyu
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiMonica Sydney
 
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Balliameghakumariji156
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...kajalverma014
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsMonica Sydney
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...meghakumariji156
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理F
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理F
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制pxcywzqs
 

Kürzlich hochgeladen (20)

call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
 
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 

Kuby, ActiveDeployment for Rails Apps

  • 1. Cameron C. Dutro Kuby: ActiveDeployment forRails Apps
  • 3. Who is this guy? • Cameron Dutro • I work at GitHub • He/him/his • Go Seahawks!
  • 4. Rails is awesome • Easy for beginners! • Simple database tools! • Super-fast development experience! • A right place for every fi le! • Generators! Gems! Community! • Take that, Java! “OOPS!”
  • 6. Rails has no official tool orguide to aide in deploying an app into production. THE UNFORTUNATE TRUTH IS,
  • 7. RR 403: Rails Needs Active Deployment with Stefan Wintermeyer March 12th, 2019 “ ” In my experience, deployment is one of the major problems of normal Rails users… it is a big pain to set up a deployment system for a Rails application, and I don’t see anything out there that makes it easier. - Stefan Wintermeyer
  • 8. RR 403: Rails Needs Active Deployment with Stefan Wintermeyer March 12th, 2019 “ ” I believe that we lose quite a lot of companies and new developers on this step. Because everything else [is] so much easier with Rails… but that last step - and it’s a super important step - is still super complicated. - Stefan Wintermeyer
  • 9. Our options • Heroku? Expensive • EC2 instance + capistrano? Dif fi cult • EC2 instance + Chef/Puppet/Ansible? So much to learn • Render, Fly, Cloud 66 Easy but vendor lock-in
  • 10.
  • 11. Today’s journey Cameron circa 2000 • What do we mean by “deployment”? • How deployment has changed in the last ~20 years • The state-of-the-art in Rails land • ActiveDeployment (a.k.a. Kuby)
  • 12. What is deployment? • You’ve built a great website and you want to put it online • Need a computer to run it on • (Ideally not your laptop) • Need to install software that listens for requests, invokes your code, and sends back the response • Might need a domain name (mycoolsite.com) • Might need persistent storage like a database
  • 13. CCM Glass • In 2002 I built my fi rst website • Pure hand-coded HTML • Deployed to free hosting provider • Free hosting, powered by ads • Files deployed via FTP
  • 14. PHP (2004 - 2010) • More dynamic • Able to store and retrieve data from MySQL • Still deploying via FTP
  • 15. Fluther (2010) • First job out of college • Django app (Python) • MySQL database • Solr full-text search • Deployed using Capistrano “Dr. Jelly”
  • 16. Twitter (2011) • Thousands of app servers • Deployments too slow using Capistrano • Wrote our own deployment tool • Servers pull code from each other via BitTorrent • First server seeds new version
  • 17. Twitter • In 2013, Twitter switched to Apache Mesos • “Program against your datacenter like it’s a single pool of resources” • Many distinct services (geolocation, photos, twitter.com, etc) • Services isolated from each other on the same host • Resource allocation, ports, etc con fi gured declaratively
  • 18. Lumos Labs • 2014: VPSes in Softlayer • Bespoke Capistrano setup + Chef • Deployed via in-house web app called Catapult • 2015: EC2 instances in AWS, still Capistrano • 2016: Docker + ECS (Elastic Container Service) • Deployed using in-house tool called Broadside • 2017: Kubernetes
  • 19. GitHub (2022) • Dotcom • Kubernetes, deployed via chat-ops • Other services • Self-service Kubernetes-based framework called Moda • Kubernetes is the platform • Tooling abstracts away the details
  • 20. 2O YEARS FTP Docker + Kubernetes
  • 21. Rails has no official tool orguide to aide in deploying an app into production. TO REITERATE,
  • 23. What I want from ActiveDeployment • Launches my app. Runs my app on a remote server • Ease of use. Con fi g should be easy to grok • BYOS. Bring our own servers • Endemicity. Rails-native
  • 24. These would be nice too • SSL/TLS certi fi cates installed/rotated automatically • Managed database instance • Sidekiq workers • Static asset server • No vendor lock-in
  • 25. as turnkey as Heroku, as unrestricted as Capistrano BASICALLY I WANT IT TO BE
  • 26. Planet Argon’s Ruby Community Survey Results, 2020
  • 27. Who here uses Capistrano? 🙋
  • 28. Capistrano • Server automation tool written in Ruby • Servers managed via remote SSH connections • Uses Rake tasks under the hood
  • 29. Why Capistrano? • Simple. It’s just rake tasks + SSH • Flexible. No limits on what you can do • Established. We’ve got years of prior art to guide us • Independent. No vendor lock-in • Ruby. Written in the language we all love
  • 30. Why not Capistrano? • Bespoke. You have to do a lot of things yourself • Imperative. Is your server really in the state you think it’s in? • Not portable. Does everything still work if you upgrade the OS? • Server-focused. Thinks of servers as individual machines
  • 31. Layers of abstraction WE ARE HERE FTP + SSH Capistrano Chef/Puppet Docker Kubernetes
  • 32. Layers of abstraction WE 
 COULD BE HERE FTP + SSH Capistrano Chef/Puppet Docker Kubernetes
  • 33. Why Kubernetes? • Extensible. Provides a true platform • Declarative. Tell Kubernetes what, not how • Portable. Deploy to any cloud provider with no con fi g changes • Cluster-focused. Servers are treated collectively as a single resource • Resilient. Restarts failed processes automatically • Scalable. Can scale on-demand
  • 35. Introducing Kuby • Kuby is ActiveDeployment for Rails apps • Packages and deploys your app into a Kubernetes cluster • Minimal, easy-to-read con fi guration • Supports major cloud providers • DigitalOcean, Linode, EKS (Amazon), Azure
  • 36. Introducing Kuby • Rails-native • Deploys the secrets in credentials.yml • Automatically provisions a database instance • Creates a static asset server • Acquires SSL/TLS certi fi cates for your domain
  • 37. Starter config Kuby.define('Railsconf') do environment(:production) do docker do credentials do username app_creds[:DOCKER_USERNAME] password app_creds[:DOCKER_PASSWORD] email app_creds[:DOCKER_EMAIL] end image_url "docker.pkg.github.com/camertron/railsconf/railsconf" end kubernetes do add_plugin :rails_app provider :linode do cluster_id app_creds[:LINODE_CLUSTER_ID] access_token app_creds[:LINODE_ACCESS_TOKEN] end end end end
  • 38. Your first deploy $> bundle exec kuby -e production build $> bundle exec kuby -e production push $> bundle exec kuby -e production deploy $> bundle exec kuby -e production setup
  • 39.
  • 40. Kubernetes is a true platform BUT REMEMBER,
  • 41. Plugins • kuby-redis: stand up Redis instances • kuby-sidekiq: easily add background job workers • kuby-prebundler: speed up bundle install • kuby-previews: deploy a copy of your app per pull request • kuby-anycable: deploys anycable’s go-based RPC components
  • 42. Add Sidekiq require "kuby/sidekiq"
 add_plugin(:sidekiq) do replicas 2 # run two workers end In your Kuby con fi g:
  • 43. Add Sidekiq if Rails.env.production ? Sidekiq.configure_server do |config | config.redis = Kuby.environment.kubernetes.plugin(:sidekiq).connection_param s end Sidekiq.configure_client do |config | config.redis = Kuby.environment.kubernetes.plugin(:sidekiq).connection_param s end end In con fi g/initializers/sidekiq.rb:
  • 44. Deploy Sidekiq $> bundle exec kuby -e production build $> bundle exec kuby -e production push $> bundle exec kuby -e production deploy $> bundle exec kuby -e production setup (because we added a plugin)
  • 45. The Platform • Capistrano: • Machine running FTP server or SSH daemon • Kubernetes: • Container scheduler, scaling, fault tolerance • Networking, load-balancing, ingress/egress • Persistent storage • Role-based access control
  • 46. Other things you can do • kuby logs: Get logs from a web pod • kuby remote shell: Like SSH - start an interactive shell in a web pod • kuby remote console: Like rails console • kuby remote dbconsole: Like rails dbconsole • kuby kubectl: Run arbitrary kubectl commands • … and much more
  • 47. Resources • getkuby.io • github.com/getkuby • github.com/getkuby/kuby-core Also, I need help! Let’s make Kuby awesome together.
  • 48.