<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>DATA ANALYSIS PLATFORM FOR STREAM AND BATCH DATA PROCESSING ON HYBRID COMPUTING RESOURCES</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>S. Belov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>I. Kadochnikov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>V. Korenkov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>A. Reshetnikov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>R. Semenov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>P. Zrelov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Joint Institute for Nuclear Research</institution>
          ,
          <addr-line>6 Joliot-Curie st., Dubna, 141980</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Plekhanov Russian University of Economics</institution>
          ,
          <addr-line>36 Stremyanny lane, Moscow, 117997</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Sergey Belov</institution>
          ,
          <addr-line>Ivan Kadochnikov, Vladimir Korenkov, Andrey Reshetnikov, Roman Semenov, Petr Zrelov</addr-line>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2021</year>
      </pub-date>
      <fpage>5</fpage>
      <lpage>9</lpage>
      <abstract>
        <p>The modern Big Data ecosystem provides tools to build a flexible platform for processing data streams and batch datasets. Supporting both the functioning of modern giant particle physics experiments and the services necessary for the work of many individual physics researchers results in generating and transferring large amounts of semi-structured data. Thus, it is promising to apply cutting-edge technologies to study these data flows and make the services' provisioning more effective. In this work, we describe the structure and implementation of our data analysis platform, built on the Apache Spark cluster. With the official support for GPU computing now available in Spark version 3, we propose a change in the architecture to utilize these more performant resources while keeping the platform's functionality provided by using mainstream Big Data software. Furthermore, the necessity for GPU support entails a change in the computing resource management infrastructure from Apache Mesos to Kubernetes. Finally, to demonstrate the features and operation of the system, we use the task of network packet analysis for security monitoring and anomaly detection in both batch and stream modes.</p>
      </abstract>
      <kwd-group>
        <kwd>big data</kwd>
        <kwd>GPU computing</kwd>
        <kwd>stream processing</kwd>
        <kwd>containers</kwd>
        <kwd>machine learning</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        High-energy physics experiments, such as those being conducted at the Large Hadron Collider
(LHC) at CERN and will be conducted at the Nuclotron-based Ion Collider fAсility (NICA) at JINR,
produce actual experimental data at the scale of terabytes per second [1]–[3]. This data is usually
processed and analyzed using specialized libraries on dedicated computing platforms [
        <xref ref-type="bibr" rid="ref1">4</xref>
        ]. In addition,
modern large experiments and institutions generate many streams of ancillary data that plays a critical
role in supporting their operations. This information has an immediate technical purpose, but it can
also be collected for a more thorough cross-referential analysis.
      </p>
      <p>Projects in the Big Data ecosystem provide robust and scalable software to build a platform
for collecting and processing such datasets. A prototype of such a platform was proposed and
implemented in [5]. This work aims to build on the given progress by implementing support for GPU
computing resources. The speedup that GPU processing ensures for different processing and analysis
operations can be then measured for more effective scale-out and task scheduling in the future. We
expect GPUs to be especially effective for accelerating the training of machine learning models built
with deep artificial neural networks.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Platform architecture</title>
      <sec id="sec-2-1">
        <title>2.1 Big Data and Apache Spark</title>
        <p>The core processing and analysis framework of the platform is Apache Spark, which facilitates
batch and stream processing, contains machine learning libraries, and can interface with many data
management and storage tools in the Big Data ecosystem.</p>
        <p>
          Distributed storage is provided within the platform by the MooseFS file system. This does not
give the performance benefits of data locality afforded by HDFS, which stores data directly on
compute nodes. However, data locality is reported to be less essential for modern Big Data platforms
than it was at the inception of the Hadoop ecosystem [
          <xref ref-type="bibr" rid="ref3">6</xref>
          ].
        </p>
      </sec>
      <sec id="sec-2-2">
        <title>2.2 Resource management in the Spark cluster</title>
        <p>The Spark cluster can be run standalone, or use a resource manager: YARN, Mesos or
Kubernetes. Mesos was used as the resource management tool of the prototype framework in [5],
however, Spark does not yet support GPU resource management with Mesos. Kubernetes was selected
as the resource manager for the future, as it allowed consolidating the management of the computing
resources and the containerization of platform services.</p>
        <p>Running Spark in the standalone cluster mode is straightforward, but it is less flexible and less
desirable in a production environment than the other modes. YARN is a resource manager specialized
for the Big Data ecosystem; it would be preferable if we had an established Hadoop-based platform to
add Spark onto.</p>
      </sec>
      <sec id="sec-2-3">
        <title>2.3 GPU resource support in Spark</title>
        <p>
          To use NVIDIA GPUs as resources in Spark jobs running on the Kubernetes cluster, the
underlying containers need to support NVIDIA hardware. The libraries and tools provided by NVIDIA
for this support are multi-layered [
          <xref ref-type="bibr" rid="ref4">7</xref>
          ]:
