35
Alfresco SPK Design|Run|Integrate Alfresco stacks

Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Embed Size (px)

Citation preview

Page 1: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Alfresco SPK Design|Run|Integrate Alfresco stacks

Page 2: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

A bit about us

Page 3: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

About us

Maurizio (maoo) Pillitu •  Today, 365 days of Alfresco Devops •  Before, 30 months of Alfresco Consultancy •  Creator and maintainer of

–  https://github.com/Alfresco/chef-alfresco –  https://github.com/Alfresco/alfresco-spk

•  Follow –  https://www.alfresco.com/blogs/devops –  https://github.com/maoo

Page 4: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

About us

Alfresco Devops Keep the lights on •  Public services (activiti|my.alfresco.com, Alfresco

Online Trials) •  Internal infrastructure •  Internal projects (QA, Engineering, Sales,

Marketing, ...) Automate all the things •  Mostly inspire •  Sometimes lead •  Never impose

Page 5: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Stack Genesis and Lifecycle

Page 6: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Challenges Stack G

enesis

Where to install Alfresco •  Myriads of Cloud Providers

–  AWS, Rackspace, OpenShift, Tutum, … •  Myriads of Orchestration Tools

–  Cloudformation, Beanstalk, Kubernetes, Terraform, Cloudify/Tosca, Mesos, Brooklyn, …

How to install Alfresco •  Alfresco is highly configurable •  Alfresco is modular

Page 7: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Stack Design Stack G

enesis Alfresco  Share  1  

Alfresco  Share  2  

(E)LB  

User  

Alfresco  Solr  1  

Alfresco  Solr  2  

DB  &  

store  

HTTP  

HTTP  Fail  over  

Page 8: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Instance Lifecycle Stack G

enesis

Root  Image  (distro)   <provision>   <bootstrap>  

<full  provisioning>  

ID IP ID

Stack  Engine  

Alfresco  Instance  

Alfresco  Image  (Dered)  

Stack Genesis

Page 9: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Instance Lifecycle Stack G

enesis

Root  Image  (distro)   <provision>   <bootstrap>  

<full  provisioning>  

ID IP ID

Stack  Engine  

Alfresco  Instance  

Alfresco  Image  (Dered)  

Stack Genesis

Page 10: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Alfresco Installation

Page 11: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Chef Alfresco VS Alfresco Installer – good things •  Cool logo •  (Alfresco) Component-based: repo, share, solr, aos, … •  Additional components: haproxy, nginx, … •  Supports 3 run modes

–  full-provisioning - to spin up an Alfresco instance from a root Image

–  provisioning-only - to create an immutable image –  bootstrap-only - to boot a pre-baked immutable image

•  Any Alfresco configuration can be customised •  Can run continuously (install on top of an installation) •  Artifacts from artifacts.alfresco.com (VS Alfresco Installer

monolithic installation) or any Maven Repository of your choice

•  Open Source, 55 releases, 8 contributors - https://github.com/Alfresco/chef-alfresco

Alfresco Installation

Page 12: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Chef Alfresco VS Alfresco Installer – bad things •  Not working on all platforms (currently working

on Centos 7.1 and Ubuntu 14.04, soon Centos 6.7 and Ubuntu 12/13)

•  artifacts.alfresco.com is (currently) slow, causing longer provisioning runs

•  Not on https://supermarket.chef.io (yet)

Alfresco Installation

Page 13: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Presenting Alfresco SPK

Page 14: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Instance Lifecycle Stack G

enesis

Root  Image  (distro)   <provision>   <bootstrap>  

<full  provisioning>  

ID IP ID

Stack  Engine  

Alfresco  Instance  

Alfresco  Image  (Dered)  

Presenting SPK

Page 15: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Instance Lifecycle Stack G

enesis

Root  Image  (distro)   <provision>   <bootstrap>  

<full  provisioning>  

ID IP ID

Stack  Engine  

Alfresco  Instance  

Alfresco  Image  (Dered)  

2. Build Images

1. Run locally

3. Integrate

Virtualbox/VmWare <or>

AWS/OpenStack/…

Presenting SPK

Page 16: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Alfresco SPK Operations Presenting SPK

Choose    

Browse  stack  templates  provided  by  

SPK  

Run    

Spin  up  a  stack  locally  using  Virtualbox  or  

VmWare  

Build  Images  (op9onal)  

 Define  Alfresco  

immutable  images  

Integrate    

Run  the  cloud  provider  and  

orchestra9on  tool  of  your  choice  

Page 17: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Alfresco SPK Templates

Page 18: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

SPK Templates

Choose – List of Stack templates

Page 19: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

SPK Templates

Choose – community-allinone.json

