196 lines
15 KiB
TeX
196 lines
15 KiB
TeX
\documentclass[a4paper,11pt]{article}
|
|
\usepackage[margin=1.3in]{geometry}
|
|
\usepackage[most]{tcolorbox}
|
|
\usepackage{xcolor}
|
|
\usepackage{tikz}
|
|
\usepackage{fancyhdr} % for headers
|
|
% \usepackage[citestyle=verbose-ibid, backend=biber, autocite=footnote]{biblatex} % Footnote references. Use autocite{}.
|
|
\usepackage{biblatex}
|
|
\usepackage{float}
|
|
\usepackage{fontspec}
|
|
|
|
% --- Configuration ---
|
|
\bibliography{src/references}
|
|
\setmonofont[Scale=0.85, ItalicFont=Hermit Light]{Hermit Light}
|
|
% \pagestyle{fancy}
|
|
% \setlength{\parskip}{6pt}
|
|
% \setlength{\parindent}{0pt}
|
|
|
|
% \fancyfoot{}
|
|
% \lhead{\rightmark}
|
|
% \rhead{\thepage}
|
|
% \fancyheadoffset{0.005\textwidth}
|
|
|
|
\setlength{\parskip}{5pt}
|
|
|
|
\begin{document}
|
|
\section{Abstract}
|
|
\begin{tcolorbox}[colback=lightgray!30!white]
|
|
Explain briefly the paper and what it does.
|
|
\end{tcolorbox}
|
|
|
|
\section{Introduction}
|
|
|
|
\textit{Scientific Workflow Management Systems} (SWMSs) are an essential tool for automating, managing, and executing complex scientific processes involving large volumes of data and computational tasks\footnote{citation?}. Traditional SWMSs employ a linear sequential approach, in which tasks are performed in a pre-defined order, as defined by the workflow. While this linear method is suitable for certain applications, it might not always be the best choice: processing sequentially can prove inefficient in cases where the next step of the process should adapt to the previous one. For these use-cases a dynamic scheduler is required, of which \textit{Managing Event Oriented Workflows}\autocite{DavidMEOW} (MEOW) is one.
|
|
|
|
\begin{tcolorbox}[colback=lightgray!30!white]
|
|
Expand on DAGs' inability to adapt
|
|
\end{tcolorbox}
|
|
|
|
MEOW employs an event-based scheduler, in which jobs are performed non-linearly, triggered based on events\footnote{citation?}. By dynamically adapting the execution order based on the outcomes of previous tasks or external factors, MEOW provides a more efficient and flexible solution for processing large volumes of experimental data\footnote{citation?}.
|
|
|
|
|
|
\begin{tcolorbox}[colback=lightgray!30!white]
|
|
\begin{itemize}
|
|
\item What work am I doing on MEOW?
|
|
\item How did it go?
|
|
\item Introduce the concept of network events.
|
|
\item \textbf{Write this last}
|
|
\end{itemize}
|
|
\end{tcolorbox}
|
|
|
|
\subsection{Problem}
|
|
|
|
In its current implementation, MEOW is able to trigger jobs based on changes to monitored local files. This covers a the range of scenarios where the data processing workflow involves the creation, modification, or removal of files. By monitoring file events, MEOW's event-based scheduler can dynamically execute tasks as soon as the required conditions are met, ensuring efficient and timely processing of the data. Since the file monitor is triggered by changes to local files, MEOW is limited to local workflows.
|
|
|
|
While file events work well as a trigger on their own, there are several scenarios where a different trigger would be preferred or even required, especially when dealing with distributed systems or remote operations. To address these shortcomings and further enhance MEOW's capabilities, the integration of network event triggers would provide significant benefits in several key use-cases.
|
|
|
|
Firstly, network event triggers would allow for manual triggering of jobs remotely, without the need for direct access to the monitored files. This is particularly useful in scenarios where human intervention or decision-making is required before proceeding with the subsequent steps in a workflow. While it is possible to manually trigger job using file events by making changes to the monitored directories, this might lead to an already running job accessing the files at the same time, which could cause problems with data integrity.
|
|
|
|
Secondly, incorporating network event triggers would facilitate seamless communication between parallel runners, ensuring that tasks can efficiently exchange information and synchronize their progress.
|
|
|
|
Finally, extending MEOW's event-based scheduler to support network event triggers would enable the simple and efficient exchange of data between workflows running on different machines. This feature is particularly valuable in distributed computing environments, where data processing tasks are often split across multiple systems to maximize resource utilization and minimize latency.
|
|
|
|
Integrating network event triggers into MEOW would provide an advantage specifically in the context of heterogeneous workflows, which incorporate a mix of different tasks running on diverse computing environments. By their nature, these workflows can involve tasks running on different systems, potentially even in different physical locations, which need to exchange data or coordinate their progress. Currently, MEOW's reliance on local file events as triggers can be a limiting factor in these scenarios. Network event triggers offer a powerful solution to this challenge. They can not only handle tasks running across different machines, but also dynamically adapt to the changing requirements of a heterogeneous workflow, such as triggering new tasks based on the results of remote computations. Thus, the addition of network event triggers is a significant step in enhancing MEOW's already robust handling of heterogeneous workflows, bolstering its utility in today's diverse and distributed computing landscape.
|
|
|
|
\begin{figure}[H]
|
|
\begin{center}
|
|
\includegraphics[width=\textwidth]{src/heterogeneous.png}
|
|
\end{center}
|
|
\caption{An example of a heterogeneous workflow}
|
|
\end{figure}
|
|
|
|
\subsection{Background}
|
|
\subsubsection{The structure of MEOW}
|
|
|
|
The MEOW event-based scheduler consists of four main components: \textit{monitors}, \textit{handlers}, \textit{the conductor}, and \textit{the runner}.
|
|
|
|
Monitors listen for triggering events. They are initialized with a number of \textit{patterns}, which describe the triggering event. When a pattern's triggering event occurs, the monitor signals to the conductor that the pattern has been triggered, and schedules a job that has been associated with the pattern.
|
|
|
|
\begin{figure}[H]
|
|
\begin{center}
|
|
\includegraphics[width=0.6\textwidth]{src/monitor.png}
|
|
\end{center}
|
|
\caption{The monitor's role in MEOW's event-based system.}
|
|
\end{figure}
|
|
|
|
\begin{tcolorbox}[colback=blue!30!white]
|
|
I haven't used "Resources" to describe the job queue. Should I do that or should I rephrase the diagram to be more in line with the rest of the project?
|
|
\end{tcolorbox}
|
|
|
|
Handlers perform actions and jobs on behalf of the scheduler. They are initialized with a number of \textit{recipes}, which describe the action to be taken. The handler starts a job when signal to do so by the conductor.
|
|
|
|
The conductor handles the jobs queue. It is initialized with a number of rules, which a pattern paired with a recipe. When a monitor sends it a triggered pattern, the rules are checked for that pattern. If one or more rules contain that pattern, the corresponding recipes are triggered in their handler.
|
|
|
|
Finally, the runner is the main program that orchestrates all these components. Each instance of the runner incorporates at least one instance of a monitor, handler, and conductor.
|
|
|
|
\begin{figure}[H]
|
|
\begin{center}
|
|
\begin{tikzpicture}
|
|
\node[draw,rectangle,rounded corners,text width=8cm,align=center] at (0,2) (run) {Runner};
|
|
\node[draw,rectangle,rounded corners] at (0,0) (con) {Conductor};
|
|
\node[draw,rectangle,rounded corners] at (3,-2) (mon) {Monitor};
|
|
\node[draw,rectangle,rounded corners] at (-3,-2) (han) {Handler};
|
|
\end{tikzpicture}
|
|
\end{center}
|
|
\caption{\textbf{WIP.} How the elements of MEOW interact.}
|
|
\end{figure}
|
|
|
|
\subsubsection{The \texttt{meow\_base} codebase}
|
|
\begin{tcolorbox}[colback=lightgray!30!white]
|
|
Specific (but not too granular) implementation details of \texttt{meow\_base}.
|
|
\end{tcolorbox}
|
|
|
|
The current implementation of MEOW, \texttt{meow\_base}\autocite{MeowBase}, \dots
|
|
|
|
\subsubsection{The \texttt{socket} library}
|
|
|
|
The \texttt{socket} library\autocite{SocketDoc}, included in the Python Standard Library, serves as an interface for the Berkeley sockets API. The Berkeley sockets API, originally developed for the Unix operating system, has become the standard for network communication across multiple platforms. It allows programs to create 'sockets', which are endpoints in a network communication path, for the purpose of sending and receiving data.
|
|
|
|
Many other libraries and modules focusing on transferring data exist for Python, some of which may be better in certain MEOW use-cases. The \texttt{ssl} library, in specific, allows for ssl-encrypted communication, which may be a requirement in workflows with sensitive data. However, implementing network triggers using the \texttt{socket} library will provide MEOW with a basic implementation of network events, which can later be expanded or improved with other features.
|
|
|
|
In my project, all sockets use the Transmission Control Protocol (TCP), which ensures safe data transfer by enforcing a stable connection between the sender and receiver. I make use of the following socket methods, which have the same names and functions in the \texttt{socket} library and the Berkeley sockets API:
|
|
|
|
\begin{tcolorbox}[colback=blue!30!white]
|
|
Too granular?
|
|
\end{tcolorbox}
|
|
|
|
\begin{itemize}
|
|
\setlength{\itemsep}{-5pt}
|
|
\item \texttt{bind()}: Associates the socket with a given local IP address and port. It also reserves the port locally.
|
|
\item \texttt{listen()}: Puts the socket in a listening state, where it waits for a sender to request a TCP connection to the socket.
|
|
\item \texttt{accept()}: Accepts the incoming TCP connection request, creating a connection.
|
|
\item \texttt{recv()}: Receives data from the given socket.
|
|
\item \texttt{connect()}: Sends a TCP connection request to a listening socket. This is only used in testing the monitor.
|
|
\item \texttt{sendall()}: Sends data a socket. This is only used in testing the monitor.
|
|
\item \texttt{close()}: Closes a connection to a given socket.
|
|
\end{itemize}
|
|
|
|
\section{Method}
|
|
|
|
To address the identified limitations of MEOW and to expand its capabilities, I will be incorporating network event triggers into the existing event-based scheduler, to supplement the current file-based event triggers. My method focuses on leveraging Python's socket library to enable the processing of network events. The following subsections detail the specific methodologies employed in expanding the codebase, the design of the network event trigger mechanism, and the integration of this mechanism into the existing MEOW system.
|
|
|
|
\subsection{Design of the network event pattern}
|
|
A main concern with implementing a pattern for network events is to seamlessly integrate it with the existing codebase. Because of this, the design of the pattern has a heavy focus on behaving similarly to the file event pattern when interacting with the other elements of the scheduler. Ideally, this should preserve loose coupling of the patterns and recipes, so any pattern can be put in a rule with any recipe. While this might not be possible for every theoretical recipe and pattern, designing for it could greatly improve future compatibility.
|
|
|
|
Network event patterns are initialized with a triggering port, similar to the triggering path of the file event patterns. While this limits the amount of possible unique patterns to the amount of ports that can be opened on the machine, that amount is large enough that it will likely not be an issue. It would have been possible to have the patterns be triggered by part of the sent message, acting as a "header". However, this would complicate the process, since the monitor will otherwise be expecting to receive raw data. This was chosen in order for the implementation to be as simple as possible, so that any feature or improvement can be added later as its own pattern type.
|
|
|
|
The network monitor, when started, opens sockets that start listening on the ports specified in the patterns it was initialized with.
|
|
|
|
\subsection{Integrating it into the existing codebase}
|
|
Data received by the network monitor is written to a temporary file, which serves two purposes. Firstly, writing the received data to a file while receiving it saves on memory, since the entire file doesn't have to be saved in memory at once. This is especially useful for large data transfers. Secondly, writing the received data to a file allows network events to reuse most of the infrastructure written for file events, passing the newly written temporary file as the "triggering path" of the event. This means that recipes taking the triggering path as their input can still be used with network events, preserving loose coupling.
|
|
|
|
\subsection{Testing}
|
|
|
|
\section{Results}
|
|
\begin{tcolorbox}[colback=lightgray!30!white]
|
|
Does it work? How well?
|
|
\end{tcolorbox}
|
|
|
|
% \subsection{Testing}
|
|
|
|
\subsection{Discussion}
|
|
\begin{tcolorbox}[colback=lightgray!30!white]
|
|
With the hindsight of the results, what could I have done better?
|
|
\end{tcolorbox}
|
|
|
|
\subsection{Future Work}
|
|
\begin{tcolorbox}[colback=lightgray!30!white]
|
|
What should someone do if they want to fix my mistakes, or expand on them further.
|
|
\begin{itemize}
|
|
\item Implementation of the other options mentioned when discussing the socket library.
|
|
\item Triggering on a header item in addition to port
|
|
\end{itemize}
|
|
\end{tcolorbox}
|
|
|
|
\begin{tcolorbox}[colback=lightgray!30!white]
|
|
Give context to following paragraph.
|
|
\end{tcolorbox}
|
|
One specific example of a use-case where network event triggers could prove useful is the workflow for The Brain Imaging Data Structure (BIDS). The BIDS workflow requires data to be sent between multiple machines and validated by a user. Network event triggers could streamline this process by automatically initiating data transfer tasks when specific conditions are met, thereby reducing the need for manual management. Additionally, network triggers could facilitate user validation by allowing users to manually prompt the continuation of the workflow through specific network requests, simplifying the user's role in the validation process.
|
|
|
|
\begin{figure}[H]
|
|
\begin{center}
|
|
\includegraphics[width=0.6\textwidth]{src/BIDS.png}
|
|
\end{center}
|
|
\caption{\textbf{Temp.} The structure of the BIDS workflow. Data is transferred to user, and to the cloud.}
|
|
\end{figure}
|
|
|
|
\section{Conclusion}
|
|
\begin{tcolorbox}[colback=lightgray!30!white]
|
|
Did I succeed in what I wanted to do?
|
|
\end{tcolorbox}
|
|
|
|
\newpage
|
|
\appendix
|
|
\printbibliography{}
|
|
\end{document} |