● libnvidia-container provides an API and CLI to set up containers with NVIDIA GPU support
● nvidia-container-toolkit provides a runC prestart hook to apply these compatibility tweaks on
container startup
● nvidia-container-runtime wraps runC, adding this prestart hook to any container config started
through this wrapper
● nvidia-docker2 installs the runtime into the local Docker configuration, allowing to start
GPUenabled containers more easily
        </p>
        <p>
          The actual need for these tools and the compatibility between Kubernetes and the NVIDIA
driver version is not very well-documented. Kubernetes suggests using k8s-device-plugin, which
purportedly requires a specific NVIDIA driver version (384.81) [
          <xref ref-type="bibr" rid="ref5">8</xref>
          ], [
          <xref ref-type="bibr" rid="ref6">9</xref>
          ]. NVIDIA themselves provide
more up-to-date and complete documentation on installing a Kubernetes cluster with GPU support
[
          <xref ref-type="bibr" rid="ref7">10</xref>
          ].
        </p>
        <p>
          We used the NVIDIA DeepOps approach suggested by that article. It provides an easy way to
deploy and configure most of the Kubernetes components needed to run a production cluster by
building on top Kubespray for Kubernetes deployment with Ansible [
          <xref ref-type="bibr" rid="ref8">11</xref>
          ]. The specific up-to-date
procedure allowed us to quickly deploy and test the cluster for our platform, but it can create support
and configuration issues in the future when we might want to deviate from the suggested cluster
architecture.
        </p>
        <p>An important aspect of managing GPU resources with Kubernetes for Spark is resource
discovery. That is, finding and annotating the GPUs present on the Kubernetes node to direct specific
Spark jobs to utilize such resources. DeepOps configured the containerized service for resource
discovery by default.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Platform testing</title>
      <sec id="sec-3-1">
        <title>3.1 Distributed Tensorflow machine learning</title>
        <p>
          To test GPU resource support on the platform, a sample distributed machine-learning job was
run on the platform. Spark-tensorflow-distributor [
          <xref ref-type="bibr" rid="ref9">12</xref>
          ] provides a method for distributing Tensorflow
workflows across the Spark cluster, basically utilizing Spark as a resource and workload manager. It
also provides a sample script to demonstrate the training of a small convolutional neural network for
the classic problem of handwritten digit classification on the standard MNIST dataset. As Tensorflow
can run with or without a GPU, the same test script was used for testing throughout this project to
ensure that the GPU virtualization of the NVIDIA T4 GPU worked with the standalone Spark node,
that the distributor library worked correctly on the Kubernetes cluster, and that GPU resources were
available to Spark through the Kubernetes node.
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>3.1 Network packet analysis</title>
        <p>To demonstrate a more practical application of the platform at a scale closer to Big Data, a
prototype pipeline to collect and process network packets was implemented on the new framework, in
an approach similar to the way the same problem was solved on the prototype framework [5].</p>
        <p>
          Network packets from one local laboratory subnetwork were duplicated and sent to one
physical machine that did not take part in the main Kubernetes cluster. Raw packet headers were
extracted with tshark[
          <xref ref-type="bibr" rid="ref10">13</xref>
          ] running in a Docker container and dumped into temporary 10Mb files
continuously. They were parsed by running 7 tshark instances with GNU parallel[
          <xref ref-type="bibr" rid="ref11">14</xref>
          ] in another
container, with the communication of files to be parsed managed by incrontab and a named FIFO pipe.
The parsed JSON files were immediately compressed into ~14Mb zstd archives and stored on the
distributed storage. This collection step ran for continuous capture for 7 days, resulting in a parsed
dataset of 700Gb ready for analysis.
        </p>
        <p>The analysis was carried out in Spark, with the processing steps submitted from the Zeppelin
notebook-style web interface running entirely within the same Kubernetes resource cluster that runs
the resulting Spark jobs. Thanks to building our own Docker images hosted on a private Gitlab
repository, mounting the distributed storage into the Zeppelin and worker nodes, version
compatibility, and adding support for reading zstd-compressed files were minor problems.</p>
        <p>
          The analysis consisted of using the Numeric Aggregate and Mode (NAGM) method to
aggregate and extract network node features from the network packet TCP and IP headers. This
method, specifically for Darknet packet analysis, is described in detail in [
          <xref ref-type="bibr" rid="ref12">15</xref>
          ]. We apply it to normal
network packets to test the performance of the framework and engineer network node features with an
existing established method for further analysis. The same approach was used to test the prototype Big
Data framework in [5].
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Conclusion</title>
      <p>Most of the platform changes from the 2020 prototype to the current state were motivated by
the inclusion of GPU resources, which necessitated the change of the resource manager, the update of
Apache Spark, the use of Ansible for initial deployment. A list of changes and the motivation for them
are presented in Table 3.</p>
    </sec>
    <sec id="sec-5">
      <title>5. Acknowledgement</title>
      <p>The study was carried out at the expense of the Russian Science Foundation grant (project No.
19-71-30008).
[1] G. Bauer et al., “The data-acquisition system of the CMS experiment at the LHC,” J. Phys. Conf.</p>
      <p>Ser., vol. 331, no. 2, p. 022021, Dec. 2011, doi: 10.1088/1742-6596/331/2/022021.
