SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
DeveloperConnect
OpenWhisk
Exercise
2
Introduction
This workshop will demonstrate some of the capabilities of the OpenWhisk open source
project that is deployed on IBM Bluemix.
OpenWhisk is a cloud-first distributed event-based programming service. It provides a
programming model to upload event handlers to a cloud service, and register the handlers to
respond to various events.
Applications built on a platform such as OpenWhisk are designed to take advantage of a so-
called “serverless architecture.” They offer key benefits in the form of automatic scale and
finer grained billing models.
This workshop will show you how to create functions – or actions in OpenWhisk parlance –
to execute logic in response to events – or triggers – such as database modifications, timers,
and other external changes.
In order to complete this workshop, you will need a Bluemix account that has access to
OpenWhisk. Please use the space provided to write down the email and password that you
will be using with the workshop.
Note: You can either use your own account or you can use the provided workshop account.
Email: ________________________________
Password: ________________________________
Build  and  deploy  an  event-­driven  application  using  the  
OpenWhisk  platform    
Log  into  Bluemix  
1. Using your browser, go to the Bluemix website at https://bluemix.net
2. Press the “LOG IN” button located at the top right hand corner of the page.
3
3. In the following page, provide the email and password and press the “Sign in” button.
4. In the Dashboard page, you should notice that you do not have any Applications created,
however you may notice some services have been created in advance for the workshops.
  
Use  the  OpenWhisk  dashboard  to  develop  actions  
In this section, you’ll write your first action, a function packaged in a single file that executes
some business logic.
1. Navigate to https://new-console.ng.bluemix.net/openwhisk/ to bring up the OpenWhisk
landing page.
4
2. Click the “Develop” button. This will bring up the web IDE where you can create actions
which represent your business logic. JavaScript is the default language, but you can also use
Python, Swift, Java, and Docker.
3. Click the “Create An Action” button.
5
4. This will bring up a view where you can set the name and programming language. We’ll
just accept the default, Node.js version 6 and give it a name: “sample-application” then click
“Create Action”.
5. The web IDE will open with the skeleton of an OpenWhisk action. All OpenWhisk actions
must include a “main” function that take a single argument containing context information.
Click the “Run This Action” button above the code.
6
6. You’ll now be shown a window to provide the context information to the action that
represents the object passed in as the params value. Leave the value as it is, and click the
“Run With This Value” button.
7. This will show the “Invocation Console” providing various details around the execution of
the Action. Note the “Completed in” (execution time) as well as the “Billed for” values.
Actions written for the OpenWhisk platform are only billed for the time they actually execute,
which can be a more attractive option than reserving resources by the gigabyte/hour or day
as in other forms of cloud computing.
7
8. Click the “Close” button which will bring you back to the JavaScript source of the action.
Change the return value to the following, then click “Run This Action.
function main(params) {
return { message: params.message };
}
9. You’ll be notified that the updated version is not yet live. Click the “Make It Live” button to
upload this latest version.
10. Change the value of the message key to “Hello DeveloperConnect!” and click the “Run
With This Value” button.
8
11. You’ll now see another result in the Invocation Console from executing the action again.
  
  
  
