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 now
APIs which allow installing or cloning
Introducing Cyclone Drupal contrib module Open source Jenkins scripts http://drupal.org/projects/cyclone http://github.com/morpht/cyclone-jenkins
Architecture
Demo User provisioning a site with Cyclone
Platform APIs
.+. .+?: .+??. ??? . +???. +?????????=. .???????????. .????????????. ########### ######## ############.#######. ####### #### ....... ######## #### ####### 50 41 4E 54 48 45 4F 4E #########.####.###### _____________ __ ________ ____ ______ ###### ... /_ __/ __/ _ \/ |/ / _/ |/ / / / / __/ #######.??.########## / / / _// , _/ /|_/ // // / /_/ /\ \ #######~+??.######### /_/ /___/_/|_/_/ /_/___/_/|_/\____/___/ ########.??.. #########.??.#######. #########.+?? ######. .+?. .????????????. +??????????, .????++++++. ????. .???, .~??. .?? .?,.
Terminus (Pantheon) ● Command Line Interface (CLI) ● Drush plugin ● Open-source https://github.com/pantheon-systems/terminus
CLI version of Pantheon ● Create new sites. ● Deploy code. ● Sync environments. ● Perform backup on demand. ● Connect to services: database, filesystem.
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
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>
Pantheon heads up Upstream repos are coming! https://groups.google.com/a/getpantheon.com/forum/#!forum/engineering-talk
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
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
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
Cyclone methods for Aegir site_create ● clone <src_site> <new_site> ● install <platform_alias> <inst_profile> <new_site> site_destroy <site>
Cyclone The contrib project
Demo A walkthrough of the backend UI
ctools plugins Making things extensible
Builders $plugin = array( 'name' => 'cyclone_builder_jenkins', 'label' => t('Jenkins Builder'), 'description' => t("Builds sites with Jenkins."), 'handler' => array( 'class' => 'CycloneJenkinsBuilder', ), );
Webhook: Jenkins talks to Cyclone
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' => 'CycloneStatus Processor ', ), );
Objective 1 No hacky Jenkins scripts
Cyclone Jenkins Builders Cyclone cyclone_jenkins/cyclone/builders.py passes the class Aegir(Builder): def __init__(self, provider): Builder def site_create(self, site_id, target, params, extensions): def site_destroy(self, site_id, target, params, extensions): class as a class Pantheon(Builder): string down def __init__(self, provider): to Cyclone def site_create(self, site_id, target, params, extensions): def site_destroy(self, site_id, target, params, extensions): Jenkins.
Objective 2 Easily extensible
Extensible Extensions ;-) Cyclone cyclone_jenkins/cyclone/extensions.py passes the class Variables(Extension): def extend(self, ext_params): Extension class Enable(Extension): class as a def extend(self, ext_params): class Disable(Extension): string down def extend(self, ext_params): to Cyclone class SomethingReallyBespoke(Extension): def extend(self, ext_params): Jenkins.
Cyclone Jenkins The backend companion https://github.com/morpht/cyclone-jenkins
Why Jenkins? ● Auditing ● Serialise jobs ● Security
Jenkins security: a few worries ● Superpowers ● No SSL with basic auth ● Logged in users often can do anything ● Anonymous user can see too much
Jenkins hardening tips ● HTTPS offloader ● firewall when possible ● user TOKENS for evoking scripts ● use the LTS Jenkins version, installed from a package
Conclusion User provisioned sites
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.
Drupal site showcase Not trivial to set up Jenkins. Agencies can try out Cyclone. Proof of concept. http://drupal.site-showcase.com
The future ● Refactoring is required. ● Stabilise code for current providers. ● Integrate new providers: ○ Acquia ○ Aberdeen ● Helpful extensions
Thanks Murray Woodman (@murrayw) Marji Cermak (@cermakm) Ivan Zugec (@zugec) Morpht (@morphtmedia) Slides http://tinyurl.com/cyclone-project
Recommend
More recommend