[2] J. G. Panduro Vazquez, “The ATLAS Data Acquisition System in LHC Run 2,” J. Phys. Conf.</p>
      <p>Ser., vol. 898, p. 032017, Oct. 2017, doi: 10.1088/1742-6596/898/3/032017.
[3] V. D. Kekelidze, “NICA project at JINR: status and prospects,” J. Instrum., vol. 12, no. 06, pp.</p>
      <p>C06012–C06012, Jun. 2017, doi: 10.1088/1748-0221/12/06/C06012.
[5] S. Belov, I. Kadochnikov, V. Korenkov, R. Semenov, and P. Zrelov, “Batch and Stream Big Data
Processing Platform: Case of Network Traffic Analysis,” in Proceedings of the Big data analysis</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>M.</given-names>
            <surname>Lamanna</surname>
          </string-name>
          , “
          <article-title>The LHC computing grid project at</article-title>
          CERN,” Nucl. Instrum.
          <source>Methods Phys. Res. Sect. Accel. Spectrometers Detect. Assoc. Equip.</source>
          , vol.
          <volume>534</volume>
          , no.
          <issue>1</issue>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>6</lpage>
          , Nov.
          <year>2004</year>
          , doi: 10.1016/j.nima.
          <year>2004</year>
          .
          <volume>07</volume>
          .049.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <source>tasks on the supercomputer GOVORUN Workshop</source>
          , Dubna, Russia, Sep.
          <year>2020</year>
          , vol.
          <volume>2772</volume>
          , pp.
          <fpage>52</fpage>
          -
          <lpage>57</lpage>
          . Accessed: Sep.
          <volume>30</volume>
          ,
          <year>2021</year>
          . [Online]. Available: http://ceur-ws.
          <source>org/</source>
          Vol-
          <volume>2772</volume>
          /#52-
          <fpage>57</fpage>
          -paper-8
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [6] “What about locality?,” Red Hat Storage, Jul.
          <volume>11</volume>
          , https://redhatstorage.redhat.com/
          <year>2018</year>
          /07/11/what-about-locality/ (accessed Mar.
          <volume>19</volume>
          ,
          <year>2019</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <article-title>[7] “What's the difference between the lastest nvidia-docker and nvidia container runtime? · Issue #1268 · NVIDIA/nvidia-docker,” GitHub</article-title>
          . https://github.com/NVIDIA/nvidia-docker/issues/1268 (accessed Sep.
          <volume>16</volume>
          ,
          <year>2021</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>“</given-names>
            <surname>Schedule</surname>
          </string-name>
          <string-name>
            <surname>GPUs</surname>
          </string-name>
          ,” Kubernetes. https://kubernetes.io/docs/tasks/manage-gpus/scheduling-gpus/ (accessed Sep.
          <volume>16</volume>
          ,
          <year>2021</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <article-title>[9] NVIDIA device plugin for Kubernetes</article-title>
          .
          <source>NVIDIA Corporation</source>
          ,
          <year>2021</year>
          . Accessed: Sep.
          <volume>16</volume>
          ,
          <year>2021</year>
          . [Online]. Available: https://github.com/NVIDIA/k8s-device-plugin
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [10]
          <string-name>
            <surname>“Install Kubernetes - NVIDIA Cloud Native</surname>
          </string-name>
          <article-title>Technologies documentation</article-title>
          .” https://docs.nvidia.com/datacenter/cloud-native/kubernetes/install-k8s.
          <source>html (accessed Sep</source>
          .
          <volume>30</volume>
          ,
          <year>2021</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [11] “deepops/docs at master · NVIDIA/deepops,” GitHub. https://github.com/NVIDIA/deepops (accessed
          <year>Sep</year>
          .
          <volume>16</volume>
          ,
          <year>2021</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [12] “ecosystem/spark/spark-tensorflow-distributor at master · tensorflow/ecosystem,” GitHub. https://github.com/tensorflow/ecosystem (accessed
          <year>Sep</year>
          .
          <volume>30</volume>
          ,
          <year>2021</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [13] “Wireshark · Go Deep.” https://www.wireshark.org/ (accessed Sep.
          <volume>30</volume>
          ,
          <year>2021</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>O.</given-names>
            <surname>Tange</surname>
          </string-name>
          ,
          <source>Gnu Parallel</source>
          <year>2018</year>
          . Zenodo,
          <year>2018</year>
          . doi:
          <volume>10</volume>
          .5281/ZENODO.1146014.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>R.</given-names>
            <surname>Niranjana</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V. A.</given-names>
            <surname>Kumar</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Sheen</surname>
          </string-name>
          , “
          <article-title>Darknet Traffic Analysis and Classification Using Numerical AGM and Mean Shift Clustering Algorithm,” SN Comput</article-title>
          . Sci., vol.
          <volume>1</volume>
          , no.
          <issue>1</issue>
          , p.
          <fpage>16</fpage>
          ,
          <string-name>
            <surname>Aug</surname>
          </string-name>
          .
          <year>2019</year>
          , doi: 10.1007/s42979-019-0016-x.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>