ݺߣ

ݺߣShare a Scribd company logo
Serverless Cat Detector - Workshop
Cloudyna 2017 - Katowice (16.12.2017)
Who we are?
~ # whoami
? Developer / Operations @ Appliscale
Erlang, Java
AWS
P.S. We are hiring!
~ # whoami (afronski)
? Developer / Operations @ Appliscale
Erlang, Elixir, Node.js
AWS (2 certificates)
P.S. We are hiring!
~ # whoami
? Developer / Operations @ Appliscale
Erlang, Elixir, C++
AWS (2 certificates)
P.S. We are hiring!
Who are you?
Survey!
https://goo.gl/bEUYrJ
Introduction
What is Serverless ?
*aaS
(... as a service)
BaaS
(back-end as a service)
FaaS
(function as a service)
What will we build?
Serverless
Cat Detector
Amazon Web Services
? S3
? Lambda
? API Gateway
? DynamoDB
? Image Rekognition
? CloudWatch
? X-Ray
S3 is an object storage built to store
and retrieve any amount of
data from anywhere.
S3 (Simple Storage Service)
Lambda lets you run code without
provisioning or managing servers.
You pay only for the compute time
you consume - there is no charge
when your code is not running.
Lambda
API Gateway is a fully managed service
that makes it easy for developers
to create, publish, maintain, monitor,
and secure APIs at any scale.
API Gateway
DynamoDB
DynamoDB is a NoSQL database service.
It is a fully managed cloud database
that supports both document and
key-value store models.
Image Rekognition
Rekognition makes it easy to add image
and video analysis to your applications.
Service can identify the objects, people,
text, scenes, and activities, as well
as detect any inappropriate content.
CloudWatch is a monitoring service
for AWS cloud resources and the
applications you run on AWS.
CloudWatch
X-Ray helps developers
analyze and debug production,
distributed applications, such
as those built using a microservices
architecture.
X-Ray
Architecture Overview
Lets build it!
Upload Architecture
Required files
User interface:
https://goo.gl/QjmPTM
Lambdas:
https://goo.gl/z5DGKY
UI - S3 Console
1
2
UI - Create S3 bucket
Frontend - Bucket Name
Bucket name must be
globally unique.
Region does not
matter in this case.
UI - Bucket Properties
UI - Bucket Permissions
UI - Bucket Summary
UI - Upload Files
UI - Upload Files
UI - Public Read Access
UI - Bucket Properties
UI - Website URL
1
2
UI - Look and Feel
Images - Copy Settings
Upload Lambda - Code
Upload Lambda - Code
Upload Lambda - Code
Upload Lambda - IAM Role
Upload Lambda - IAM
Upload Lambda - IAM
Upload Lambda - IAM Role
Upload Lambda
Upload Lambda
Select newly created role.
Upload Lambda
Upload Lambda
Upload Lambda
Lambda - Code package
Upload Lambda - Handler
Upload Lambda - ENV
Frontend replace API URL
Frontend replace API URL
Lets try it! :)
Upload Lambda
Upload Lambda - CORS
Upload Lambda - CORS
Upload Lambda - Deploy
Lets try it! :)
Upload Bucket - CORS
Lets try it! :)
Coffee Break
Rekognition Architecture
DynamoDB - Create Table
DynamoDB
Recognition Lambda - IAM
Recognition Lambda
Recognition Lambda
Recognition Lambda
Recognition Lambda
Recognition Lambda
Recognition Lambda
Lets try it! :)
Coffee Break
Get Results Arch
Get Results Lambda - IAM
Get Results Lambda
Get Results Lambda
Get Results Lambda - ENV
Get Results Lambda
Get Results Lambda
Get Results - API endpoint
Lets try it! :)
Coffee Break
Debugging
X-Ray / CloudWatch
Debugging
Debugging
No errors
Debugging
Debugging
Debugging
Debugging
Improvements
CloudFormation provides a common language
for you to describe and provision
all the infrastructure resources
in your cloud environment.
CloudFormation
Serverless Framework
Serverless - Invoke Locally
export SLS_DEBUG=*
# to have detail logging
export AWS_XRAY_CONTEXT_MISSING=LOG_ERROR
# log error instead of throwing an exception
# when x-ray context is missing
export AWS_PROFILE=appliscale-dev
# profile to be used while calling aws cli
Serverless - Invoke Locally
JSON file with an
event which will be
sent to your lambda
function.
Full payload can be
retrieved from
CloudWatch logs.
{
"Records":[
{
(...)
"eventName":"ObjectCreated:Put",
,
(...)
"s3":{
"s3SchemaVersion":"1.0",
"configurationId":"695b503e-7bc3-4cdc-9d1a-5021c2ac5921",
"bucket":{
"name":"serverless-cat-detector-img-repo-47",
"ownerIdentity":{
"principalId":"A3W0C5E4PDB3VB"
},
"arn":"arn:aws:s3:::serverless-cat-detector-img-repo-47"
},
"object":{
"key":"cat2.jpg",
(...)
}
}
}]}
Serverless - Invoke Locally
serverless invoke local
--function catrekognition
--path event.json
You need to configure your AWS credentials
as this will call real AWS services (S3, Rekognition, DynamoDB).
Serverless - Invoke Locally
There is a way to use local DynamoDB.
To do that, first run the database locally as described here:
http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html
Then, modify the source code pointing your DynamoDB client to the local service:
dynamoDb = new AWS.DynamoDB.DocumentClient({
endpoint: new AWS.Endpoint('http://localhost:8000')
});
Thats it!
Summary
Survey!
https://goo.gl/kpBfRP
?Thank you!
Any questions?
References
1. Our company - Appliscale.
2. Sebastian Feduniak - feduniak.com.
3. Wojtek Gawroski - afronski.pl and his talks (LinkedIn profile).
4. Pawe? Piku?a - pawelpikula.pl.
5. Functional Miners (facebook, twitter, github, email).
6. NatywnaChmura.pl (www, meetup, facebook).
7. Serverless CommitStrip.
8. AWS Serverless Application Model.
9. Serverless Framework.
10. Local DynamoDB - Documentation.
11. Repository with Source Code.

