{'fraction_non_alphanumeric': 0.026567314343205684, 'fraction_numerical': 0.007105577563981638, 'mean_word_length': 5.191648822269808, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Reproducible and Portable Big Data Analytics in the Cloud

Cloud computing has become a major approach to help reproduce computational experiments because it supports on-demand hardware and software resource provisioning. Yet there are still two main difficulties in reproducing big data applications in the cloud. The first is how to automate end-to-end execution of analytics including environment provisioning, analytics pipeline description, pipeline execution, and resource termination. The second is that an application developed for one cloud is difficult to be reproduced in another cloud, a.k.a. vendor lock-in problem. To tackle these problems, we leverage serverless computing and containerization techniques for automated scalable execution and reproducibility, and utilize the adapter design pattern to enable application portability and reproducibility across different clouds. We propose and develop an open-source toolkit that supports 1) fully automated end-to-end execution and reproduction via a single command, 2) automated data and configuration storage for each execution, 3) flexible client modes based on user preferences, 4) execution history query, and 5) simple reproduction of existing executions in the same environment or a different environment. We did extensive experiments on both AWS and Azure using four big data analytics applications that run on virtual CPU/GPU clusters. The experiments show our toolkit can achieve good execution performance, scalability, and efficient reproducibility for cloud-based big data analytics.


INTRODUCTION
R Eproducibility is increasingly required by the research community, funding agencies, and publishers [1]. By reproducing an existing computational experiment and obtaining consistent results, we can have more confidence in the research. Further, besides reproducing the exact process, it is also valuable to explore how the experiment behaves with different input datasets, execution arguments, and environments. Cloud computing has been a major approach for reproducibility [2] because cloud services can be leveraged to provision data, software, or hardware needed in reproduction. For instance, paper [3] summarized 13 aspects that cloud computing can help with reproducibility.
In this paper, we mainly address the following challenges in cloud-based reproducibility. First, it is still difficult to achieve end-to-end automated big data analytics execution and reproduction in the cloud. The end-to-end automation should support scale-up and scale-out of distributed hardware environment, software environment provisioning, data and configuration storage for each execution, resource termination after execution, execution history query and reproducibility of existing executions in the same environment or a different cloud environment. Second, because the services provided by each service provider such as AWS and Azure are proprietary, an application developed for one cloud cannot run in another cloud, which is a well-known vendor lock-in challenge. Two scientific problems to be studied by tackling challenges are: 1) what is a proper abstraction and design for better reproducibility support from both user and toolkit perspectives, 2) what is a more efficient way to achieve cloud-based reproducibility for big data analytics.
Based on the above challenges and scientific problems, we propose an approach and corresponding open-source toolkit [4] for Reproducible and Portable big data Analytics in the Cloud (RPAC). Our contributions are summarized as follows.
• Our proposed approach and toolkit integrate serverless computing techniques to automate end-to-end big data analytics execution. Tasks of big data analytics execution (resource provisioning, application execution, data storage and resource termination) are encapsulated as cloud functions and automatically triggered by proper events. With the full automation support, users can re-run the exact execution or run the application with different configurations, including different scale-out and scale-up factors, via only one command. Our RPAC toolkit supports both AWS and Azure cloud environments.
• For easy reproducibility, we make proper data modeling and abstraction. It first separates essential information required for reproducibility and detailed information required by each cloud provider. Following the separation of concerns principle, it further separates the essential information into three categories (resources, application, personal) for easy reconfiguration. The essential information will also be automatically stored in the cloud by our toolkit arXiv:2112.09762v3 [cs.DC] 28 Oct 2022 as authentic recording of the execution. Later, the storage URL can be published and shared as the single source to reproduce the historical execution.
• To deal with the vendor lock-in challenge, on top of the above abstractions, we propose a Cloud Agnostic Application Model (CAAM) to support execution and reproducibility portability with different cloud providers. CAAM abstracts the application out of its cloud specific logic, and allows reproducing executions in another cloud via only minimal configuration changes from the user. • We benchmark both CPU-based and GPU-based big data analytics applications using our RPAC toolkit. We measure the overhead of data storing for reproducibility. We also did extensive experiments to benchmark three applications on different cloud providers in terms of execution performance, scalability and reproducibility efficiency.
The rest of the paper is organized as follows. In Section 2, we briefly introduce related techniques our work is built on. Section 3 provides an overview of our proposed approach. Three main parts of our approach, namely data modeling, automated execution and reproduction of big data analytics in the cloud are explained in Section 4, Section 5 and Section 6, respectively. Experiments and benchmarking results are discussed in Section 7. We compare our work with related studies in 8 and conclude in Section 9.

Big Data Analytics
To deal with increasing data volumes in data analytics, many platforms have been proposed to achieve parallelization of the analytics in a distributed environment. We explain three such platforms that our work is built on for reproducibility. As one of the most popular big data platform, Spark [5] follows and extends the MapReduce paradigm [6] and achieve parallelism by distributing input data among many parallel tasks of the same function. To run an application, Spark employs a master process on one node and a worker process on each of other nodes so the worker processes can take tasks from the master process and run them in parallel. Similar to Spark, a Dask [7] application is composed as a task graph that can be distributed within one computer or a distributed computing environment. Dask employs a similar master-worker framework for task scheduling. Horovod [8], as a popular software framework for distributed learning, provides data parallel deep learning optimized for GPU-based data analytics. For coordinating execution between distributed processes on GPU, Horovod can use Message Passing Interface (MPI) for communicating data with high performance. The CUDAaware MPI is commonly used in HPC to build applications that can scale to multi-node computer clusters [9].

Reproducibility
There have been many definitions of reproducibility and similar terms like replicability and repeatability [10,11]. Unfortunately, these definitions are not very consistent, some even contradict with each other [1]. Here, we simply define reproducibility as a capability that obtains consistent results using the same computational steps, methods, and code. As paper [12] said, containerization is one of the valid and common solutions for the reproducible software deployment problem of scientific pipelines. For cloud-based reproducibility, it studies how to re-execute an existing application in the cloud [3]. We categorize reproducibility support into four ways: 1) rerun exactly the same application with the same hardware and software environment, 2) reproduce with a different application configuration to know how the application performs with different datasets or arguments, 3) reproduce with different cloud provider hardware environment (virtual machine type and number, etc.) within the same cloud provider to test scale-up and scale-out; and 4) reproduce with a different cloud provider to avoid vendor lock-in problem. Our toolkit is built to support all four types of reproduction.

