serverlesswebsite+ publishing...

Post on 30-Aug-2020

7 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Serverless Website  Publishingwith  AWS  Code*  Services

Steffen  Grunwald

Solutions  Architect,  AWS

October  27,  2016

Software  Delivery  Models  evolved

What  do  you  need  to  move  fast?

Automate  provisioning  of  all  environments  and  services

Automate  the  deploymentof  application  versions

Orchestrate  the  whole  process

Re-­use  services,Architect  for  re-­usability

Measure  software  qualityAutomate  builds  and  tests

Release  processes  levels

Source Build Test Production

Continuous  integration

Continuous  delivery

Continuous  deployment

Continuous  Delivery  Benefits

Improve  developer  productivity

Find  and  address  bugs  quickly

Deliver  updates  fasterAutomate  the  software  release  process

Continuous  delivery  service  for  fast  and  reliable  application  updates

Model  and  visualize  your  software  release  process

Builds,  tests,  and  deploys  your  code  every  time  there  is  a  code  change

Integrates  with  3rd party  tools  and  AWS

AWS  CodePipeline

AWS  CodePipeline Benefits

Improved  quality

Rapid  delivery Get  started  fast

Configurable  workflow Easy  to  integrate

Source

SourceGitHub

Build

JenkinsOnEC2Jenkins

Deploy

JavaAppElastic  Beanstalk

PipelineStage

Action

Transition

CodePipelineMyApplication

Source

SourceGitHub

Build

JenkinsOnEC2Jenkins

Deploy

JavaAppElastic  Beanstalk

NotifyDevelopersLambda

CodePipelineMyApplication

Parallel  actions

Source

SourceGitHub

Build

JenkinsOnEC2Jenkins

Deploy

JavaAppElastic  Beanstalk

NotifyDevelopersLambda

TestAPIRunscope

CodePipelineMyApplication

Sequential  actions

Source

SourceGitHub

Build

JenkinsOnEC2Jenkins

Deploy

JavaAppElastic  Beanstalk

CodePipelineMyApplication

Artifacts  are  passed  via  S3

Demo:  Publishing  Workflow  on  AWS

Editing  Markdown Versioning Build Publish

https://c9.io/ AWS  CodeCommit Amazon  S3https://jekyllrb.com/

Pipeline  Design

Commit/Push

https://c9.io/ AWS  CodeCommit Amazon  S3https://jekyllrb.com/

Pipeline  Design  -­‐ add  Approval  Stage Re-­‐use  Functionwith  differentparameters

150  LoC  of  Custom  Job  Worker  Code  at  a  Glance

loop:poll_for_jobs

acknowledge_jobtry:

download site sourcerun Jekyllupload build siteput_job_success

catch:put_job_failure

Deploy  Applications  with  AWS  CodeDeploy

• Automates  code  deployments  to  any  instance

• Handles  the  complexity  of  updating  your  applications

• Avoid  downtime  during  application  deployment

• Deploy  to  Amazon  EC2  or  on-­‐premises  servers,  in  any  language  and  on  any  operating  system

• Integrates  with  3rd party  tools  and  AWS

Automate  deployment  with  Built-­‐In  Actions

Watches  for  code  changes

Triggers  CodeDeploydeployment

appspec.ymlversion: 0.0os: linuxfiles:- source: appdestination: /home/ec2-user/app

- source: scripts/siteBuilder.confdestination: /etc/init

permissions:- object: /home/ec2-user/appowner: ec2-usergroup: ec2-user

hooks:ApplicationStop:- location: deploy-hooks/stop.sh

AfterInstall:- location: deploy-hooks/reloadServices.sh- location: deploy-hooks/installBundles.shrunas: ec2-user

ApplicationStart:- location: deploy-hooks/start.sh

appspec.ymlversion: 0.0os: linuxfiles:- source: appdestination: /home/ec2-user/app

- source: scripts/siteBuilder.confdestination: /etc/init

permissions:- object: /home/ec2-user/appowner: ec2-usergroup: ec2-user

hooks:ApplicationStop:- location: deploy-hooks/stop.sh

AfterInstall:- location: deploy-hooks/reloadServices.sh- location: deploy-hooks/installBundles.shrunas: ec2-user

ApplicationStart:- location: deploy-hooks/start.sh

Copy  files  to  system-­‐ Application

-­‐ Upstart  Config

Set  file  permissions

Execute  scripts  onapplication  lifecycle

events

AWS  service  integrationsSource Invoke  Logic             Deploy

AWS  Elastic  BeanstalkAWS  CodeDeployAWS  OpsWorks

Amazon  S3AWS  CodeCommit

AWS  Lambda

We  have  a  strong  partner  list,  and  it’s  growingSource Build Test Deploy

Make  Jekyll  Serverless

We  know:• Jekyll  is  written  in  Ruby• Ruby*  runs  on  Java• Java  runs  on  AWS  Lambda

Deduction:Jekyll*  runs  on  AWS  Lambda

*some

Packaging  Jekyll

Java  AWS  Lambda  Handler

JRuby Complete  Distribution

Jekyll’s  and  Dependencies’  

Gems

Jekyll  Start  Ruby  Script

Uber  JAR

Packaging  Jekyll

Java  AWS  Lambda  Handler

JRuby Complete  Distribution

Jekyll’s  and  Dependencies’  

Gems

Jekyll  Start  Ruby  Script

Uber  JAR

Maven  Build

dependency run  jruby install  @generate  resources

src/main/java src/main/resources

src/assembly

Provision  with  AWS  CloudFormation

• Specify  a  collection  of  related  AWS  resources  in  a  declarative  way

• Put  the  configuration  to  version  control

• Provision  and  update  your  infrastructure  in  a  predictable  fashion:• Additional  Test  Environments• Complete  Pipelines

Scaffolding  with  AWS  CloudFormation Template

• Use  a  parameterized  CloudFormation template• Create  a  stack  of  resources  from  scratch:  pipeline,  

S3  buckets,  IAM  roles,  AWS  Lambda  functions,  policies,  etc.

Create  a  service  adhering  to  best  practices  in  minutes!

AWS  CloudFormation Example  w/  Parameter(Excerpt)BuiltSiteCustomAction:Type:  "AWS::CodePipeline::CustomActionType"Properties:Category:  "Build"Provider:Fn::Join:-­‐ ""-­‐ -­‐ Ref:  AWS::StackName-­‐ "-­‐BuildActn"

Version:  1

Summary• Infrastructure  and  application  can  be  provisioned  in  

a  fully  automated  fashion  and  allows  for  a  fast  start• AWS  CodePipeline is  very  versatile  and  allows  

integration  of  all  almost  services  and  tools• Going  all  serverless builds  a  fully  cost  aware  

architecture

Start  now  and  benefit  from  AWS  Free  TierPay  for  what  you  use!

AWS  services  used  are  part  of  the  AWS  Free  Tier:-­‐ AWS  CodePipeline-­‐ AWS  CodeCommit-­‐ AWS  Lambda-­‐ Amazon  Simple  Storage  Service  (S3)See  Terms  at  https://aws.amazon.com/free

Thank  you!

top related