Try before you buy User provisioned sites targeting multiple - - PowerPoint PPT Presentation

try before you buy
SMART_READER_LITE
LIVE PREVIEW

Try before you buy User provisioned sites targeting multiple - - PowerPoint PPT Presentation

Try before you buy User provisioned sites targeting multiple providers Murray Woodman, Marji Cermak February 15, 2014 How did we get here? How can we make it easy for users to spin up sites? Drupal As A Service There are lots of options


slide-1
SLIDE 1

Try before you buy

User provisioned sites targeting multiple providers

Murray Woodman, Marji Cermak February 15, 2014

slide-2
SLIDE 2

How did we get here?

slide-3
SLIDE 3

How can we make it easy for users to spin up sites?

slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6

Drupal As A Service There are lots of options now

slide-7
SLIDE 7
slide-8
SLIDE 8
slide-9
SLIDE 9
slide-10
SLIDE 10
slide-11
SLIDE 11
slide-12
SLIDE 12

APIs which allow installing or cloning

slide-13
SLIDE 13

Introducing Cyclone

Drupal contrib module Open source Jenkins scripts

http://drupal.org/projects/cyclone http://github.com/morpht/cyclone-jenkins

slide-14
SLIDE 14

Architecture

slide-15
SLIDE 15

Demo

User provisioning a site with Cyclone

slide-16
SLIDE 16

Platform APIs

slide-17
SLIDE 17

.+. .+?: .+??. ??? . +???. +?????????=. .???????????. .????????????. ########### ######## ############.#######. ####### #### ....... ######## #### ####### 50 41 4E 54 48 45 4F 4E #########.####.###### _____________ __ ________ ____ ______ ###### ... /_ __/ __/ _ \/ |/ / _/ |/ / / / / __/ #######.??.########## / / / _// , _/ /|_/ // // / /_/ /\ \ #######~+??.######### /_/ /___/_/|_/_/ /_/___/_/|_/\____/___/ ########.??.. #########.??.#######. #########.+?? ######. .+?. .????????????. +??????????, .????++++++. ????. .???, .~??. .?? .?,.

slide-18
SLIDE 18

Terminus (Pantheon)

  • Command Line Interface (CLI)
  • Drush plugin
  • Open-source

https://github.com/pantheon-systems/terminus

slide-19
SLIDE 19

CLI version of Pantheon

  • Create new sites.
  • Deploy code.
  • Sync environments.
  • Perform backup on demand.
  • Connect to services: database, filesystem.
slide-20
SLIDE 20

Terminus session

$ drush pantheon-auth $ drush pantheon-site-create my-site --label='My Site' -- product=21e1fada-199c-492b-97bd-0b36b53a9da0 $ drush pantheon-aliases $ drush -y @pantheon.my-site.dev si --site-name='My site' pantheon $ drush -y @pantheon.my-site.dev en views ctools $ drush psite-dash my-site -y $ drush psite-clone $SITE_UUID dev test

slide-21
SLIDE 21

Cyclone methods for Pantheon

site_create

  • import <archive_url> <new_site>
  • install <product_id> <inst_profile> <new_site>
  • clone <src_site> <new_site>

site_destroy <site>

slide-22
SLIDE 22

Pantheon heads up

Upstream repos are coming!

https://groups.google.com/a/getpantheon.com/forum/#!forum/engineering-talk

slide-23
SLIDE 23

Provision (Aegir)

A backend component of the Aegir hosting system. https://drupal.org/project/provision Access functionality via drush.

  • manage drush aliases
  • provision sites
  • delete sites
  • perform backup on demand

https://drupal.org/project/provision

slide-24
SLIDE 24

Provision (Aegir)

Clone an existing site

$ drush @wellington.cyclone.morpht.com provision-clone @my- wellington.cyclone.morpht.com $ drush @hostmaster hosting-task --force @platform_drupal726 verify https://drupal.org/project/provision

slide-25
SLIDE 25

Provision (Aegir)

Install a new site from installation profile