Serverless Computing
As a recent cloud-based execution model, serverless computing provides a few advantages. First, it responds to user service requests without maintaining back-end servers in the cloud. Second, it employs Function as a Service (FaaS) architecture that allows customers to develop separate functions directly rather than standalone cloud applications. As explained in [13], each application logic/pipeline is split into functions and application execution is based on internal or external events. All major cloud providers offer serverless services, including AWS Lambda, Azure Functions and Google Cloud Functions.

OVERVIEW OF REPRODUCIBLE AND PORTABLE DATA ANALYTICS IN THE CLOUD
In this section, we provide an overview of how our proposed approach achieves reproducible and portable data analytics in the cloud. With the approach and corresponding open-source toolkit RPAC for reproducible and portable data analytics in the cloud, users can easily re-run previous experiments with the same or different setups including environments, application arguments, input data and cloud providers. Our approach is built on top of serverless computing and we adopt a new way of utilizing serverless computing for large scale computations. So we will explain first how to use serverless large scale computations, then how to use serverless for big data analytics reproducibility.

Serverless based Reproducibility
As shown in Fig. 1, our proposed approach has two parts: 1) first execution of an application, and 2) reproduction of the existing execution from historical configurations. Both first execution and reproduction are automated via serverlessbased approach shown on the right.
In the beginning, there is no execution history for querying and reproducing. Clients need to prepare configurations to generate the pipeline file for the whole execution. The configuration includes all configurable setups, for example, the application-based information like application programs, arguments, input data, and the cloud-based information like virtual cluster type, size, network setting,  memory, with personal credentials. Our toolkit will take this information to create an executable pipeline for a target cloud. With this pipeline, the data analytics application will execute in the cloud environment, output its results to the storage, and automatically terminate resources once the execution finishes. We will explain in detail how we leverage serverless techniques for automated big data analytics in Section 5.
After an application is executed, clients can reproduce it based on its execution history. Our RPAC toolkit will generate a pipeline file based on the execution history and reproduction configurations. If the client wants to reproduce an existing execution with the exact environment and configuration, the pipeline file within the execution history can be used directly by our toolkit for reproducibility. If the client chooses to reproduce existing execution within the same cloud, but with a different environment or application, our toolkit will combine changed configurations of cloud resources or applications with the historical execution information to generate a new pipeline file. If the client prefers reproducing existing execution on a different cloud, our toolkit will provide cloud service mapping and implementations of functions in the target cloud. With userprovided personal information and historical execution, a new pipeline will be generated for the target cloud. Finally, with the pipeline file executable by cloud serverless services, the data analytics will be reproduced in cloud automatically. Details of how our approach achieves reproducibility will be explained in Section 6.
We would like to note the serverless pipeline used here is different from most other workflow or pipeline definitions such as [12] [14][15] [16]. These definitions only include the processing steps and their dependencies. They do not describe how to provision hardware and software environments because they assume these environments are ready before pipeline execution. Our serverless pipeline includes the full execution life cycle including hardware and software provisioning, big data analytics, execution export and resource release. Our pipeline does not describe internal processing steps, but could be integrated with traditional pipelines as internal logic description in its Function 2: conduct big data analytics.

Serverless based Large Scale Application in the Cloud
Traditionally, serverless computing is used to execute serverless pipelines and the functions defined in each pipeline directly via cloud services like AWS CloudFormation. In this case, the computation is executed following the pipeline without using any additional cloud resources. Because of the memory and CPU limit for serverless functions, this approach can only handle computations whose resource requirements are light. For instance, OpenWhisk [17] is an event-based serverless computing cloud platform, which allows users to implement their own OpenWhisk APIs for the connections between the event source and trigger, the trigger rule, and the computation actions. Different from the above way to use serverless, we leverage serverless computing and its FaaS to achieve reproducibility for big data analytics in the cloud. The main difference is that we use the serverless pipeline as a way to orchestrate and manage additional cloud resources for heavy workloads while each step is wrapped as a function. In this way, both the serverless pipeline and its functions do not execute heavy commands directly. Instead, each function's execution only submits commands from serverless to the additional cloud resources. Then when the function is triggered, the commands will be transferred to the additional cloud services and be executed as background processes so they can return without waiting for the finish of the commands. As shown in Fig. 2, the serverless pipeline listens to events sent by our toolkit or other cloud services. By mapping the triggers mentioned in the event with the trigger rule associated with each serverless function, it knows which serverless function will be involved based on the received event. For instance, Function 2 will be triggered when the pipeline receives an event as SoftwareEnvReady. For each function's execution, it only submits commands from serverless to additional cloud services such as AWS EC2, so the resource and time limits for serverless functions will not be violated. Also, all major cloud providers including AWS and Azure, only enforce time limits for serverless functions, not serverless pipelines. So serverless pipelines are capable of large-scale computations that might take a long time. Serverless pipeline is also a reasonable choice from a budgetary cost perspective because serverless service is charged by the invocation time of its functions, not the deployment time of the pipeline.

DATA MODELING AND STORAGE FOR REPRO-DUCIBILITY
To achieve easy configurability by users and future reproducibility across cloud providers, we categorize data based on their usage and employ different levels of data abstraction. Specifically, the data model contains three parts: abstract request information, executable request information and execution history information. We believe the data model can serve as a reference model for different reproducibility toolkits.

