SlideShare ist ein Scribd-Unternehmen logo
1 von 34
Downloaden Sie, um offline zu lesen
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Run Your CI/CD and Test Workloads
for 90% Less with Amazon EC2 Spot
Instances
Jarrod Spiga
Solutions Architect
Amazon Web Services
C M P 4 0 1
Chad Schmutzer
Sr. EC2 Spot Specialist SA
Amazon Web Services
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
Workshop preparation and an introduction to Amazon Elastic Compute Cloud
(Amazon EC2) Spot
Lab one: Reduce the cost of builds using Amazon EC2 Spot Fleet
Lab two: Deploy testing environments using Spot & launch templates
Lab three: Externalize state data to add resiliency to Jenkins
Lab four: Using containers backed by Spot Instances in Auto Scaling groups
Workshop clean up
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Workshop prerequisites
Before you get started, please check that you have the following
A laptop or tablet device with an SSH client.
Please ensure that this device is connected to the re:Invent Wi-Fi network.
An AWS account where you have “administrator access” IAM policy level rights.
The cost for running the resources required for this workshop should only amount to a couple of dollars.
That said, we will be providing you with AWS credits to cover this spend at the completion of the
workshop.
Additionally, we will be providing detailed clean up instructions to ensure that resources are not left
running in the account that you use.
If you don’t meet these prerequisites, reach out to a session facilitator.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Workshop preparation
Ensure that you’re using the EU (Ireland) region
An interactive workshop guide is available at the following address
https://amzn.to/reInvent2018-spotcicdworkshop
Please commence following the instructions contained in the workshop guide up
to and including the workshop preparation page
If you have trouble deploying the AWS CloudFormation template, please reach out
to a session facilitator
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EC2 purchasing options
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
With Amazon EC2 Spot, the rules are simple
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Jenkins master
What has the AWS CloudFormation template deployed?
AWS CloudFormation
stack
EC2 (On-Demand)
eu-west-1beu-west-1ceu-west-1a
Application load
balancer
S3 Bucket
eu-west-1 (Ireland) region
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Spot use case: Batch processing
Leverage per-
second billing
Optimize for
lowest cost
Determine job
completion and
retry failed jobs
Be instance
flexible
Also consider AWS Batch for batch workloads or AWS CodeBuild as a build agent service
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Jenkins master
What are we doing in lab one?
eu-west-1beu-west-1ceu-west-1a
Application load
balancer
Jenkins agent
Jenkins agent
Spot Fleet
You
EC2 (Spot)
GitHub
eu-west-1 (Ireland) region
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lab one: Important notes
When provisioning your Spot Fleet, use a lowest price allocation strategy in order
to minimize cost
You’ll need to configure the AWS Spot Fleet plug-in with an access key and secret
key from the SpotCICDWorkshopJenkins AWS Identity and Access Management
(IAM) user that has already been created by AWS CloudFormation
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Spot use case: Stateless applications
Cloud best
practices also
apply when
using Spot
Diversify to
improve
resilience
Don’t rule out
older instance
generations
Embrace the
chaos
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Jenkins master
What are we doing in lab two?
eu-west-1beu-west-1ceu-west-1a
Jenkins
application load
balancer
Jenkins agent
App host
Spot Fleet
You
Workshop AWS
CloudFormation
stack
Testing
application load
balancer
Spot Fleet
Artifact S3
bucket
eu-west-1 (Ireland) region
GitHub
DynamoDB table
Deployment
Lambda function
EC2 (Spot)
EC2 (Spot)App host
Testing AWS
CloudFormation
stack
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lab two: Important notes
You should increase the number of executors on your build agents for this lab
(three should suffice).
The syntax for the Jenkins pipeline is contained in the lab guide.
There is an issue with the community-developed AWS Lambda plug-in where
output values from the Lambda function are not stored in Jenkins environment
variables when configured to do so. To work around this issue, the Lambda
function is persisting state data in an Amazon DynamoDB table. Similar
mechanism could be used for other elements of your deployment workflows.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Spot use case: Stateful applications
Many apps
persist data to
local file systems
Amazon Elastic File
System (Amazon
EFS) can be used to
store data
independent of
compute instances
AWS has a wide
variety of other
services to
persist data
Consider your
RPOs and RTOs
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Spot Fleet
Jenkins master
What are we doing in lab three?
eu-west-1 (Ireland) region
eu-west-1beu-west-1ceu-west-1a
Application load
balancer
Jenkins master
Jenkins master
You
EFS volume
AWS CloudFormation
stack
EC2 (Spot)
EC2 (Spot)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lab three: Important notes
This lab also uses launch templates in order to simplify the deployment of Amazon
EC2 instances
The EFS file system ID (deployed by the AWS CloudFormation template) can be
found in the outputs tabs for the AWS CloudFormation stack
Jenkins stores all of the data that it needs to persist on the file system under
/var/lib/jenkins
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Spot use case: Containers
Use the two-
minute warning
to drain
containers
Specify target
capacity by
weighted
resources
Use Amazon
CloudWatch
Alarms to trigger
scaling
Diversify across
capacity pools,
bid based on
defined weight
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Connection draining during the two-minute warning
#!/bin/bash
while sleep 5; do
if [ -z $(curl -Isf http://169.254.169.254/latest/meta-data/spot/termination-time) ]; then
/bin/false
else
ECS_CLUSTER=$(curl -s http://localhost:51678/v1/metadata | jq .Cluster | tr -d ")
CONTAINER_INSTANCE=$(curl -s http://localhost:51678/v1/metadata 
| jq .ContainerInstanceArn | tr -d ")
aws ecs update-container-instances-state --cluster $ECS_CLUSTER 
--container-instances $CONTAINER_INSTANCE --status DRAINING
fi
done
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EC2 Fleet
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Before: Multiple ASGs to use Spot, On-Demand, and RIs together
m4.large Spot ASG min: 1 max: 10
m5.large Spot ASG min: 1 max: 10
c4.xlarge O-D ASG min: 1 max: 10
Availability
Zone 1
Availability
Zone 2
Availability
Zone 3
The old way
with three ASGs
—one for each
instance type/
purchase option
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
After: Include Spot, On-Demand and RIs in a single ASG
m4.large Spot Instances
m5.large Spot Instances
c4.xlarge On-Demand instances
Availability
Zone 1
Availability
Zone 2
Availability
Zone 3
The new way
combines purchase
options, instance
types, and AZs in a
single ASG
Single ASG
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What are we doing in lab four?
eu-west-1 (Ireland) region
eu-west-1beu-west-1ceu-west-1a
Application load
balancer
Jenkins master
Auto
Scaling
group
You
EFS volume
AWS CloudFormation
stack
Spot Fleet
EC2 (Spot)
EC2 (On-Dem.)
jenkins.local
Amazon Route 53
hosted zone
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lab four: Important notes
Auto-scaling of EC2 resources within the Amazon Elastic Container Service
(Amazon ECS) cluster has not been configured, though it should not be required
for this workshop. While the deployed Auto Scaling group provides self-healing
capabilities, you may want to implement scaling triggers in your environments.
When deployed via YUM, Jenkins runs with a different UID than what the
containerized version runs with—hence why you must change the ownership of
data on the EFS volume.
As accessing containers via SSH is trivial, build agents will report status back to the
master using the Java Native Launch Protocol (JNLP), with assistance by Amazon
ECS Service Discovery to allow agents to locate the master.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Cleaning up your account
Please execute these steps in order
• Delete all objects within the S3 bucket created by AWS CloudFormation
• Modify the Jenkins Master ECS Service so that 0 tasks are desired
• Terminate all Auto Scaling groups
• Cancel all remaining Spot requests
• Ensure that all EC2 instances have been terminated
• Delete all AWS CloudFormation stacks
• Delete all CloudWatch Log groups related to the SpotCICDWorkshop
• Remove the Amazon EC2 keypair created during the workshop preparation
phase
More prescriptive instructions are found in the lab guide
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Jarrod Spiga
spigaj@amazon.com
Chad Schmutzer
schmutze@amazon.com
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Weitere ähnliche Inhalte

Was ist angesagt?

A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018
A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018
A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018Amazon Web Services
 
Cost Optimize EC2 with Amazon EC2 Spot Instances
Cost Optimize EC2 with Amazon EC2 Spot InstancesCost Optimize EC2 with Amazon EC2 Spot Instances
Cost Optimize EC2 with Amazon EC2 Spot InstancesAmazon Web Services
 
Metrics-Driven Performance Tuning for AWS Glue ETL Jobs (ANT332) - AWS re:Inv...
Metrics-Driven Performance Tuning for AWS Glue ETL Jobs (ANT332) - AWS re:Inv...Metrics-Driven Performance Tuning for AWS Glue ETL Jobs (ANT332) - AWS re:Inv...
Metrics-Driven Performance Tuning for AWS Glue ETL Jobs (ANT332) - AWS re:Inv...Amazon Web Services
 
Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018
Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018
Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018Amazon Web Services
 
[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...
[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...
[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...Amazon Web Services
 
Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...
Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...
Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...Amazon Web Services
 
End Extra Spending Hunting for Increased Value through Cost Optimization (ENT...
End Extra Spending Hunting for Increased Value through Cost Optimization (ENT...End Extra Spending Hunting for Increased Value through Cost Optimization (ENT...
End Extra Spending Hunting for Increased Value through Cost Optimization (ENT...Amazon Web Services
 
Day Two Operations of Kubernetes on AWS (GPSTEC309) - AWS re:Invent 2018
Day Two Operations of Kubernetes on AWS (GPSTEC309) - AWS re:Invent 2018Day Two Operations of Kubernetes on AWS (GPSTEC309) - AWS re:Invent 2018
Day Two Operations of Kubernetes on AWS (GPSTEC309) - AWS re:Invent 2018Amazon Web Services
 
Running Amazon EKS Workloads on Amazon EC2 Spot Instances (CMP403-R1) - AWS r...
Running Amazon EKS Workloads on Amazon EC2 Spot Instances (CMP403-R1) - AWS r...Running Amazon EKS Workloads on Amazon EC2 Spot Instances (CMP403-R1) - AWS r...
Running Amazon EKS Workloads on Amazon EC2 Spot Instances (CMP403-R1) - AWS r...Amazon Web Services
 
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)Amazon Web Services
 
Migrate Microsoft Applications to AWS like an Expert (WIN301) - AWS re:Invent...
Migrate Microsoft Applications to AWS like an Expert (WIN301) - AWS re:Invent...Migrate Microsoft Applications to AWS like an Expert (WIN301) - AWS re:Invent...
Migrate Microsoft Applications to AWS like an Expert (WIN301) - AWS re:Invent...Amazon Web Services
 
Studio in the Cloud: Producing Content on AWS (MAE202) - AWS re:Invent 2018
Studio in the Cloud: Producing Content on AWS (MAE202) - AWS re:Invent 2018Studio in the Cloud: Producing Content on AWS (MAE202) - AWS re:Invent 2018
Studio in the Cloud: Producing Content on AWS (MAE202) - AWS re:Invent 2018Amazon Web Services
 
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...Amazon Web Services
 
BDA308 Deep Dive: Log Analytics with Amazon Elasticsearch Service
BDA308 Deep Dive: Log Analytics with Amazon Elasticsearch ServiceBDA308 Deep Dive: Log Analytics with Amazon Elasticsearch Service
BDA308 Deep Dive: Log Analytics with Amazon Elasticsearch ServiceAmazon Web Services
 
Build AWS CloudFormation Custom Resources (DEV417-R2) - AWS re:Invent 2018
Build AWS CloudFormation Custom Resources (DEV417-R2) - AWS re:Invent 2018Build AWS CloudFormation Custom Resources (DEV417-R2) - AWS re:Invent 2018
Build AWS CloudFormation Custom Resources (DEV417-R2) - AWS re:Invent 2018Amazon Web Services
 
Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...
Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...
Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...Amazon Web Services
 
Developing with .NET Core on AWS: What's New (DEV318-R1) - AWS re:Invent 2018
Developing with .NET Core on AWS: What's New (DEV318-R1) - AWS re:Invent 2018Developing with .NET Core on AWS: What's New (DEV318-R1) - AWS re:Invent 2018
Developing with .NET Core on AWS: What's New (DEV318-R1) - AWS re:Invent 2018Amazon Web Services
 
[NEW LAUNCH!] Introducing Amazon EC2 A1 Instances Based on the Arm Architectu...
[NEW LAUNCH!] Introducing Amazon EC2 A1 Instances Based on the Arm Architectu...[NEW LAUNCH!] Introducing Amazon EC2 A1 Instances Based on the Arm Architectu...
[NEW LAUNCH!] Introducing Amazon EC2 A1 Instances Based on the Arm Architectu...Amazon Web Services
 
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)Amazon Web Services
 

Was ist angesagt? (20)

A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018
A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018
A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018
 
Cost Optimize EC2 with Amazon EC2 Spot Instances
Cost Optimize EC2 with Amazon EC2 Spot InstancesCost Optimize EC2 with Amazon EC2 Spot Instances
Cost Optimize EC2 with Amazon EC2 Spot Instances
 
Metrics-Driven Performance Tuning for AWS Glue ETL Jobs (ANT332) - AWS re:Inv...
Metrics-Driven Performance Tuning for AWS Glue ETL Jobs (ANT332) - AWS re:Inv...Metrics-Driven Performance Tuning for AWS Glue ETL Jobs (ANT332) - AWS re:Inv...
Metrics-Driven Performance Tuning for AWS Glue ETL Jobs (ANT332) - AWS re:Inv...
 
Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018
Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018
Running Amazon EC2 Workloads at Scale (CMP402-R1) - AWS re:Invent 2018
 
[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...
[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...
[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...
 
Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...
Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...
Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...
 
End Extra Spending Hunting for Increased Value through Cost Optimization (ENT...
End Extra Spending Hunting for Increased Value through Cost Optimization (ENT...End Extra Spending Hunting for Increased Value through Cost Optimization (ENT...
End Extra Spending Hunting for Increased Value through Cost Optimization (ENT...
 
Day Two Operations of Kubernetes on AWS (GPSTEC309) - AWS re:Invent 2018
Day Two Operations of Kubernetes on AWS (GPSTEC309) - AWS re:Invent 2018Day Two Operations of Kubernetes on AWS (GPSTEC309) - AWS re:Invent 2018
Day Two Operations of Kubernetes on AWS (GPSTEC309) - AWS re:Invent 2018
 
Running Amazon EKS Workloads on Amazon EC2 Spot Instances (CMP403-R1) - AWS r...
Running Amazon EKS Workloads on Amazon EC2 Spot Instances (CMP403-R1) - AWS r...Running Amazon EKS Workloads on Amazon EC2 Spot Instances (CMP403-R1) - AWS r...
Running Amazon EKS Workloads on Amazon EC2 Spot Instances (CMP403-R1) - AWS r...
 
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
 
Migrate Microsoft Applications to AWS like an Expert (WIN301) - AWS re:Invent...
Migrate Microsoft Applications to AWS like an Expert (WIN301) - AWS re:Invent...Migrate Microsoft Applications to AWS like an Expert (WIN301) - AWS re:Invent...
Migrate Microsoft Applications to AWS like an Expert (WIN301) - AWS re:Invent...
 
Studio in the Cloud: Producing Content on AWS (MAE202) - AWS re:Invent 2018
Studio in the Cloud: Producing Content on AWS (MAE202) - AWS re:Invent 2018Studio in the Cloud: Producing Content on AWS (MAE202) - AWS re:Invent 2018
Studio in the Cloud: Producing Content on AWS (MAE202) - AWS re:Invent 2018
 
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
 
BDA308 Deep Dive: Log Analytics with Amazon Elasticsearch Service
BDA308 Deep Dive: Log Analytics with Amazon Elasticsearch ServiceBDA308 Deep Dive: Log Analytics with Amazon Elasticsearch Service
BDA308 Deep Dive: Log Analytics with Amazon Elasticsearch Service
 
Build AWS CloudFormation Custom Resources (DEV417-R2) - AWS re:Invent 2018
Build AWS CloudFormation Custom Resources (DEV417-R2) - AWS re:Invent 2018Build AWS CloudFormation Custom Resources (DEV417-R2) - AWS re:Invent 2018
Build AWS CloudFormation Custom Resources (DEV417-R2) - AWS re:Invent 2018
 
Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...
Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...
Running Enterprise Test/Dev on Amazon EC2 Spot Instances (CMP407-R1) - AWS re...
 
Developing with .NET Core on AWS: What's New (DEV318-R1) - AWS re:Invent 2018
Developing with .NET Core on AWS: What's New (DEV318-R1) - AWS re:Invent 2018Developing with .NET Core on AWS: What's New (DEV318-R1) - AWS re:Invent 2018
Developing with .NET Core on AWS: What's New (DEV318-R1) - AWS re:Invent 2018
 
[NEW LAUNCH!] Introducing Amazon EC2 A1 Instances Based on the Arm Architectu...
[NEW LAUNCH!] Introducing Amazon EC2 A1 Instances Based on the Arm Architectu...[NEW LAUNCH!] Introducing Amazon EC2 A1 Instances Based on the Arm Architectu...
[NEW LAUNCH!] Introducing Amazon EC2 A1 Instances Based on the Arm Architectu...
 
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)
 
What's New with Amazon DynamoDB
What's New with Amazon DynamoDBWhat's New with Amazon DynamoDB
What's New with Amazon DynamoDB
 

Ähnlich wie Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot Instances (CMP401-R1) - AWS re:Invent 2018

Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot - CMP317 ...
Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot - CMP317 ...Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot - CMP317 ...
Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot - CMP317 ...Amazon Web Services
 
Workshop: Deploy a Deep Learning Framework on Amazon ECS
Workshop: Deploy a Deep Learning Framework on Amazon ECSWorkshop: Deploy a Deep Learning Framework on Amazon ECS
Workshop: Deploy a Deep Learning Framework on Amazon ECSAmazon Web Services
 
AWS 微服務中的 Container 選項比較 (Level 400)
AWS 微服務中的 Container 選項比較   (Level 400)AWS 微服務中的 Container 選項比較   (Level 400)
AWS 微服務中的 Container 選項比較 (Level 400)Amazon Web Services
 
Run Production Workloads on Spot, Save up to 90%
Run Production Workloads on Spot, Save up to 90%Run Production Workloads on Spot, Save up to 90%
Run Production Workloads on Spot, Save up to 90%Amazon Web Services
 
AWS Summit London 2019 - Containers on AWS
AWS Summit London 2019 - Containers on AWSAWS Summit London 2019 - Containers on AWS
AWS Summit London 2019 - Containers on AWSMassimo Ferre'
 
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...Amazon Web Services
 
Comparing Compute Options for Microservices - AWS Summti Sydney 2018
Comparing Compute Options for Microservices - AWS Summti Sydney 2018Comparing Compute Options for Microservices - AWS Summti Sydney 2018
Comparing Compute Options for Microservices - AWS Summti Sydney 2018Amazon Web Services
 
Deep dive ECS & Fargate Deep Dive
Deep dive ECS & Fargate Deep DiveDeep dive ECS & Fargate Deep Dive
Deep dive ECS & Fargate Deep DiveAmazon Web Services
 
Running Amazon EC2 workloads at scale - CMP301 - New York AWS Summit
Running Amazon EC2 workloads at scale - CMP301 - New York AWS SummitRunning Amazon EC2 workloads at scale - CMP301 - New York AWS Summit
Running Amazon EC2 workloads at scale - CMP301 - New York AWS SummitAmazon Web Services
 
Amazon EC2 Strategie per l'ottimizzazione dei costi
Amazon EC2 Strategie per l'ottimizzazione dei costiAmazon EC2 Strategie per l'ottimizzazione dei costi
Amazon EC2 Strategie per l'ottimizzazione dei costiAmazon Web Services
 
Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot Instances
Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot InstancesWorkshop; Deploy a Deep Learning Framework on Amazon ECS and Spot Instances
Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot InstancesAmazon Web Services
 
Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DE...
Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DE...Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DE...
Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DE...Amazon Web Services
 
Module 2: Core AWS Compute and Storage Services - Virtual AWSome Day June 2018
Module 2: Core AWS Compute and Storage Services - Virtual AWSome Day June 2018Module 2: Core AWS Compute and Storage Services - Virtual AWSome Day June 2018
Module 2: Core AWS Compute and Storage Services - Virtual AWSome Day June 2018Amazon Web Services
 
Getting Started with Containers on AWS
Getting Started with Containers on AWSGetting Started with Containers on AWS
Getting Started with Containers on AWSAmazon Web Services
 
Semplificare la gestione dei container con i servizi AWS
Semplificare la gestione dei container con i servizi AWSSemplificare la gestione dei container con i servizi AWS
Semplificare la gestione dei container con i servizi AWSAmazon Web Services
 
Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...
Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...
Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...Amazon Web Services
 
Re:Invent 2019 Recap. AWS User Groups in Spain. Javier Ramirez
 Re:Invent 2019 Recap. AWS User Groups in Spain. Javier Ramirez Re:Invent 2019 Recap. AWS User Groups in Spain. Javier Ramirez
Re:Invent 2019 Recap. AWS User Groups in Spain. Javier Ramirezjavier ramirez
 

Ähnlich wie Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot Instances (CMP401-R1) - AWS re:Invent 2018 (20)

Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot - CMP317 ...
Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot - CMP317 ...Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot - CMP317 ...
Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot - CMP317 ...
 
Workshop: Deploy a Deep Learning Framework on Amazon ECS
Workshop: Deploy a Deep Learning Framework on Amazon ECSWorkshop: Deploy a Deep Learning Framework on Amazon ECS
Workshop: Deploy a Deep Learning Framework on Amazon ECS
 
應用開發新思維
應用開發新思維應用開發新思維
應用開發新思維
 
AWS 微服務中的 Container 選項比較 (Level 400)
AWS 微服務中的 Container 選項比較   (Level 400)AWS 微服務中的 Container 選項比較   (Level 400)
AWS 微服務中的 Container 選項比較 (Level 400)
 
Run Production Workloads on Spot, Save up to 90%
Run Production Workloads on Spot, Save up to 90%Run Production Workloads on Spot, Save up to 90%
Run Production Workloads on Spot, Save up to 90%
 
AWS Summit London 2019 - Containers on AWS
AWS Summit London 2019 - Containers on AWSAWS Summit London 2019 - Containers on AWS
AWS Summit London 2019 - Containers on AWS
 
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...
 
Amazon EC2 Spot Instances
Amazon EC2 Spot InstancesAmazon EC2 Spot Instances
Amazon EC2 Spot Instances
 
Comparing Compute Options for Microservices - AWS Summti Sydney 2018
Comparing Compute Options for Microservices - AWS Summti Sydney 2018Comparing Compute Options for Microservices - AWS Summti Sydney 2018
Comparing Compute Options for Microservices - AWS Summti Sydney 2018
 
Deep dive ECS & Fargate Deep Dive
Deep dive ECS & Fargate Deep DiveDeep dive ECS & Fargate Deep Dive
Deep dive ECS & Fargate Deep Dive
 
Running Amazon EC2 workloads at scale - CMP301 - New York AWS Summit
Running Amazon EC2 workloads at scale - CMP301 - New York AWS SummitRunning Amazon EC2 workloads at scale - CMP301 - New York AWS Summit
Running Amazon EC2 workloads at scale - CMP301 - New York AWS Summit
 
Compute@Scale
Compute@ScaleCompute@Scale
Compute@Scale
 
Amazon EC2 Strategie per l'ottimizzazione dei costi
Amazon EC2 Strategie per l'ottimizzazione dei costiAmazon EC2 Strategie per l'ottimizzazione dei costi
Amazon EC2 Strategie per l'ottimizzazione dei costi
 
Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot Instances
Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot InstancesWorkshop; Deploy a Deep Learning Framework on Amazon ECS and Spot Instances
Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot Instances
 
Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DE...
Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DE...Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DE...
Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DE...
 
Module 2: Core AWS Compute and Storage Services - Virtual AWSome Day June 2018
Module 2: Core AWS Compute and Storage Services - Virtual AWSome Day June 2018Module 2: Core AWS Compute and Storage Services - Virtual AWSome Day June 2018
Module 2: Core AWS Compute and Storage Services - Virtual AWSome Day June 2018
 
Getting Started with Containers on AWS
Getting Started with Containers on AWSGetting Started with Containers on AWS
Getting Started with Containers on AWS
 
Semplificare la gestione dei container con i servizi AWS
Semplificare la gestione dei container con i servizi AWSSemplificare la gestione dei container con i servizi AWS
Semplificare la gestione dei container con i servizi AWS
 
Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...
Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...
Better, Faster, Cheaper – Cost Optimizing Compute with Amazon EC2 Fleet #savi...
 
Re:Invent 2019 Recap. AWS User Groups in Spain. Javier Ramirez
 Re:Invent 2019 Recap. AWS User Groups in Spain. Javier Ramirez Re:Invent 2019 Recap. AWS User Groups in Spain. Javier Ramirez
Re:Invent 2019 Recap. AWS User Groups in Spain. Javier Ramirez
 

Mehr von Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Mehr von Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot Instances (CMP401-R1) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot Instances Jarrod Spiga Solutions Architect Amazon Web Services C M P 4 0 1 Chad Schmutzer Sr. EC2 Spot Specialist SA Amazon Web Services
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Agenda Workshop preparation and an introduction to Amazon Elastic Compute Cloud (Amazon EC2) Spot Lab one: Reduce the cost of builds using Amazon EC2 Spot Fleet Lab two: Deploy testing environments using Spot & launch templates Lab three: Externalize state data to add resiliency to Jenkins Lab four: Using containers backed by Spot Instances in Auto Scaling groups Workshop clean up
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Workshop prerequisites Before you get started, please check that you have the following A laptop or tablet device with an SSH client. Please ensure that this device is connected to the re:Invent Wi-Fi network. An AWS account where you have “administrator access” IAM policy level rights. The cost for running the resources required for this workshop should only amount to a couple of dollars. That said, we will be providing you with AWS credits to cover this spend at the completion of the workshop. Additionally, we will be providing detailed clean up instructions to ensure that resources are not left running in the account that you use. If you don’t meet these prerequisites, reach out to a session facilitator.
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Workshop preparation Ensure that you’re using the EU (Ireland) region An interactive workshop guide is available at the following address https://amzn.to/reInvent2018-spotcicdworkshop Please commence following the instructions contained in the workshop guide up to and including the workshop preparation page If you have trouble deploying the AWS CloudFormation template, please reach out to a session facilitator
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EC2 purchasing options
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. With Amazon EC2 Spot, the rules are simple
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Jenkins master What has the AWS CloudFormation template deployed? AWS CloudFormation stack EC2 (On-Demand) eu-west-1beu-west-1ceu-west-1a Application load balancer S3 Bucket eu-west-1 (Ireland) region
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Spot use case: Batch processing Leverage per- second billing Optimize for lowest cost Determine job completion and retry failed jobs Be instance flexible Also consider AWS Batch for batch workloads or AWS CodeBuild as a build agent service
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Jenkins master What are we doing in lab one? eu-west-1beu-west-1ceu-west-1a Application load balancer Jenkins agent Jenkins agent Spot Fleet You EC2 (Spot) GitHub eu-west-1 (Ireland) region
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lab one: Important notes When provisioning your Spot Fleet, use a lowest price allocation strategy in order to minimize cost You’ll need to configure the AWS Spot Fleet plug-in with an access key and secret key from the SpotCICDWorkshopJenkins AWS Identity and Access Management (IAM) user that has already been created by AWS CloudFormation
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Spot use case: Stateless applications Cloud best practices also apply when using Spot Diversify to improve resilience Don’t rule out older instance generations Embrace the chaos
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Jenkins master What are we doing in lab two? eu-west-1beu-west-1ceu-west-1a Jenkins application load balancer Jenkins agent App host Spot Fleet You Workshop AWS CloudFormation stack Testing application load balancer Spot Fleet Artifact S3 bucket eu-west-1 (Ireland) region GitHub DynamoDB table Deployment Lambda function EC2 (Spot) EC2 (Spot)App host Testing AWS CloudFormation stack
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lab two: Important notes You should increase the number of executors on your build agents for this lab (three should suffice). The syntax for the Jenkins pipeline is contained in the lab guide. There is an issue with the community-developed AWS Lambda plug-in where output values from the Lambda function are not stored in Jenkins environment variables when configured to do so. To work around this issue, the Lambda function is persisting state data in an Amazon DynamoDB table. Similar mechanism could be used for other elements of your deployment workflows.
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Spot use case: Stateful applications Many apps persist data to local file systems Amazon Elastic File System (Amazon EFS) can be used to store data independent of compute instances AWS has a wide variety of other services to persist data Consider your RPOs and RTOs
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Spot Fleet Jenkins master What are we doing in lab three? eu-west-1 (Ireland) region eu-west-1beu-west-1ceu-west-1a Application load balancer Jenkins master Jenkins master You EFS volume AWS CloudFormation stack EC2 (Spot) EC2 (Spot)
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lab three: Important notes This lab also uses launch templates in order to simplify the deployment of Amazon EC2 instances The EFS file system ID (deployed by the AWS CloudFormation template) can be found in the outputs tabs for the AWS CloudFormation stack Jenkins stores all of the data that it needs to persist on the file system under /var/lib/jenkins
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Spot use case: Containers Use the two- minute warning to drain containers Specify target capacity by weighted resources Use Amazon CloudWatch Alarms to trigger scaling Diversify across capacity pools, bid based on defined weight
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Connection draining during the two-minute warning #!/bin/bash while sleep 5; do if [ -z $(curl -Isf http://169.254.169.254/latest/meta-data/spot/termination-time) ]; then /bin/false else ECS_CLUSTER=$(curl -s http://localhost:51678/v1/metadata | jq .Cluster | tr -d ") CONTAINER_INSTANCE=$(curl -s http://localhost:51678/v1/metadata | jq .ContainerInstanceArn | tr -d ") aws ecs update-container-instances-state --cluster $ECS_CLUSTER --container-instances $CONTAINER_INSTANCE --status DRAINING fi done
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EC2 Fleet
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Before: Multiple ASGs to use Spot, On-Demand, and RIs together m4.large Spot ASG min: 1 max: 10 m5.large Spot ASG min: 1 max: 10 c4.xlarge O-D ASG min: 1 max: 10 Availability Zone 1 Availability Zone 2 Availability Zone 3 The old way with three ASGs —one for each instance type/ purchase option
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. After: Include Spot, On-Demand and RIs in a single ASG m4.large Spot Instances m5.large Spot Instances c4.xlarge On-Demand instances Availability Zone 1 Availability Zone 2 Availability Zone 3 The new way combines purchase options, instance types, and AZs in a single ASG Single ASG
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What are we doing in lab four? eu-west-1 (Ireland) region eu-west-1beu-west-1ceu-west-1a Application load balancer Jenkins master Auto Scaling group You EFS volume AWS CloudFormation stack Spot Fleet EC2 (Spot) EC2 (On-Dem.) jenkins.local Amazon Route 53 hosted zone
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lab four: Important notes Auto-scaling of EC2 resources within the Amazon Elastic Container Service (Amazon ECS) cluster has not been configured, though it should not be required for this workshop. While the deployed Auto Scaling group provides self-healing capabilities, you may want to implement scaling triggers in your environments. When deployed via YUM, Jenkins runs with a different UID than what the containerized version runs with—hence why you must change the ownership of data on the EFS volume. As accessing containers via SSH is trivial, build agents will report status back to the master using the Java Native Launch Protocol (JNLP), with assistance by Amazon ECS Service Discovery to allow agents to locate the master.
  • 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Cleaning up your account Please execute these steps in order • Delete all objects within the S3 bucket created by AWS CloudFormation • Modify the Jenkins Master ECS Service so that 0 tasks are desired • Terminate all Auto Scaling groups • Cancel all remaining Spot requests • Ensure that all EC2 instances have been terminated • Delete all AWS CloudFormation stacks • Delete all CloudWatch Log groups related to the SpotCICDWorkshop • Remove the Amazon EC2 keypair created during the workshop preparation phase More prescriptive instructions are found in the lab guide
  • 33. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Jarrod Spiga spigaj@amazon.com Chad Schmutzer schmutze@amazon.com
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.