This reference architecture shows how serverless, event-driven architectures can execute code that scales automatically in response to demand from [...]. No code runs until [...] When that happens, application instances are started to match the load needed by each [...] exactly.
In addition to using cloud resources efficiently, this means that developers can build and deploy applications more quickly. You can learn more about the benefits of building a serverless architecture for this use case in the accompanying IBM Code Pattern.
This repository provides a template skeleton for IBM Cloud Functions reference architectures. You can deploy it right away using the IBM Cloud Functions user interface, or setup and deploy using command line tools on your own system.
If you haven't already, sign up for an IBM Cloud account and go to the Cloud Functions dashboard to explore other reference architecture templates and download command line tools, if needed.
- IBM Cloud Functions (powered by Apache OpenWhisk)
- Service A (Powered by open source project A)
- Service B (Powered by open source project B)
The application demonstrates two IBM Cloud Functions (based on Apache OpenWhisk) that [...]. The use case demonstrates how actions work with data services and execute logic in response to [...] events.
One function, or action, is triggered by [...]. These [...] are piped to another action in a sequence (a way to link actions declaratively in a chain). The second action aggregates the [...] and [...].
You should have a basic understanding of the OpenWhisk programming model. If not, try the action, trigger, and rule demo first.
Also, you'll need XXX
- Install X
- Configure X
- Verify X
- Run Y
- etc.
Choose "Start Creating" and select "Deploy template" then [This template] from the list. A wizard will then take you through configuration and connection to event sources step-by-step.
Behind the scenes, the UI uses wskdeploy
, which you can also use directly from the CLI by following the steps in the next section.
This approach deploy the Cloud Functions with one command driven by the runtime-specific manifest file available in this repository.
- Download the latest
bx
CLI and Cloud Functions plugins and log into the IBM Cloud. - Download the latest
wskdeploy
from the release page of the openwhisk-wskdeploy project. - Provision a Service instance.
- Copy
template.local.env
to a new file namedlocal.env
and update theSERVICE_HOSTNAME
,SERVICE_USERNAME
,SERVICE_PASSWORD
andSERVICE_DATABASE
for your Service instance.
# Get a local copy of this repository
git clone https://github.com/IBM/ibm-cloud-functions-refarch-template.git
cd ibm-cloud-functions-refarch-template
# Make service credentials available to your environment
source local.env
wsk package refresh
# Deploy the packages, actions, triggers, and rules using your preferred language
cd runtimes/nodejs # Or runtimes/[php|python|swift]
wskdeploy
# Deploy the packages, actions, triggers, and rules
wskdeploy undeploy
This approach shows you how to deploy individual the packages, actions, triggers, and rules with CLI commands. It helps you understand and control the underlying deployment artifacts.
This approach sets up a continuous delivery pipeline that redeploys on changes to a personal clone of this repository. It may be of interest to setting up an overall software delivery lifecycle around Cloud Functions.