Abstract Request Information
To avoid learning specific specifications and templates for specific clouds, we extract minimal information a user has to provide for application execution or reproduction.
Further, as shown in the upper part of Fig. 3, we categorize the information into three separate key-value based configuration files where ini is used as file extension to distinguish them from other file types used by our toolkit. Specifically, resources.ini stores hardware and software resources information such as virtual machine type, virtual instance number, docker image URL and big data engine; application.ini records the program URI of the application, program arguments, and input dataset URIs of the program; personal.ini contains the cloud credential information such as SSH key location and cloud credential info (which can also be provided at runtime for security concerns). We use three different files so only a subset of files needs to be edited for each type of reproducibility shown in Fig. 1.

Executable Request Information
We separate information that is required for actual cloudbased application execution into four files and use json as the file extension. Such files have to follow specifications set by each cloud. For such files, our RPAC toolkit generates them automatically based on corresponding abstract ini file(s) mentioned above. The first file is resources.json which describes hardware and software environment info. This file has to be changed if the cloud provider is switched. The resources.json will be generated based on the above resources.ini file, the cloud type and the type of big data analytics. Another file is application.json which contains application specific information and will be generated by our toolkit based on the above application.ini file and the cloud type. Similarly, personal.json can be generated from personal.ini. As shown in Fig. 3, by combining resources.json, application.json, personal.json and four cloud-specific serverless functions shown in Fig. 1, we get pipeline.json that describes the execution logic of the serverless application. Our RPAC toolkit contains template json files and serverless function implementations so they can be reused for different data analytics applications. We illustrate how to map from abstract requirements in Section 4.1 to an executable cloud specific serverless pipeline and its implemented functions in Fig. 4. The pipeline file is generated by the three abstract request information provided by users, which transfers the stateless configurations to executable cloud-specific information. Each serverless function listens to the upcoming events. If a received event (e.g.,HardwareEnvReady in Fig. 4) matches, the associated function (e.g., SoftwareEnvSetup() in Fig. 4)   SoftwareEnvReady in Fig. 4) will be returned to trigger the downstream functions.
Next, we will explain how the files are used for automated execution in detail in Section 5.1 and how they are reused or transformed for reproduction in Section 6.

Execution History Information
Execution history information is critical to share each execution for later analysis and reproduction. As illustrated in Fig. 5, we classify execution history related data into three categories and store them separately. The first category is execution log metadata, such as timestamps, duration, cost, and status, which are stored in the database for query. Keyvalue based execution parameters including analytics command line and arguments are also stored for easy comparison among executions. This metadata information is unique for each execution, not required for reproducibility, but useful for later analysis such as finding the fastest execution time of the same application on different clouds or cloud resources. For information that can be referred from external resources, such as input datasets, output files and configuration files used for the execution, only their URLs are stored in the database. The second category is object based storage of each execution information for reproducibility. Two items are stored for each execution: 1) abstract request information (resources.ini, personal.ini and application.ini in Config.zip), 2) execution output datasets in Result.zip. Only abstract request information, not cloud specific information, is stored by our RPAC toolkit in order to minimize storage overhead. These data are compressed, categorized and stored in cloud object storage services such as AWS S3 and Azure Blob storage so a unique URL could be obtained for each execution. Because the data has the complete information to achieve reproducibility, the URL could be easily published as public records following the Research Object framework [18] so it can be referred to via a DOI identifier later as the single source for reproducibility. The third category is shared object storage of input datasets. It is stored separately so that multiple executions with the same input data only need one object storage. Also, cloud storage services like AWS S3 and Azure Blob storage allow automatic versioning so minor changes of input datasets do not require a fully separate storage.

AUTOMATED BIG DATA ANALYTICS IN THE CLOUD TOWARDS REPRODUCIBILITY
To achieve easy reproducibility, the execution should be as automated as possible to minimize manual operations during reproduction phase. Also, an execution should be easily configurable for different scalability factors, application parameters, even cloud providers. In this section, we discuss our techniques to achieve fully automated big data analytics in the cloud so an application can be executed and later reproduced using only one command.

Serverless and Docker-based Execution Automation
We leverage serverless computing to achieve overall analytics pipeline description and execution, and docker for software environment setup. Serverless computing offers a few advantages for reproducibility: 1) it saves costs because we do not need to maintain a server in the cloud especially for cases reproduction does not happen frequently; 2) its FaaS model allows us to design and implement separate functions required for automated execution/reproduction; 3) its event-based function composition and execution eliminates the requirement of a separate workflow/pipeline software which is needed for many traditional workflowbased reproducibility [1]. As explained in Section 2.3, serverless computing offers templates to describe cloud service resources required by the application, structured application pipeline, and event-based execution. Each component in the application pipeline is implemented as a serverless function and triggered by the events it listens to. So the pipeline binds cloud services with the specific event in order to trigger the corresponding serverless function. In addition, we can package complicated software dependencies required for an application via docker. The details of the automation are illustrated in Fig. 6.
After receiving the user request, RPAC execution automation starts with pipeline generation and submission. Based on configurations, RPAC generates corresponding pipeline files, deploys its serverless functions, and uploads these configurations to the storage except client personal information. RPAC then submits this pipeline to the cloud and starts serverless execution. The serverless pipeline starts with the on-demand hardware environment provisioning (step a in Fig. 6) via cloud manager services (such as Cloud-Formation for AWS and Deployment Manager for Azure). The hardware provisioning is more like an on-demand resource request service that is a prerequirement for all serverless functions. So we put the hardware provisioning at the beginning of the serverless pipeline. To conduct big data analytics, we also need to create a virtual cluster by specifying the type and sub-type of virtual machines, the number of virtual machines, network security groups, etc. Cloud manager services allow the information to be submitted based on their semi-structured specification such as JSON and YAML. RPAC will send a reply once the pipeline file is submitted.
The remaining steps of the automated pipeline execution are done via four cloud functions. On top of the virtual hardware environment provisioned, the next automation step is to deploy the required software to run the application (step b in Fig. 6). It is achieved by the first serverless function, which pulls required docker file and starts it. After the hardware and software environments are provisioned, it is ready to execute applications. The second serverless function in Fig. 6 executes the application by deploying user application (e.g., download application codes and unzip them) and running its commands with proper parameters (input data, application specific arguments, etc.). The third function exports all addresses of stored files to cloud database and object storage for future query and reproduction. After the storage completes, a termination event is sent to the last function, which terminates all cloud resources. At this time, the whole pipeline is fully executed, and the client is able to check and query information stored in the database and object storage.
All these functions are triggered automatically when they receive corresponding events. The cloud manager services mentioned before can help the client manually send events to the serverless function from cloud console. In order to achieve full automation, these events can also be delivered to the target function by cloud event handling services (such as EventBridge for AWS and Event Grid for Azure) using a pre-defined event rule. Each serverless function needs to set up an event rule which specifies what type/property of event can trigger this function. For example, the rule of execution export function (step d in Fig. 6) requires the event source from object storage with a ruledefined prefix, like export. Besides serverless-based execution, our RPAC toolkit also supports cloud SDK-based execution to allow flexible client modes. Their differences are summarized in TABLE 1. The cloud SDK mode is designed based on the cloud-specific software development toolkit (SDK). SDK facilitates the creation of applications by having a compiler, debugger and a software framework based on its functionality. The implementation of this SDK-based mode contains cloud application programming interfaces (APIs) for pipeline management. For example, AWS Boto python SDK can be invoked to describe the status of EC2 using ec2.describe_instances(). The execution can be automated by a periodical status pulling loop. This SDK-based mode requires programming knowledge and a complete understanding of the data analytics pipeline, so that developers become preferred users since they can either run the application in a fully automated way or step-wise execution for debugging purposes. By supporting different execution modes, users can make flexible choices. In comparison, serverless based approach is fully automated and more efficient because only the execution is managed via internal event triggering. No communications between client and cloud are needed once the pipeline is submitted.