Use  the  OpenWhisk  dashboard  to  monitor  actions  
In this section you’ll explore the monitoring dashboard that provides logs and historical data
about your action executions.
1. Click the “Monitor” tab next to the “Develop” tab that you used to enter the web IDE at the
start of this lab.
2. This brings up a dashboard with the history of actions executed, their degree of success
over time, and deeper details into the execution of the actions.
9
3. Click on the green arrow next to the two “sample-application” invocations in the right
pane. This will display stack traces and other important debugging information as you
develop more complex applications, such as those that tie several actions together into a
sequence or which are not invoked manually, as we have been doing with the Develop
console.
10
Use  the  dashboard  to  create  an  alarm  triggered  action  
In this section, you’ll set up an event feed for your action. Instead of invoking them manually,
we’ll create a trigger that invokes them on a schedule (every 20 seconds) using the web IDE.
1. Click the “Develop” tab to get you back to the web IDE. Update the “sample-application”
with this new main function and click the button at the bottom to “Make It Live”.
function main(params) {
var date = new Date();
var now = (date.getHours() + ":" +
date.getMinutes() + ":" +
date.getSeconds());
console.log("Invoked at: " + now);
return { message: "Invoked at: " + now };
}
2. The “Make It Live” button will now become an “Automate This Action – Create a Rule”
button. Click that button and select the “Periodic – Alarm-based triggers” tile in the resulting
screen.
3. Click the “New Alarm +” tile, then pick “Cron” on the following screen, and enter this cron
syntax: */30 * * * * *
4. Name the trigger “every-30-seconds” and click the “Create Periodic Trigger” button and
click the “Next” button. You’ll now see confirmation that the alarm feed is linked to your
action. Click “This Looks Good”. Save the rule and click “Done”.
11
12
5. Click the “Monitor” tab and let’s see our actions invoked every 30 seconds.
6. By default, the alarm will run 1,000 times so disable it after you’re done testing. Click back
to the “Develop” tab, and find the alarm in the bottom right pane. Hover over the alarm and
click the trash can icon.
13
Install  the  OpenWhisk  command  line  tool    
So far you’ve seen the powerful tooling that the Bluemix hosted implementation of
OpenWhisk provides. But you can also use the open source command line interface tool to
interact with OpenWhisk running on Bluemix or any other host where OpenWhisk may be
installed.
1. Navigate back to https://new-console.ng.bluemix.net/openwhisk/ to bring up the
OpenWhisk landing page.
2. Click the “Use the CLI” link. This will bring up three steps to download the command line
tool. You can install this CLI onto your workstation, or if you prefer, onto a separate virtual
machine.
3. Once you have downloaded the CLI for your platform, open a terminal window to run the
“wsk” executable. Set your OpenWhisk Namespace and Authorization Key by copying it
from this page and running it in your terminal.
4. Finally, run the “whisk action invoke” command to execute the test action. If that works,
you’re ready for the next step.
Use  the  OpenWhisk  CLI  to  create  an  alarm  triggered  action  
This next section will introduce you to triggers and how they can be mapped to actions using
rules. These steps will create an alarm trigger – similar to a cron job – that invokes an action
every 20 seconds.
1. Create an action that we will invoke from the trigger by entering the following JavaScript
into a file called “handler.js”.
function main(params) {
var date = new Date();
var now = (date.getHours() + ":" +
date.getMinutes() + ":" +
date.getSeconds());
console.log("Invoked at: " + now);
return { message: "Invoked at: " + now };
}
2. Upload the file to OpenWhisk
$ wsk action create handler handler.js
3. Invoke the action manually
$ wsk action invoke --blocking handler
14
4. Create an alarm trigger to invoke the action every 20 seconds (this will run 1,000 times by
default, so we’ll specify a maximum of 9 invocations just for testing).
$ wsk trigger create every-20-seconds 
--feed /whisk.system/alarms/alarm 
--param cron '*/20 * * * * *' 
--param maxTriggers 9
5. Create a rule to map the trigger to the rule and enable it
$ wsk rule create --enable invoke-periodically every-20-seconds handler
6. Poll the logs to see the output until you see an activation for “handler”.
$ wsk activation poll
7. Hit CTRL-C to stop polling the log and get the details on that particular activation.
$ wsk activation get [activation id from above]
Continue  to  iterate  on  your  actions,  triggers,  and  rules  
You can now extend the application or create new actions, triggers, and rules. You might
also want to explore a few sample applications to see serverless architectures in action.
James Thomas has a list of some of the compelling IoT, bot, and microservices available on
his “Awesome OpenWhisk” page: http://bit.ly/awe-ow
15

Weitere ähnliche Inhalte

Was ist angesagt?

Create a meteor chat app in 30 minutes
Create a meteor chat app in 30 minutesCreate a meteor chat app in 30 minutes
Create a meteor chat app in 30 minutesDesignveloper
 
GigaSpaces Cloud Computing Framework 4 XAP - Quick Tour - v2
GigaSpaces Cloud Computing Framework 4 XAP - Quick Tour - v2GigaSpaces Cloud Computing Framework 4 XAP - Quick Tour - v2
GigaSpaces Cloud Computing Framework 4 XAP - Quick Tour - v2Shay Hassidim
 
Cloud and Ubiquitous Computing manual
Cloud and Ubiquitous Computing manual Cloud and Ubiquitous Computing manual
Cloud and Ubiquitous Computing manual Sonali Parab
 
Developed your first Xamarin.Forms Application
Developed your first Xamarin.Forms ApplicationDeveloped your first Xamarin.Forms Application
Developed your first Xamarin.Forms ApplicationCheah Eng Soon
 
Get started with docker & dev ops
Get started with docker & dev opsGet started with docker & dev ops
Get started with docker & dev opsAsya Dudnik
 
Servlet and jsp development with eclipse wtp
Servlet and jsp development with eclipse wtpServlet and jsp development with eclipse wtp
Servlet and jsp development with eclipse wtpodilodif
 
Chicago alm user group git demo script and notes
Chicago alm user group   git demo script and notesChicago alm user group   git demo script and notes
Chicago alm user group git demo script and notesDave Burnison
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationGiacomo Vacca
 
Get started with docker & dev ops
Get started with docker & dev opsGet started with docker & dev ops
Get started with docker & dev opsAsya Dudnik
 
Managing Web Infrastructure Systems with Windows PowerShell 2.0 Demo Script
Managing Web Infrastructure Systems with Windows PowerShell 2.0 Demo ScriptManaging Web Infrastructure Systems with Windows PowerShell 2.0 Demo Script
Managing Web Infrastructure Systems with Windows PowerShell 2.0 Demo ScriptMicrosoft TechNet
 
OSDC 2017 - Julien Pivotto - Automating Jenkins
OSDC 2017 - Julien Pivotto - Automating JenkinsOSDC 2017 - Julien Pivotto - Automating Jenkins
OSDC 2017 - Julien Pivotto - Automating JenkinsNETWAYS
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chefMukta Aphale
 
