SlideShare une entreprise Scribd logo
1  sur  45
Télécharger pour lire hors ligne
Deployment Automation
Riccardo Lemmi aka AXA
Who am I?
● Python, Zope and Plone Developer (from 2001)
● Sysadmin (Debian, Ubuntu)
● ...but I like to say “Über Developer”
● Metalhead
● Multi-instrumentalist
Deployment Automation
Or: how to build a complete system from scratch
It begins by the requirements to have an installation process easy to
repeat, documented and auditable.
We are going to discuss about
● "Vagrant” to create virtual machine,
● "fabric" to automate operations
● and the tools to deploy on Amazon Web Services (AWS)
Motivation
To find an easy way to reproduce the installation process,
so our co-workers can replicate the deployment without pain.
Some definitions
SW deployment
Software deployment is the set of all the activities that make a software
system available for use
"Deployment" should be interpreted as a general process that has to be
customized according to specific requirements or characteristics.
Some definitions
Deployment activities
Release
It follows from the completed development process
Installation
It can vary from simple to a complex set of activities
and it can involve continuous delivery
Some definitions
Deployment activities
Update
It replaces an earlier version of sw with a newer release
Continuous delivery
It produces software in short cycles,
ensuring that the software can be reliably released at any time
Employed Tools
● Vagrant
● Fabric
● AWS
● Boto3 / AWS CLI
Vagrant
What is it?
It is a tool to manage Virtual Machines and Containers
and a repository of pre-installed VM
Vagrant: some definitions
"Provisioners"
Tools like Puppet, Chef and Ansible but I use Fabric
They run commands on a machine
"Providers"
Providers are the services that Vagrant uses to set up and create
virtual environments (VirtualBox, Hyper-V, and Docker…)
Vagrant: How I use it
Choose a pre-installed VM: a Box
https://vagrantcloud.com/boxes/search
Initialize the machine:
$ vagrant init ubuntu/bionic64
Vagrant: How I use it
The ‘init’ command create a Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
end
where one can configure some parameters as
# of cpus and memory size
Vagrant: How I use it
Start the VM with:
$ vagrant up
then login
$ vagrant ssh
and stop it
$ vagrant halt
Fabric: What is it?
It is a python library
It is designed to execute shell commands remotely over SSH connection
It is similar to Ansible more than Chef or Puppet
It uses “Invoke” library to manage shell command execution
It uses “Paramiko” library to manage low/mid level SSH functionality
Fabric: How I use it
To install packages
Configure servers (as apache, monit, postfix, slapd)
Compile sources
Run buildouts
Fabric: How I use it
Ansible terminology
Control machine
Machine from where we can manage other machines.
Remote machine
Machines which are handled/controlled by control machine.
Fabric: Basics
The most basic use of Fabric is:
to execute a shell command on a remote system via SSH,
then check the result.
Other typical operations are:
● interact with some cli commands (with Responder)
● transfer files
● run the same commands on multiple machines
Fabric: Methods
Run
It is the simplest method: run a single command on a server:
from fabric import Connection
server = Connection('web1')
result = server.run('hostname')
if result.ok:
...
Fabric: Methods
Sudo
To run commands as the remote system's superuser
server.sudo('useradd axa')
server.sudo('mkdir /opt/aws')
server.sudo('apachectl restart')
Fabric: Methods
Put
Send a file to the server
server.put('apache2.conf', remote='/etc/apache2/')
Fabric: More Libraries
● Fabtools
● Cuisine
Fabric: Fabtools
https://fabtools.readthedocs.io/
It provides methods to manage system users, packages, databases, etc.
The 'require' methods are a declarative style similar to Chef or Puppet.
Fabric: Fabtools
Some modules:
● fabtools.require.apache
● fabtools.require.git
● fabtools.require.groups
● fabtools.require.nodejs
● fabtools.require.postfix
● fabtools.require.postgres
● fabtools.require.python
● fabtools.require.system
● fabtools.require.users
Fabric: Fabtools Examples
fabtools.require.apache.server()
Require the Apache HTTP server to be installed and running.
fabtools.require.users.user('axa')
Require a user and its home directory.
fabtools.require.postgres.database('userdb', 'axa')
Create a Database in postgres
Fabric: Cuisine
https://github.com/sebastien/cuisine
It has some methods similar to fabtools (Chef-like)
It provides common administration operations such as:
● file/dir operations
● user/group creation
● package install/upgrade
Fabric: Cuisine Methods
text_*
Text-processing functions
file_*
File operations
dir_*
Directory operations
Fabric: Cuisine Methods
package_*
Package management operations
command_*
Shell commands availability
user_*
User creation commands
Fabric: Cuisine Methods
group*
Group creation commands
mode_*
Configures cuisine's behaviour within the current session.
select_*
Selects a specific option, such as package back-end
(apt, yum, zypper, or pacman)
Fabric: Cuisine Examples
file_update(
"/etc/monit/monitrc",
lambda _:text_replace_line(
_,
"# with start delay 240 # optional: delay the first check by 4-minutes (by ",
" with start delay 60",
)[0]
)
Fabric: Cuisine Examples
user_ensure('axa')
Ensures that the given users exists,
optionally updating their passwd/home/uid/gid/shell.
package_ensure('imagemagick')
Tests if the given package is installed, and installs it in
case it's not already there.
Fabric example
from fabric.api import task, run
@task
def check_system():
""" """
run('uname -a')
run('lsb_release -a')
run('hostnamectl status')
$ fab -H sanctuary check_system
Amazon Web Services (AWS)
Motivations
To deploy production and stage machines in a simple and replicable
way
With the chance to choose and change the size of the machine
whenever required (cpu, ram, disk)
AWS: What is it
"Amazon Web Services offers a broad set of global cloud-based products
including compute, storage, databases, analytics, networking, mobile,
developer tools, management tools, IoT, security and enterprise
applications."
AWS: How I use it
EC2, EBS and EIP for the most
Snapshots as simple backup tool
Security group rules as a firewall to control traffic
… and more
AWS: How do I create a machine?
● Boto3
● AWS CLI
AWS: Why scripting installation?
To have “Infrastructure as code” so:
"...the process of managing and provisioning computer data centers
through machine-readable definition files, rather than physical
hardware configuration or interactive configuration tools."
AWS: Boto3
"Boto is the Amazon Web Services (AWS) SDK for Python. It enables
Python developers to create, configure, and manage AWS services, such
as EC2 and S3. Boto provides an easy to use, object-oriented API, as well
as low-level access to AWS services."
AWS: Boto3 - How I use it
Boto3 is a library providing methods to create and configure resources
● EC2 Elastic Compute Cloud
● EBS Elastic Block storage
● EIP Elastic IP
● CF Cloud Front (CDN: Content Delivery Network)
● RDS Relational Database
AWS: Boto3 - Examples
Show status and parameters of all instances
ec2 = boto3.client('ec2')
response = ec2.describe_instances()
print(response)
AWS: Boto3 - Examples
Create an Instance
ec2 = boto3.client('ec2')
ec2.run_instances(
ImageId='ami-0286372f78291e588',
InstanceType='t2.nano',
...)
AWS: Boto3 - Examples
Create a volume
ec2 = boto3.client('ec2')
volume = ec2.create_volume(
AvailabilityZone='eu-west-1a',
Size=50,
VolumeType='gp2',
...)
AWS: Boto3 - Examples
Start EC2 Instance
ec2 = boto3.client('ec2')
ec2.start_instances(InstanceIds=[instance_id])
AWS: AWS CLI
The AWS Command Line Interface (CLI) is a unified tool to manage your
AWS services.
The commands are the same available in boto3 but they can be used
from bash scripts.
How to install it:
$ pip install awscli
Yes, it is in Python and it is based on boto3!
Thank you
● https://www.fabfile.org/
● https://12factor.net/