Scalable Execution for Three Parallel Frameworks
In this section, we discuss how our approach supports scalable execution via the three parallel frameworks in Section 2.1, namely Spark-based, Dask-based, and Horovodbased analytics. The first two utilize virtual CPU clusters and the third utilizes virtual GPU clusters. By specifying the virtual machine type and number, cloud services can provision a cluster hardware environment. However, software dependencies, process coordination, and even access permission may differ for different big data analytics. Because of these differences, each framework requires its own resources.json and implementation of the first serverless function shown in Fig. 6. To reproduce big data analytics, one important part is to record and reuse original big data engine configurations. Paper [19] uses separate files to record Spark memory configuration for reproducibility. Similar to this approach, we set these configurations by recording the information via command line arguments or original big data engine configuration files. Big data engine's configurations can be modified in application reproduction by users in application.ini file, such as changing -driver-memory 60g -executor-memory 60g for Spark engine. Additional big data engine configurations are set up via separate files like spark-env.sh in the $SPARK/conf folder. Our toolkit supports storing such files in the cloud so they can be reused in reproduction.
Beyond the listed frameworks, the additional parallel frameworks can also be deployed by updating the docker images' address in application.ini. RPAC will setup this parallel framework in the second serverless function of Fig. 6 and execute analytics within the new environment.

Spark-based big data analytics on virtual CPU nodes.
We provide Spark-based parallel framework via the dockerbased Spark engine virtual cluster provisioned by direct cloud services like AWS EMR with additional cloud resources like virtual network, container service and file system. By default setting, the resource manager like YARN NodeManager initiates the environment from a pulled docker image, and allocates one virtual instance as the master while others as workers. With serverless based pipeline execution, our toolkit enables automated execution management on master and execution computation on workers defined by serverless function handlers/implementations.
Since big data analytics utilizes many compute nodes with complex computation proprieties, it is important to make sure availability and reliability during cloud execution. To achieve a secure and stable scalable execution, we control the access permission of master and workers by using the network security group. During big data analytics, our pipeline assigns one group for the master and another group for workers, and only enables TCP/UDP inbound and outbound rules within them. Also, for computation reliability, the big data analytics pipeline only allows client SSH permission for the master security group.

Dask-based big data analytics on virtual CPU nodes.
Besides Spark, our RPAC toolkit also supports CPU-based parallel analytics by using Dask as the resource manager in the virtual cluster. Different from Spark which has dedicated cloud services (such as EMR in AWS), Dask environment can only be provisioned by regular virtual machine services (such as EC2 in AWS).
Each virtual instance in the cluster initiates one docker container and our pipeline assigns one of the containers to be the Dask scheduler and others to be workers. Same with the security group setup with Spark-based analytics, we divide the client access between scheduler and workers for execution reliability. During execution, different from AWS EMR service which automatically initiates Spark processes after hardware provisioning, our RPAC toolkit needs to start Dask processes on both scheduler and worker containers during software provisioning before executing big data analytics on virtual CPU nodes. Besides, same as Sparkbased cloud services, the client can also produce interactive visualizations based on Dask diagnostic dashboard in our framework, by using the public DNS name (public IP) of the scheduler instance with its dashboard port.

Horovod-based big data analytics on virtual GPU nodes.
To provide a GPU-based parallel framework, we leverage Horovod and regular virtual machine services for analytics. The RPAC toolkit executes multi-instance GPU-based data analytics within our pre-built Docker containers, involving a shared file system and a customized port number for the SSH daemon. In order to categorize functionality between different instances, we set one of them as the primary worker and others as secondary workers. Within the container, the primary worker runs the MPI parallel command for data analytics execution while secondary workers listen to that specific port.

REPRODUCE BIG DATA ANALYTICS IN THE CLOUD
In this section, we discuss how to achieve different levels of reproducibility within the same cloud and across different cloud providers. To achieve reproducibility, the user only needs to provide the URL of a historical execution stored in cloud storage (more in Section 4) and her own configurations. We will explain how our framework and RPAC toolkit support different ways of reproducibility summarized in Section 2.2.

Reproducibility in the Same Cloud
Reproduction with the same environment and configuration. This type of reproducibility is simplest because it is the same with the first execution as long as we can retrieve the information used from execution history. As illustrated by the first item in reproducibility phase of Fig. 1, by retrieving resources.ini and application.ini from execution history and providing proper personal.ini, our RPAC toolkit can rerun the experiment the same way it was executed for the first time.
Reproduction in a different environment. Reproduction in a different environment means the virtual environment configuration needs to be changed from a historical execution, which is often useful for scale-up and scale-out experiments. As illustrated by the second reproducibility item in Fig. 1, a new resources.ini needs to be provided explaining the new environment setup (mostly virtual machine type and number). Then our RPAC toolkit can use it to generate a new executable resources.json and run the experiment in the same cloud.

