SlideShare a Scribd company logo
1 of 27
Download to read offline
Jesus Jackson
Developing Rails Apps in
Technical Isolation
Background
● Live in Washington, D.C.
● Software developer who has been leading a
Ruby on Rails project for over 2 years.
● Developer advocate in a Java-based world
Team Background
● 15 developers
● DoD clients in secure spaces
● Development occurs on a restricted intranet
- no way for our application to connect to the
Internet.
Technical Isolation?
No
● Developing on an island :o)
Yes
● Developing apps on an intranet
● No sudo privileges on servers
● Don't have control over firewall rules
What do we do?
How do we manage our Rubies and gemsets behind a
firewalled/restricted environment?
Problem 1: Using RVM
Solution: RVM::FW
● Created by Steven Haddox - a developer who
worked on my team and was instrumental in
our success
● https://github.com/stevenhaddox/rvm_fw
● Sinatra app that runs on a Phusion enabled
web server
● Works by modifying RVM's ~/.rvm/user/db
to point to an internal file which reference
your Rubies.
Set up RVM::FW
1) "rake boot:strap" to download Rubies and
packages
2) Copy contents and deploy to your internal server
3) Install RVM: "bash < <( curl http://<your-server>:<port>/releases/rvm-install-latest )"
4) Configure RVM: "wget http://<your-server>:<port>/db -O ~/.rvm/user/db"
5) "rvm reload"...and viola!
Using RVM::FW
● Other projects on your network can now use
your server to install RVM::FW and
maintain their Rubies.
● http(s)://[your_host]:[port]/db to get a list
of rubies. Your users can copy and paste the
contents into their ~/.rvm/user/db to point
to your RVM::FW instance to download its
Rubies.
● http(s)://[your_host]:[port]/known - will
provide a list of available Rubies when user
does "rvm list known"
Problem #2: Capistrano
Deployment Gotchas
Using Capistrano
● Not very difficult to set up, even in a
restricted environment.
● You need to set up key-based authentication,
which was my team's primary challenge.
Telnet and FTP are not supported.
● By default, Capistrano attempts to use sudo.
"set :user_sudo, false" within deploy.rb to
bypass this.
Capistrano
● Place chmod task in deploy.rb to chmod 775
so releases/### and releases/###/public
are accessible to Apache.
namespace :permissions do
desc "chmod the release and public folder for Apache"
task :make_public do
run "chmod 775 #{release_path}"
run "chmod 775 -R #{release_path}/public"
end
end
Capistrano
● Important to stop and restart Resque
workers
namespace :resque do
desc "Stop resque workers"
task :stop do
begin
run "cd #{shared_path}/path;
RAILS_ENV=production bundle exec rake resque:stop"
rescue Exception => e
puts "!" * 80
"ERROR: Unable to stop Resque workers: #{e}"
puts "!" * 80
end
end
end
How do we test email notifications when the SMTP
server is locked down?
Problem 3: Testing Email
Testing Email Notifications
● Emails blocked when being sent from
ActionMailer
● By default, ActionMailer delivery is sent to
an SMTP server running on your localhost
on port 25.
● SMTP server won't receive emails and don't
have ability to set up another full-fledged
SMTP server and configure ActionMailer to
reference it
Solution: MailCatcher
● Runs a lightweight SMTP server on your
localhost
● Catches any emails sent to it and displays
emails in a nifty interface.
● Configure your app to send mail to smtp:
//127.0.0.1:1025
● View emails at http://127.0.0.1:1080
MailCatcher UI
Problem 4: Using Git
How to use Git in an SVN world
SVN is still prevalent
● Every project on the contract used SVN
● No official server or host for Git on the
intranet.
● Git was misunderstood and misinformation
flew rapidly.
● It was difficult for people to see the benefits
of a distributed versioning control system
because of the small learning curve.
Solution: git svn
● Tool allows you to use Git as a valid client,
but push all of your changes to an SVN
server.
● You can use the nifty features of Git locally
(branching/merging, rebasing, etc.)
● You can use Git locally while the rest of your
team or organization uses SVN.
● It's a great tool to get your team's feet wet
with Git without having to make a complete
commitment.
Using git svn
● "git svn clone [SVN URL] -s" - import your
SVN repo into your local Git repo
● "git commit -am 'My awesome commit
message'" - commit locally without pushing
to the SVN server. You can do this many
times without modifying the SVN repo.
● "git svn dcommit" - Push all of your changes
to the SVN repo. Performs an SVN commit
for each one of your local commits.
● "git svn rebase" - Pull all changes from the
SVN repo and updates your local repo.
git svn caveat
● Remember, you're still using SVN under the
hood.
○ Rebase your work as much as possible.
○ Don't simultaneously interact with a Git repo.
● SVN history is linear
● A "git svn dcommit" rewrites your local Git
to include a unique ID. Working
simultaneously with a remote Git repo can
screw things up. Keep it simple :o)
Solution 2: Gitlab
● If you can host Git on a server, try Gitlab.
● Allows you to manage multiple repos. It's
pretty much your very own Github.
● You can handle user access permissions,
merge requests, issues, wikis, and code
reviews.
Problem 5: Managing Gems
How do we host gems in restricted environments?
Solution: "gem server"
● Rubygems comes with the command "gem
server"
● Running this command will serve all of your
gems from http://localhost:8808
● Visiting the address in your browser will
provide gem details.
● When you install new gems, they'll
automatically be available through your gem
server.
Solution 2: Gem In A Box
● Provides more features, like the ability to
push gems to the server.
● Easy to set up:
○ Create the directory for storing gems
○ Modify the config.ru file to point to the gems
directory.
○ Run the server
● Push gems via the "inabox" command:
○ "gem inabox ./my-awesome-gem-1.0.0.gem"
The end
Questions?