Contenu connexe

Tendances

Learn Puppet : Quest Guide for the Learning VM
Learn Puppet : Quest Guide for the Learning VMLearn Puppet : Quest Guide for the Learning VM
Learn Puppet : Quest Guide for the Learning VMKumaran Balachandran
 
Ansible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeAnsible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeSarah Z
 
Multi-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and moreMulti-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and moreChef Software, Inc.
 
Deploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleDeploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleOrestes Carracedo
 
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu ServerForget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Serveraaroncouch
 
How To Set a Vagrant Development System
How To Set a Vagrant Development SystemHow To Set a Vagrant Development System
How To Set a Vagrant Development SystemPaul Bearne
 
Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]Nicolas Poggi
 
Controlling multiple VMs with the power of Python
Controlling multiple VMs with the power of PythonControlling multiple VMs with the power of Python
Controlling multiple VMs with the power of PythonYurii Vasylenko
 
Vagrant for Virtualized Development
Vagrant for Virtualized DevelopmentVagrant for Virtualized Development
Vagrant for Virtualized DevelopmentAdam Culp
 
Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Michele Orselli
 
A Presentation about Puppet that I've made at the OSSPAC conference
A Presentation about Puppet that I've made at the OSSPAC conferenceA Presentation about Puppet that I've made at the OSSPAC conference
A Presentation about Puppet that I've made at the OSSPAC conferenceohadlevy
 