Reproduction with a different application configuration.
Reproduction with a different application configuration is often useful to run the application with a different dataset and/or application argument. As illustrated by the third reproducibility item in Fig. 1, a new application.ini needs to be provided explaining the new application setup. Then our toolkit can use it to generate a new executable application.json and run the experiment in the same cloud.
We note that the last two reproductions can be easily combined for the requirements of running an application with different configurations and a different environment. To support it, a new resources.ini and a new application.ini should be provided.

Cross-cloud Reproducibility
We discuss how the client achieves reproducibility with a different cloud provider. As illustrated in the fourth way of reproduction in Fig. 1, by providing cloud service mapping and corresponding serverless function implementation, our To extend the reproducibility to another cloud, by leveraging the adapter pattern [20], we propose a portable Cloud Agnostic Application Model (CAAM) in order to solve the vendor lock-in and interoperability problem for big data analytics, which is shown in Algorithm 1. When CAAM receives resources.ini, application.ini and proper personal.ini, CloudAdapter() invokes each vendor specific method of different cloud. It means as long as there is an adaptee class written for the cloud provider, by calling the CloudAdapter() with this cloud provider, the provided general-purpose configurations will be transformed to the executable request information of the target cloud based on its specification sets and execution requirements. By combining the compatible information of resources, application and personal, CAAM generates the overall executable pipeline.json and starts to execute the data analytics. As shown in Algorithm 1, each cloud adaptee needs to implement how to get its resources.json based on resources.ini from execution history, parallel framework and service mapping shown in TABLE 2. After all json files are ready, AWS uses GetAwsPipeline(AwsConfig) to generate pipeline file, while Azure uses GetAzurePipeline (AzureConfig) for generation. With CAAM, client directly calls CloudAdapter() with a specific adaptee method to execute data analytics with one general-purpose configuration. By calling Pipeline.execution(), the generate() method in corresponding cloud adaptee will generate the pipeline file and execute the big data analytics in cloud. Particularly, adaptee is in a modular design that can be injected into, removed from, or replaced within CAAM at any time.
Extensibility on cross-cloud reproduction. Our reproducible and portable big data analytics can be easily extended to additional clouds because most services from different cloud providers can be mapped to each other. TABLE 2 lists all cloud services provided by Amazon AWS, Microsoft Azure and Google Cloud for data analytics. Our toolkit currently only implements cross-cloud reproducibility between AWS and Azure. Extension to Google Cloud can be done by adding an additional cloud specific adaptee and providing corresponding service mapping with function implementation.

EVALUATION
We implement the reproducible and portable cloud computing and open-source it on GitHub at [4]. Two CPUbased analytics applications (cloud retrieval and causality discovery) and one GPU-based analytics application (domain adaptation) are tested in our experiments. All benchmark evaluations are developed on two cloud providers, Amazon AWS and Microsoft Azure. Seven metrics are used to evaluate our work which include data analytics metrics like execution time, budgetary cost, cost-performance ratio, and cloud reproducibility metrics like overhead.   3 lists the exact cloud resources we use for each data analytics. For executing the application with a larger dataset, additional storage like AWS Elastic Block Store (EBS) is also been attached during the resource initialization. One variation is in scale-out of AWS CPU-based evaluation. We use c5d.large cluster for Dask-based analytics, but c5d.xlarge cluster for Spark-based analytics because AWS EMR requires more computational capability.

Benchmark Analytics and Datasets
To benchmark our toolkit's functionality comprehensively, we employ four applications and each uses a separate big data framework in Section 2.1.
Cloud retrieval. Cloud property retrieval is an important task in remote sensing and Atmospheric science. We used the implementation of paper [21] for our first application. It trains a Random Forest machine learning model for cloud mask and cloud thermodynamic-phase retrieval from satellite observations. Dask framework is used for execution parallelization. The Docker image we built is hosted on DockerHub public repository, with Python 3.6 and sklearn 0.24.2. Total datasets are around 0.5 GB.
Causality discovery. In order to discover the cause-effect relationships in a system with the increasing volume and dimensionality of available data, the two-phase scalable and hybrid causality discovery is proposed by Guo et al. [22]. As a big data analytics, we use the Spark application with Hadoop in the cloud virtual cluster. The Docker image we built is hosted on DockerHub public repository, with Python 3.7 and R 3.4. The data in our execution is 200,000 rows of simulated five variable time-series records, which is around 10 MB.

Domain adaptation. Unsupervised Domain Adaptation
(UDA) aims to transfer the knowledge learned from a labeled source domain to an unlabeled target domain. We use the UDA implementation designed by Sun et al. [23] that solves the problem of the unlabeled target domain. To move this data analytics to the cloud, we use the virtual cluster with Pytorch GPU acceleration and Horovod with MPI. The Docker image we built is hosted on DockerHub public repository, with Python 3.6, CUDA 10.1 and cuDNN 7. The data we used is the public Office dataset containing 31 object categories in two domains: Amazon and Webcam, which is around 50 MB in total.

Satellite collocation.
Because there are many satellites orbiting the Earth, it is valuable to integrate and/or compare their measurements. Satellite collocation provides a way to pair measurements from two satellite sensors that observe the same location quasi-simultaneously. We implemented and parallelized the method in [24] to generate collocated data from two satellites. Like the cloud retrieval application, we use Dask framework for execution parallelization. The Docker image we built is hosted on DockerHub public repository, with Python 3.8, Pandas 1.5.0 and H5py 3.7.0. The two satellites we used in the experiment include the ABI passive sensing data product from NOAA Geostationary Operational Environmental Satellites (GOES-16+) [25] and the CALIOP active sensing data product from NASA Cloud-Aerosol Lidar and Infrared Pathfinder Satellite Observations (CALIPSO) satellite [26]. The total input data volume is 1.1 TB.

