a Hybrid Cloud Storage Story
Cats vs. Dogs
1
Yuval Lifshitz
Principal Software Engineer,
Red Hat
OVERVIEW
2
What is Ceph?
RADOS Gateway and Object Storage
Notifications and PubSub (Publish Subscribe) in Ceph
Knative, Kubernetes and Lambda
Live Demo!
“... We believe in: … running code."
David D. Clark (IETF/MIT)
WHAT IS CEPH?
3
Ceph is free and open source software
Runs on commodity hardware
Commodity servers
IP networks
HDDs, SSDs, NVMe, NV-DIMMs, …
Unified - a single cluster can serve object, block, and file
workloads
OBJECT STORAGE
4
Put immutable objects in buckets
images
videos
audios
applications
VMs
containers
…
Buckets are flat (no hierarchy)
Create
Read
Update
Delete
Versioning
Lifecycle
Replication
…
CEPH IS FREE AND OPEN SOURCE
5
Free to use (...as in beer)
Free to change (...as in speech)
Free from vendor lock-in
Open to the world (the little secret of open source projects):
PubSub
Cloud
Dynamic Object Interface (Lua)
…
UNIFIED STORAGE SYSTEM
6
RGW
S3 and Swift
object storage
LIBRADOS
Low-level storage API
RADOS
Reliable, elastic, distributed storage layer with
replication and erasure coding
RBD
Virtual block device
CEPHFS
Distributed network
file system
OBJECT BLOCK FILE
RGW: RADOS Gateway
7
S3 and Swift-compatible object storage
HTTPS/REST-based API
Combined with load balancer
Users, buckets, objects
ACL-based permissions, enforced by RGW
RGW objects not same as RADOS objects
S3 objects can be very big: GB to TB
RGW stripes data across RADOS objects
RGW
LIBRADOS
RGW
LIBRADOS
S3
HTTPS
RADOS CLUSTER
CEPH NOTIFICATIONS/PUB-SUB: WHY?
8
External monitoring systems
Application taking actions on the objects
(as will be shown in the demo)
External tiering logic
Hacking in general (e.g. migration...) and things we cannot
imagine (my favorite usecase!)
CEPH PUB-SUB: SELF CONTAINED SOLUTION
9
Uses the pluggable sync-module architecture. An RGW on a specific zone
called “pubsub” zone, will be synced with metadata from the zonegroup
Since pubsub is a sync-module it benefits from the multisite reliable
messaging and ack semantics
The events are stored in a special bucket in Ceph (we call a subscription)
and could be pulled and removed (acked)
Zone “A” Zone “B” Zone ‘C” (“pubsub” tier)
OPENING PUB-SUB: PUSH ENDPOINTS
10
Has pluggable endpoint architecture for pushing the events. Currently we
support HTTP and AMQP0.9.1 (RabbitMQ)
We plan on adding: Kafka, AMQP1.0 (ActiveMQ), native serverless support…
and more!
CEPH NOTIFICATIONS
11
Message busses like: AMQP, Kafka, Knative etc. have their own reliability
mechanism, so, want to allow for push only mode where events are not stored
in Ceph, and just pushed into one or more endpoints
In such a case we may add a simpler deployment option, where there won’t be a
need for a dedicated “pubsub” zone, and an event would be considered as
“acked” once it is successfully sent to the endpoint
This will allow a richer set of event triggers, as well as payloded info, without
overloading the zone sync mechanism
And more fine grained persistency schemes. In case of more ephemeral events
we may chose not to persist them to storage at all (at the risk of losing them if
and RGW restart)
CEPH NOTIFICATIONS/PUB-SUB: DATA MODEL
12
Topics are named object that could contain the definition of a specific
endpoint
Notifications associate topics with a specific bucket, and may also include
filter definition on the events (e.g. do we want to see all events or only object
creations?). If associated topic has an endpoint, the events will be pushed
there - push mode
If a topic used by a notification does not have an endpoint, or want to persist
the events on top of sending them, events will be stored in a subscription in
Ceph and could be fetched from the subscription - pull mode
KNATIVE OVERVIEW
13
A framework build on top of kubernetes and Istio to: build, trigger, monitor
and run serverless function
In our case we use 2 components of Knative:
Eventing: reliable event delivery to single or multiple data sinks
Serving: route traffic to functions; triggering and scale up/down function
containers
A “WORD” ABOUT SERVERLESS
14
Simplicity: “I’m just a dev, don’t want to run a server”
Efficiency: “I pay for what I run”
DEMO: A “HYBRID” STORYLINE
15
We want to do image classification for every new image uploaded into Ceph.
And we have two types of users: cat owners and dog owners
Our cat classification algorithm is homegrown, and specializes in cats, and
we want to run it in our on-premise serverless environment (knative on k8s)
For the dog images we want to use a publicly available algorithm, in public
cloud serverless environment (lambda on AWS)
There could be many other reasons for splitting work between functions on
private/public clouds: Cost, Performance, Bandwidth, Privacy …
DEMO: HYBRID CLOUD
16
DEMO: CEPH SETUP
17
First we create two buckets, one for cats and one for dogs
Using the notification mechanism in Ceph we create two topics and
notifications:
One that would track new objects on the cat bucket and push notifications to
the http-to-knative process
Another that track new objects on the dog bucket and push notifications to the
http-to-aws process
DEMO: FORMAT TRANSLATORS
18
The http-to-knative process run as a pod (ContainerSource in Knative terms) in
k8s, and put all incoming PubSubs events it receives into a predefined knative
channel
The http-to-aws process convert incoming PubSub events into lambda function
invocations
In the future we could have knative-flavored HTTP endpoint and lambda-flavored
HTTP endpoint natively in RGW, so these conversion processes are not needed
anymore
DEMO: PUBLIC/PRIVATE CLOUD SETUP
19
Upload to AWS a lambda function that knows how to fetch an object from Ceph
(based on information in the incoming trigger event), and classify it
Configure on the k8s cluster a Knative service that will launch a pod that knows
how to fetch an object from Ceph (based on information in the incoming trigger
event), and classify it
We use Istio on the k8s cluster to allow for data to flow between the cluster and
the RGW
DEMO
20
https://github.com/ceph/rgw-pubsub-api
Have a look at the Ceph cluster (zones and buckets)
PubSub client
Knative/Istio yamls
Lambda
Lets go!
linkedin.com/company/red-hat
youtube.com/user/RedHatVideos
facebook.com/redhatinc
twitter.com/RedHat
Red Hat is the world’s leading provider of enterprise
open source software solutions. Award-winning
support, training, and consulting services make
Red Hat a trusted adviser to the Fortune 500.
Thank you
21

