class: center, middle # Kraken CI ## Architecture --- # Agenda 1. Architecture 2. Workflow --- # Introduction - Kraken composed of: - web UI - several backend services - distributted agents - Backend in Python - UI in Typescript/HTML - Development based on Docker --- # Kraken Architecture  --- .imgover[] # Web UI - Angular framework - PrimeNG components --- .imgover[] # API Server - Serves API requests from: - users (via web UI or programmatically) - other backend services - Serves webhooks - API defined in Swagger --- .imgover[] # Controller - Single instance - Planner - Scheduler - Watchdog - Storage --- .imgover[] # Controller / Planner - Remembers planned job triggers - Fires them at indicated time: - periodically - on given time - according CRON rule --- .imgover[] # Controller / Scheduler - Assigns triggered jobs to idle agents - FIFO --- .imgover[] # Controller / Watchdog - Monitors Runs and their Jobs - Run timeout - Job timeout - Monitors Agents - if not responding then disabled to avoid assigning --- .imgover[] # Controller / Storage - Serves storage for agents - Agents can put or get artifacts --- .imgover[] # RQ - Background tasks - processes results of a job - results history analysis - and more --- .imgover[] # Agent - Agent runs on a host - Jobs are run in executor via tool - Executors - Bare - Docker - LXD --- .imgover[] # Agent / Tool - Run in executor - Provided operations: - shell - git operations - storing/retrieving artifacts - pytest - pylint - ngling - cloc --- .imgover[] # ELK - Logstash - backend services and all agents log to Logstash - log entries are assigned to agents/jobs/etc - Elasticsearch - allows querying logs - eg. shows all logs associated with given job or stage - Kibana - UI to Elasticsearch --- .imgover[] # PostgreSQL - main database --- .imgover[] # Kraken Workflow - Planner or UI trigger a Job - Job is scheduled for execution to idle Agent - Agent executes the Job - Agent can store or fetch artifacts from Storage - Whole Job execution log goes to ELK - After completing the Job its results are processed by RQ 