Evaluation Metrics
Even though there have been many studies on reproducibility, as stated in this recent survey paper [27], there are still no agreed metrics that can quantitatively measure reproducibility and compare different reproducible toolkits. The survey paper thinks performance, scalability and efficiency are possible metrics, but no concrete metric definition was provided. In this work, to promote fair comparison, we provide our own definition of performance, scalability and efficiency for cloud based reproducibility, which results in seven metrics (namely m1 to m7 listed below).

Execution Performance Metrics
Following paper [28], we measure execution performance of our cloud based application via m1: execution time, m2: budgetary cost and m3: performance-price ratio (PPR). We first record execution time for each data analytics benchmark. The execution time is the wall-clock time of analytics pipeline (as shown in Fig. 6), which includes pipeline file preparation, cloud resources deployment and initialization, data analytics execution, execution history upload, and termination.
Budgetary cost contains bill usages for all resources used in each data analytics benchmark, which mainly includes the virtual cluster, container, network, database, and object storage with read and write request usage.
Regarding the performance-price ratio (PPR), it evaluates the performance of each analytics considering the execution time with cost. We use the same formula used in [29] for PPR by calculating the product of execution time and budgetary cost. Lower PPR is more desirable excluding other factors.

Cloud Scalability Metrics
We evaluate the scalability of our work for both m4: scale-up (vertical scaling) and m5: scale-out (horizontal scaling).
Cloud scale-up is achieved by utilizing more resources within an existing computation system to reach a desired state of performance. In our evaluation, scale-up is set in a single virtual machine by having more threads in Daskbased analytics, more executor cores in Spark-based analytics, or more GPUs in Horovod-based analytics. For cloud retrieval, we fix the number of threads for each Dask worker, and utilize the number of workers from 1 to 8 during evaluation. It is the same in domain adaptation, except by increasing more threads for GPUs rather than CPUs. For causality discovery, because of the EMR setup, we launch only one worker in each virtual instance and allocate only one executor in this worker. To scale up, we use one executor with increasing the numbers of vCPUs of this executor for parallel execution.
In real world scale-up, it is undesired to launch a powerful instance but only use its partial computational capability. In order to have a fair comparison, we additionally measure scale-up cost by usage, which times the budgetary cost of one instance by the percentage of CPU that is actually used. It simulates scale-up scenarios that use more and more powerful machines.
Cloud scale-out is usually associated with a distributed architecture, which is achieved by adding additional computational capacity to a cluster. In our evaluation, scale-out is set by increasing more virtual machines in an existing cluster. For cloud retrieval and domain adaptation, we deploy only one worker process per instance, and increase the number of instances from 1 to 8 during evaluation. For causality discovery, we instead use one CPU core in each executor, and increase the number of workers by adding virtual instances.

Reproducibility Efficiency Metrics
For reproducibility, a metric m6: reproducibility overhead is used to understand how much overhead it brings by supporting reproducibility during execution. Since reproducibility support is achieved by storing application configuration and execution history, we calculate the ratio between additional execution time caused by reproducibility data storage and the execution time of execution without reproducibility support. The lower the overhead ratio is, the better.
As we mentioned in Section 5.1, an SDK-based pipeline execution mode has also been proposed for big data analytics. Since both SDK-based and serverless-based approaches can be achieved automatically, we also measure m7: reproducibility efficiency to compare their execution time with reproducibility.

Benchmarking for Execution Performance and Scalability
In this section, we first assess the cloud scalability of our RPAC toolkit based on three metrics: m1: execution time, m2: budgetary cost, and m3: performance-price ratio. In m4: scale-up evaluation, the execution is analyzed by gradually utilizing more resources in one instance. In m5: scale-out, the evaluation is achieved by gradually adding additional instances of the same type in one cluster. Next, we will explain our benchmarking results of the four applications.

Scalability for Cloud Retrieval
The cloud retrieval m4: scale-up and m5: scale-out evaluations are shown in Fig. 7. As illustrated in Fig. 7a, the m1: execution time decreases when the number of executors increases in both AWS and Azure with similar trends. The m2: budgetary cost as shown in Fig. 7b, however, decreases in m4: scale-up and increases in m5: scale-out when the number of executors increase. The reason is that in cluster scale-up, the same resources were used while their execution time was decreasing; and in cluster scale-out, the costs saved by less execution time costs were less than the costs increased   (c) Performance-price ratio.     with additional resources. If only calculating the cost by usage for m4: scale-up case, its trends become similar to those of m5: scale-out. Combining cost and time, as illustrated in Fig. 7c, the m3: PPR in m4: scale-up and scale-up by usage decrease when the numbers of executors increase. However, the m3: PPR first decreases but later increases a little bit in m5: scale-out cases. The figure also shows AWS achieves better m3: PPR than Azure, and m4: scale-up achieves better m3: PPR than m5: scale-out. So the best m3: PPR for the Dask-based big data application with virtual CPU nodes is achieved by m4: scale-up of application with more executors in AWS.

Scalability for Causality Discovery
Because Azure HD-Insight cluster does not support Dockerbased Spark computation, we only focus on the evaluation of causality discovery for AWS, which is shown in Fig. 8. The trends for this application are very similar to those for the previous application since they both are CPU-based. As illustrated in Fig. 8a, the m1: execution time for both m4: scaleup and m5: scale-out decreases dramatically by at most 80% when the parallelism increases. This change of time appears more significant in causality discovery compared with what is in cloud retrieval. For the m2: budgetary cost in Fig. 8b, when the parallelism increases, the m4: scale-up decreases, while both m5: scale-out and scale-up by usage increase with similar trends. For all three metrics in Fig. 8c, The m3: PPR decreases when the numbers of executors increase. As a result, it is better to use a larger number of executors in the Spark-based big data analytics with virtual CPU nodes.