More Related Content

What's hot (15)

PDF
AWS CloudFormation (February 2016)
Julien SIMON
?
PDF
From Docker Straight to AWS
DevOps.com
?
PDF
Developing and deploying serverless applications (February 2017)
Julien SIMON
?
PPTX
Real World AWS Deployment With Boto, Fabric, and Cloud Formation
Dixon Whitmire
?
PDF
AWS Code{Commit,Deploy,Pipeline} (June 2016)
Julien SIMON
?
PDF
AWS Cloud Development Kit (CDK)? ??? ?? ?? ??? ?? ? ?? - ???(??????) :: AWS C...
AWSKRUG - AWS???????
?
PDF
Building serverless apps with Node.js
Julien SIMON
?
PPTX
Perl and AWS
Jose Luis Martnez
?
PPTX
AWS Cloud Formation
Amit Thakkar
?
PDF
Serverless Architecture on AWS
Rajind Ruparathna
?
PPTX
Serverless Architecture
Micha? Kurzeja
?
PPTX
Advanced Discussion on Cloud Formation
Henry Huang
?
PDF
Hands-on with AWS IoT
Julien SIMON
?
PPTX
Deep Dive into AWS ECS and Spot Instances at Scale
Pahud Hsieh
?
PDF
How to create aws s3 bucket using terraform
Katy Slemon
?
AWS CloudFormation (February 2016)
Julien SIMON
?
From Docker Straight to AWS
DevOps.com
?
Developing and deploying serverless applications (February 2017)
Julien SIMON
?
Real World AWS Deployment With Boto, Fabric, and Cloud Formation
Dixon Whitmire
?
AWS Code{Commit,Deploy,Pipeline} (June 2016)
Julien SIMON
?
AWS Cloud Development Kit (CDK)? ??? ?? ?? ??? ?? ? ?? - ???(??????) :: AWS C...
AWSKRUG - AWS???????
?
Building serverless apps with Node.js
Julien SIMON
?
Perl and AWS
Jose Luis Martnez
?
AWS Cloud Formation
Amit Thakkar
?
Serverless Architecture on AWS
Rajind Ruparathna
?
Serverless Architecture
Micha? Kurzeja
?
Advanced Discussion on Cloud Formation
Henry Huang
?
Hands-on with AWS IoT
Julien SIMON
?
Deep Dive into AWS ECS and Spot Instances at Scale
Pahud Hsieh
?
How to create aws s3 bucket using terraform
Katy Slemon
?

Similar to Serverless cat detector workshop - cloudyna 2017 (16.12.2017) (19)