$ drush provision-save @kiwi.cyclone.morpht.com

  • -context_type=site --uri=kiwi.cyclone.morpht.com
  • -platform=@platform_drupal726 --profile=standard
  • -db_server=@server_localhost --client_name=admin

$ drush @kiwi.cyclone.morpht.com provision-install $ drush @hostmaster hosting-task

  • -force @platform_drupal726 verify

https://drupal.org/project/provision

slide-26
SLIDE 26

Cyclone methods for Aegir

site_create

  • clone <src_site> <new_site>
  • install <platform_alias> <inst_profile> <new_site>

site_destroy <site>

slide-27
SLIDE 27

Cyclone The contrib project

slide-28
SLIDE 28

Demo

A walkthrough of the backend UI

slide-29
SLIDE 29

ctools plugins

Making things extensible

slide-30
SLIDE 30

Builders

$plugin = array( 'name' => 'cyclone_builder_jenkins', 'label' => t('Jenkins Builder'), 'description' => t("Builds sites with Jenkins."), 'handler' => array( 'class' => 'CycloneJenkinsBuilder', ), );

slide-31
SLIDE 31

Webhook: Jenkins talks to Cyclone

slide-32
SLIDE 32

webhook module

$plugin = array( 'title' => t('URL encoded key=value'), 'handler' => array( 'class' => 'Webhook_Plugins_Unserializer_UrlEncoded', ), ); $plugin = array( 'title' => t('Cyclone Status Processor'), 'handler' => array( 'class' => 'CycloneStatusProcessor', ), );

slide-33
SLIDE 33

No hacky Jenkins scripts

Objective 1

slide-34
SLIDE 34

Cyclone passes the Builder class as a string down to Cyclone Jenkins.

Cyclone Jenkins Builders

cyclone_jenkins/cyclone/builders.py class Aegir(Builder): def __init__(self, provider): def site_create(self, site_id, target, params, extensions): def site_destroy(self, site_id, target, params, extensions): class Pantheon(Builder): def __init__(self, provider): def site_create(self, site_id, target, params, extensions): def site_destroy(self, site_id, target, params, extensions):

slide-35
SLIDE 35

Easily extensible

Objective 2

slide-36
SLIDE 36

Cyclone passes the Extension class as a string down to Cyclone Jenkins.

Extensible Extensions ;-)

cyclone_jenkins/cyclone/extensions.py class Variables(Extension): def extend(self, ext_params): class Enable(Extension): def extend(self, ext_params): class Disable(Extension): def extend(self, ext_params): class SomethingReallyBespoke(Extension): def extend(self, ext_params):

slide-37
SLIDE 37

Cyclone Jenkins

The backend companion

https://github.com/morpht/cyclone-jenkins

slide-38
SLIDE 38

Why Jenkins?

  • Auditing
  • Serialise jobs
  • Security
slide-39
SLIDE 39

Jenkins security: a few worries

  • Superpowers
  • No SSL with basic auth
  • Logged in users often can do anything
  • Anonymous user can see too much
slide-40
SLIDE 40

Jenkins hardening tips

  • HTTPS offloader
  • firewall when possible
  • user TOKENS for evoking scripts
  • use the LTS Jenkins version, installed from a package
slide-41
SLIDE 41

Conclusion

User provisioned sites

slide-42
SLIDE 42

Who is this for?

  • Trainers can provide sandboxes for education.
  • Agencies can demo for leads.
  • Entrepreneurs can provide subscription services.
  • Institutions can give power to departments.
  • Evangelists can expose new users to Drupal.
slide-43
SLIDE 43

Drupal site showcase

Not trivial to set up Jenkins. Agencies can try out Cyclone. Proof of concept. http://drupal.site-showcase.com

slide-44
SLIDE 44

The future

  • Refactoring is required.
  • Stabilise code for current providers.
  • Integrate new providers:

○ Acquia ○ Aberdeen

  • Helpful extensions
slide-45
SLIDE 45

Thanks

Murray Woodman (@murrayw) Marji Cermak (@cermakm) Ivan Zugec (@zugec) Morpht (@morphtmedia)

Slides

http://tinyurl.com/cyclone-project