Scalability for Domain Adaptation
For domain adaptation, the evaluations are shown in Fig. 9.
Because the maximal number of GPUs in one instance is 4 for Azure, we compare m4: scale-up only from 1 GPU to 4 GPUs. As illustrated in Fig. 9a, same with the findings from other data analytics, the m1: execution time decreases when the numbers of GPUs increase in both AWS and Azure. The m2: budgetary cost in Fig. 9b, also have the same regularity compared with CPU-based analytics. For m3: PPR, as illustrated in Fig. 9c, more GPUs lead to better ratios for m4: scale-up and worse ratios for scale-up by usage. For m5: scaleout, m3: PPR first gets worse and then improves a little bit. But still launching with only 1 instance can have the best m3: PPR for both AWS and Azure execution.

Scalability for Satellite Collocation
The above three applications already show the effectiveness of RPAC for parallel frameworks in different clouds. We further evaluate the satellite collection application with over 1 TB input data on AWS, and its longest total execution time is over 25 hours. As shown in Fig. 10, the m1: execution time in Fig. 10a  (c) Performance-price ratio.    are first decrease but later increase a little bit. As a result, the better parallelism strategy for the big data application is using more executors in m4: scale-up deployment.

Benchmarking for Reproducibility Efficiency
In this section, we assess the efficiency of reproducibility for RPAC toolkit in the first three applications. We first evaluate the overhead caused by serverless-based reproducibility, then we compared the efficiency between serverless-based and SDK-based approaches.

Efficiency Comparison for Reproducibility Support
We first measure the m6: reproducibility overhead of our applications with and without reproducibility support. For each application, we measure the AWS scale-up with 4 parallelisms, run each experiment 10 times and collect all results in a box-plot shown in Fig. 11. From the figure, we can see having reproducibility support did not cause much overhead, which is less than 0.01 hours, for all applications. (b) The relative difference. Fig. 11: The box-plots and its relative difference for application execution time with and without reproducibility support.
The overhead percentage caused by reproducibility for cloud retrieval (CR), causality discovery (CD), and domain adaptation (DA), are 1.28%, 3.58%, and 2.17%, respectively. Besides, the time range of GPU-based analytics is larger than both CPU-based analytics, which means the execution time of GPU-based computation is more unstable than CPUbased one. We utilize a statistical hypothesis test approach, called T-test [30], to determine whether the execution time with and without reproducibility support differ statistically. Ttest determines a possible conclusion from two different hypotheses. By calculating the corresponding p-value [31], we can measure the probability that an observed difference has occurred just by random chance. Hypothesizing that the reproduce execution provides some overhead over the execution without reproducibility, we calculate the p-value for the two sample t-test with equal variance. The p-values of CR, CD and DA, turn out to be 0.4968, 0.3193 and 0.3634. Since these are not less than p = 0.05, we fail to reject the null hypothesis of the tests. As the result, we do not have   Fig. 12: The box-plots and its relative difference for application execution time with serverless-based and SDK-based approach sufficient evidence to say that the average execution time between the two species (with and without reproducibility support) is different for all three applications.

Comparison with SDK-based Reproduction
Besides the serverless-based approach, as shown in TABLE 1, we also implemented an SDK-based automatic execution mode which is achieved by periodical status pulling. In order to explore their difference, we evaluate the m7: reproducibility efficiency of these two approaches with the same applications. Same with the previous measurement setting, we run each experiment 10 times and collect all results in a box-plot as illustrated in Fig. 12. For SDKbased approach, the time window for each status pulling is set to 10 second. The figure shows that serverless-based approach is more efficient than SDK-based approach, and the percentage of overhead reduction for CR, CD and DA, are 25.92%, 28.24% and 29.41%, respectively. The time range of serverless-based approach is larger than SDK-based one especially in GPU-based analytics. The reason is that, in SDK-based approach, the execution status monitoring could be delayed with periodical pulling. With the serverless function and event trigger, serverless-based approach enables big data analytics to be measured more efficiently and with less noise.
We also use T-test to determine whether the execution time using serverless approach and SDK-based approach differs statistically. Hypothesize that the serverless-based approach provides some efficient benefit over SDK-based approach. The p-values of CR, CD and DA, turn out to be 9.31e−15, 6.00e−14 and 2.19e−06. Since these p-values are less than 0.05, we can reject the null hypothesis of the tests. The serverless-based approach is indeed providing statistically significant efficient benefit compared with SDKbased approach.

