Top Banner
Advanced Techniques Paths, Docker Containers, etc. Grape Server Basics
7

Grape Server – Advanced · redis-persistent application_ redis-pubsub ... Websocket Service (grape-ws) Handles websocket connections with gunicorn and gevent. All actions from the

Oct 10, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Grape Server – Advanced · redis-persistent application_ redis-pubsub ... Websocket Service (grape-ws) Handles websocket connections with gunicorn and gevent. All actions from the

Advanced TechniquesPaths, Docker Containers, etc.

Grape Server Basics

Page 2: Grape Server – Advanced · redis-persistent application_ redis-pubsub ... Websocket Service (grape-ws) Handles websocket connections with gunicorn and gevent. All actions from the

Paths /data/grape/

config/

config.yml - configuration not relevant for application (docker registry credentials etc.) (used only by grape command)

settings.yml - configuration for proxy/application/sentry (used only by grape command)

sub directories for proxy/sentry/application, will be created by web setup

proxy/docker-compose.yml

sentry/docker-compose.yml

application/docker-compose.yml

data/ - persistent data (database, static, media, …)

setup/ – contains the symlinks current and next which point to the respective installed and to-be-upgraded grape versions

logs/ - logs from all services

bin/

websetup/

docker-compose.yml

some configuration files

/home/grape/.local/bin/grape - “grape” command

Page 3: Grape Server – Advanced · redis-persistent application_ redis-pubsub ... Websocket Service (grape-ws) Handles websocket connections with gunicorn and gevent. All actions from the

• grape user must be in the docker group • /data/grape must belong to grape user • Please don’t change the username

Paths

Page 4: Grape Server – Advanced · redis-persistent application_ redis-pubsub ... Websocket Service (grape-ws) Handles websocket connections with gunicorn and gevent. All actions from the

Containers

Grape Server / VM

Grape Web Setup

HTTP Port 80 → redirect HTTPS HTTPS Port 443 WS Port 443 HTTPS Port 8888 (Web Setup)

Grape Docker Compose Sentry Docker Compose

proxy_nginx

websetup_nginx

websetup_django

websetup_redis

application_nginx

application_grape-runtime

application_elasticsearch

application_postgresql

application_redis-transientapplication_redis-persistentapplication_redis-pubsub

sentry_grapesentry-sentry

sentry_grapesentry-redis

sentry_grapesentry-celery1

sentry_grapesentry-postgresql

sentry_grapesentry-celery-beat

application_nignx-elasticsearch

application_pgbouncer

Docker Compose PackagesDocker Containers

Page 5: Grape Server – Advanced · redis-persistent application_ redis-pubsub ... Websocket Service (grape-ws) Handles websocket connections with gunicorn and gevent. All actions from the

Databases

PostgreSQL

• Organization Data • Memberships • User Data • Channels Metadata (Private

Conversation / Groups and their Memberships)

• everything in grape.example.com/admin

• Messages • Data for Grape Search

Elasticsearch

• Cache • User Online Status • PubSub Channels for Realtime

Event Dispatching

Redis

Page 6: Grape Server – Advanced · redis-persistent application_ redis-pubsub ... Websocket Service (grape-ws) Handles websocket connections with gunicorn and gevent. All actions from the

Application Container

Websocket Service (grape-ws)

Handles websocket connections with gunicorn and gevent. All actions from the core chat like sending/updating/deleting a message as well as opening channels are handled over this service (RPC API).

Managed by Supervisor (http://supervisord.org/)

HTTP Request Response Service (grape-rr)

Handles request/response requests over HTTP like image up/download, delivering the webclient on initial call and the web settings pages.

General Purpose Worker for Asynchronous Operations (chatgrape_celery-worker_{n})

Processes asynchronous tasks like cronjobs, syncing user directory or labeling messages with NLP.

Async Worker for Notifications (worker-notifications_{n})

Processes notifications asynchronously to be closer to realtime and does not get blocked by log running “general purpose” tasks and syncs.

Page 7: Grape Server – Advanced · redis-persistent application_ redis-pubsub ... Websocket Service (grape-ws) Handles websocket connections with gunicorn and gevent. All actions from the

Thanks for watching!