Creating an nuget package for EPiServer
Creating an nuget package for EPiServerCreating an nuget package for EPiServer
Creating an nuget package for EPiServerPaul Graham
 
Forensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance InvestigationsForensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance InvestigationsNicholas Jansma
 
TIAD - DYI: A simple orchestrator built step by step
TIAD - DYI: A simple orchestrator built step by stepTIAD - DYI: A simple orchestrator built step by step
TIAD - DYI: A simple orchestrator built step by stepThe Incredible Automation Day
 
D installation manual
D installation manualD installation manual
D installation manualFaheem Akbar
 

Was ist angesagt? (18)

Create a meteor chat app in 30 minutes
Create a meteor chat app in 30 minutesCreate a meteor chat app in 30 minutes
Create a meteor chat app in 30 minutes
 
GigaSpaces Cloud Computing Framework 4 XAP - Quick Tour - v2
GigaSpaces Cloud Computing Framework 4 XAP - Quick Tour - v2GigaSpaces Cloud Computing Framework 4 XAP - Quick Tour - v2
GigaSpaces Cloud Computing Framework 4 XAP - Quick Tour - v2
 
Cloud and Ubiquitous Computing manual
Cloud and Ubiquitous Computing manual Cloud and Ubiquitous Computing manual
Cloud and Ubiquitous Computing manual
 
Meteor Day Talk
Meteor Day TalkMeteor Day Talk
Meteor Day Talk
 
Developed your first Xamarin.Forms Application
Developed your first Xamarin.Forms ApplicationDeveloped your first Xamarin.Forms Application
Developed your first Xamarin.Forms Application
 
Get started with docker & dev ops
Get started with docker & dev opsGet started with docker & dev ops
Get started with docker & dev ops
 
Servlet and jsp development with eclipse wtp
Servlet and jsp development with eclipse wtpServlet and jsp development with eclipse wtp
Servlet and jsp development with eclipse wtp
 
Chicago alm user group git demo script and notes
Chicago alm user group   git demo script and notesChicago alm user group   git demo script and notes
Chicago alm user group git demo script and notes
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous Integration
 
Get started with docker & dev ops
Get started with docker & dev opsGet started with docker & dev ops
Get started with docker & dev ops
 
TIAD : Automating the modern datacenter
TIAD : Automating the modern datacenterTIAD : Automating the modern datacenter
TIAD : Automating the modern datacenter
 
Managing Web Infrastructure Systems with Windows PowerShell 2.0 Demo Script
Managing Web Infrastructure Systems with Windows PowerShell 2.0 Demo ScriptManaging Web Infrastructure Systems with Windows PowerShell 2.0 Demo Script
Managing Web Infrastructure Systems with Windows PowerShell 2.0 Demo Script
 
OSDC 2017 - Julien Pivotto - Automating Jenkins
OSDC 2017 - Julien Pivotto - Automating JenkinsOSDC 2017 - Julien Pivotto - Automating Jenkins
OSDC 2017 - Julien Pivotto - Automating Jenkins
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chef
 
Creating an nuget package for EPiServer
Creating an nuget package for EPiServerCreating an nuget package for EPiServer
Creating an nuget package for EPiServer
 
Forensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance InvestigationsForensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance Investigations
 
TIAD - DYI: A simple orchestrator built step by step
TIAD - DYI: A simple orchestrator built step by stepTIAD - DYI: A simple orchestrator built step by step
TIAD - DYI: A simple orchestrator built step by step
 
D installation manual
D installation manualD installation manual
D installation manual
 

Andere mochten auch

Material de conteo para niños sordos
Material de conteo para niños sordosMaterial de conteo para niños sordos
Material de conteo para niños sordosPily Aco-ll
 
"Somos Físicos" Petróleo e Meios Alternativos de Transportes
"Somos Físicos" Petróleo e Meios Alternativos de Transportes "Somos Físicos" Petróleo e Meios Alternativos de Transportes
"Somos Físicos" Petróleo e Meios Alternativos de Transportes Vania Lima "Somos Físicos"
 
A Linha de Cascais a Morrer e a Demagogia a Florescer
A Linha de Cascais a Morrer e a Demagogia a FlorescerA Linha de Cascais a Morrer e a Demagogia a Florescer
A Linha de Cascais a Morrer e a Demagogia a FlorescerPlataforma Cascalenses
 
Diapositivas
DiapositivasDiapositivas
Diapositivasaytara
 
Cd26 defebrero2014 abril-25-26-27
Cd26 defebrero2014 abril-25-26-27Cd26 defebrero2014 abril-25-26-27
Cd26 defebrero2014 abril-25-26-27noeliaa1
 
Revista Fundação Cascais - Setembro 2002
Revista Fundação Cascais - Setembro 2002Revista Fundação Cascais - Setembro 2002
Revista Fundação Cascais - Setembro 2002Plataforma Cascalenses
 
