This document discusses using Chef and Capistrano together to automate the deployment and management of a Rails application. Chef is used to configure the infrastructure and shared components, while Capistrano handles application-specific deployment tasks. Key steps include defining Chef recipes, roles, and node attributes; setting up Capistrano configuration and custom tasks; and integrating the two systems so that Capistrano deployments trigger Chef provisioning tasks.
Vous avez besoin d'une stratégie pour déployer votre infrastructure ? Je vais vous donner une méthode qui vient du monde du développement. Dans le but d'avoir une plate-forme stable.
Décrivez ce dont vous avez besoin dans votre future recette "Je veux un serveur HTTP" est testez avec un outil du type BDD (Développement Piloté par les Fonctionnalités).
Maintenant, vous allez devoir de décrire (avec un langage de plus bas niveau) les prérequis dont vous avez besoin pour cette fonctionnalité (vérifier si NGINX est installé).
Vous basculez donc dans le mode TDD (Développement Piloté par les Tests). Quand votre recette est prête, vous allez l'ajouter à votre gestionnaire de sources. Et votre système d'Intégration Continue va tester votre recette à chaque mise à jour.
Comme pour un système de développement. Je vous l'ai dit “Infrastructure as code”
Vous avez besoin d'une stratégie pour déployer votre infrastructure ? Je vais vous donner une méthode qui vient du monde du développement. Dans le but d'avoir une plate-forme stable.
Décrivez ce dont vous avez besoin dans votre future recette "Je veux un serveur HTTP" est testez avec un outil du type BDD (Développement Piloté par les Fonctionnalités).
Maintenant, vous allez devoir de décrire (avec un langage de plus bas niveau) les prérequis dont vous avez besoin pour cette fonctionnalité (vérifier si NGINX est installé).
Vous basculez donc dans le mode TDD (Développement Piloté par les Tests). Quand votre recette est prête, vous allez l'ajouter à votre gestionnaire de sources. Et votre système d'Intégration Continue va tester votre recette à chaque mise à jour.
Comme pour un système de développement. Je vous l'ai dit “Infrastructure as code”
Desenvolver rapidamente, criando toda a estrutura PaaS virtualizada localmente, depois de maneira rápida homologar com o cliente e subir o ambiente produção na AWS facilmente.
Presentation of my TechTalk at eSapce (Every Thursday one of the departments make a session about something recently begun to use or a new technology, this was my session from SysOps team.) This is an introduction to Ansible, and how to get started with it ... and since then we moved to Ansible :-)
Ansible is a great tool for many purposes like: configuration management, contentious deployment, and multi-tier orchestration ... and more!
- http://tech.aabouzaid.com/
- http://espace.com.eg/
- http://ansible.com/
A practical workflow using Bower and Grunt that keeps your vendor folder clean, copies your assets in different locations and makes your dependency management an easy task.
For many years Capistrano has been the defacto deployment tool, but many organisations have yet to realise the benefits of automating their deployment process. Automated Deployments are fast, less error prone, easier to rollback and you can dish out the keys to other team members so anyone can deploy.
During this talk we’ll look at how to “capify” a simple PHP project and deploy it in a few minutes. And, as Capistrano is a “remote server automation and deployment tool”, we’ll also look at some of the other things Capistrano can do for you such as restarting apache or grepping server log (and more). We’ll also take a look at the various plug-ins available and see how easy it can be to write your own.
If you are deploying using ssh / git pull / apache restart? Then it’s time to make a change: automate all the things and live in a world of “repeatable success”.
Learn how to use Capistrano to automate the deployment of your Ruby on Rails applications. Apply best practices and add-ons for customizing Capistrano.
Desenvolver rapidamente, criando toda a estrutura PaaS virtualizada localmente, depois de maneira rápida homologar com o cliente e subir o ambiente produção na AWS facilmente.
Presentation of my TechTalk at eSapce (Every Thursday one of the departments make a session about something recently begun to use or a new technology, this was my session from SysOps team.) This is an introduction to Ansible, and how to get started with it ... and since then we moved to Ansible :-)
Ansible is a great tool for many purposes like: configuration management, contentious deployment, and multi-tier orchestration ... and more!
- http://tech.aabouzaid.com/
- http://espace.com.eg/
- http://ansible.com/
A practical workflow using Bower and Grunt that keeps your vendor folder clean, copies your assets in different locations and makes your dependency management an easy task.
For many years Capistrano has been the defacto deployment tool, but many organisations have yet to realise the benefits of automating their deployment process. Automated Deployments are fast, less error prone, easier to rollback and you can dish out the keys to other team members so anyone can deploy.
During this talk we’ll look at how to “capify” a simple PHP project and deploy it in a few minutes. And, as Capistrano is a “remote server automation and deployment tool”, we’ll also look at some of the other things Capistrano can do for you such as restarting apache or grepping server log (and more). We’ll also take a look at the various plug-ins available and see how easy it can be to write your own.
If you are deploying using ssh / git pull / apache restart? Then it’s time to make a change: automate all the things and live in a world of “repeatable success”.
Learn how to use Capistrano to automate the deployment of your Ruby on Rails applications. Apply best practices and add-ons for customizing Capistrano.
Burn down the silos! Helping dev and ops gel on high availability websitesLindsay Holmwood
HA websites are where the rubber meets the road - at 200km/h. Traditional separation of dev and ops just doesn't cut it.
Everything is related to everything. Code relies on performant and resilient infrastructure, but highly performant infrastructure will only get a poorly written application so far. Worse still, root cause analysis in HA sites will more often than not identify problems that don't clearly belong to either devs or ops.
The two options are collaborate or die.
This talk will introduce 3 core principles for improving collaboration between operations and development teams: consistency, repeatability, and visibility. These principles will be investigated with real world case studies and associated technologies audience members can start using now. In particular, there will be a focus on:
- fast provisioning of test environments with configuration management
- reliable and repeatable automated deployments
- application and infrastructure visibility with statistics collection, logging, and visualisation
Capistrano deploy Magento project in an efficient waySylvain Rayé
Deploying a Magento project can be very a long and laborious task with some risks of errors. Having the good tool to prevent such a pain like Capistrano will help you to automatize such a process. Thanks such a tool you may deploy a release of your Magento project in less than 5 minutes.
Webinar: Building Your First App in Node.jsMongoDB
Node.js is one of the fastest growing and most popular application frameworks today. It offers a set of features that is both useful and challenging to modern web and back-end developer. Most engineers think of it as a cool, simple, and fast application framework that makes iterative development easier.
In this webinar we will talk about how Node.js and MongoDB interact, discuss the best ways to get started, and walk through how to use MongoDB and Node.js in a set of use cases.
Webinar: Building Your First App in Node.jsMongoDB
Node.js is one of the fastest growing and most popular application frameworks today. It offers a set of features that is both useful and challenging to modern web and back-end developer. Most engineers think of it as a cool, simple, and fast application framework that makes iterative development easier.
In this webinar we will talk about how Node.js and MongoDB interact, discuss the best ways to get started, and walk through how to use MongoDB and Node.js in a set of use cases.
A bit of history, frustration-driven development, and why and how we started looking into Puppet at Opera Software. What we're doing, successes, pain points and what we're going to do with Puppet and Config Management next.
Presentation on MongoDB and Node.JS. We describe how to do basic CRUD operations (insert, remove, update, find) how to aggregate using node.js. We also discuss a bit of Meteor, MEAN Stack and other ODMs and projects on Javascript and MongoDB
Nagios Conference 2014 - Mike Weber - Expanding NRDS Capabilities on Linux Sy...Nagios
Mike Weber's presentation on Expanding NRDS Capabilities on Linux Systems.
The presentation was given during the Nagios World Conference North America held Oct 13th - Oct 16th, 2014 in Saint Paul, MN. For more information on the conference (including photos and videos), visit: http://go.nagios.com/conference
More info at http://blog.carlossanchez.eu/tag/devops
Video en español: http://youtu.be/E_OE4l3t5BA
The DevOps movement aims to improve communication between developers and operations teams to solve critical issues such as fear of change and risky deployments. But the same way that Agile development would likely fail without continuous integration tools, the DevOps principles need tools to make them real, and provide the automation required to actually be implemented. Most of the so called DevOps tools focus on the operations side, and there should be more than that, the automation must cover the full process, Dev to QA to Ops and be as automated and agile as possible. Tools in each part of the workflow have evolved in their own silos, and with the support of their own target teams. But a true DevOps mentality requires a seamless process from the start of development to the end in production deployments and maintenance, and for a process to be successful there must be tools that take the burden out of humans.
Apache Maven has arguably been the most successful tool for development, project standardization and automation introduced in the last years. On the operations side we have open source tools like Puppet or Chef that are becoming increasingly popular to automate infrastructure maintenance and server provisioning.
In this presentation we will introduce an end-to-end development-to-production process that will take advantage of Maven and Puppet, each of them at their strong points, and open source tools to automate the handover between them, automating continuous build and deployment, continuous delivery, from source code to any number of application servers managed with Puppet, running either in physical hardware or the cloud, handling new continuous integration builds and releases automatically through several stages and environments such as development, QA, and production.
Similar to Practical Chef and Capistrano for Your Rails App (20)
Elixir is great for web servers and embedded devices, but is there anything else it’s good for?
Yes! Elixir is also great at being a multiplayer game server.
We’ll take a look through some existing applications that use Elixir as a multiplayer backend server, ExVenture and Kalevala.
See how they’re architected to be full of state and event driven to handle thousands of users.
DC |> Elixir Meetup - Going off the Rails into Elixir - Dan IvovichSmartLogic
Presentation from DC |> Elixir, March 19, 2019. Covered transitioning from Ruby on Rails to Elixir and Phoenix, and why developers want to make that transition, and why management should be supportive of that transition.
Monitoring Your Elixir Application with PrometheusSmartLogic
Get under the hood of your application, with metrics! What is your slowest external call? What are your total daily interactions? Find out with Prometheus!
We’ll use Prometheus and Grafana to give us insights into your application. Prometheus will gather time series metrics, and Grafana will give a powerful display of them.
We’ll cover how to add instrumentation through the lens of a real-world application.
Finally, we'll get alerted about key metrics via the Prometheus AlertManager.
You have an application that works well on a single node, and you’ve heard that Erlang lets you scale out in a cluster. How do you go about doing that?
We’ll walk through the steps I took to turn ExVenture (a multiplayer game server) into a distributed application.
Starting with connecting nodes in development and production, to picking a cluster leader via the Raft protocol, and dealing with process groups to fan calls throughout the cluster.
Finally we’ll see some of the hurdles I encountered when spanning multiple nodes.
SmartLogic's Eric Oestrich discusses Kubernetes at Baltimore Innovation Week. Kubernetes is a webscale cluster manager. By the end of the talk we will have a Rails application hosted inside of Kubernetes, Google's new cluster manager.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
JMeter webinar - integration with InfluxDB and Grafana
Practical Chef and Capistrano for Your Rails App
1. Practical Chef and Capistrano
For Your Rails Application
Dan Ivovich
SLS Internal Dec 2012
12/17/12
2. Dan Ivovich
SmartLogic Solutions
http://smartlogicsolutions.com
Twitter - @danivovich
Dan Ivovich on GitHub
3. What is the goal?
● Build a machine that can run the application
quickly and repeatedly
● Make deploying the app, upgrading
components, adding components, etc seamless
and easy
4. Who does what?
● Chef
○ User / SSH Keys
○ Web server
○ Database
○ Postfix
○ Redis / Memcached
○ Monit
○ NewRelic Server monitoring
○ /etc/hosts
○ rbenv & Ruby
○ Application binary dependencies (i.e.
Sphinx)
5. Who does what?
● Capistrano
○ Virtual Hosts
○ Unicorn init.d script
○ Unicorn.rb
○ Monit process monitors
○ Normal Capistrano Stuff
6. Why both?
● Use each for what it is best at
● Chef is for infrastructure
● Capistrano is for the app
● Could have more than one Capistrano app with
the same Chef config
● Chef config changes infrequently, Capistrano
config could change more frequently
7. How? - Chef
● Standard Recipes
● Custom Recipes
● Recipes assigned to Roles
● Roles assigned to Nodes
● Nodes with attributes to tailor the install
9. Chef - Getting started
● Gemfile
● knife kitchen chef-repo
○ Create the folder structure you need
● Solo specific stuff (chef-repo/.chef/knife.rb)
● knife cookbook site install nginx
○ Get the nginx cookbook and anything it
needs
12. directory "#{node['your_app']['cap_base']}" do
action :create
owner 'deploy'
group 'deploy'
mode '0755'
end
directory "#{node['your_app']['deploy_to']}/shared" do
action :create
owner 'deploy'
group 'deploy'
mode '0755'
end
template "#{node['your_app']['deploy_to']}/shared/database.yml"
do
source 'database.yml.erb'
owner 'deploy'
group 'deploy'
mode '0644'
end
20. Capistrano - Getting Started
● Add capistrano and capistrano-ext
● Capify
● deploy.rb
21. Capistrano - deploy.rb
require 'bundler/capistrano'
require 'capistrano/ext/multistage'
load 'config/recipes/base'
load 'config/recipes/nginx'
load 'config/recipes/unicorn'
load 'config/recipes/monit'
set :default_environment, {
'PATH' => "/opt/rbenv/shims:/opt/rbenv/bin:$PATH",
'RBENV_ROOT' => "/opt/rbenv"
}
set :bundle_flags, "--deployment --quiet --binstubs --shebang ruby-local-exec"
set :use_sudo, false
set :application, 'your_app'
set :repository, 'git@github.com:you/your_app.git'
set :deploy_to, '/home/deploy/apps/your_app'
set :deploy_via, :remote_cache
22. Capistrano - deploy.rb
set :branch, 'master'
set :scm, :git
set :target_os, :ubuntu
set :maintenance_template_path, File.expand_path("..
/recipes/templates/maintenance.html.erb", __FILE__)
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
namespace :custom do
desc 'Create the .rbenv-version file'
task :rbenv_version, :roles => :app do
run "cd #{release_path} && rbenv local 1.9.2-p320"
end
end
before 'bundle:install', 'custom:rbenv_version'
23. Capistrano - recipes/base.rb
def template(from, to)
erb = File.read(File.expand_path("../templates/#{from}", __FILE__))
put ERB.new(erb).result(binding), to
end
def set_default(name, *args, &block)
set(name, *args, &block) unless exists?(name)
end
24. Capistrano - recipes/monit.rb
set_default(:alert_email, "dan@smartlogicsolutions.com")
namespace :monit do
desc "Setup all Monit configuration"
task :setup do
unicorn
syntax
restart
end
after "deploy:setup", "monit:setup"
task(:unicorn, roles: :app) { monit_config "unicorn" }
%w[start stop restart syntax].each do |command|
desc "Run Monit #{command} script"
task command do
with_user "deploy" do
sudo "service monit #{command}"
end
end
end
end
26. Capistrano - recipes/nginx.rb
namespace :nginx do
desc "Setup nginx configuration for this application"
task :setup, roles: :web do
template "nginx_unicorn.erb", "/tmp/nginx_conf"
sudo "mv /tmp/nginx_conf /etc/nginx/sites-enabled/#{application}"
sudo "rm -f /etc/nginx/sites-enabled/default"
restart
end
after "deploy:setup", "nginx:setup"
%w[start stop restart].each do |command|
desc "#{command} nginx"
task command, roles: :web do
sudo "service nginx #{command}"
end
end
end
31. Capistrano - templates/unicorn.rb.erb
before_fork do |server, worker|
# Disconnect since the database connection will not carry over
if defined? ActiveRecord::Base
ActiveRecord::Base.connection.disconnect!
end
# Quit the old unicorn process
old_pid = "#{server.config[:pid]}.oldbin"
if File.exists?(old_pid) && server.pid != old_pid
begin
Process.kill("QUIT", File.read(old_pid).to_i)
rescue Errno::ENOENT, Errno::ESRCH
# someone else did our job for us
end
end
end
32. Capistrano - templates/unicorn.rb.erb
after_fork do |server, worker|
# Start up the database connection again in the worker
if defined?(ActiveRecord::Base)
ActiveRecord::Base.establish_connection
end
child_pid = server.config[:pid].sub(".pid", ".#{worker.nr}.pid")
system("echo #{Process.pid} > #{child_pid}")
end
33. Capistrano - t/monit/unicorn.erb
check process <%= application %>_unicorn with pidfile <%= unicorn_pid %>
start program = "/etc/init.d/unicorn_<%= application %> start"
stop program = "/etc/init.d/unicorn_<%= application %> stop"
<% unicorn_workers.times do |n| %>
<% pid = unicorn_pid.sub(".pid", ".#{n}.pid") %>
check process <%= application %>_unicorn_worker_<%= n %> with pidfile <%= pid %>
start program = "/bin/true"
stop program = "/usr/bin/test -s <%= pid %> && /bin/kill -QUIT `cat <%= pid %>`"
if mem > 200.0 MB for 1 cycles then restart
if cpu > 50% for 3 cycles then restart
if 5 restarts within 5 cycles then timeout
alert <%= alert_email %> only on { pid }
if changed pid 2 times within 60 cycles then alert
<% end %>
38. Ready?!? Here we go!
1. New VM at my_web_app in your .ssh/config
2. Create chef-repo/nodes/my_web_app.json
3. In chef-repo:
bundle exec knife bootstrap node_name
--template-file=ubuntu-12.04-lts.erb
4. bundle exec knife cook root@my_web_app
5. In app directory:
create/edit config/deploy/staging.rb
6. cap staging deploy:setup deploy:migrations
7. Hit the bars
39. Thoughts....
● Vagrant and VMs are you friend. Rinse and repeat
● It is ok to tweak your Chef stuff and re-cook, but I always
like to restart with a fresh VM once I think I'm done
● Capistrano tweaks should be easy to apply, especially with
tasks like nginx:setup, unicorn:setup etc.
● Chef issues are harder to debug and more frustrating than
Capistrano issues, another reason to put more app specific
custom stuff in Capistrano and do standard things in Chef