Upload
silicon-comte
View
134
Download
4
Embed Size (px)
Citation preview
Développeurs,Gagnez du temps
avec le CloudChristophe Bliard •
Développeur
@cbliard
Hiptest
Photo par lennysan https://www.flickr.com/photos/lennysan/4403695597/
PlanCloud ?
Notre usage
Autres usages
Cloud ComputingIaaS, PaaS, SaaS ?
wtf ?...
Pizza !Faite
maisonPrête à
cuireLivrée àdomicile
Sortierestaurant
Couverts
Vous
Vous
Vous
Vendeur
Huile piquante
Électricité/Gaz
Vendeur
Cuisson
Four
Fromage
VendeurGarniture
Sauce tomate
Pâte à pizza
Photo par djwtwo https://www.flickr.com/photos/djwtwo/9864611814/
Idée originale d'Albert Barron, Sr. Software Client Architect à IBM
Logiciel !Sur site Infrastructure
as a ServicePlatform
as a ServiceSoftware
as a Service
Applications
Vous
Vous
Vous
Vendeur
Données
Runtime
Middleware
Vendeur
Système (OS)
Virtualisation
Réseau
VendeurStockage
Serveurs
Photo par camknows https://www.flickr.com/photos/camknows/3726757043/
Autres aspectsCloud public/privé
Paiement à l'usage
Mise à jour en continu
Flexibilité
ATAWAD
Plateforme SaaS de gestion de tests d'applications Web etmobile pour tester au rythme des équipes agiles.
Mesurer, c'est un métier
Photo par orkomedix https://www.flickr.com/photos/orkomedix/4413901705/
“Constantly monitoring your applicationsso you don’t have to.”
Vue d'ensemble
Répartition du temps
Arborescence temporelle
Métriques serveurs
“Platform for hosting Ruby and Ruby on Rails apps,focusing on the developers happiness.”
Prix
20 € offerts à l'inscription
ConfigurationFichier Cloudfile
hiptest: ruby_version: 2.1.5 environment: production # RAILS_ENV domains: hiptest.shellyapp.com hiptest.net www.hiptest.net servers: app1: size: small thin: 2 app2: size: small thin: 2 job1: size: small whenever: on delayed_job: 2 store: size: large databases: postgresql elasticsearch: on
Modificationhiptest: ruby_version: 2.1.5 environment: production # RAILS_ENV domains: hiptest.shellyapp.com hiptest.net www.hiptest.net servers: app1: size: small thin: 2 app2: size: small thin: 2 job1: size: small whenever: on delayed_job: 2 store: size: large databases: postgresql elasticsearch: on
hiptest: ruby_version: 2.1.5 environment: production # RAILS_ENV domains: hiptest.shellyapp.com hiptest.net www.hiptest.net servers: app1: size: small thin: 2 app2: size: small thin: 2 job1: size: small whenever: on delayed_job: 2 store: size: small databases: postgresql esearch: size: small elasticsearch: on
On modifie et on pousse
shellyCommander son appli du bout des doigts
$ gem install shelly
Connecter son dépôt git$ shelly register [email protected]: [enter your password]Password confirmation: [enter your password]
Uploading your public SSH key from /home/cbliard/.ssh/id_rsa.pubSuccessfully registered!Check you mailbox for email address confirmation
$ shelly setupSetting up example cloud
Running: git remote add shelly [email protected]:example.gitRunning: git fetch shelly
Your application is set up.
Déployer son application enproduction
$ git push shelly masterCounting objects: 17, done.Delta compression using up to 8 threads.Compressing objects: 100% (10/10), done.Writing objects: 100% (10/10), 1.04 KiB | 0 bytes/s, done.Total 10 (delta 8), reused 0 (delta 0)
> Received push to cloud 'hiptest' > Checking Gemfile > Creating code package... done. > Deploying your application > Deployment on server app1 started > Deployment on server app1 finished > Deployment on server job1 started > Deployment on server app2 started > Deployment on server job1 finished > Deployment on server app2 finished
> Deployment successfulTo [email protected]:hiptest.git 3d493f5..7e12026 master > master
Logs du déploiement$ shelly deploys show lastLog for deploy done on 20150326 at 11:28:03Starting processesEye started! ㋡Config loaded!Starting 'rake jobs:work' was successfulWhenever[write] crontab file updated# Begin Whenever generated tasks for: /home/app/app/releases/3d493f57740dcc1b6b959faeee30dfbd7e3713de/config/schedule.rb0 6 * * * /bin/bash l c 'cd /home/app/app/releases/3d493f57740dcc1b6b959faeee30dfbd7e3713de && RAILS_ENV=production bundle exec rake intercom:notify silent >> whenever.log 2>&1'
# End Whenever generated tasks for: /home/app/app/releases/3d493f57740dcc1b6b959faeee30dfbd7e3713de/config/schedule.rbRunning after successful deploy hookI, [20150326T11:31:22.722120 #3547] INFO : Notifying Appsignal of deploy with: revision: 3d493f57740dcc1b6b959faeee30dfbd7e3713de, user: [email protected], [20150326T11:31:22.777596 #3547] INFO : Appsignal has been notified of this deploy!
Informations$ shelly infoCloud hiptest: Region: EU State: running
Deployed commit sha: 3d493f57740dcc1b6b959faeee30dfbd7e3713de Deployed commit message: Enhance production exception visibility Deployed by: [email protected]
Repository URL: [email protected]:hiptest.git Web server IP: 178.32.77.22, 178.32.77.22
Usage: Filesystem: Current: 2.35 GiB Average: 2.33 GiB Database: Current: 864.65 MiB Average: 817.97 MiB Traffic: Incoming: 3.74 GiB Outgoing: 8.94 GiB Total: 12.68 GiB
Statistics: app1: Load average: 1m: 0.42, 5m: 0.16, 15m: 0.09 CPU: 0.0%, MEM: 63.5%, SWAP: 6.0% app2: Load average: 1m: 0.01, 5m: 0.02, 15m: 0.05 CPU: 0.0%, MEM: 69.4%, SWAP: 6.0%
Logs applicatifsVoir$ shelly logs latest
Récupérer$ shelly logs getTime: 00:00:03 [====================================] 100% Progress | Time: 00:00:03
Log file saved to hiptest.log20150327.gz
À une date précise$ shelly logs get 26032015Time: 00:00:05 [====================================] 100% Progress | Time: 00:00:05
Log file saved to hiptest.log20150326.gz
Accès ssh$ shelly [email protected] [production] ~/app/current $
Sur un hôte particulier$ shelly ssh server [email protected] [production] ~/app/current $
ConsoleRails$ shelly consoleLoading production environment (Rails 4.0.13)2.1.5 :001 >
PostgreSQL$ shelly dbconsolepsql (9.3.5)Type "help" for help.
hiptest=#
Backups de base de donnéesLister$ shelly backup list c hiptestShowing only last 10 backups.Use all or a option to list all backups.
Filename | Size | State 2015.03.23.17.02.26.hiptest.postgresql.tar | 80 MiB | completed 2015.03.24.05.03.10.hiptest.postgresql.tar | 80 MiB | completed 2015.03.24.17.02.32.hiptest.postgresql.tar | 80 MiB | completed 2015.03.25.05.05.24.hiptest.postgresql.tar | 80 MiB | completed 2015.03.25.17.02.51.hiptest.postgresql.tar | 80 MiB | completed 2015.03.26.05.10.46.hiptest.postgresql.tar | 80 MiB | completed 2015.03.26.10.15.33.hiptest.postgresql.tar | 80 MiB | completed 2015.03.26.17.02.43.hiptest.postgresql.tar | 80 MiB | completed 2015.03.27.05.04.54.hiptest.postgresql.tar | 80 MiB | completed
Récupérer le dernier$ shelly backup getTime: 00:00:34 [================================] 100% Progress | Time: 00:00:34
Backup file saved to 2015.03.27.05.04.54.hiptest.postgresql.tar
Lancer une sauvegarde$ shelly backup create postgresqlBackup requested. It can take up to several minutes for the backup process to finish.
$ shelly backup listShowing only last 10 backups.Use all or a option to list all backups.
Filename | Size | State 2015.03.24.17.02.32.hiptest.postgresql.tar | 80 MiB | completed 2015.03.25.05.05.24.hiptest.postgresql.tar | 80 MiB | completed 2015.03.25.17.02.51.hiptest.postgresql.tar | 80 MiB | completed 2015.03.26.05.10.46.hiptest.postgresql.tar | 80 MiB | completed 2015.03.26.10.15.33.hiptest.postgresql.tar | 80 MiB | completed 2015.03.26.17.02.43.hiptest.postgresql.tar | 80 MiB | completed 2015.03.27.05.04.54.hiptest.postgresql.tar | 80 MiB | completed 2015.03.27.17.02.20.hiptest.postgresql.tar | 80 MiB | completed . | | in progress
# quelques minutes plus tard...$ shelly backup listShowing only last 10 backups.Use all or a option to list all backups.
Filename | Size | State 2015.03.24.17.02.32.hiptest.postgresql.tar | 80 MiB | completed 2015.03.25.05.05.24.hiptest.postgresql.tar | 80 MiB | completed 2015.03.25.17.02.51.hiptest.postgresql.tar | 80 MiB | completed 2015.03.26.05.10.46.hiptest.postgresql.tar | 80 MiB | completed 2015.03.26.10.15.33.hiptest.postgresql.tar | 80 MiB | completed 2015.03.26.17.02.43.hiptest.postgresql.tar | 80 MiB | completed 2015.03.27.05.04.54.hiptest.postgresql.tar | 80 MiB | completed 2015.03.27.17.02.20.hiptest.postgresql.tar | 80 MiB | completed 2015.03.27.17.09.30.hiptest.postgresql.tar | 80 MiB | completed
Restaurer une sauvegarde (doc officielle)$ shelly backup restore 2011.11.26.04.00.10.foo.postgresql.tar.gzYou are about restore database postgres for cloud todolisttest to state from2011.11.26.04.00.10.foo.postgresql.tar.gz
I want to restore the database (yes/no): yesRestore has been scheduled. Wait few minutes till database is restored.
Configuration SSLCréation d'un point d'entrée$ shelly endpoint createEndpoint was created for your cloudPoint your domain to private IP address: 10.0.0.1
Voir le point d'entrée créé$ shelly endpoint listAvailable HTTP endpoints
UUID | IP address | Certificate | SNI afef15709e9948368c87c997d736506f | 10.0.0.1 | ✗ | ✗
Ajout du certificat SSL$ shelly endpoint update afef15709e9948368c87c997d736506f server.crt server.keyEndpoint was updatedDeployed certificate on front end servers.Point your domain to private IP address: 10.0.0.1
Et d'autres...$ shelly helpTasks: shelly add # Add a new cloud shelly backup <command> # Manage database backups shelly check # Check if application fulfills Shelly Cloud requirements shelly config <command> # Manage application configuration files shelly console # Open application console shelly database <command> # Manage databases shelly dbconsole # Run rails dbconsole shelly delete # Delete the cloud shelly deploy <command> # View deploy logs shelly endpoint <command> # Manage application HTTP(S) endpoints shelly file <command> # Upload and download files to and from persistent storage shelly help [TASK] # Describe available tasks or one specific task shelly info # Show basic information about cloud shelly list # List available clouds shelly login [EMAIL] # Log into Shelly Cloud shelly logout # Logout from Shelly Cloud shelly logs <command> # View application logs shelly maintenance <command> # Mange application maintenance events shelly mongoconsole # Run MongoDB console shelly open # Open application page in browser shelly organization <command> # View organizations shelly rake TASK # Run rake task shelly redeploy # Redeploy application shelly rediscli # Run rediscli shelly register [EMAIL] # Register new account shelly setup # Set up git remotes for deployment on Shelly Cloud shelly ssh # Log into virtual server shelly start # Start the cloud shelly stop # Shutdown the cloud
Ship fast, evolve faster
Page d'accueil
Tableau de bord
Configuration • shippable.yml# Configuration file for Shippable# Shippable provides continuous integration in the cloudbuild_environment: ubuntu1204language: rubyrvm: 2.1.5
# Enable cached containers, reset with [reset_minion] in commit message.cache: true# Enable archiving the shippable/ directory as an artifact to downloadarchive: true
services: # sets elasticsearch on localhost, port 9200 elasticsearch
script: rm f log/test.log bin/rspec format RspecJunitFormatter out shippable/testresults/rspec.xml
# http://docs.shippable.com/en/latest/config.html#emailnotificationnotifications: email: recipients: [email protected] on_success: change on_failure: always
Personnalisation • shippable.ymlenv: global: # devise_secret_token secure: pGUq5116iDVWh6R4/ZOfPxIZj8Vqn4FXS6jmZKyHk99ln20EWX4Ie2xsPSwgFJcOFA==
branches: only: master
before_install: # make chromedriver available "curl o /tmp/chromedriver.zip L http://chromedriver.storage.googleapis.com/2.10/chromedriver_linux64.zip" "unzip o /tmp/chromedriver.zip d /home/shippable/bin" "chmod +x /home/shippable/bin/chromedriver" "printf '#!/bin/bash\nexec /usr/bin/chrome nosandbox disablegpu \"$@\"\n' | sudo tee /usr/bin/googlechrome" "sudo chmod +x /home/shippable/bin/chromedriver /usr/bin/googlechrome"
before_script: "export DISPLAY=:99.0" "/etc/init.d/xvfb start"
after_script: "/etc/init.d/xvfb stop"
after_success: # push to production "git push shelly master"
after_failure: # save some test logs "mv log/test.log shippable/"
Résultats
Ship better code, faster.
Page d'accueil
Tableau de bord
Configuration • circle.yml# Setup servicesdependencies: post: # install custom version of elasticsearch # See https://circleci.com/docs/installingelasticsearch wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch1.0 tar xvf elasticsearch1.0.3.tar.gz elasticsearch1.0.3/bin/elasticsearch: {background: true} sleep 10 # wait elasticsearch start
test: override: "bundle exec rspec": timeout: 3600
Résultats
Your Ruby apps can run smoother.
Que retenir de notre évolution ?Maintenance fortement réduite
Meilleure focalisation sur notre métier
Coût similaire
Plus de fonctionnalités
Plus flexible
Moins de contrôle
Sécurité des données
Autres acteurs ?
paasify.it
Quelques PaaS
Heroku
Scalingo
Deliverous
Clever Cloud
Firebase
Quelques SaaSMonitoring
Skylight
Datadog
Quelques SaaSDéveloppement
Cloud9
Nitrous
Codebox
Quelques SaaSHébergement
GitHub Pages
Slidedeck.io
Quelques SaaSHébergement de code
GitHub
Bitbucket
Quelques SaaSGestion de projet
Trello
Quelques SaaSEnvoi d'emails
Mailjet
Quelques SaaSGestion de logs
loggly
papertrail
Quelques SaaSGestion d'erreurs
Honeybadger
bugsnag
Raygun
Quelques SaaSRecherche temps réel
Algolia
Quelques SaaSQualité
Travis CI
Code Climate
Quelques SaaSRelation client
Zopim
Intercom
FinDes questions ?
Christophe Bliard • @cbliardcbliard.github.io/cloud-slides
Photo par mohammadali https://www.flickr.com/photos/mfakheri/8873167/