Revista Fundação Cascais - Julho 2001
Revista Fundação Cascais - Julho 2001Revista Fundação Cascais - Julho 2001
Revista Fundação Cascais - Julho 2001Plataforma Cascalenses
 
InovaçõEs AgríColas E Aumento Da Produtividade
InovaçõEs AgríColas E Aumento Da ProdutividadeInovaçõEs AgríColas E Aumento Da Produtividade
InovaçõEs AgríColas E Aumento Da Produtividadecrie_historia8
 
Oracle EPM Cloud for Midsize Customers
Oracle EPM Cloud for Midsize CustomersOracle EPM Cloud for Midsize Customers
Oracle EPM Cloud for Midsize CustomersAlithya
 
FILOSOFIA DAS LUZES
FILOSOFIA DAS LUZESFILOSOFIA DAS LUZES
FILOSOFIA DAS LUZEScattonia
 
SIOR MICHIGAN - LUNCHEON PRESENTATIOn
SIOR MICHIGAN - LUNCHEON PRESENTATIOnSIOR MICHIGAN - LUNCHEON PRESENTATIOn
SIOR MICHIGAN - LUNCHEON PRESENTATIOnmanagingmatters
 
Império romano blogue
Império romano blogueImpério romano blogue
Império romano blogueVítor Santos
 
Revolução francesa módulo 7
Revolução francesa  módulo 7Revolução francesa  módulo 7
Revolução francesa módulo 7Carla Teixeira
 
Renascimento cultural 3
Renascimento cultural 3Renascimento cultural 3
Renascimento cultural 3Carla Teixeira
 

Andere mochten auch (20)

Material de conteo para niños sordos
Material de conteo para niños sordosMaterial de conteo para niños sordos
Material de conteo para niños sordos
 
Letter_Of_Recommendation
Letter_Of_RecommendationLetter_Of_Recommendation
Letter_Of_Recommendation
 
"Somos Físicos" Petróleo e Meios Alternativos de Transportes
"Somos Físicos" Petróleo e Meios Alternativos de Transportes "Somos Físicos" Petróleo e Meios Alternativos de Transportes
"Somos Físicos" Petróleo e Meios Alternativos de Transportes
 
A Linha de Cascais a Morrer e a Demagogia a Florescer
A Linha de Cascais a Morrer e a Demagogia a FlorescerA Linha de Cascais a Morrer e a Demagogia a Florescer
A Linha de Cascais a Morrer e a Demagogia a Florescer
 
Nordpeis X-20F
Nordpeis X-20FNordpeis X-20F
Nordpeis X-20F
 
Diapositivas
DiapositivasDiapositivas
Diapositivas
 
Ecuacion
EcuacionEcuacion
Ecuacion
 
Cd26 defebrero2014 abril-25-26-27
Cd26 defebrero2014 abril-25-26-27Cd26 defebrero2014 abril-25-26-27
Cd26 defebrero2014 abril-25-26-27
 
Revista Fundação Cascais - Setembro 2002
Revista Fundação Cascais - Setembro 2002Revista Fundação Cascais - Setembro 2002
Revista Fundação Cascais - Setembro 2002
 
Revista Fundação Cascais - Julho 2001
Revista Fundação Cascais - Julho 2001Revista Fundação Cascais - Julho 2001
Revista Fundação Cascais - Julho 2001
 
Días terribles
Días terriblesDías terribles
Días terribles
 
Barroco slides
Barroco slidesBarroco slides
Barroco slides
 
InovaçõEs AgríColas E Aumento Da Produtividade
InovaçõEs AgríColas E Aumento Da ProdutividadeInovaçõEs AgríColas E Aumento Da Produtividade
InovaçõEs AgríColas E Aumento Da Produtividade
 
Oracle EPM Cloud for Midsize Customers
Oracle EPM Cloud for Midsize CustomersOracle EPM Cloud for Midsize Customers
Oracle EPM Cloud for Midsize Customers
 
FILOSOFIA DAS LUZES
FILOSOFIA DAS LUZESFILOSOFIA DAS LUZES
FILOSOFIA DAS LUZES
 
SIOR MICHIGAN - LUNCHEON PRESENTATIOn
SIOR MICHIGAN - LUNCHEON PRESENTATIOnSIOR MICHIGAN - LUNCHEON PRESENTATIOn
SIOR MICHIGAN - LUNCHEON PRESENTATIOn
 
Império romano blogue
Império romano blogueImpério romano blogue
Império romano blogue
 
Revolução francesa módulo 7
Revolução francesa  módulo 7Revolução francesa  módulo 7
Revolução francesa módulo 7
 
Renascimento cultural 3
Renascimento cultural 3Renascimento cultural 3
Renascimento cultural 3
 
O maneirismo1
O maneirismo1O maneirismo1
O maneirismo1
 

Ähnlich wie OpenWhisk Lab

The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180Mahmoud Samir Fayed
 
Containers Lab
Containers Lab Containers Lab
Containers Lab Dev_Events
 
BLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxBLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxmoirarandell
 
PVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOpsPVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOpsAndrey Karpov
 
Introduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKIntroduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKBrendan Lim
 
