Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità...

30
Metodologie e strumenti a supporto dello sviluppo di soluzioni enterprise Bologna, 05/06/2015 Stefano Monti [email protected] www.epocaricerca.it

Transcript of Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità...

Page 1: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Metodologie e strumenti a supporto dello sviluppo di soluzioni enterprise

Bologna, 05/06/2015Stefano Monti

[email protected]

Page 2: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

Agenda

1. Continuous Integration & Continuous Delivery

2. Seamless local/cloud development

3. The mobile (r-)evolution

Page 3: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

1. Continuous Integration & Continuous Delivery

Page 4: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

Traditional development pipeline

EDIT COMPILE TEST DEPLOYPACKAGE

EDIT COMPILE UNIT TEST DEPLOYPACKAGE INTEGRATION TEST

RELEASE

RELEASE

LOCAL SERVER

REMOTE SERVER

Page 5: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

Traditional development pipeline

EDIT COMPILE TEST DEPLOYPACKAGE

EDIT COMPILE UNIT TEST DEPLOYPACKAGE INTEGRATION TEST

RELEASE

RELEASE

LOCAL SERVER

REMOTE SERVER

Page 6: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

CI/CD pipeline (simplified)

EDIT COMPILE UNIT TEST DEPLOYPACKAGE INTEGRATION TEST

EDIT COMPILE UNIT TEST DEPLOYPACKAGE INTEGRATION TEST

SOURCE CODE MANAGEMENT COMPILE UNIT TEST DEPLOYPACKAGE

INTEGRATIONACCEPTANCE

LOADTESTS

RELEASE

CONTINUOUS INTEGRATION ENVIRONMENTS (DEV, STAGING, QA, etc... )

DEVELOPER ENVIRONMENT

CONTINUOUS INTEGRATION ENVIRONMENT

PRODUCTION ENVIRONMENT

CI/CD TOOLS

Page 7: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

Continuous Integration & Continuous Delivery

- adozione di strumenti di Source Code Management (es Mercurial, Git, SVN, …)

- adozione di strumenti di automazione di test distribuiti

- ambienti di test uguali a quelli di produzione

- cloud (IaaS, PaaS) come ambiente ideale per- scalare risorse- replicare ambienti

- ogni build è teoricamente “production-ready”

Page 8: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

CI/CD - benefici

- immediata integrazione sorgenti e risoluzione conflitti

- automatizzazione test di alto livello- integration- performance & load- user acceptance

- replicabilità e garanzia risultati tramite procedure di build e test in ambiente server standard (tipicamente cloud)

Page 9: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

2. Seamless local/cloud development

Page 10: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

Cloud computing

IaaSInfrastructure as a Service

PaaSPlatform as a Service

SaaSSoftware as a Service

Page 11: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

Cloud computing - soluzione o problema?

Soluzione

1. disponibilità on demand2. scalabilità e flessibilità3. virtualizzazione, affidabilità e replica

Page 12: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

Cloud computing - soluzione o problema?

Problema: come gestire scale up dell’infrastruttura?

Problema: come gestire controllo dell’infrastruttura?

Page 13: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

CI/CD TOOLS

Garanzia di configurazione

EDIT COMPILE UNIT TEST DEPLOYPACKAGE INTEGRATION TEST

EDIT COMPILE UNIT TEST DEPLOYPACKAGE INTEGRATION TEST

SOURCE CODE MANAGEMENT COMPILE UNIT TEST DEPLOYPACKAGE RELEASE

STAGING ENVIRONMENT PRODUCTION ENVIRONMENT

Apache Tomcat 6MySQL v.5.1Oracle JDK 1.6OS: Win

Apache Tomcat 7MySQL v.5.5OpenJDK 7OS: Ubuntu Server

Apache Tomcat 7MySQL v.5.5OpenJDK 7OS: Ubuntu Server

INTEGRATIONACCEPTANCE

LOADTESTS

Page 14: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

CI/CD TOOLS

Automazione setup infrastruttura

EDIT COMPILE UNIT TEST DEPLOYPACKAGE INTEGRATION TEST

EDIT COMPILE UNIT TEST DEPLOYPACKAGE INTEGRATION TEST

SOURCE CODE MANAGEMENT

COMPILE UNIT TEST DEPLOYPACKAGE RELEASE

STAGING ENVIRONMENT PRODUCTION ENVIRONMENT

INTEGRATIONACCEPTANCE

LOADTESTS

Page 15: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

Cloud computing - soluzione o problema?

Problema: come gestire scale up dell’infrastruttura?

1. gestione infrastrutture complesse e configurazione server→ Configuration Management (Chef, Puppet, …)

2. controllo e riproducibilità locale/remota→ Platform Provisioning tools (e.g. Vagrant, Vortex)

Page 16: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

CI/CD TOOLS

Automazione setup infrastruttura

EDIT COMPILE UNIT TEST DEPLOYPACKAGE INTEGRATION TEST

EDIT COMPILE UNIT TEST DEPLOYPACKAGE INTEGRATION TEST

SOURCE CODE MANAGEMENT COMPILE UNIT TEST DEPLOYPACKAGE RELEASE

STAGING ENVIRONMENT

PRODUCTION ENVIRONMENT

Configuration Management

Platformprovisioning

Configuration Management

Platformprovisioning

INTEGRATIONACCEPTANCE

LOADTESTS

Page 17: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

Configuration management tools

Obiettivo: facilitare la configurazione ambienti server (locali o in cloud)1. automatizzazione della configurazione server2. approccio dichiarativo e/o procedurale3. integrazione in procedure di build

Page 18: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