PDF
Serverless computing with AWS Lambda
Apigee | Google Cloud
?
PDF
Serverless Optical Character Recognition in support of Astronaut Safety AWS M...
Chris Shenton
?
PDF
Serverless OCR for NASA EVA: AWS Meetup DC 2017-12-12
Chris Shenton
?
PDF
Deploying Serverless Cloud Optical Character Recognition in Support of NASA A...
Chris Shenton
?
PDF
Serverless Architectural Patterns & Best Practices
Daniel Zivkovic
?
PDF
Hands-On AWS: Java SDK + CLI for Cloud Developers
Meetu Maltiar
?
PDF
Building Serverless APIs on AWS
Julien SIMON
?
PDF
Continuous Deployment in AWS Lambda
Shu Ting Tseng
?
PDF
AWS re:Invent 2016 Day 2 Keynote re:Cap
Adrian Hornsby
?
PDF
AWS re:Invent 2016 Day 2 Keynote re:Cap
Ian Massingham
?
PDF
AWS Serverless Workshop
Mikael Puittinen
?
PPTX
Introduction to DevOps on AWS
Shiva Narayanaswamy
?
PPTX
Reinvent recap
Jason Poley
?
PDF
An introduction to serverless architectures (February 2017)
Julien SIMON
?
PDF
Serverless Architecture - A Gentle Overview
CodeOps Technologies LLP
?
PDF
AWS and Serverless Computing
Roberto Casadei
?
PDF
Aws Lambda in Swift - NSLondon - 3rd December 2020
Andrea Scuderi
?
PPT
Cloud State of the Union for Java Developers
Burr Sutter
?
PDF
AWS Lambda
Scott Leberknight
?
Serverless computing with AWS Lambda
Apigee | Google Cloud
?
Serverless Optical Character Recognition in support of Astronaut Safety AWS M...
Chris Shenton
?
Serverless OCR for NASA EVA: AWS Meetup DC 2017-12-12
Chris Shenton
?
Deploying Serverless Cloud Optical Character Recognition in Support of NASA A...
Chris Shenton
?
Serverless Architectural Patterns & Best Practices
Daniel Zivkovic
?
Hands-On AWS: Java SDK + CLI for Cloud Developers
Meetu Maltiar
?
Building Serverless APIs on AWS
Julien SIMON
?
Continuous Deployment in AWS Lambda
Shu Ting Tseng
?
AWS re:Invent 2016 Day 2 Keynote re:Cap
Adrian Hornsby
?
AWS re:Invent 2016 Day 2 Keynote re:Cap
Ian Massingham
?
AWS Serverless Workshop
Mikael Puittinen
?
Introduction to DevOps on AWS
Shiva Narayanaswamy
?
Reinvent recap
Jason Poley
?
An introduction to serverless architectures (February 2017)
Julien SIMON
?
Serverless Architecture - A Gentle Overview
CodeOps Technologies LLP
?
AWS and Serverless Computing
Roberto Casadei
?
Aws Lambda in Swift - NSLondon - 3rd December 2020
Andrea Scuderi
?
Cloud State of the Union for Java Developers
Burr Sutter
?
Ad

Recently uploaded (20)

PDF
Automated Testing and Safety Analysis of Deep Neural Networks
Lionel Briand
?
PPTX
IObit Uninstaller Pro 14.3.1.8 Crack Free Download 2025
sdfger qwerty
?
PDF
Writing Maintainable Playwright Tests with Ease
Shubham Joshi
?
PDF
OpenChain Webinar - AboutCode - Practical Compliance in One Stack C Licensing...
Shane Coughlan
?
PPTX
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
?
PPTX
Introduction to web development | MERN Stack
JosephLiyon
?
PDF
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
?
PDF
Mastering VPC Architecture Build for Scale from Day 1.pdf
Devseccops.ai
?
PPTX
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
?
PDF
The Next-Gen HMIS Software AI, Blockchain & Cloud for Housing.pdf
Prudence B2B
?
PDF
The Rise of Sustainable Mobile App Solutions by New York Development Firms
ostechnologies16
?
PDF
From Data Preparation to Inference: How Alluxio Speeds Up AI
Alluxio, Inc.
?
PDF
Alur Perkembangan Software dan Jaringan Komputer
ssuser754303
?
PDF
Telemedicine App Development_ Key Factors to Consider for Your Healthcare Ven...
Mobilityinfotech
?
PDF
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
?
PPTX
arctitecture application system design os dsa
za241967
?
PPTX
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
dheeodoo
?
PDF
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
?
PPTX
Wondershare Filmora Crack 14.5.18 + Key Full Download [Latest 2025]
HyperPc soft
?
PPTX
Avast Premium Security crack 25.5.6162 + License Key 2025
HyperPc soft
?
Automated Testing and Safety Analysis of Deep Neural Networks
Lionel Briand
?
IObit Uninstaller Pro 14.3.1.8 Crack Free Download 2025
sdfger qwerty
?
Writing Maintainable Playwright Tests with Ease
Shubham Joshi
?
OpenChain Webinar - AboutCode - Practical Compliance in One Stack C Licensing...
Shane Coughlan
?
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
?
Introduction to web development | MERN Stack
JosephLiyon
?
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
?
Mastering VPC Architecture Build for Scale from Day 1.pdf
Devseccops.ai
?
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
?
The Next-Gen HMIS Software AI, Blockchain & Cloud for Housing.pdf
Prudence B2B
?
The Rise of Sustainable Mobile App Solutions by New York Development Firms
ostechnologies16
?
From Data Preparation to Inference: How Alluxio Speeds Up AI
Alluxio, Inc.
?
Alur Perkembangan Software dan Jaringan Komputer
ssuser754303
?
Telemedicine App Development_ Key Factors to Consider for Your Healthcare Ven...
Mobilityinfotech
?
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
?
arctitecture application system design os dsa
za241967
?
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
dheeodoo
?
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
?
Wondershare Filmora Crack 14.5.18 + Key Full Download [Latest 2025]
HyperPc soft
?
Avast Premium Security crack 25.5.6162 + License Key 2025
HyperPc soft
?
Ad

Serverless cat detector workshop - cloudyna 2017 (16.12.2017)