Setting up your virtual infrastructure using fi-lab cloud
Setting up your virtual infrastructure using fi-lab cloudSetting up your virtual infrastructure using fi-lab cloud
Setting up your virtual infrastructure using fi-lab cloudFernando Lopez Aguilar
 
The Ring programming language version 1.6 book - Part 73 of 189
The Ring programming language version 1.6 book - Part 73 of 189The Ring programming language version 1.6 book - Part 73 of 189
The Ring programming language version 1.6 book - Part 73 of 189Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210Mahmoud Samir Fayed
 
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!Anderson Bassani
 
The Ring programming language version 1.5.2 book - Part 68 of 181
The Ring programming language version 1.5.2 book - Part 68 of 181The Ring programming language version 1.5.2 book - Part 68 of 181
The Ring programming language version 1.5.2 book - Part 68 of 181Mahmoud Samir Fayed
 
Laboratorio: Desarrollo para Smart Devices
Laboratorio: Desarrollo para Smart DevicesLaboratorio: Desarrollo para Smart Devices
Laboratorio: Desarrollo para Smart DevicesGeneXus
 
The Ring programming language version 1.5.4 book - Part 71 of 185
The Ring programming language version 1.5.4 book - Part 71 of 185The Ring programming language version 1.5.4 book - Part 71 of 185
The Ring programming language version 1.5.4 book - Part 71 of 185Mahmoud Samir Fayed
 
Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008Yudep Apoi
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3kognate
 
Event driven network
Event driven networkEvent driven network
Event driven networkHarish B
 
Creating Sentiment Line Chart with Watson
Creating Sentiment Line Chart with Watson Creating Sentiment Line Chart with Watson
Creating Sentiment Line Chart with Watson Dev_Events
 
XPages Blast - ILUG 2010
XPages Blast - ILUG 2010XPages Blast - ILUG 2010
XPages Blast - ILUG 2010Tim Clark
 

Ähnlich wie OpenWhisk Lab (20)

The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180
 
Containers Lab
Containers Lab Containers Lab
Containers Lab
 
BLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxBLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docx
 
PVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOpsPVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOps
 
Introduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKIntroduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDK
 
Setting up your virtual infrastructure using fi-lab cloud
Setting up your virtual infrastructure using fi-lab cloudSetting up your virtual infrastructure using fi-lab cloud
Setting up your virtual infrastructure using fi-lab cloud
 
The Ring programming language version 1.6 book - Part 73 of 189
The Ring programming language version 1.6 book - Part 73 of 189The Ring programming language version 1.6 book - Part 73 of 189
The Ring programming language version 1.6 book - Part 73 of 189
 
web application.pptx
web application.pptxweb application.pptx
web application.pptx
 
The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210
 
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!
 
The Ring programming language version 1.5.2 book - Part 68 of 181
The Ring programming language version 1.5.2 book - Part 68 of 181The Ring programming language version 1.5.2 book - Part 68 of 181
The Ring programming language version 1.5.2 book - Part 68 of 181
 
Laboratorio: Desarrollo para Smart Devices
Laboratorio: Desarrollo para Smart DevicesLaboratorio: Desarrollo para Smart Devices
Laboratorio: Desarrollo para Smart Devices
 
The Ring programming language version 1.5.4 book - Part 71 of 185
The Ring programming language version 1.5.4 book - Part 71 of 185The Ring programming language version 1.5.4 book - Part 71 of 185
The Ring programming language version 1.5.4 book - Part 71 of 185
 
2015 09-18-jawsug hpc-#1
2015 09-18-jawsug hpc-#12015 09-18-jawsug hpc-#1
2015 09-18-jawsug hpc-#1
 
Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3
 
Event driven network
Event driven networkEvent driven network
Event driven network
 
Creating Sentiment Line Chart with Watson
Creating Sentiment Line Chart with Watson Creating Sentiment Line Chart with Watson
Creating Sentiment Line Chart with Watson
 
XPages Blast - ILUG 2010
XPages Blast - ILUG 2010XPages Blast - ILUG 2010
XPages Blast - ILUG 2010
 
Wave Workshop
Wave WorkshopWave Workshop
Wave Workshop
 

Mehr von Dev_Events

Eclipse OMR: a modern, open-source toolkit for building language runtimes
Eclipse OMR: a modern, open-source toolkit for building language runtimesEclipse OMR: a modern, open-source toolkit for building language runtimes
Eclipse OMR: a modern, open-source toolkit for building language runtimesDev_Events
 
Eclipse MicroProfile: Accelerating the adoption of Java Microservices
Eclipse MicroProfile: Accelerating the adoption of Java MicroservicesEclipse MicroProfile: Accelerating the adoption of Java Microservices
Eclipse MicroProfile: Accelerating the adoption of Java MicroservicesDev_Events
 
From Science Fiction to Science Fact: How AI Will Change Our Approach to Buil...
From Science Fiction to Science Fact: How AI Will Change Our Approach to Buil...From Science Fiction to Science Fact: How AI Will Change Our Approach to Buil...
From Science Fiction to Science Fact: How AI Will Change Our Approach to Buil...Dev_Events
 