Using Puppet in Small Infrastructures
Using Puppet in Small InfrastructuresUsing Puppet in Small Infrastructures
Using Puppet in Small InfrastructuresRachel Andrew
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationSuresh Kumar
 

Tendances (20)

Learn Puppet : Quest Guide for the Learning VM
Learn Puppet : Quest Guide for the Learning VMLearn Puppet : Quest Guide for the Learning VM
Learn Puppet : Quest Guide for the Learning VM
 
Node.js essentials
 Node.js essentials Node.js essentials
Node.js essentials
 
Ansible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeAnsible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less Coffee
 
Multi-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and moreMulti-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and more
 
Deploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleDeploying PHP Applications with Ansible
Deploying PHP Applications with Ansible
 
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu ServerForget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
 
How To Set a Vagrant Development System
How To Set a Vagrant Development SystemHow To Set a Vagrant Development System
How To Set a Vagrant Development System
 
Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]
 
Controlling multiple VMs with the power of Python
Controlling multiple VMs with the power of PythonControlling multiple VMs with the power of Python
Controlling multiple VMs with the power of Python
 
Ansible - A 'crowd' introduction
Ansible - A 'crowd' introductionAnsible - A 'crowd' introduction
Ansible - A 'crowd' introduction
 
Vagrant + Docker
Vagrant + DockerVagrant + Docker
Vagrant + Docker
 
Puppet - an introduction
Puppet - an introductionPuppet - an introduction
Puppet - an introduction
 
Vagrant to-aws-flow
Vagrant to-aws-flowVagrant to-aws-flow
Vagrant to-aws-flow
 
Vagrant for Virtualized Development
Vagrant for Virtualized DevelopmentVagrant for Virtualized Development
Vagrant for Virtualized Development
 
Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))
 
A Presentation about Puppet that I've made at the OSSPAC conference
A Presentation about Puppet that I've made at the OSSPAC conferenceA Presentation about Puppet that I've made at the OSSPAC conference
A Presentation about Puppet that I've made at the OSSPAC conference
 
Packer
Packer Packer
Packer
 
Docker toolbox
Docker toolboxDocker toolbox
Docker toolbox
 
Using Puppet in Small Infrastructures
Using Puppet in Small InfrastructuresUsing Puppet in Small Infrastructures
Using Puppet in Small Infrastructures
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 