RELATED WORK
There have been many studies on cloud-based reproducibility. Some of them [34,[39][40][41][42] only study its conceptual frameworks. In this section, we only discuss those having actual systems/toolkits. As shown in TABLE 4, we categorize related work into four groups based on their systems' capabilities. Besides, we also selected two most related works to compare in detail. The comparison is shown in TABLE 5 where the first one also leverages serverless computing and the second is one of the most recent work on cloud based reproducibility.

General Comparison with Related Work
Among the related studies in TABLE 4, nearly all related approaches achieve the software environment provision for reproducibility. However, approaches in group 1 mainly use the archived or containerized software environment, which limits the scope of applicability and lacks support for maintaining hardware configurations within cloud. Additionally, they monitor execution status by system commands or cloud APIs based periodical pulling which is less efficient than event-based execution in our work. For example, ReproZip [32] tracks system commands and zips collected information along with all the used system files together for reproducibility. CARE [33] reproduces a job execution by monitoring and archiving all the material required to reexecute operations. For related work in group 2, their proposed approaches encapsulate the code dependencies and software in virtual machine images or graphs, and enable history retrieval for reproduction. For instance, WSSE [40] proposes to generate digital data and source code snapshots to be reproduced and distributed within a cloud-computing provider. The Tapis [16] open-source API platform was proposed for accomplishing distributed computational experiments in a secure, scalable, and reproducible way. With the implemented pipeline with the Python API, the containerized applications can be submitted, scheduled and executed as tasks using a traditional HPC batch scheduler such as SLURM. AMOS [39] uses a VM containing a set of tools previously installed to implement a mechanism that initializes and configures VMs on demand. However, this reproduction is more like a history repetition, which is designed for verification and validation of history execution. They also provide configurable environment variables for automatic resource deployment in a single cloud, but do not support cross-cloud reproducibility. Instead, our proposed RPAC uses a data abstraction for information needed for reproducibility and transforms resource configurations used in one cloud into those in another cloud.
For related studies in TABLE 4, group 3's capabilities are closest to ours. These approaches rely on annotated information provided by a user to assign workflow, and software/hardware environment. For example, PRECIPE [44] provides APIs to access both AWS and private cloud. However, users need to call the functions in order and have to manually terminate resources after the experiment is done, so it does not support automated end-to-end execution and reproducibility. The whole execution has to wait at the client side before the next function can be called. On the contrary, RPAC serverless event triggering enables fewer communications between client and cloud, which improves the efficiency for cloud analytics. Chef [45] achieves virtual execution environment launching and termination via designed knife commands. Chef client is installed in virtual machines to run the pipeline within the virtual machines. So some internal steps of the application can be executed within the virtual machines via its pipeline. However, Chef does not support full automation since its user has to wait at client side to manually terminate resources after the experiment  [32], CARE [33], DevOps-based [34], Skyport [35], Hyperflow [36], TOSCA [37,38] AMOS [39], WSSE [40], PDIFF [41], ReCAP [42], Tapis [16] OpenWhisk [14,17], NeuroCAAS [43] PRECIPE [44], Chef [45], Apt [46], Semantic Driven [47,48] RPAC (this work) is done. Apt [46] uses user-provided profiles, which consists of a cluster with a control system to instantiate encapsulated experiment environments, for repeating historical research. From this information, they deduce the required execution resources in cloud and then re-provision or configure them through their own APIs. In comparison, we use a serverlessbased pipeline and follow cloud function APIs provided by cloud providers so the execution/reproduction process can be managed by the cloud without communications with toolkit. Also, their fully created annotations, even in crosscloud reproduction, rely heavily on the users instead of execution history. Our work abstracts information required by users from information in execution history, users only need to provide minimal information to reproduce. Our toolkit will transform user-provided information into executable pipeline. For automated execution and reproducibility, none of these approaches can achieve full automation including resources and software provisioning, analytics execution and termination. RPAC's event-based automation is the one-command execution that achieves a more efficient cloud computation and reproduction. For cross-cloud reproducibility, we further use the adapter pattern model to achieve the configuration mapping without taking all inputs from the user.

Detailed Comparison with Most Related Work
As shown in  [14] is an open-source, distributed Serverless cloud platform. In their serverless design, functions are explicitly defined in terms of the event, trigger, and action, which are implemented by users. Events are generated from event sources, which often indicate changes in data or carry data themselves. The trigger is defined by specifying its name and parameters (key-value pairs). It is associated with an action. The action is defined as functions (code snippets), which encapsulate application logic to be executed in response to events. Before deployment, users need to initiate the cluster in the cloud and provide the hostname and port of the Kubernetes cluster to the toolkit. No resource termination option when deployment finishes. Openwhisk has three deployment options. 1) OpenWhisk can be deployed using Helm charts on any Kubernetes provisioned from a public cloud provider.
2) The deployment can be achieved by OpenWhisk REST API or OpenWhisk CLI. 3) Use the clouddefined CLI on a cloud provider that already provisions Apache OpenWhisk as a service, which is only supported by IBM cloud as of now. For parallel execution, Openwhisk does not provide direct parallel framework support. To enable scalable execution, users need to initiate a cloud cluster with the parallel software environment and prepare docker images with a parallel framework. Then users need to implement the parallel logic in the pipeline's action. OpenWhisk enables the deployment on different clouds with Helm charts on any Kubernetes. However, an application for one cloud cannot be redeployed in another cloud, unless users 1) initiate instances on another cloud with the Kubernetes cluster, 2) rewrite the events and triggers in the pipeline, and 3) provide the new hostname and port of Kubernetes cluster to the toolkit and redeploy the pipeline. Another example is NeuroCAAS [43]. NeuroCAAS provides formatted pipelines, called blueprints, in a public code repository and defines a resource bank that can make hardware available through pre-specified instances in one specific cloud. The users are able to update the blueprint with new configurations and upload its new version to the public repository for deployment and reproduction. The users need to provide the blueprint's repository address for automated deployment, execution and reproduction. By default, NeuroCAAS fixes a single instance type per analysis in order to facilitate reproducibility. With the blueprint, datasets, and configuration files for one analysis, Neuro-CAAS achieves reproducibility for corresponding analyses with the same environment and configuration. For parallel execution, NeuroCAAS does not provide direct parallel framework support. The logic of parallel processing must be explicitly scripted and implemented in the blueprint by users.

CONCLUSIONS
Reproducibility is an important way to gain the confidence of new research contributions. In this paper, we study how to achieve cloud-based reproducibility for big data analytics. By leveraging serverless, containerization and adapter design pattern techniques, our proposed approach and RPAC toolkit can achieve reproducibility, portability and scalability for big data analytics. Our experiments show our toolkit can achieve good scalability and low overhead for reproducibility support for both AWS and Azure. For future work, we will mainly focus on the following three aspects. First, we will optimize the executions in terms of time, cost or ratio by mining execution history, and further optimize the overhead of reproducibility via better data abstraction, modeling and storage. Second, we will extend our work to easily publish data analytics as public records following the Research Object framework [18] so they can be referred via DOI identifiers later. Third, we will study how to utilize execution history data to achieve automated execution optimization based on users' objectives (time, cost or ratio) and datasets. Xin Wang is working toward her PhD degree with the Big Data Analytics Lab in the Department of Information Systems, University of Maryland, Baltimore County. Her research interests include distributed computing (systems), blockchains, big data analytics, federated learning, cloud computing and reproducibility.

Pei Guo is working as a Data Scientist at Wyze
Labs. She received her PhD in Information Systems from the University of Maryland, Baltimore County in 2021. Her PhD researches focused on spatiotemporal causal modeling on large-scale data, big data application parallelizing and cloud computing. Her contribution to the paper was done during her PhD study at UMBC. Xingyan Li is a PhD student working with the Big Data Analytics Lab in the Department of Information Systems, University of Maryland, Baltimore County. Her research interests include data science, machine learning and deep learning.