AWS Black Belt Online Seminar AWS Code Services Part 2

  • View
    9.523

  • Download
    0

Embed Size (px)

Text of AWS Black Belt Online Seminar AWS Code Services Part 2

  1. 1. AWS Black Belt Online Seminar Developer Tools AWS Code Series Part 2 2017.06.28 2017, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CodeDeployAWS CodePipelineAWS CodeStar
  2. 2. fatsushi@ AWS AWS Code AWS IoTLambdaC#
  3. 3. 2017628 AWS(http://aws.amazon.com/ ) AWS AWS AWS does not offer binding price quotes. AWS pricing is publicly available and is subject to change in accordance with the AWS Customer Agreement available at http://aws.amazon.com/agreement/. Any pricing information included in this document is provided only as an estimate of usage charges for AWS services based on certain information that you have provided. Monthly charges will be based on your actual use of AWS services, and may vary from the estimates provided.
  4. 4. Agenda CI/CDAWS Code Series ASW CodeDeploy AWS CodePipeline AWS CodeStar
  5. 5.
  6. 6.
  7. 7.
  8. 8. UI 4 JavaC#
  9. 9.
  10. 10.
  11. 11. AWS Code AWS CodePipeline AWS CodeCommit AWS CodeBuildAWS CodeDeploy
  12. 12. == https://www.flickr.com/photos/cannnela/4614340819/
  13. 13. AWS Code Source Build Test Production
  14. 14. Source Build Test Production AWS CodeCommit AWS Code
  15. 15. Source Build Test Production AWS CodeBuild AWS Code
  16. 16. Source Build Test Production Third Party Tooling AWS Code AWS CodeBuild
  17. 17. Source Build Test Production AWS CodeDeploy AWS Code
  18. 18. Source Build Test Production EC2 On-Prem AWS CodeDeploy AWS Code
  19. 19. Source Build Test Production AWS CodePipeline AWS Code
  20. 20. Source Build Test Production Third Party Tooling AWS CodeCommit AWS CodeBuild AWS CodeDeploy AWS CodePipeline AWS Code AWS CodeBuild
  21. 21. AWS Code Services AWS CodeCommit Git Git Tool PushSNS/Lambda AWS CodeBuild Docker AWS CodeDeploy S3GitHub In-place() Blue/Green AWS CodePipeline AWS3rd
  22. 22. AWS Code Series Part 1 Part 1 AWS CodeCommitAWS CodeBuild https://connect.awswebcasts.com/p11xi3ubqpo/ PDF https://d0.awsstatic.com/webinars/jp/pdf/services/2017 0322_AWS-BlackBelt-CodeCommit-CodeBuild.pdf 24
  23. 23. Deploying your applications https://secure.flickr.com/photos/simononly/15386966677
  24. 24. AWS CodeDeploy In-place Amazon EC2 Blue/Green AWS CodeDeployAWS CLI AWS CodeDeploy
  25. 25. Availability Zone Availability Zone v2
  26. 26. Push FTP, rsync, git pull Capistrano, Fabric
  27. 27. AWS CodeDeploy CodeDeployAutoScaling AWS CodeDeploy
  28. 28. AWS CodeDeploy
  29. 29. AWS CodeDeploy
  30. 30. AWS CodeDeploy Application IAM 32
  31. 31. Application appspec.yml () hook Amazon S3Object GitHubRepository zip / appspec.yml config/ config.xml deploy_hooks/ start-tomcat.sh stop-tomcat.sh target/ hello.war or Amazon S3 : mavenbundle put/push
  32. 32. AppSpec File files version: 0.0 os: linux files: - source: config destination: /etc/app - source: target/hello.war destination: /var/lib/tomcat6/webapps hooks: ApplicationStop: - location: deploy_hooks/stop-tomcat.sh ApplicationStart: - location: deploy_hooks/start-tomcat.sh hooks Event
  33. 33. appspec.yml version: 0.0 os: linux files: - source: / destination: /var/www/html permissions: - object: /var/www/html pattern: *.html owner: root group: root mode: 755 hooks: ApplicationStop: - location: scripts/deregister_from_elb.sh BeforeInstall: - location: scripts/install_dependencies.sh ApplicationStart: - location: scripts/start_httpd.sh ValidateService: - location: scripts/test_site.sh - location: scripts/register_with_elb.sh ELB Apache
  34. 34. AWS CodeDeploy Agent OS Amazon Linux 2017.03.x, 2016.09.0, 2016.03.1, 2016.03.0, 2015.03, 2014.09.1 Ubuntu Server 16.04 LTS and 14.04 LTS Microsoft Windows Server 2016, 2012 R2, and 2008 R2 Red Hat Enterprise Linux (RHEL) 7.x Open Source https://github.com/aws/aws-codedeploy-agent 36
  35. 35. v2 v1 v1 v1 v1 v1 v1 v1 v2 v2 v1 v1 v1 v1 v1 v1 v2 v2 v2 v2 v1 v1 v1 v1 v2 v2 v2 v2 v2 v2 v2 v2 One-at-a-time Min. healthy hosts = 99% [Custom] Min. healthy hosts = 75% Half-at-a-time Min. healthy hosts = 50% All-at-once Min. healthy hosts = 0
  36. 36. Auto Scaling Dev Test Prod v2.0 v1.2 v1.1 v2.0 v1.2 v1.1 v2.0 v1.2 v1.1
  37. 37. AWS CodeDeployAuto Scaling Group(ASG) ASGLifecycle Hook Deployment GroupASG
  38. 38. In-place 40 Blue/Green v1 v1 v1 v1 v1 v1v2 v2 v2 2017/6/28CLBCLB/ALB
  39. 39. In-place 41 Blue/Green v1 v1 v1 v1 v1 v1v2 v2 v2 v2 v2 v2 2017/6/28CLBCLB/ALB
  40. 40. Auto Scaling Auto Scaling CodeDeploy Auto Scalling CodeDeploy Auto Scaling CodeDeploy 42
  41. 41. Auto Scaling Auto Scaling CodeDeploy Agent Auto Scaling CodeDeployAuto Scalling CodeDeploy Auto Scalingsample https://github.com/awslabs/aws-codedeploy-samples/tree/master/load- balancing/elb CLB and ASG https://github.com/awslabs/aws-codedeploy-samples/tree/master/load- balancing/elb-v2 ALB and ASG) 43
  42. 42. IAM EC2 44 { "Version": "2012-10-17", "Statement": [ { "Action": [ "s3:Get*", "s3:List* ], "Effect": "Allow", "Resource": "*" } ] }
  43. 43. Web AppSpec Linux: zip, tar, compressed tar Windows: zip S3GitHub S3Etag GitHubCommit ID 45
  44. 44. CodeDeploy AWSCodeDeployRole 46 Auto Scaling CloudWatch EC2 ELB ELB v2 Resource Group Tagging SNS
  45. 45. 47
  46. 46. AWS 48 Amazon CloudWatch CloudWatch Alarms CloudWatch Event CloudWatch LogsAWS CodeDeploy Agent https://aws.amazon.com/jp/blogs/devops/view-aws- codedeploy-logs-in-amazon-cloudwatch-console/ Auto Scalling EC2 AWS CodePipeline CodeDeploy Elastic Load Balancing Blue/Green AWS CloudTrail API
  47. 47. AWS CodeDeploy
  48. 48. AWS CodeDeploy Amazon EC2 Amazon S3S3 $0.02// 2017/6/28
  49. 49. Orchestrating build and deploy with a pipeline https://www.flickr.com/photos/seattlemunicipalarchives/12504672623/
  50. 50. UAT
  51. 51.
  52. 52. AWS CodePipeline UICLI CodePipeline
  53. 53. AWS CodePipeline
  54. 54. AWS CodePipeline Amazon Build 1) 2) Unit 1) 2) UI Source Beta Production 1) 2) Gamma 1) 2) 1 3) 2
  55. 55. A CodePipeline B
  56. 56. Source Source GitHub Build JenkinsOnEC2 Jenkins Deploy JavaApp Elastic Beanstalk CodePipeline MyApplication
  57. 57. Source Source GitHub Build JenkinsOnEC2 Jenkins Deploy JavaApp Elastic Beanstalk NotifyDevelopers Lambda CodePipeline MyApplication
  58. 58. Source Source GitHub Build JenkinsOnEC2 Jenkins Deploy JavaApp Elastic Beanstalk NotifyDevelopers Lambda TestAPI Runscope CodePipeline MyApplication
  59. 59. CodePipeline Developers AWS CodeCommit AWS CodePipeline AWS CodeBuild AWS CloudFormation Amazon ECS Amazon ECR git push CodePipeline CloudFormation ECRDocker ECS CodeBuildDocker ECR
  60. 60. . CodePipeline Source Source CodeCommit Build JenkinsOnEC2 CodeBuild Deploy JavaApp CloudFormation S3 S 5. 1. 6. 3. 4. 7. 8. CloudFormation MyApplication AWS CodeCommit Amazon ECS Amazon ECR AWS CodeBuild
  61. 61. AWS AWS Elastic Beanstalk Amazon S3 AWS CodeDeployAWS Lambda AWS CodeCommit AWS OpsWorks AWS CloudFormation AWS CodeBuild 2017/6/28
  62. 62.
  63. 63. CodePipeline 65 Source Amazon S3AWS CodeCommitGitHub Build AWS CodeBuildCloudBeesJenkinsSolano CI TeamCity Test AWS CodeBuildApicaBlazeMeterGhost Inspector HPE StormRunner LoadNouvolaRunscope Deploy AWS CloudFormationAWS CodeDeployAWS ElasticBeanstalkAWS OpsWorks StacksXebiaLabs Approval Amazon Simple Notification Service Invoke AWS Lambda
  64. 64. AWS Lambda AWS CodePipelineLambda Lamdba AWS CloudFormation 1CloudFormation LambdaCNAME ElasticBeanstalk Amazon ECSDocker AMI IRC 66
  65. 65. Approval SNS Web 67
  66. 66. Approval 68
  67. 67. Custom AWS CLI Job Worker CustomAWS CodePipeline Custom Job AWS CodePipeline AWS CodePipeline URL http://docs.aws.amazon.com/ja_jp/codepipeline/latest/userguide/ actions-create-custom-action.html 69
  68. 68. Custom CodePipeline S3 1. 2. 4. 3. Ack 5.
  69. 69. AWS CodePipeline 1$1/ 30 1 1 / 2017/6/28
  70. 70. AWS CodeStar 72
  71. 71. AWS CodeStar AWS AWS
  72. 72. EC2 or Beanstalk or Lambda CodeCommit CodeBuild CodeDeploy or Beanstalk or CloudFormation CodePipeline CloudWatch
  73. 73.
  74. 74.
  75. 75.
  76. 76. CloudWatch CodeCommit App CodePipelineJIRA
  77. 77. AWS CodeStar CodeStar AWS Amazon EC2 AWS LambdaAmazon S3 79 2017/6/28
  78. 78. https://aws.amazon.com/jp/devops/
  79. 79. AWS CodeDeploy AWS CodePipeline AWS CodeStar CI/CD 81
  80. 80. 84