Similaire à Deployment automation

Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developerPaul Czarkowski
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platformnirajrules
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for DevelopersJohn Coggeshall
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and dockerFabio Fumarola
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Fabrice Bernhard
 
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdfNigussMehari4
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java binOlve Hansen
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for DevelopersJohn Coggeshall
 
A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to KubernetesPaul Czarkowski
 
Azure Bootcamp 2016 - Docker Orchestration on Azure with Rancher
Azure Bootcamp 2016 - Docker Orchestration on Azure with RancherAzure Bootcamp 2016 - Docker Orchestration on Azure with Rancher
Azure Bootcamp 2016 - Docker Orchestration on Azure with RancherKarim Vaes
 
Automation - fabric, django and more
Automation - fabric, django and moreAutomation - fabric, django and more
Automation - fabric, django and moreIlian Iliev
 
Setting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntuSetting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntukesavan N B
 
Omaha (Google Update) server
Omaha (Google Update) serverOmaha (Google Update) server
Omaha (Google Update) serverDmitry Lyfar
 
AWS re:Invent 2016: Deploying and Managing .NET Pipelines and Microsoft Workl...
AWS re:Invent 2016: Deploying and Managing .NET Pipelines and Microsoft Workl...AWS re:Invent 2016: Deploying and Managing .NET Pipelines and Microsoft Workl...
AWS re:Invent 2016: Deploying and Managing .NET Pipelines and Microsoft Workl...Amazon Web Services
 

Similaire à Deployment automation (20)

Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developer
 
Automation in Cloud
Automation in CloudAutomation in Cloud
Automation in Cloud
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platform
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and docker
 
Ansible - Hands on Training
Ansible - Hands on TrainingAnsible - Hands on Training
Ansible - Hands on Training
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Django Deployment
Django DeploymentDjango Deployment
Django Deployment
 
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdf
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java bin
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 
A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to Kubernetes
 
iac.pptx
iac.pptxiac.pptx
iac.pptx
 
Azure Bootcamp 2016 - Docker Orchestration on Azure with Rancher
Azure Bootcamp 2016 - Docker Orchestration on Azure with RancherAzure Bootcamp 2016 - Docker Orchestration on Azure with Rancher
Azure Bootcamp 2016 - Docker Orchestration on Azure with Rancher
 
Automation - fabric, django and more
Automation - fabric, django and moreAutomation - fabric, django and more
Automation - fabric, django and more
 
Setting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntuSetting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntu
 
Overview of Docker
Overview of DockerOverview of Docker
Overview of Docker
 
Omaha (Google Update) server
Omaha (Google Update) serverOmaha (Google Update) server
Omaha (Google Update) server
 
Security Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-CodeSecurity Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-Code
 
AWS re:Invent 2016: Deploying and Managing .NET Pipelines and Microsoft Workl...
AWS re:Invent 2016: Deploying and Managing .NET Pipelines and Microsoft Workl...AWS re:Invent 2016: Deploying and Managing .NET Pipelines and Microsoft Workl...
AWS re:Invent 2016: Deploying and Managing .NET Pipelines and Microsoft Workl...
 

Plus de Riccardo Lemmi

Plus de Riccardo Lemmi (7)

Pycon5 creare soundscape con pyo
Pycon5 creare soundscape con pyoPycon5 creare soundscape con pyo
Pycon5 creare soundscape con pyo
 
Introduzione a Python
Introduzione a PythonIntroduzione a Python
Introduzione a Python
 
Open Hardware: Arduino, un prodotto italiano
Open Hardware: Arduino, un prodotto italianoOpen Hardware: Arduino, un prodotto italiano
Open Hardware: Arduino, un prodotto italiano
 
World Plone Day 2009
World Plone Day 2009World Plone Day 2009
World Plone Day 2009
 
Workflow tecnologies
Workflow tecnologiesWorkflow tecnologies
Workflow tecnologies
 
Zodb
ZodbZodb
Zodb
 
Buildout
BuildoutBuildout
Buildout
 

Dernier

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 