{ "alfresco-allinone" : { "instance-template" : { "url" : "file://$PWD/instance-templates/allinone-community.json", "overlay" : { "alfresco" : { "install_fonts" : false }

} }, "local-run" : { "memory" : "2048", "cpus" : "2” } ...

Page 20: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

SPK Templates

Choose – community-allinone.json

{ "alfresco-allinone" : { "images" : { "provisioners" : { "selinux-permissive" : "file://$PWD/packer/selinux-permissive-provisioner.json", "chef-alfresco" : "file://$PWD/packer/chef-alfresco-provisioner.json" }, "builders" : { "amazon-ebs" : "file://$PWD/packer/amazon-ebs-builder.json" }, "variables" : { "ami_description" : "Alfresco Community 5.1.c-EA - Allinone Server - {{timestamp}}", "ami_name" : "Alfresco Community 5.1.c-EA - Allinone Server - {{timestamp}}" }

Page 21: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

SPK Templates

Choose – List of instance templates

Page 22: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

SPK Templates

Choose – Allinone Instance template

{ "name": "allinone-community", "nginx" : { "use_nossl_config" : true, "disable_nginx_init" : true }, "alfresco" : { "skip_certificate_creation" : true, "public_protocol" : "http", "public_portssl" : "80" }, "run_list": ["alfresco::default"] }

Page 23: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

SPK Templates

Choose – enterprise-clustered.json

{ "alfresco-share1" : { "instance-template" : { "url" : "file://$PWD/instance-templates/share.json", ... }, "alfresco-share2" : { [same as share1] }, "alfresco-solr1" : { "instance-template" : { "url" : "file://$PWD/instance-templates/solr.json", ... }, "alfresco-solr2" : { [same as solr1]

Page 24: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Run Alfresco SPK

Page 25: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Run SPK

Run – Local stack # Checkout Alfresco SPK project > git clone [email protected]:Alfresco/alfresco-spk.git ; cd alfresco-spk # Choose Enterprise Clustered stack > STACK_INSTANCE_TEMPLATE=file://$PWD/stack-templates/enterprise-clustered.json # Run the stack locally > vagrant up Instance ‘share1’ started! Instance ‘share2’ started! Instance ‘solr1’ started! Instance ‘solr2’ started!

Page 26: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Build images with SPK

Page 27: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Build Images

Build Images # Choose your custom Stack Template > STACK_INSTANCE_TEMPLATE=file://$PWD/stack-templates/my-stack.json

# Build your custom Images > vagrant up build-images EBS AMI for ‘My Alfresco Share Enterprise 5.0.2’ created! EBS AMI for ‘My Alfresco Solr Enterprise 5.0.2’ created!

Docker Image for ‘My Alfresco Share Enterprise 5.0.2’ created! Docker Image for ‘My Alfresco Solr Enterprise 5.0.2’ created!

Page 28: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Integrate Alfresco SPK

Page 29: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Integrate SPK

Integrate – EC2 User Data

#!/bin/bash export FQDN=$(curl http://169.254.169.254/latest/meta-data/public-hostname) cat > $CHEF_LOCAL_YAML_VARS_URL << ENDOFCONTENT --- run_list: ["alfresco::default"] alfresco: public_hostname: '$FQDN' ENDOFCONTENT ... curl -L https://raw.githubusercontent.com/alfresco/alfresco-spk/master/scripts/chef-bootstrap.rb > chef-bootstrap.rb # Run Alfresco installation ruby chef-bootstrap.rb

Full provisioning

Page 30: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Integrate SPK

Integrate – AWS Cloudformation Template

#!/bin/bash cat > $CHEF_LOCAL_YAML_VARS_URL << ENDOFCONTENT --- run_list: ["alfresco::redeploy"] alfresco: public_hostname: '{"Fn::GetAtt": ["ElasticLoadBalancer","DNSName"]}' ENDOFCONTENT ... curl -L https://raw.githubusercontent.com/alfresco/alfresco-spk/master/scripts/chef-bootstrap.rb > chef-bootstrap.rb # Run Alfresco installation ruby chef-bootstrap.rb

Bootstrapping

Page 31: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Wrapping up

Page 32: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Wrapping up

Infrastructure as Code delivered

•  Revamped installation experience

–  Component-based installation –  Controls provisioning and bootstrap phases

https://github.com/Alfresco/chef-alfresco

•  Reusable stack templates •  Reusable images •  Integration with cloud providers and orchestration tools

https://github.com/Alfresco/alfresco-spk

SPK

Page 33: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Wrapping up

Roadmap •  Phase II

–  Support for Centos 6.7 (next 2 weeks) and Ubuntu 12/13 –  Publish Alfresco AMIs for existing instance templates (allinone, share, solr) –  Publish chef-alfresco into Chef Supermarket –  Improved docs for advanced Chef users –  Integrate with SDK

•  Phase III

–  Add support for OVF and Docker –  Certify some SPK stack templates to be Alfresco Supported –  Ship Alfresco SPK as a Vagrant plugin

Page 34: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Wrapping up

Links Code •  http://github.com/Alfresco/chef-alfresco •  http://github.com/Alfresco/alfresco-spk

Icons in the presentation •  http://www.flaticon.com/free-icon/three-books_74982 •  http://www.flaticon.com/free-icon/puzzle_69154 •  http://www.flaticon.com/free-icon/man-sprinting_67001 •  http://www.flaticon.com/free-icon/closed-cardboard-box-with-packing-tape_65843 •  http://www.flaticon.com/free-icon/recycle-reuse_25274 •  http://www.flaticon.com/free-icon/light-bulb_34386 •  http://www.flaticon.com/free-icon/robot-with-server_77744

Page 35: Alfresco Day Roma 2015: Infrastructure as Code with Chef-Alfresco

Thank you!

Condividi su

#AlfrescoDayRoma