blob: 59cea1261d0fa62a63939dd909e6f3ee8f99d496 [file] [log] [blame] [view]
Giorgi Lekveishvilic548ec52020-03-16 21:59:14 +04001# PCloud
Luka Samkharadze51947172021-06-14 17:10:49 +04002PCloud is a set of distributed infrastructure tools meant for setting up a personal cloud on commodity hardware such as Raspberry Pi.
3The goal of the project is to provide:
giolekvab3d409d2020-05-17 17:22:38 +04004* Object and file storage: distributed storage with configurable replication for durability and redundancy
5* Knowledge graph: storing graph shaped data representing user/application generated content and relations between them
6* Application infrastructure: to easily set up and run third-party applications, where applications can communicate with each other and produce/consume knowledge graph nodes
7* Search infrastructure: indexing knowledge graph and making it searchable
giolekvabb10bf02020-03-25 14:55:18 +04008
Luka Samkharadze51947172021-06-14 17:10:49 +04009To prove the viability of the project first milestone will be to build fully functional image storage and indexing infrastructure. User experience setting it up will look something like this:
10* Set up PCloud on 3 or more servers and pair a mobile device with it
11* Configure IFTTT (if this then that) like the workflow to automatically:
giolekva84ac7d12020-03-25 14:57:46 +040012 * Back up every newly taken picture on PCloud
13 * Run face detection app on backed up pictures and store this information in Metadata service
14 * Index face annotations and make them searchable
giolekvaf265b972020-03-25 15:02:39 +040015
Luka Samkharadze51947172021-06-14 17:10:49 +040016The user must be able to configure all of these from the previously paired mobile device.
giolekvab3d409d2020-05-17 17:22:38 +040017
18# Status
giolekvab3d409d2020-05-17 17:22:38 +040019Three core infrastructure services have been prototyped:
Luka Samkharadze51947172021-06-14 17:10:49 +040020* Knowledge Graph API: GraphQL based API with extensible schema
giolekvab3d409d2020-05-17 17:22:38 +040021 * Provides CRUD operations
22 * Auto-generates appropriate events upon data modification and includes them within mutation transaction
Luka Samkharadze51947172021-06-14 17:10:49 +040023 * Application installed by Application Manager (see below) can extend Knowledge Graph schema
24* Application Manager: supports installing third-party applications by uploading configuration archives via web UI
giolekvab3d409d2020-05-17 17:22:38 +040025 * Application configuration consists of:
Luka Samkharadze51947172021-06-14 17:10:49 +040026 * Schema extension (optional): if provided Knowledge Graph schema will be extended with new types and relations
27 * Actions (optional): application can define any number of actions that can be invoked from other applications. Actions are parametrized
28 * Initialization action (optional): application can configure the action, provided possibly by another application, to be run post-installation
29 * Triggers (optional): applications can set up triggers on Knowledge Graph mutations. Triggers run actions
30 * Applications are installed into separate namespaces for isolation
31* Event Processor: monitors changes in Knowledge Graph and triggers actions registered by applications installed using Application Manager
32 * It is a state machine moving events from NEW to IN_PROGRESS to DONE states
giolekvab3d409d2020-05-17 17:22:38 +040033
giolekvab6d40622020-05-17 18:22:54 +040034On top of this we are running five "third-party" applications:
giolekvab3d409d2020-05-17 17:22:38 +040035* Random Puppy:
36 * Does not use any PCloud features
giolekvab6d40622020-05-17 18:22:54 +040037 * Deploys web server with ingress
giolekvab3d409d2020-05-17 17:22:38 +040038* Object Store:
39 * Provides AWS S3 compatible API
Luka Samkharadze51947172021-06-14 17:10:49 +040040 * Exposes create-bucket-with-webhook action so other applications can create buckets and receive notifications when new objects are created
41 * An important detail here is that the object store itself is installed as a third-party app. This means other storage solutions can be integrated with PCloud infrastructure without changing PCloud itself
giolekvab3d409d2020-05-17 17:22:38 +040042* Image importer:
43 * Registers new Knowledge Graph node type: Image
44 * Using Object Store create-bucket-with-webhook action to create new images bucket and register itself as a listener
Luka Samkharadze51947172021-06-14 17:10:49 +040045 * For every new object creates a new Image node in Knowledge Graph
giolekvab3d409d2020-05-17 17:22:38 +040046* Face Detector:
Luka Samkharadze51947172021-06-14 17:10:49 +040047 * Registers new Knowledge Graph node type ImageSegment and extends previously created Image type with their relation
48 * Registers trigger on new Image nodes with action running face detection algorithm, which upon completion creates ImageSegment node for each face and attaches them to source Image
giolekvab6d40622020-05-17 18:22:54 +040049* Photos UI:
Luka Samkharadze51947172021-06-14 17:10:49 +040050 * Web-based photo gallery application consuming Image and ImageSegment nodes via Knowledge Graph API
giolekvab6d40622020-05-17 18:22:54 +040051
Luka Samkharadze51947172021-06-14 17:10:49 +040052Note that since Object Store is a standalone application with its API, new third-party applications can be developed to import data from cloud providers, such as Google Drive, where users might currently be storing their data.
giolekvab6d40622020-05-17 18:22:54 +040053
54# Next steps:
Luka Samkharadze51947172021-06-14 17:10:49 +040055* To further isolate applications from each other, the namespaces that are created must be configured so they can communicate only with core PCloud services. PCloud API will take responsibility for forwarding action requests to applications
56* Once the previous step is implemented, PCloud API can enforce ACLs and make application to application communication transparent to the PCloud owner. Application during installation will list actions, provided by other applications, it wants to use. And all of these can be reviewed and possibly rejected by the owner
57* Make Knowledge Graph types namespaced. Right now applications add new types into the global namespace which can cause conflicts. To avoid this Knowledge Graph API can build namespaces on top of Dgraph GraphQL schemas
58* Support replaying events so applications can "react" to events created before installation. This way Face Detection app will be able to process images created before the face detector was installed
59* Make Tensorflow Facenet model work on Raspberry Pi