Blockchain Hyperledger Lab
Blockchain Hyperledger LabBlockchain Hyperledger Lab
Blockchain Hyperledger LabDev_Events
 
Introduction to Blockchain and Hyperledger
Introduction to Blockchain and HyperledgerIntroduction to Blockchain and Hyperledger
Introduction to Blockchain and HyperledgerDev_Events
 
Using GPUs to Achieve Massive Parallelism in Java 8
Using GPUs to Achieve Massive Parallelism in Java 8Using GPUs to Achieve Massive Parallelism in Java 8
Using GPUs to Achieve Massive Parallelism in Java 8Dev_Events
 
Lean and Easy IoT Applications with OSGi and Eclipse Concierge
Lean and Easy IoT Applications with OSGi and Eclipse ConciergeLean and Easy IoT Applications with OSGi and Eclipse Concierge
Lean and Easy IoT Applications with OSGi and Eclipse ConciergeDev_Events
 
Eclipse JDT Embraces Java 9 – An Insider’s View
Eclipse JDT Embraces Java 9 – An Insider’s ViewEclipse JDT Embraces Java 9 – An Insider’s View
Eclipse JDT Embraces Java 9 – An Insider’s ViewDev_Events
 
Node.js – ask us anything!
Node.js – ask us anything! Node.js – ask us anything!
Node.js – ask us anything! Dev_Events
 
Swift on the Server
Swift on the Server Swift on the Server
Swift on the Server Dev_Events
 
Being serverless and Swift... Is that allowed?
Being serverless and Swift... Is that allowed? Being serverless and Swift... Is that allowed?
Being serverless and Swift... Is that allowed? Dev_Events
 
Secrets of building a debuggable runtime: Learn how language implementors sol...
Secrets of building a debuggable runtime: Learn how language implementors sol...Secrets of building a debuggable runtime: Learn how language implementors sol...
Secrets of building a debuggable runtime: Learn how language implementors sol...Dev_Events
 
Tools in Action: Transforming everyday objects with the power of deeplearning...
Tools in Action: Transforming everyday objects with the power of deeplearning...Tools in Action: Transforming everyday objects with the power of deeplearning...
Tools in Action: Transforming everyday objects with the power of deeplearning...Dev_Events
 
Microservices without Servers
Microservices without ServersMicroservices without Servers
Microservices without ServersDev_Events
 
The App Evolution
The App EvolutionThe App Evolution
The App EvolutionDev_Events
 
Building Next Generation Applications and Microservices
Building Next Generation Applications and Microservices Building Next Generation Applications and Microservices
Building Next Generation Applications and Microservices Dev_Events
 
Create and Manage APIs with API Connect, Swagger and Bluemix
Create and Manage APIs with API Connect, Swagger and BluemixCreate and Manage APIs with API Connect, Swagger and Bluemix
Create and Manage APIs with API Connect, Swagger and BluemixDev_Events
 
OpenWhisk - Serverless Architecture
OpenWhisk - Serverless Architecture OpenWhisk - Serverless Architecture
OpenWhisk - Serverless Architecture Dev_Events
 
Add Custom Model and ORM to Node.js
Add Custom Model and ORM to Node.jsAdd Custom Model and ORM to Node.js
Add Custom Model and ORM to Node.jsDev_Events
 
Adding User Management to Node.js
Adding User Management to Node.jsAdding User Management to Node.js
Adding User Management to Node.jsDev_Events
 

Mehr von Dev_Events (20)

Eclipse OMR: a modern, open-source toolkit for building language runtimes
Eclipse OMR: a modern, open-source toolkit for building language runtimesEclipse OMR: a modern, open-source toolkit for building language runtimes
Eclipse OMR: a modern, open-source toolkit for building language runtimes
 
Eclipse MicroProfile: Accelerating the adoption of Java Microservices
Eclipse MicroProfile: Accelerating the adoption of Java MicroservicesEclipse MicroProfile: Accelerating the adoption of Java Microservices
Eclipse MicroProfile: Accelerating the adoption of Java Microservices
 
From Science Fiction to Science Fact: How AI Will Change Our Approach to Buil...
From Science Fiction to Science Fact: How AI Will Change Our Approach to Buil...From Science Fiction to Science Fact: How AI Will Change Our Approach to Buil...
From Science Fiction to Science Fact: How AI Will Change Our Approach to Buil...
 
Blockchain Hyperledger Lab
Blockchain Hyperledger LabBlockchain Hyperledger Lab
Blockchain Hyperledger Lab
 
Introduction to Blockchain and Hyperledger
Introduction to Blockchain and HyperledgerIntroduction to Blockchain and Hyperledger
Introduction to Blockchain and Hyperledger
 
Using GPUs to Achieve Massive Parallelism in Java 8
Using GPUs to Achieve Massive Parallelism in Java 8Using GPUs to Achieve Massive Parallelism in Java 8
Using GPUs to Achieve Massive Parallelism in Java 8
 