More Related Content

What's hot

Rubygem Dev And Workflow
Rubygem Dev And WorkflowRubygem Dev And Workflow
Rubygem Dev And Workflow
Dr Nic Williams
 

What's hot (20)

Containerised Testing at Demonware : PyCon Ireland 2016
Containerised Testing at Demonware : PyCon Ireland 2016Containerised Testing at Demonware : PyCon Ireland 2016
Containerised Testing at Demonware : PyCon Ireland 2016
 
Grunt js and WordPress
Grunt js and WordPressGrunt js and WordPress
Grunt js and WordPress
 
Joomla Continuous Delivery with Docker
Joomla Continuous Delivery with DockerJoomla Continuous Delivery with Docker
Joomla Continuous Delivery with Docker
 
Docker Swarm 1.12 Overview and Demo
Docker Swarm 1.12 Overview and DemoDocker Swarm 1.12 Overview and Demo
Docker Swarm 1.12 Overview and Demo
 
Docker e git lab
Docker e git labDocker e git lab
Docker e git lab
 
Docker for tooling
Docker for toolingDocker for tooling
Docker for tooling
 
Automate CI/CD with Rancher
Automate CI/CD with RancherAutomate CI/CD with Rancher
Automate CI/CD with Rancher
 
Docker based-Pipelines with Codefresh
Docker based-Pipelines with CodefreshDocker based-Pipelines with Codefresh
Docker based-Pipelines with Codefresh
 
Pragmatic Monolith-First, easy to decompose, clean architecture
Pragmatic Monolith-First, easy to decompose, clean architecturePragmatic Monolith-First, easy to decompose, clean architecture
Pragmatic Monolith-First, easy to decompose, clean architecture
 
Capistrano
CapistranoCapistrano
Capistrano
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
Vagrant step-by-step guide for Beginners
Vagrant step-by-step guide for BeginnersVagrant step-by-step guide for Beginners
Vagrant step-by-step guide for Beginners
 
