In this demo, you will learn how Serverless Functions can be used to do facial recognition in the Telegram chat.
Here you can watch a recording of this demo:
- OpenShift 4.6 (or newer)
- Red Hat OpenShift Serverless - installed as an operator from OperatorHub (version >= 1.11.0)
- To install on a cluster that does not have this available, clone
the serverless operator repository,
ensure that you are logged into your OpenShift cluster and run
make images install
- To install on a cluster that does not have this available, clone
the serverless operator repository,
ensure that you are logged into your OpenShift cluster and run
- Red Hat Integration - Camel K - installed as an operator from OperatorHub (version >= 1.2.0)
You will also need the following API keys and accounts
- Microsoft Faces API Key
- Telegram Bot API KEY
- An image registry account such as docker.io or quay.io
-
Set the Telegram API Key in the following files
deploy/kamelet-broker.yaml
receiver/func.yaml
responder/func.yaml
responder/package.json
-
Set the Microsoft Faces API Key in the following files
processor/func.yaml
oc apply -f deploy/broker.yaml
The demo uses Telegram to send images to a bot. A CamelSource
is used to receive
these images and convert them to a CloudEvent
which can then be sent to a Knative
event sink to be processed by functions. Install the Telegram Kamelet
which handeles
the creation of CamelSource
and binding it to the Broker
for you..
kubectl apply -f kamelet-broker.yaml
Export image registry that's being to used to store function images, if you haven't done so:
export FUNC_REGISTRY=docker.io/johndoe
Deploy receiver
:
kn func deploy -p receiver
And connect it to the Broker:
oc apply -f deploy/trigger-receiver.yaml
Deploy processor
:
kn func deploy -p processor
And connect it to the Broker:
oc apply -f deploy/trigger-processor.yaml
Deploy responder
:
kn func deploy -p responder
And connect it to the Broker:
oc apply -f deploy/trigger-responder.yaml