SlideShare ist ein Scribd-Unternehmen logo
1 von 63
GOING SERVERLESS WITH
OPENWHISK
RAYMOND CAMDEN
WHY AM I HERE?
• Developer Advocate for IBM
• LoopBack, OpenWhisk, Node.js,
Cordova, web stuff, and cats
• Blogging at
raymondcamden.com
• Tweeting at @raymondcamden
CONGRATULATIONS!
• New job!
• CTO of the Galactic Empire
• Full discretion!
• Build the Future of the Empire!
CURRENT SYSTEM
• J2EE servers
• Oracle
• Monolithic, slow to update
• One change requires 10 people to sign off, 10 unit tests, a Star
Destroyer, and a full day of Jenkins deployment
NEW SYSTEM
• Node/JavaScript
• Microservices
• Serverless
LETS TALK ABOUT THAT NAME…
“Serverless”
WHAT IS SERVERLESS?
“Serverless computing refers to a model where the
existence of servers is simply hidden from developers.
I.e. that even though servers still exist developers are
relieved from the need to care about their operation.
They are relieved from the need to worry about low-
level infrastructural and operational details such as
scalability, high-availability, infrastructure-security, and
so forth.”
Credit: A dead link at IBM
“FUNCTION AS A SERVICE”
• I write a function and it does one thing
• The actual hosting of the function, the making it available, is
handled by the service
• I call my function
• “Details”
APACHE OPENWHISK (OPENWHISK.ORG)
INSTALLATION
• Focused on the IBM Cloud (Bluemix) path
• https://console.ng.bluemix.net/openwhisk/
TASK ONE
Stormtroopers
get armor
1
Armor needs
paint
2
What color
should it be?
3
ACTIONS!
ACTIONS ARE…
• Small, atomic, stateless functions that do stuff (normally one
thing)
• Written in JavaScript, Swift, Python, Java, Go, PHP or Docker
• JavaScript!
• Can take arguments (as well as having default arguments too)
EXAMPLE
function main() {
return { output: ‘Pew pew!’ };
}
GETTING IT TO IBMCLOUD/OPENWHISK
• CLI to create
• CLI to update
• (Yes, this can be repetitive)
• bx wsk action create NAME file
• bx wsk action update NAME file
DEMO
RUNNING YOUR ACTION
• bx wsk action invoke NAME
• This is asynchronous!
• But you can get around that. ;)
DEMO
ACTIONS WITH ARGUMENTS
• One main argument object sent to function
• CLI call:
• --param name value
• --param-file foo.json
• You can define defaults in code or at the Action level
• bx wsk action update nameOfAction --param paramName
paramValue
TASK TWO
Add an argument
for type
1
Use the type to
figure out the
color
2
Default to white
3
DEMO
MORE ON ACTIVATIONS
• Useful for debugging errors
• You can watch your activations live (wsk activation poll)
LET’S SCREW UP!
ASYNC ACTIONS
• Wait – wasn’t it already async?
• An Async action being called by an Async CLI
EXAMPLE
function main(args) {
//stuff here, fancy stuff
return new Promise(function(resolve, reject) {
//stuff
});
}
TASK THREE
Hit the Death Star
API
1
Retrieve targeting
info from XML
Java-based service
2
Rewrite XML to
JSON
3
DEMO
HOW DO WE ACTUALLY USE
THIS?
ACTUALLY USING THE DARN THING
• Everything has a secure REST API (and npm package)
• Web Actions
• API Gateway
• "api-experimental“ (Old school, don’t use, deprecated, etc)
WEB ACTIONS
• Enabled via an action annotation (think metadata)
• bx wsk action update foo --web true
• Your action is now anonymously-accessible via a URL
• https://{APIHOST}/api/v1/web/{QUALIFIED ACTION NAME}.{EXT}
• bx wsk action get NAME --url
WEB ACTIONS (2)
• Support for HTTP, JSON, HTML, images
• URL can ask for different content response types
• URL can ask for a portion of the response
• Automatically map query and form values to params
• Access to request headers/body
• Code *will* change
TASK FOUR
Help
Stormtrooper
Recruitment
1
Build a static form
2
Process the form
result
3
DEMO
API GATEWAY
• The “Enterprise” Level API (kidding – mostly)
• Enables specific HTTP methods
• Enables monitoring
• Enables rate limiting
• Enables key/auth management
• UI + CLI support
SEQUENCES
• Simply a way to link actions
• Output automatically “flows” from one to the other
• Made in CLI: bx wsk action create NAME --sequence
A,B,C
• End result is an action
• Input/Output must ‘connect’
TASK FIVE
Create a new
“Verify Type”
action
1
Build Sequence
between Verify
and Paint
2
Return the paint
color
3
DEMO
PACKAGES
• Just an organization thing
• Literally – a subdirectory
• Actions are in a “default” package (by – wait for it – default)
• CLI to create/get details on packages
• Default params can be set package level
• You can share packages
• OpenWhisk has some (mostly around Watson stuff)
EXAMPLE
• bx wsk package create NAME
• bx wsk package list
• bx wsk package get NAME (optionally with --summary)
• bx wsk action create PACKAGE/ACTION foo.js
TRIGGERS AND RULES
• A trigger is an event source
• New email
• New Git commit
• Time based (think cron)
• Triggers have data (like an event in JS)
• A rule is the pairing between one trigger and one action
EXAMPLES
• 911 Example
• Blog Nag Example
IBM COMPOSER & CLOUD SHELL
• New way to build apps
• New graphical shell
• https://github.com/ibm-functions/composer
PRICING
• https://console.ng.bluemix.net/openwhisk/learn/pricing
• “you only pay for the exact duration your code is executing, rounded
up to the nearest 100ms”
• $0.000017 per second of execution, per GB of memory allocated
• 5M activations using 128MB per action and averaging 500ms: Free
• 10M activations using 512MB averaging 1 second: $78.20
• Free like kittens! (Ok, so not…)
WRAP UP
• Slack: openwhisk-team.slack.com (signup at
slack.openwhisk.org)
• My stuff: https://www.raymondcamden.com/tags/openwhisk
• Includes an example of testing
• Developer Journey:
https://developer.ibm.com/code/journey/unlock-enterprise-
data-using-apis/
• Visual Studio Code extension
• https://github.com/openwhisk/openwhisk-vscode
http://www.oreilly.com/programming/free/developing-serverless-
applications.csp
“YOU KNOW SERVERLESS
STILL HAS SERVERS,
RIGHT?”
Going Serverless with OpenWhisk