[Quality Meetup #20] Michał Górski - Continuous Deployment w chmurze
[Quality Meetup #20] Michał Górski - Continuous Deployment w chmurze[Quality Meetup #20] Michał Górski - Continuous Deployment w chmurze
[Quality Meetup #20] Michał Górski - Continuous Deployment w chmurze
 
The pain and gains running Docker in live @Pipedrive
The pain and gains running Docker in live @PipedriveThe pain and gains running Docker in live @Pipedrive
The pain and gains running Docker in live @Pipedrive
 
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconfContinuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
 
Helpful pre commit hooks for Python and Django
Helpful pre commit hooks for Python and DjangoHelpful pre commit hooks for Python and Django
Helpful pre commit hooks for Python and Django
 
Webinar : SVN to GIT Migration
Webinar : SVN to GIT Migration Webinar : SVN to GIT Migration
Webinar : SVN to GIT Migration
 
Rubygem Dev And Workflow
Rubygem Dev And WorkflowRubygem Dev And Workflow
Rubygem Dev And Workflow
 
Better delivery with DevOps Driven Development
Better delivery with DevOps Driven DevelopmentBetter delivery with DevOps Driven Development
Better delivery with DevOps Driven Development
 
Development with Vagrant
Development with VagrantDevelopment with Vagrant
Development with Vagrant
 

Similar to Developing Rails Apps in Technical Isolation

Similar to Developing Rails Apps in Technical Isolation (20)

GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
 
FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CI
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scaling
 
Deploying Rails Apps with Chef and Capistrano
 Deploying Rails Apps with Chef and Capistrano Deploying Rails Apps with Chef and Capistrano
Deploying Rails Apps with Chef and Capistrano
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 
Warden @ Meet magento Romania 2021
Warden @ Meet magento Romania 2021Warden @ Meet magento Romania 2021
Warden @ Meet magento Romania 2021
 
Volunteering at YouSee on Technology Support
Volunteering at YouSee on Technology SupportVolunteering at YouSee on Technology Support
Volunteering at YouSee on Technology Support
 
Git pusshuten
Git pusshutenGit pusshuten
Git pusshuten
 
Upgrade Kubernetes the boring way
Upgrade Kubernetes the boring wayUpgrade Kubernetes the boring way
Upgrade Kubernetes the boring way
 
Git
GitGit
Git
 
Devoops: DoJ Annual Cybersecurity Training Symposium Edition 2015
Devoops: DoJ Annual Cybersecurity Training Symposium Edition 2015Devoops: DoJ Annual Cybersecurity Training Symposium Edition 2015
Devoops: DoJ Annual Cybersecurity Training Symposium Edition 2015
 
Automate your WordPress Workflow with Grunt.js
Automate your WordPress Workflow with Grunt.jsAutomate your WordPress Workflow with Grunt.js
Automate your WordPress Workflow with Grunt.js
 
Pluggable Infrastructure with CI/CD and Docker
Pluggable Infrastructure with CI/CD and DockerPluggable Infrastructure with CI/CD and Docker
Pluggable Infrastructure with CI/CD and Docker
 
LINE's Private Cloud - Meet Cloud Native World
LINE's Private Cloud - Meet Cloud Native WorldLINE's Private Cloud - Meet Cloud Native World
LINE's Private Cloud - Meet Cloud Native World
 
DevOops & How I hacked you DevopsDays DC June 2015
DevOops & How I hacked you DevopsDays DC June 2015DevOops & How I hacked you DevopsDays DC June 2015
DevOops & How I hacked you DevopsDays DC June 2015
 
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
 
Container Days
Container DaysContainer Days
Container Days
 
Dockerfile for rust project
Dockerfile for rust projectDockerfile for rust project
Dockerfile for rust project
 
Crikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor WorkshopCrikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor Workshop
 

Recently uploaded

Recently uploaded (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Developing Rails Apps in Technical Isolation

  • 1. Jesus Jackson Developing Rails Apps in Technical Isolation
  • 2. Background ● Live in Washington, D.C. ● Software developer who has been leading a Ruby on Rails project for over 2 years. ● Developer advocate in a Java-based world Team Background ● 15 developers ● DoD clients in secure spaces ● Development occurs on a restricted intranet - no way for our application to connect to the Internet.
  • 3. Technical Isolation? No ● Developing on an island :o) Yes ● Developing apps on an intranet ● No sudo privileges on servers ● Don't have control over firewall rules
  • 5.
  • 6. How do we manage our Rubies and gemsets behind a firewalled/restricted environment? Problem 1: Using RVM
  • 7. Solution: RVM::FW ● Created by Steven Haddox - a developer who worked on my team and was instrumental in our success ● https://github.com/stevenhaddox/rvm_fw ● Sinatra app that runs on a Phusion enabled web server ● Works by modifying RVM's ~/.rvm/user/db to point to an internal file which reference your Rubies.
  • 8. Set up RVM::FW 1) "rake boot:strap" to download Rubies and packages 2) Copy contents and deploy to your internal server 3) Install RVM: "bash < <( curl http://<your-server>:<port>/releases/rvm-install-latest )" 4) Configure RVM: "wget http://<your-server>:<port>/db -O ~/.rvm/user/db" 5) "rvm reload"...and viola!
  • 9. Using RVM::FW ● Other projects on your network can now use your server to install RVM::FW and maintain their Rubies. ● http(s)://[your_host]:[port]/db to get a list of rubies. Your users can copy and paste the contents into their ~/.rvm/user/db to point to your RVM::FW instance to download its Rubies. ● http(s)://[your_host]:[port]/known - will provide a list of available Rubies when user does "rvm list known"
  • 11. Using Capistrano ● Not very difficult to set up, even in a restricted environment. ● You need to set up key-based authentication, which was my team's primary challenge. Telnet and FTP are not supported. ● By default, Capistrano attempts to use sudo. "set :user_sudo, false" within deploy.rb to bypass this.
  • 12. Capistrano ● Place chmod task in deploy.rb to chmod 775 so releases/### and releases/###/public are accessible to Apache. namespace :permissions do desc "chmod the release and public folder for Apache" task :make_public do run "chmod 775 #{release_path}" run "chmod 775 -R #{release_path}/public" end end
  • 13. Capistrano ● Important to stop and restart Resque workers namespace :resque do desc "Stop resque workers" task :stop do begin run "cd #{shared_path}/path; RAILS_ENV=production bundle exec rake resque:stop" rescue Exception => e puts "!" * 80 "ERROR: Unable to stop Resque workers: #{e}" puts "!" * 80 end end end
  • 14. How do we test email notifications when the SMTP server is locked down? Problem 3: Testing Email
  • 15. Testing Email Notifications ● Emails blocked when being sent from ActionMailer ● By default, ActionMailer delivery is sent to an SMTP server running on your localhost on port 25. ● SMTP server won't receive emails and don't have ability to set up another full-fledged SMTP server and configure ActionMailer to reference it
  • 16. Solution: MailCatcher ● Runs a lightweight SMTP server on your localhost ● Catches any emails sent to it and displays emails in a nifty interface. ● Configure your app to send mail to smtp: //127.0.0.1:1025 ● View emails at http://127.0.0.1:1080
  • 18. Problem 4: Using Git How to use Git in an SVN world
  • 19. SVN is still prevalent ● Every project on the contract used SVN ● No official server or host for Git on the intranet. ● Git was misunderstood and misinformation flew rapidly. ● It was difficult for people to see the benefits of a distributed versioning control system because of the small learning curve.
  • 20. Solution: git svn ● Tool allows you to use Git as a valid client, but push all of your changes to an SVN server. ● You can use the nifty features of Git locally (branching/merging, rebasing, etc.) ● You can use Git locally while the rest of your team or organization uses SVN. ● It's a great tool to get your team's feet wet with Git without having to make a complete commitment.
  • 21. Using git svn ● "git svn clone [SVN URL] -s" - import your SVN repo into your local Git repo ● "git commit -am 'My awesome commit message'" - commit locally without pushing to the SVN server. You can do this many times without modifying the SVN repo. ● "git svn dcommit" - Push all of your changes to the SVN repo. Performs an SVN commit for each one of your local commits. ● "git svn rebase" - Pull all changes from the SVN repo and updates your local repo.
  • 22. git svn caveat ● Remember, you're still using SVN under the hood. ○ Rebase your work as much as possible. ○ Don't simultaneously interact with a Git repo. ● SVN history is linear ● A "git svn dcommit" rewrites your local Git to include a unique ID. Working simultaneously with a remote Git repo can screw things up. Keep it simple :o)
  • 23. Solution 2: Gitlab ● If you can host Git on a server, try Gitlab. ● Allows you to manage multiple repos. It's pretty much your very own Github. ● You can handle user access permissions, merge requests, issues, wikis, and code reviews.
  • 24. Problem 5: Managing Gems How do we host gems in restricted environments?
  • 25. Solution: "gem server" ● Rubygems comes with the command "gem server" ● Running this command will serve all of your gems from http://localhost:8808 ● Visiting the address in your browser will provide gem details. ● When you install new gems, they'll automatically be available through your gem server.
  • 26. Solution 2: Gem In A Box ● Provides more features, like the ability to push gems to the server. ● Easy to set up: ○ Create the directory for storing gems ○ Modify the config.ru file to point to the gems directory. ○ Run the server ● Push gems via the "inabox" command: ○ "gem inabox ./my-awesome-gem-1.0.0.gem"