Lean and Easy IoT Applications with OSGi and Eclipse Concierge
Lean and Easy IoT Applications with OSGi and Eclipse ConciergeLean and Easy IoT Applications with OSGi and Eclipse Concierge
Lean and Easy IoT Applications with OSGi and Eclipse Concierge
 
Eclipse JDT Embraces Java 9 – An Insider’s View
Eclipse JDT Embraces Java 9 – An Insider’s ViewEclipse JDT Embraces Java 9 – An Insider’s View
Eclipse JDT Embraces Java 9 – An Insider’s View
 
Node.js – ask us anything!
Node.js – ask us anything! Node.js – ask us anything!
Node.js – ask us anything!
 
Swift on the Server
Swift on the Server Swift on the Server
Swift on the Server
 
Being serverless and Swift... Is that allowed?
Being serverless and Swift... Is that allowed? Being serverless and Swift... Is that allowed?
Being serverless and Swift... Is that allowed?
 
Secrets of building a debuggable runtime: Learn how language implementors sol...
Secrets of building a debuggable runtime: Learn how language implementors sol...Secrets of building a debuggable runtime: Learn how language implementors sol...
Secrets of building a debuggable runtime: Learn how language implementors sol...
 
Tools in Action: Transforming everyday objects with the power of deeplearning...
Tools in Action: Transforming everyday objects with the power of deeplearning...Tools in Action: Transforming everyday objects with the power of deeplearning...
Tools in Action: Transforming everyday objects with the power of deeplearning...
 
Microservices without Servers
Microservices without ServersMicroservices without Servers
Microservices without Servers
 
The App Evolution
The App EvolutionThe App Evolution
The App Evolution
 
Building Next Generation Applications and Microservices
Building Next Generation Applications and Microservices Building Next Generation Applications and Microservices
Building Next Generation Applications and Microservices
 
Create and Manage APIs with API Connect, Swagger and Bluemix
Create and Manage APIs with API Connect, Swagger and BluemixCreate and Manage APIs with API Connect, Swagger and Bluemix
Create and Manage APIs with API Connect, Swagger and Bluemix
 
OpenWhisk - Serverless Architecture
OpenWhisk - Serverless Architecture OpenWhisk - Serverless Architecture
OpenWhisk - Serverless Architecture
 
Add Custom Model and ORM to Node.js
Add Custom Model and ORM to Node.jsAdd Custom Model and ORM to Node.js
Add Custom Model and ORM to Node.js
 
Adding User Management to Node.js
Adding User Management to Node.jsAdding User Management to Node.js
Adding User Management to Node.js
 