PubSub and Notifications in Ceph

  • 1.
    a Hybrid CloudStorage Story Cats vs. Dogs 1 Yuval Lifshitz Principal Software Engineer, Red Hat
  • 2.
    OVERVIEW 2 What is Ceph? RADOSGateway and Object Storage Notifications and PubSub (Publish Subscribe) in Ceph Knative, Kubernetes and Lambda Live Demo! “... We believe in: … running code." David D. Clark (IETF/MIT)
  • 3.
    WHAT IS CEPH? 3 Cephis free and open source software Runs on commodity hardware Commodity servers IP networks HDDs, SSDs, NVMe, NV-DIMMs, … Unified - a single cluster can serve object, block, and file workloads
  • 4.
    OBJECT STORAGE 4 Put immutableobjects in buckets images videos audios applications VMs containers … Buckets are flat (no hierarchy) Create Read Update Delete Versioning Lifecycle Replication …
  • 5.
    CEPH IS FREEAND OPEN SOURCE 5 Free to use (...as in beer) Free to change (...as in speech) Free from vendor lock-in Open to the world (the little secret of open source projects): PubSub Cloud Dynamic Object Interface (Lua) …
  • 6.
    UNIFIED STORAGE SYSTEM 6 RGW S3and Swift object storage LIBRADOS Low-level storage API RADOS Reliable, elastic, distributed storage layer with replication and erasure coding RBD Virtual block device CEPHFS Distributed network file system OBJECT BLOCK FILE
  • 7.
    RGW: RADOS Gateway 7 S3and Swift-compatible object storage HTTPS/REST-based API Combined with load balancer Users, buckets, objects ACL-based permissions, enforced by RGW RGW objects not same as RADOS objects S3 objects can be very big: GB to TB RGW stripes data across RADOS objects RGW LIBRADOS RGW LIBRADOS S3 HTTPS RADOS CLUSTER
  • 8.
    CEPH NOTIFICATIONS/PUB-SUB: WHY? 8 Externalmonitoring systems Application taking actions on the objects (as will be shown in the demo) External tiering logic Hacking in general (e.g. migration...) and things we cannot imagine (my favorite usecase!)
  • 9.
    CEPH PUB-SUB: SELFCONTAINED SOLUTION 9 Uses the pluggable sync-module architecture. An RGW on a specific zone called “pubsub” zone, will be synced with metadata from the zonegroup Since pubsub is a sync-module it benefits from the multisite reliable messaging and ack semantics The events are stored in a special bucket in Ceph (we call a subscription) and could be pulled and removed (acked) Zone “A” Zone “B” Zone ‘C” (“pubsub” tier)
  • 10.
    OPENING PUB-SUB: PUSHENDPOINTS 10 Has pluggable endpoint architecture for pushing the events. Currently we support HTTP and AMQP0.9.1 (RabbitMQ) We plan on adding: Kafka, AMQP1.0 (ActiveMQ), native serverless support… and more!
  • 11.
    CEPH NOTIFICATIONS 11 Message busseslike: AMQP, Kafka, Knative etc. have their own reliability mechanism, so, want to allow for push only mode where events are not stored in Ceph, and just pushed into one or more endpoints In such a case we may add a simpler deployment option, where there won’t be a need for a dedicated “pubsub” zone, and an event would be considered as “acked” once it is successfully sent to the endpoint This will allow a richer set of event triggers, as well as payloded info, without overloading the zone sync mechanism And more fine grained persistency schemes. In case of more ephemeral events we may chose not to persist them to storage at all (at the risk of losing them if and RGW restart)
  • 12.
    CEPH NOTIFICATIONS/PUB-SUB: DATAMODEL 12 Topics are named object that could contain the definition of a specific endpoint Notifications associate topics with a specific bucket, and may also include filter definition on the events (e.g. do we want to see all events or only object creations?). If associated topic has an endpoint, the events will be pushed there - push mode If a topic used by a notification does not have an endpoint, or want to persist the events on top of sending them, events will be stored in a subscription in Ceph and could be fetched from the subscription - pull mode
  • 13.
    KNATIVE OVERVIEW 13 A frameworkbuild on top of kubernetes and Istio to: build, trigger, monitor and run serverless function In our case we use 2 components of Knative: Eventing: reliable event delivery to single or multiple data sinks Serving: route traffic to functions; triggering and scale up/down function containers
  • 14.
    A “WORD” ABOUTSERVERLESS 14 Simplicity: “I’m just a dev, don’t want to run a server” Efficiency: “I pay for what I run”
  • 15.
    DEMO: A “HYBRID”STORYLINE 15 We want to do image classification for every new image uploaded into Ceph. And we have two types of users: cat owners and dog owners Our cat classification algorithm is homegrown, and specializes in cats, and we want to run it in our on-premise serverless environment (knative on k8s) For the dog images we want to use a publicly available algorithm, in public cloud serverless environment (lambda on AWS) There could be many other reasons for splitting work between functions on private/public clouds: Cost, Performance, Bandwidth, Privacy …
  • 16.
  • 17.
    DEMO: CEPH SETUP 17 Firstwe create two buckets, one for cats and one for dogs Using the notification mechanism in Ceph we create two topics and notifications: One that would track new objects on the cat bucket and push notifications to the http-to-knative process Another that track new objects on the dog bucket and push notifications to the http-to-aws process
  • 18.
    DEMO: FORMAT TRANSLATORS 18 Thehttp-to-knative process run as a pod (ContainerSource in Knative terms) in k8s, and put all incoming PubSubs events it receives into a predefined knative channel The http-to-aws process convert incoming PubSub events into lambda function invocations In the future we could have knative-flavored HTTP endpoint and lambda-flavored HTTP endpoint natively in RGW, so these conversion processes are not needed anymore
  • 19.
    DEMO: PUBLIC/PRIVATE CLOUDSETUP 19 Upload to AWS a lambda function that knows how to fetch an object from Ceph (based on information in the incoming trigger event), and classify it Configure on the k8s cluster a Knative service that will launch a pod that knows how to fetch an object from Ceph (based on information in the incoming trigger event), and classify it We use Istio on the k8s cluster to allow for data to flow between the cluster and the RGW
  • 20.
    DEMO 20 https://github.com/ceph/rgw-pubsub-api Have a lookat the Ceph cluster (zones and buckets) PubSub client Knative/Istio yamls Lambda Lets go!
  • 21.
    linkedin.com/company/red-hat youtube.com/user/RedHatVideos facebook.com/redhatinc twitter.com/RedHat Red Hat isthe world’s leading provider of enterprise open source software solutions. Award-winning support, training, and consulting services make Red Hat a trusted adviser to the Fortune 500. Thank you 21