Configuration management toolspackage { ' openssh-server':

ensure => installed,}file { '/etc/ssh/sshd_config':

source => 'puppet:///modules/sshd/sshd_config',owner => 'root',group => 'root',mode => '640',notify => Service['sshd'], require => Package['openssh-server'],

}service { ' sshd':

ensure => running,enable => true,hasstatus => true,hasrestart => true,

}

class mysql::server { package { " mysql-server": ensure => installed } package { " mysql": ensure => installed }

service { " mysqld": enable => true, ensure => running, require => Package["mysql-server"], }

file { " /var/lib/mysql/my.cnf": owner => "mysql", group => "mysql", source => "puppet:///mysql/my.cnf", notify => Service["mysqld"], require => Package["mysql-server"], } file { " /etc/my.cnf": require => File["/var/lib/mysql/my.cnf"], ensure => "/var/lib/mysql/my.cnf", }

exec { " set-mysql-password": unless => "mysqladmin -uroot -p$mysql_password status", path => ["/bin", "/usr/bin"], command => "mysqladmin -uroot password $mysql_password", require => Service["mysqld"], }

Puppet configuration file excerpthttp://docs.puppetlabs.com/

Page 19: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

Obiettivo: istanziare infrastrutture server complesse 1. integrazione con Configuration Management tools2. astrazione infrastruttura locale/cloud tramite Virtual Machine

Platform provisioning tools

Page 20: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

Platform Provisioning tool che astrae:- infrastructure provider: supporto trasparente a provider di Virtual Machine

- locali - Virtualbox, VMWare- remote - Amazon EC2, Openstack

- infrastructure provisioning: supporto a Configuration Management tools e/o script a riga di comando

Vagrant

Page 21: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

VagrantVAGRANTFILE_API_VERSION = "2"

Vagrant.configure("2") do |config| config.vm.box =”ubuntu/trusty64”end

$ vagrant init ubuntu/trusty64$ vagrant up --provider virtualbox$ vagrant ssh

Vagrant exampleshttp://docs.vagrantup.

com/v2/getting-started/index.html

$ vagrant init ubuntu/trusty64$ vagrant up --provider aws$ vagrant ssh

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure("2") do |config| config.vm.provider :aws do |aws, override| aws.access_key_id = "XXX" aws.secret_access_key "YYY" aws.keypair_name = "key.pem" aws.region = "eu-west-1" aws.ami = "ami-8e987ef9" aws.instance_type="m1.medium" aws.tags = { 'Name' => 'MyFirstVagrantServer', }

end

Page 22: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

3. The mobile (r)evolution

Page 23: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

CI/CD TOOLS

Mobile landscape

EDIT COMPILE UNIT TEST DEPLOYPACKAGE INTEGRATION TEST

EDIT COMPILE UNIT TEST DEPLOYPACKAGE INTEGRATION TEST

SOURCE CODE MANAGEMENT COMPILE UNIT TEST DEPLOYPACKAGE RELEASE

STAGING ENVIRONMENT PRODUCTION ENVIRONMENT

Configuration Management

Platformprovisioning

INTEGRATIONACCEPTANCE

LOADTESTS

Page 24: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

- eterogeneità device- differenti S.O. e differenti versioni- differenti produttori e librerie proprietarie- differente hardware (es. risoluzione schermo, connettività, ecc…)

- gestione “deploy” su mobile

- approccio sempre più fat client - logica di processamento e interazione su device- backend server (relativamente) meno centrali

Mobile landscape

Page 25: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

- eterogeneità device → infrastrutture Device as a Service per testare in cloud su dispositivi fisici

- gestione “deploy” su mobile → infrastrutture Mobile Device Management per gestire e coordinare piani di rilascio

- approccio sempre più fat client → infrastrutture Mobile Backend as a Service per prototipare e realizzare logica di backend in cloud in maniera semplificata

Mobile landscape

Page 26: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

Mobile landscape

IaaSInfrastructure as a Service

PaaSPlatform as a Service

SaaSSoftware as a Service

(M)BaaSMobile Backend as a Service

DaaSDevice as a Service

MDMMobile Device Management

Page 27: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

Strumenti a supporto della gestione flotte di dispositivi mobile- installazione/rimozione app (anche selettivo)- aggiornamento app (anche selettivo)- multi-OS (Android, iOS, Windows)- gestione sicurezza dispositivo

- blocco e/o wipe in caso di furto- cifratura supporti di memoria- definizione profili d’uso

- modalità cloud (SaaS) oppure on-premise- strumenti open source (es. WSO2 EMM, OpenMEAP) o commerciali (es.

CISCO Meraki, Airwatch, Apple Profile Manager, ecc...)

Mobile Device Management

Page 28: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

Strumenti a supporto della prototipazione e realizzazione rapida di backend- ideali per realizzare app con modelli fortemente fat client (es. backend

solo per memorizzazione remota) con supporto per- cloud database- push notifications- analytics

- modalità cloud (SaaS) e/o on-premise- supporto multi-OS- strumenti open source (es.Baasbox) o commerciali (es. Kinvey, Parse,

Firebase, ecc...)

Mobile Backend as a Service

Page 29: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

Strumenti a supporto del testing rapido su dispositivi mobile- possibilità di testare su numero virtualmente illimitato di dispositivi fisici ed

OS- modalità cloud- supporto multi-OS- strumenti commerciali (es. AppThwack, ecc...)

Device as a Service

Page 30: Metodologie e strumenti a supporto dello sviluppo …...2. controllo e riproducibilità locale/remota → Platform Provisioning tools (e.g. Vagrant, Vortex) Ing. Stefano Monti, Ph.

Ing. Stefano Monti, Ph. D. www.epocaricerca.it

Questions?

Stefano Monti [email protected]