Weitere ähnliche Inhalte

Was ist angesagt?

Open stack ocata summit enabling aws lambda-like functionality with openstac...
Open stack ocata summit  enabling aws lambda-like functionality with openstac...Open stack ocata summit  enabling aws lambda-like functionality with openstac...
Open stack ocata summit enabling aws lambda-like functionality with openstac...Shaun Murakami
 
Developing Microservices with Apache Camel
Developing Microservices with Apache CamelDeveloping Microservices with Apache Camel
Developing Microservices with Apache CamelClaus Ibsen
 
308 the dark side of containers new
308 the dark side of containers new308 the dark side of containers new
308 the dark side of containers newAlexandru Hapliuc
 
Automate Amazon S3 Storage with Alexandria
Automate Amazon S3 Storage with AlexandriaAutomate Amazon S3 Storage with Alexandria
Automate Amazon S3 Storage with AlexandriaJeffrey Kemp
 
Build reactive systems on lambda
Build reactive systems on lambdaBuild reactive systems on lambda
Build reactive systems on lambdaYan Cui
 
AWS Lambda from the Trenches
AWS Lambda from the TrenchesAWS Lambda from the Trenches
AWS Lambda from the TrenchesYan Cui
 
Meeyup aws-loadbalancing-28032015
Meeyup aws-loadbalancing-28032015Meeyup aws-loadbalancing-28032015
Meeyup aws-loadbalancing-28032015Jhalak Modi
 
(CMP302) Amazon ECS: Distributed Applications at Scale
(CMP302) Amazon ECS: Distributed Applications at Scale(CMP302) Amazon ECS: Distributed Applications at Scale
(CMP302) Amazon ECS: Distributed Applications at ScaleAmazon Web Services
 
