Original title:
Asynchronní zpracování úloh v projektu PCS
Translated title:
Asynchronous Task Processing in PCS Project
Authors:
Pospíšil, Michal ; Pavela, Jiří (referee) ; Rogalewicz, Adam (advisor) Document type: Bachelor's theses
Year:
2022
Language:
eng Publisher:
Vysoké učení technické v Brně. Fakulta informačních technologií Abstract:
[eng][cze]
Projekt PCS je distribuovaná aplikácia. Z toho vyplýva, že potrebuje spôsob ako spúšťať akcie vo vzdialených inštanciách PCS. Cieľom tejto práce je vyvinúť minimálne životaschopné riešenie pre spúšťanie akcií cez REST API, ktoré je implementované metódami asynchrónneho programovania. Tieto akcie však nie sú implementované asynchrónne, takže nemôžu byť spustené priamo z asynchrónneho kódu. REST API je preto napojené na asynchrónny plánovač, ktorý obchádza toto obmedzenie spúšťaním akcií v sade procesov (process pool). Plánovač skrýva akcie za abstrakčnú vrstvu úloh, ktoré uchovávajú informácie o stave a výsledkoch akcií. Všetky akcie potrebujú posielať aktualizácie svojho stavu klientom v reálnom čase. Toto je dosiahnuté jednosmerným komunikačným kanálom medzi akciami a plánovačom, ktorý správy od akcií ukladá do úloh. REST API umožňuje vytváranie, kontrolu stavu a rušenie spracovania úloh. Klient teda môže opakovane žiadať o stav úlohy a takto zobrazovať aktualizácie stavu z akcií. Klient tiež môže zrušiť spracovanie úloh, ktoré bežia príliš dlho.
The PCS project is a distributed application; therefore, many actions need a way to launch actions in remote application instances. The goal of this thesis is to implement a minimum viable solution for executing actions through a REST API that uses the asynchronous programming model. However, actions themselves are not implemented asynchronously and cannot be invoked directly from asynchronous code. The REST API is connected to an asynchronous scheduler that circumvents this limitation by launching actions in a process pool. The scheduler hides actions behind an abstraction layer of tasks that store information about their status and results. All the actions need to send real-time updates to the clients. This is made possible via a one-way communication channel from the actions to the scheduler that updates the tasks. The REST API provides methods for creating, getting results, and killing tasks. Clients can periodically check the task status and show these updates to the user. Clients can also choose to kill tasks that take too long to finish.
Keywords:
asynchrónne programovanie; AsyncIO; klaster; klaster s vysokou dostupnosťou; Pacemaker/Corosync Configuration System; PCS; REST; REST API; Tornado; asynchronous programming; AsyncIO; cluster; high-availability cluster; Pacemaker/Corosync Configuration System; PCS; REST; REST API; Tornado
Institution: Brno University of Technology
(web)
Document availability information: Fulltext is available in the Brno University of Technology Digital Library. Original record: http://hdl.handle.net/11012/207500