Kürzlich hochgeladen

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Kürzlich hochgeladen (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

OpenWhisk Lab

  • 2. 2 Introduction This workshop will demonstrate some of the capabilities of the OpenWhisk open source project that is deployed on IBM Bluemix. OpenWhisk is a cloud-first distributed event-based programming service. It provides a programming model to upload event handlers to a cloud service, and register the handlers to respond to various events. Applications built on a platform such as OpenWhisk are designed to take advantage of a so- called “serverless architecture.” They offer key benefits in the form of automatic scale and finer grained billing models. This workshop will show you how to create functions – or actions in OpenWhisk parlance – to execute logic in response to events – or triggers – such as database modifications, timers, and other external changes. In order to complete this workshop, you will need a Bluemix account that has access to OpenWhisk. Please use the space provided to write down the email and password that you will be using with the workshop. Note: You can either use your own account or you can use the provided workshop account. Email: ________________________________ Password: ________________________________ Build  and  deploy  an  event-­driven  application  using  the   OpenWhisk  platform     Log  into  Bluemix   1. Using your browser, go to the Bluemix website at https://bluemix.net 2. Press the “LOG IN” button located at the top right hand corner of the page.
  • 3. 3 3. In the following page, provide the email and password and press the “Sign in” button. 4. In the Dashboard page, you should notice that you do not have any Applications created, however you may notice some services have been created in advance for the workshops.   Use  the  OpenWhisk  dashboard  to  develop  actions   In this section, you’ll write your first action, a function packaged in a single file that executes some business logic. 1. Navigate to https://new-console.ng.bluemix.net/openwhisk/ to bring up the OpenWhisk landing page.
  • 4. 4 2. Click the “Develop” button. This will bring up the web IDE where you can create actions which represent your business logic. JavaScript is the default language, but you can also use Python, Swift, Java, and Docker. 3. Click the “Create An Action” button.
  • 5. 5 4. This will bring up a view where you can set the name and programming language. We’ll just accept the default, Node.js version 6 and give it a name: “sample-application” then click “Create Action”. 5. The web IDE will open with the skeleton of an OpenWhisk action. All OpenWhisk actions must include a “main” function that take a single argument containing context information. Click the “Run This Action” button above the code.
  • 6. 6 6. You’ll now be shown a window to provide the context information to the action that represents the object passed in as the params value. Leave the value as it is, and click the “Run With This Value” button. 7. This will show the “Invocation Console” providing various details around the execution of the Action. Note the “Completed in” (execution time) as well as the “Billed for” values. Actions written for the OpenWhisk platform are only billed for the time they actually execute, which can be a more attractive option than reserving resources by the gigabyte/hour or day as in other forms of cloud computing.
  • 7. 7 8. Click the “Close” button which will bring you back to the JavaScript source of the action. Change the return value to the following, then click “Run This Action. function main(params) { return { message: params.message }; } 9. You’ll be notified that the updated version is not yet live. Click the “Make It Live” button to upload this latest version. 10. Change the value of the message key to “Hello DeveloperConnect!” and click the “Run With This Value” button.
  • 8. 8 11. You’ll now see another result in the Invocation Console from executing the action again.       Use  the  OpenWhisk  dashboard  to  monitor  actions   In this section you’ll explore the monitoring dashboard that provides logs and historical data about your action executions. 1. Click the “Monitor” tab next to the “Develop” tab that you used to enter the web IDE at the start of this lab. 2. This brings up a dashboard with the history of actions executed, their degree of success over time, and deeper details into the execution of the actions.
  • 9. 9 3. Click on the green arrow next to the two “sample-application” invocations in the right pane. This will display stack traces and other important debugging information as you develop more complex applications, such as those that tie several actions together into a sequence or which are not invoked manually, as we have been doing with the Develop console.
  • 10. 10 Use  the  dashboard  to  create  an  alarm  triggered  action   In this section, you’ll set up an event feed for your action. Instead of invoking them manually, we’ll create a trigger that invokes them on a schedule (every 20 seconds) using the web IDE. 1. Click the “Develop” tab to get you back to the web IDE. Update the “sample-application” with this new main function and click the button at the bottom to “Make It Live”. function main(params) { var date = new Date(); var now = (date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds()); console.log("Invoked at: " + now); return { message: "Invoked at: " + now }; } 2. The “Make It Live” button will now become an “Automate This Action – Create a Rule” button. Click that button and select the “Periodic – Alarm-based triggers” tile in the resulting screen. 3. Click the “New Alarm +” tile, then pick “Cron” on the following screen, and enter this cron syntax: */30 * * * * * 4. Name the trigger “every-30-seconds” and click the “Create Periodic Trigger” button and click the “Next” button. You’ll now see confirmation that the alarm feed is linked to your action. Click “This Looks Good”. Save the rule and click “Done”.
  • 11. 11
  • 12. 12 5. Click the “Monitor” tab and let’s see our actions invoked every 30 seconds. 6. By default, the alarm will run 1,000 times so disable it after you’re done testing. Click back to the “Develop” tab, and find the alarm in the bottom right pane. Hover over the alarm and click the trash can icon.
  • 13. 13 Install  the  OpenWhisk  command  line  tool     So far you’ve seen the powerful tooling that the Bluemix hosted implementation of OpenWhisk provides. But you can also use the open source command line interface tool to interact with OpenWhisk running on Bluemix or any other host where OpenWhisk may be installed. 1. Navigate back to https://new-console.ng.bluemix.net/openwhisk/ to bring up the OpenWhisk landing page. 2. Click the “Use the CLI” link. This will bring up three steps to download the command line tool. You can install this CLI onto your workstation, or if you prefer, onto a separate virtual machine. 3. Once you have downloaded the CLI for your platform, open a terminal window to run the “wsk” executable. Set your OpenWhisk Namespace and Authorization Key by copying it from this page and running it in your terminal. 4. Finally, run the “whisk action invoke” command to execute the test action. If that works, you’re ready for the next step. Use  the  OpenWhisk  CLI  to  create  an  alarm  triggered  action   This next section will introduce you to triggers and how they can be mapped to actions using rules. These steps will create an alarm trigger – similar to a cron job – that invokes an action every 20 seconds. 1. Create an action that we will invoke from the trigger by entering the following JavaScript into a file called “handler.js”. function main(params) { var date = new Date(); var now = (date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds()); console.log("Invoked at: " + now); return { message: "Invoked at: " + now }; } 2. Upload the file to OpenWhisk $ wsk action create handler handler.js 3. Invoke the action manually $ wsk action invoke --blocking handler
  • 14. 14 4. Create an alarm trigger to invoke the action every 20 seconds (this will run 1,000 times by default, so we’ll specify a maximum of 9 invocations just for testing). $ wsk trigger create every-20-seconds --feed /whisk.system/alarms/alarm --param cron '*/20 * * * * *' --param maxTriggers 9 5. Create a rule to map the trigger to the rule and enable it $ wsk rule create --enable invoke-periodically every-20-seconds handler 6. Poll the logs to see the output until you see an activation for “handler”. $ wsk activation poll 7. Hit CTRL-C to stop polling the log and get the details on that particular activation. $ wsk activation get [activation id from above] Continue  to  iterate  on  your  actions,  triggers,  and  rules   You can now extend the application or create new actions, triggers, and rules. You might also want to explore a few sample applications to see serverless architectures in action. James Thomas has a list of some of the compelling IoT, bot, and microservices available on his “Awesome OpenWhisk” page: http://bit.ly/awe-ow
  • 15. 15