Skip to content

A sample application illustrating the use of OpenShift Serverless Functions, Camel-K and Telegram to do AI image analysis on Telegram chat messages.

Notifications You must be signed in to change notification settings

boson-samples/telegram-image-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Image Analysis with OpenShift Serverless Functions

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 Serverless Functions - Telegram Image Analysis Demo

Setup

  • 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
  • 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

Set the API keys for Telegram and MS Faces API

  • 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

Create the default broker

oc apply -f deploy/broker.yaml

Connect to Telegram via CamelSource

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

Create the image receiver

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

Create the image processor

Deploy processor:

kn func deploy -p processor

And connect it to the Broker:

oc apply -f deploy/trigger-processor.yaml

Create the responder

Deploy responder:

kn func deploy -p responder

And connect it to the Broker:

oc apply -f deploy/trigger-responder.yaml

About

A sample application illustrating the use of OpenShift Serverless Functions, Camel-K and Telegram to do AI image analysis on Telegram chat messages.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors 4

  •  
  •  
  •  
  •