Dernier (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

Deployment automation

  • 2. Who am I? ● Python, Zope and Plone Developer (from 2001) ● Sysadmin (Debian, Ubuntu) ● ...but I like to say “Über Developer” ● Metalhead ● Multi-instrumentalist
  • 3. Deployment Automation Or: how to build a complete system from scratch It begins by the requirements to have an installation process easy to repeat, documented and auditable. We are going to discuss about ● "Vagrant” to create virtual machine, ● "fabric" to automate operations ● and the tools to deploy on Amazon Web Services (AWS)
  • 4. Motivation To find an easy way to reproduce the installation process, so our co-workers can replicate the deployment without pain.
  • 5. Some definitions SW deployment Software deployment is the set of all the activities that make a software system available for use "Deployment" should be interpreted as a general process that has to be customized according to specific requirements or characteristics.
  • 6. Some definitions Deployment activities Release It follows from the completed development process Installation It can vary from simple to a complex set of activities and it can involve continuous delivery
  • 7. Some definitions Deployment activities Update It replaces an earlier version of sw with a newer release Continuous delivery It produces software in short cycles, ensuring that the software can be reliably released at any time
  • 8. Employed Tools ● Vagrant ● Fabric ● AWS ● Boto3 / AWS CLI
  • 9. Vagrant What is it? It is a tool to manage Virtual Machines and Containers and a repository of pre-installed VM
  • 10. Vagrant: some definitions "Provisioners" Tools like Puppet, Chef and Ansible but I use Fabric They run commands on a machine "Providers" Providers are the services that Vagrant uses to set up and create virtual environments (VirtualBox, Hyper-V, and Docker…)
  • 11. Vagrant: How I use it Choose a pre-installed VM: a Box https://vagrantcloud.com/boxes/search Initialize the machine: $ vagrant init ubuntu/bionic64
  • 12. Vagrant: How I use it The ‘init’ command create a Vagrantfile Vagrant.configure("2") do |config| config.vm.box = "ubuntu/bionic64" end where one can configure some parameters as # of cpus and memory size
  • 13. Vagrant: How I use it Start the VM with: $ vagrant up then login $ vagrant ssh and stop it $ vagrant halt
  • 14. Fabric: What is it? It is a python library It is designed to execute shell commands remotely over SSH connection It is similar to Ansible more than Chef or Puppet It uses “Invoke” library to manage shell command execution It uses “Paramiko” library to manage low/mid level SSH functionality
  • 15. Fabric: How I use it To install packages Configure servers (as apache, monit, postfix, slapd) Compile sources Run buildouts
  • 16. Fabric: How I use it Ansible terminology Control machine Machine from where we can manage other machines. Remote machine Machines which are handled/controlled by control machine.
  • 17. Fabric: Basics The most basic use of Fabric is: to execute a shell command on a remote system via SSH, then check the result. Other typical operations are: ● interact with some cli commands (with Responder) ● transfer files ● run the same commands on multiple machines
  • 18. Fabric: Methods Run It is the simplest method: run a single command on a server: from fabric import Connection server = Connection('web1') result = server.run('hostname') if result.ok: ...
  • 19. Fabric: Methods Sudo To run commands as the remote system's superuser server.sudo('useradd axa') server.sudo('mkdir /opt/aws') server.sudo('apachectl restart')
  • 20. Fabric: Methods Put Send a file to the server server.put('apache2.conf', remote='/etc/apache2/')
  • 21. Fabric: More Libraries ● Fabtools ● Cuisine
  • 22. Fabric: Fabtools https://fabtools.readthedocs.io/ It provides methods to manage system users, packages, databases, etc. The 'require' methods are a declarative style similar to Chef or Puppet.
  • 23. Fabric: Fabtools Some modules: ● fabtools.require.apache ● fabtools.require.git ● fabtools.require.groups ● fabtools.require.nodejs ● fabtools.require.postfix ● fabtools.require.postgres ● fabtools.require.python ● fabtools.require.system ● fabtools.require.users
  • 24. Fabric: Fabtools Examples fabtools.require.apache.server() Require the Apache HTTP server to be installed and running. fabtools.require.users.user('axa') Require a user and its home directory. fabtools.require.postgres.database('userdb', 'axa') Create a Database in postgres
  • 25. Fabric: Cuisine https://github.com/sebastien/cuisine It has some methods similar to fabtools (Chef-like) It provides common administration operations such as: ● file/dir operations ● user/group creation ● package install/upgrade
  • 26. Fabric: Cuisine Methods text_* Text-processing functions file_* File operations dir_* Directory operations
  • 27. Fabric: Cuisine Methods package_* Package management operations command_* Shell commands availability user_* User creation commands
  • 28. Fabric: Cuisine Methods group* Group creation commands mode_* Configures cuisine's behaviour within the current session. select_* Selects a specific option, such as package back-end (apt, yum, zypper, or pacman)
  • 29. Fabric: Cuisine Examples file_update( "/etc/monit/monitrc", lambda _:text_replace_line( _, "# with start delay 240 # optional: delay the first check by 4-minutes (by ", " with start delay 60", )[0] )
  • 30. Fabric: Cuisine Examples user_ensure('axa') Ensures that the given users exists, optionally updating their passwd/home/uid/gid/shell. package_ensure('imagemagick') Tests if the given package is installed, and installs it in case it's not already there.
  • 31. Fabric example from fabric.api import task, run @task def check_system(): """ """ run('uname -a') run('lsb_release -a') run('hostnamectl status') $ fab -H sanctuary check_system
  • 32. Amazon Web Services (AWS) Motivations To deploy production and stage machines in a simple and replicable way With the chance to choose and change the size of the machine whenever required (cpu, ram, disk)
  • 33. AWS: What is it "Amazon Web Services offers a broad set of global cloud-based products including compute, storage, databases, analytics, networking, mobile, developer tools, management tools, IoT, security and enterprise applications."
  • 34. AWS: How I use it EC2, EBS and EIP for the most Snapshots as simple backup tool Security group rules as a firewall to control traffic … and more
  • 35. AWS: How do I create a machine? ● Boto3 ● AWS CLI
  • 36. AWS: Why scripting installation? To have “Infrastructure as code” so: "...the process of managing and provisioning computer data centers through machine-readable definition files, rather than physical hardware configuration or interactive configuration tools."
  • 37. AWS: Boto3 "Boto is the Amazon Web Services (AWS) SDK for Python. It enables Python developers to create, configure, and manage AWS services, such as EC2 and S3. Boto provides an easy to use, object-oriented API, as well as low-level access to AWS services."
  • 38. AWS: Boto3 - How I use it Boto3 is a library providing methods to create and configure resources ● EC2 Elastic Compute Cloud ● EBS Elastic Block storage ● EIP Elastic IP ● CF Cloud Front (CDN: Content Delivery Network) ● RDS Relational Database
  • 39. AWS: Boto3 - Examples Show status and parameters of all instances ec2 = boto3.client('ec2') response = ec2.describe_instances() print(response)
  • 40. AWS: Boto3 - Examples Create an Instance ec2 = boto3.client('ec2') ec2.run_instances( ImageId='ami-0286372f78291e588', InstanceType='t2.nano', ...)
  • 41. AWS: Boto3 - Examples Create a volume ec2 = boto3.client('ec2') volume = ec2.create_volume( AvailabilityZone='eu-west-1a', Size=50, VolumeType='gp2', ...)
  • 42. AWS: Boto3 - Examples Start EC2 Instance ec2 = boto3.client('ec2') ec2.start_instances(InstanceIds=[instance_id])
  • 43. AWS: AWS CLI The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. The commands are the same available in boto3 but they can be used from bash scripts. How to install it: $ pip install awscli Yes, it is in Python and it is based on boto3!