Modern websites in 2020 and Joomla
Modern websites in 2020 and JoomlaModern websites in 2020 and Joomla
Modern websites in 2020 and JoomlaGeorge Wilson
 
Building A Dynamic Website - 31st Jan 2015
Building A Dynamic Website - 31st Jan 2015Building A Dynamic Website - 31st Jan 2015
Building A Dynamic Website - 31st Jan 2015Jhalak Modi
 
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up LoftTurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up LoftAmazon Web Services
 
Continuous Delivery to Amazon ECS
Continuous Delivery to Amazon ECSContinuous Delivery to Amazon ECS
Continuous Delivery to Amazon ECSAmazon Web Services
 
AWS Lambda from the trenches
AWS Lambda from the trenchesAWS Lambda from the trenches
AWS Lambda from the trenchesYan Cui
 
Scaling your web app horizontally and vertically (ahmedabad amazon aws cloud...
Scaling your web app  horizontally and vertically (ahmedabad amazon aws cloud...Scaling your web app  horizontally and vertically (ahmedabad amazon aws cloud...
Scaling your web app horizontally and vertically (ahmedabad amazon aws cloud...Jhalak Modi
 
Automated Scaling of Microservice Stacks for JavaEE Applications
Automated Scaling of Microservice Stacks for JavaEE ApplicationsAutomated Scaling of Microservice Stacks for JavaEE Applications
Automated Scaling of Microservice Stacks for JavaEE ApplicationsJelastic Multi-Cloud PaaS
 
MJ Berends talk - Women & Non-Binary Focused Intro to AWS
 MJ Berends talk - Women & Non-Binary Focused Intro to AWS MJ Berends talk - Women & Non-Binary Focused Intro to AWS
MJ Berends talk - Women & Non-Binary Focused Intro to AWSAWS Chicago
 

Was ist angesagt? (20)

Open stack ocata summit enabling aws lambda-like functionality with openstac...
Open stack ocata summit  enabling aws lambda-like functionality with openstac...Open stack ocata summit  enabling aws lambda-like functionality with openstac...
Open stack ocata summit enabling aws lambda-like functionality with openstac...
 
Subversion Saves The Day
Subversion Saves The DaySubversion Saves The Day
Subversion Saves The Day
 
Developing Microservices with Apache Camel
Developing Microservices with Apache CamelDeveloping Microservices with Apache Camel
Developing Microservices with Apache Camel
 
308 the dark side of containers new
308 the dark side of containers new308 the dark side of containers new
308 the dark side of containers new
 
Automate Amazon S3 Storage with Alexandria
Automate Amazon S3 Storage with AlexandriaAutomate Amazon S3 Storage with Alexandria
Automate Amazon S3 Storage with Alexandria
 
Build reactive systems on lambda
Build reactive systems on lambdaBuild reactive systems on lambda
Build reactive systems on lambda
 
AWS Lambda from the Trenches
AWS Lambda from the TrenchesAWS Lambda from the Trenches
AWS Lambda from the Trenches
 
Java to scala
Java to scalaJava to scala
Java to scala
 
Meeyup aws-loadbalancing-28032015
Meeyup aws-loadbalancing-28032015Meeyup aws-loadbalancing-28032015
Meeyup aws-loadbalancing-28032015
 
(CMP302) Amazon ECS: Distributed Applications at Scale
(CMP302) Amazon ECS: Distributed Applications at Scale(CMP302) Amazon ECS: Distributed Applications at Scale
(CMP302) Amazon ECS: Distributed Applications at Scale
 
Modern websites in 2020 and Joomla
Modern websites in 2020 and JoomlaModern websites in 2020 and Joomla
Modern websites in 2020 and Joomla
 
Building A Dynamic Website - 31st Jan 2015
Building A Dynamic Website - 31st Jan 2015Building A Dynamic Website - 31st Jan 2015
Building A Dynamic Website - 31st Jan 2015
 
DevOps for Scala
DevOps for ScalaDevOps for Scala
DevOps for Scala
 
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up LoftTurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft
 
Continuous Delivery to Amazon ECS
Continuous Delivery to Amazon ECSContinuous Delivery to Amazon ECS
Continuous Delivery to Amazon ECS
 
AWS Lambda from the trenches
AWS Lambda from the trenchesAWS Lambda from the trenches
AWS Lambda from the trenches
 
Scaling your web app horizontally and vertically (ahmedabad amazon aws cloud...
Scaling your web app  horizontally and vertically (ahmedabad amazon aws cloud...Scaling your web app  horizontally and vertically (ahmedabad amazon aws cloud...
Scaling your web app horizontally and vertically (ahmedabad amazon aws cloud...
 
Gone in 60 Seconds
Gone in 60 SecondsGone in 60 Seconds
Gone in 60 Seconds
 
Automated Scaling of Microservice Stacks for JavaEE Applications
Automated Scaling of Microservice Stacks for JavaEE ApplicationsAutomated Scaling of Microservice Stacks for JavaEE Applications
Automated Scaling of Microservice Stacks for JavaEE Applications
 
MJ Berends talk - Women & Non-Binary Focused Intro to AWS
 MJ Berends talk - Women & Non-Binary Focused Intro to AWS MJ Berends talk - Women & Non-Binary Focused Intro to AWS
MJ Berends talk - Women & Non-Binary Focused Intro to AWS
 

Ähnlich wie Going Serverless with OpenWhisk

[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
 [AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵 [AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵Amazon Web Services Korea
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without InterferenceTony Tam
 
AWS Lambda at JUST EAT
AWS Lambda at JUST EATAWS Lambda at JUST EAT
AWS Lambda at JUST EATAndrew Brown
 
컴퓨팅 서비스 업데이트 - EC2, ECS, Lambda (김상필) :: re:Invent re:Cap Webinar 2015
컴퓨팅 서비스 업데이트 - EC2, ECS, Lambda (김상필) :: re:Invent re:Cap Webinar 2015컴퓨팅 서비스 업데이트 - EC2, ECS, Lambda (김상필) :: re:Invent re:Cap Webinar 2015
컴퓨팅 서비스 업데이트 - EC2, ECS, Lambda (김상필) :: re:Invent re:Cap Webinar 2015Amazon Web Services Korea
 
CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!Ortus Solutions, Corp
 
Embulk - 進化するバルクデータローダ
Embulk - 進化するバルクデータローダEmbulk - 進化するバルクデータローダ
Embulk - 進化するバルクデータローダSadayuki Furuhashi
 
Exploring KSQL Patterns
Exploring KSQL PatternsExploring KSQL Patterns
Exploring KSQL Patternsconfluent
 
Fighting Against Chaotically Separated Values with Embulk
Fighting Against Chaotically Separated Values with EmbulkFighting Against Chaotically Separated Values with Embulk
Fighting Against Chaotically Separated Values with EmbulkSadayuki Furuhashi
 
OpenFaaS serverless framework for Docker and Kubernetes - London
OpenFaaS serverless framework for Docker and Kubernetes - LondonOpenFaaS serverless framework for Docker and Kubernetes - London
OpenFaaS serverless framework for Docker and Kubernetes - LondonAlex Ellis
 
Play Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container ServicePlay Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container ServiceJosh Padnick
 
OpenFaaS KubeCon Zero to Serverless in 60 seconds anywhere
OpenFaaS KubeCon Zero to Serverless in 60 seconds anywhereOpenFaaS KubeCon Zero to Serverless in 60 seconds anywhere
OpenFaaS KubeCon Zero to Serverless in 60 seconds anywhereAlex Ellis
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele RialdiCodeFest
 
WTF is Twisted?
WTF is Twisted?WTF is Twisted?
WTF is Twisted?hawkowl
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesAmazon Web Services
 
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with ContainersAmazon Web Services
 
Developing in the Cloud
Developing in the CloudDeveloping in the Cloud
Developing in the CloudRyan Cuprak
 
Innovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCInnovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCkscaldef
 
Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015Evan Chan
 

Ähnlich wie Going Serverless with OpenWhisk (20)

[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
 [AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵 [AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without Interference
 
AWS Lambda at JUST EAT
AWS Lambda at JUST EATAWS Lambda at JUST EAT
AWS Lambda at JUST EAT
 
컴퓨팅 서비스 업데이트 - EC2, ECS, Lambda (김상필) :: re:Invent re:Cap Webinar 2015
컴퓨팅 서비스 업데이트 - EC2, ECS, Lambda (김상필) :: re:Invent re:Cap Webinar 2015컴퓨팅 서비스 업데이트 - EC2, ECS, Lambda (김상필) :: re:Invent re:Cap Webinar 2015
컴퓨팅 서비스 업데이트 - EC2, ECS, Lambda (김상필) :: re:Invent re:Cap Webinar 2015
 
CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!
 
Embulk - 進化するバルクデータローダ
Embulk - 進化するバルクデータローダEmbulk - 進化するバルクデータローダ
Embulk - 進化するバルクデータローダ
 
OpenWhisk Go Runtime
OpenWhisk Go RuntimeOpenWhisk Go Runtime
OpenWhisk Go Runtime
 
Exploring KSQL Patterns
Exploring KSQL PatternsExploring KSQL Patterns
Exploring KSQL Patterns
 
Fighting Against Chaotically Separated Values with Embulk
Fighting Against Chaotically Separated Values with EmbulkFighting Against Chaotically Separated Values with Embulk
Fighting Against Chaotically Separated Values with Embulk
 
OpenFaaS serverless framework for Docker and Kubernetes - London
OpenFaaS serverless framework for Docker and Kubernetes - LondonOpenFaaS serverless framework for Docker and Kubernetes - London
OpenFaaS serverless framework for Docker and Kubernetes - London
 
Play Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container ServicePlay Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container Service
 
OpenFaaS KubeCon Zero to Serverless in 60 seconds anywhere
OpenFaaS KubeCon Zero to Serverless in 60 seconds anywhereOpenFaaS KubeCon Zero to Serverless in 60 seconds anywhere
OpenFaaS KubeCon Zero to Serverless in 60 seconds anywhere
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele Rialdi
 
WTF is Twisted?
WTF is Twisted?WTF is Twisted?
WTF is Twisted?
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
 
ITB2017 - Keynote
ITB2017 - KeynoteITB2017 - Keynote
ITB2017 - Keynote
 
Developing in the Cloud
Developing in the CloudDeveloping in the Cloud
Developing in the Cloud
 
Innovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCInnovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXC
 
Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015
 

Mehr von Raymond Camden

Building a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared ToBuilding a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared ToRaymond Camden
 
Don't Over-React - just use Vue!
Don't Over-React - just use Vue!Don't Over-React - just use Vue!
Don't Over-React - just use Vue!Raymond Camden
 
Rapid API Development with LoopBack/StrongLoop
Rapid API Development with LoopBack/StrongLoopRapid API Development with LoopBack/StrongLoop
Rapid API Development with LoopBack/StrongLoopRaymond Camden
 
Cordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirstCordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirstRaymond Camden
 
Hybrid Mobile Development and MobileFirst
Hybrid Mobile Development and MobileFirstHybrid Mobile Development and MobileFirst
Hybrid Mobile Development and MobileFirstRaymond Camden
 
Introduction to Cordova
Introduction to CordovaIntroduction to Cordova
Introduction to CordovaRaymond Camden
 
Static Sites - Bringing Web 1.0 Back
Static Sites - Bringing Web 1.0 BackStatic Sites - Bringing Web 1.0 Back
Static Sites - Bringing Web 1.0 BackRaymond Camden
 
Leveling Up at JavaScript
Leveling Up at JavaScriptLeveling Up at JavaScript
Leveling Up at JavaScriptRaymond Camden
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGapRaymond Camden
 

Mehr von Raymond Camden (11)

Building a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared ToBuilding a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared To
 
Don't Over-React - just use Vue!
Don't Over-React - just use Vue!Don't Over-React - just use Vue!
Don't Over-React - just use Vue!
 
Rapid API Development with LoopBack/StrongLoop
Rapid API Development with LoopBack/StrongLoopRapid API Development with LoopBack/StrongLoop
Rapid API Development with LoopBack/StrongLoop
 
Cordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirstCordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirst
 
Hybrid Mobile Development and MobileFirst
Hybrid Mobile Development and MobileFirstHybrid Mobile Development and MobileFirst
Hybrid Mobile Development and MobileFirst
 
Introduction to Cordova
Introduction to CordovaIntroduction to Cordova
Introduction to Cordova
 
Static Sites - Bringing Web 1.0 Back
Static Sites - Bringing Web 1.0 BackStatic Sites - Bringing Web 1.0 Back
Static Sites - Bringing Web 1.0 Back
 
Leveling Up at JavaScript
Leveling Up at JavaScriptLeveling Up at JavaScript
Leveling Up at JavaScript
 
The Other Dev Tools
The Other Dev ToolsThe Other Dev Tools
The Other Dev Tools
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGap
 
ColdFusion 10
ColdFusion 10ColdFusion 10
ColdFusion 10
 

Kürzlich hochgeladen

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 

Kürzlich hochgeladen (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 

Going Serverless with OpenWhisk

  • 2. WHY AM I HERE? • Developer Advocate for IBM • LoopBack, OpenWhisk, Node.js, Cordova, web stuff, and cats • Blogging at raymondcamden.com • Tweeting at @raymondcamden
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. CONGRATULATIONS! • New job! • CTO of the Galactic Empire • Full discretion! • Build the Future of the Empire!
  • 8.
  • 9. CURRENT SYSTEM • J2EE servers • Oracle • Monolithic, slow to update • One change requires 10 people to sign off, 10 unit tests, a Star Destroyer, and a full day of Jenkins deployment
  • 10. NEW SYSTEM • Node/JavaScript • Microservices • Serverless
  • 11. LETS TALK ABOUT THAT NAME… “Serverless”
  • 12. WHAT IS SERVERLESS? “Serverless computing refers to a model where the existence of servers is simply hidden from developers. I.e. that even though servers still exist developers are relieved from the need to care about their operation. They are relieved from the need to worry about low- level infrastructural and operational details such as scalability, high-availability, infrastructure-security, and so forth.” Credit: A dead link at IBM
  • 13.
  • 14. “FUNCTION AS A SERVICE” • I write a function and it does one thing • The actual hosting of the function, the making it available, is handled by the service • I call my function • “Details”
  • 15.
  • 16.
  • 17.
  • 19.
  • 20. INSTALLATION • Focused on the IBM Cloud (Bluemix) path • https://console.ng.bluemix.net/openwhisk/
  • 21.
  • 22.
  • 23.
  • 24. TASK ONE Stormtroopers get armor 1 Armor needs paint 2 What color should it be? 3
  • 26. ACTIONS ARE… • Small, atomic, stateless functions that do stuff (normally one thing) • Written in JavaScript, Swift, Python, Java, Go, PHP or Docker • JavaScript! • Can take arguments (as well as having default arguments too)
  • 27. EXAMPLE function main() { return { output: ‘Pew pew!’ }; }
  • 28. GETTING IT TO IBMCLOUD/OPENWHISK • CLI to create • CLI to update • (Yes, this can be repetitive) • bx wsk action create NAME file • bx wsk action update NAME file
  • 29. DEMO
  • 30. RUNNING YOUR ACTION • bx wsk action invoke NAME • This is asynchronous! • But you can get around that. ;)
  • 31. DEMO
  • 32. ACTIONS WITH ARGUMENTS • One main argument object sent to function • CLI call: • --param name value • --param-file foo.json • You can define defaults in code or at the Action level • bx wsk action update nameOfAction --param paramName paramValue
  • 33. TASK TWO Add an argument for type 1 Use the type to figure out the color 2 Default to white 3
  • 34. DEMO
  • 35. MORE ON ACTIVATIONS • Useful for debugging errors • You can watch your activations live (wsk activation poll)
  • 37. ASYNC ACTIONS • Wait – wasn’t it already async? • An Async action being called by an Async CLI
  • 38. EXAMPLE function main(args) { //stuff here, fancy stuff return new Promise(function(resolve, reject) { //stuff }); }
  • 39. TASK THREE Hit the Death Star API 1 Retrieve targeting info from XML Java-based service 2 Rewrite XML to JSON 3
  • 40. DEMO
  • 41. HOW DO WE ACTUALLY USE THIS?
  • 42. ACTUALLY USING THE DARN THING • Everything has a secure REST API (and npm package) • Web Actions • API Gateway • "api-experimental“ (Old school, don’t use, deprecated, etc)
  • 43. WEB ACTIONS • Enabled via an action annotation (think metadata) • bx wsk action update foo --web true • Your action is now anonymously-accessible via a URL • https://{APIHOST}/api/v1/web/{QUALIFIED ACTION NAME}.{EXT} • bx wsk action get NAME --url
  • 44. WEB ACTIONS (2) • Support for HTTP, JSON, HTML, images • URL can ask for different content response types • URL can ask for a portion of the response • Automatically map query and form values to params • Access to request headers/body • Code *will* change
  • 45. TASK FOUR Help Stormtrooper Recruitment 1 Build a static form 2 Process the form result 3
  • 46. DEMO
  • 47. API GATEWAY • The “Enterprise” Level API (kidding – mostly) • Enables specific HTTP methods • Enables monitoring • Enables rate limiting • Enables key/auth management • UI + CLI support
  • 48. SEQUENCES • Simply a way to link actions • Output automatically “flows” from one to the other • Made in CLI: bx wsk action create NAME --sequence A,B,C • End result is an action • Input/Output must ‘connect’
  • 49. TASK FIVE Create a new “Verify Type” action 1 Build Sequence between Verify and Paint 2 Return the paint color 3
  • 50. DEMO
  • 51. PACKAGES • Just an organization thing • Literally – a subdirectory • Actions are in a “default” package (by – wait for it – default) • CLI to create/get details on packages • Default params can be set package level • You can share packages • OpenWhisk has some (mostly around Watson stuff)
  • 52. EXAMPLE • bx wsk package create NAME • bx wsk package list • bx wsk package get NAME (optionally with --summary) • bx wsk action create PACKAGE/ACTION foo.js
  • 53. TRIGGERS AND RULES • A trigger is an event source • New email • New Git commit • Time based (think cron) • Triggers have data (like an event in JS) • A rule is the pairing between one trigger and one action
  • 54. EXAMPLES • 911 Example • Blog Nag Example
  • 55. IBM COMPOSER & CLOUD SHELL • New way to build apps • New graphical shell • https://github.com/ibm-functions/composer
  • 56.
  • 57.
  • 58.
  • 59. PRICING • https://console.ng.bluemix.net/openwhisk/learn/pricing • “you only pay for the exact duration your code is executing, rounded up to the nearest 100ms” • $0.000017 per second of execution, per GB of memory allocated • 5M activations using 128MB per action and averaging 500ms: Free • 10M activations using 512MB averaging 1 second: $78.20 • Free like kittens! (Ok, so not…)
  • 60. WRAP UP • Slack: openwhisk-team.slack.com (signup at slack.openwhisk.org) • My stuff: https://www.raymondcamden.com/tags/openwhisk • Includes an example of testing • Developer Journey: https://developer.ibm.com/code/journey/unlock-enterprise- data-using-apis/ • Visual Studio Code extension • https://github.com/openwhisk/openwhisk-vscode
  • 62. “YOU KNOW SERVERLESS STILL HAS SERVERS, RIGHT?”

Hinweis der Redaktion

  1. I want to start off talking about “serverless”
  2. Create the action, make the name dynamic Update List
  3. Wsk action invoke name Wsk activation get X Wsk action invoke name –b Wsk action invoke name –b –r
  4. README! Be sure to run wsk bluemix login --user X --password Pick an action, let's say hello2 First, make it a web action! wsk action update hello2 --web true Now make a managed API: wsk api create /apis /hello2 get hello2 Note the output - it's the URL. Mention you can wsk api list if you forget copy the url, paste into browser, done, maybe add ?name=ray