Implementation of Distributed Cloud System Architecture Using Advanced Container Orchestration, Cloud Storage, and Centralized Database for a Web-Based Platform
Total Page:16
File Type:pdf, Size:1020Kb
Implementation of distributed cloud system architecture using advanced container orchestration, cloud storage, and centralized database for a web-based platform A thesis submitted to the Graduate School of the University of Cincinnati in partial fulfillment of the requirements for the degree of Master of Science In the Department of Electrical Engineering and Computer Science Of the College of Engineering and Applied Science By Sohan Karkera Bachelor of Technology, University of Mumbai June 2018 Thesis Advisor and Committee Chair: Arthur J. Helmicki, Ph.D. Committee Members: Victor J. Hunt, Ph.D. and Nan Niu, Ph.D. University of Cincinnati, December 2020 Abstract In the case of a distributed system based architecture, the cost to maintain an application might be higher, as the components of the system are distributed across various physical locations. Also, there is repeatedly an issue of latency between components that comes into effect. To resolve this issue cloud computing has played a significant role. Due to rapid technological advances being made, it has become more economical and easier to manage these components by substituting them with the various options available with cloud computing vendors which offer lower latency and dashboards for easy maintenance. Moreover, with the emergence of container- based and orchestration-based technologies, it has become possible to easily manage and deploy these applications by packaging them inside containers. This research focuses on using these advanced cloud computing, container and orchestration-based technologies to improve the scalability of an existing web appli- cation from a single-server-based architecture to a multi-server-based architecture. The application being considered in this research work is the Common Operating Platform (COP). For this, technologies like Docker and Docker Swarm have been used for containerization and orchestration and Azure File storage has been used for the storage needs of the application. The database storage needs of the application have been fulfilled by the Oracle database. Apart from these, to improve and add some features to the application, we are using Python for scripting. Initially, the current architecture of the COP and its shortcomings are discussed. Then the solutions to those shortcomings are discussed via the proposed architecture. Under the implementation section, the multi-server architecture of the application is discussed initially. After that, the usage of centralized storage is discussed in detail. Ultimately, the other enhancements made to the existing architecture are discussed. After the implementation section, the final results can be observed in the results section. The idea over here is to tweak and improve the existing application archi- tecture to make it easy for scaling and managing by packaging the entire application code inside containers and make it a highly available and automated system. i Acknowledgements I would like to take this opportunity to thank my professors, Dr. Arthur Helmicki and Dr. Victor Hunt, for their guidance and encouragement throughout this re- search project. I would also like to thank Dr. Nan Niu for taking time out of his busy schedule to serve on my thesis committee. A special thanks to the Ohio De- partment of Transportation (ODOT) for funding and providing necessary resources for the project. I would like to thank Mr. Niranjan Krishnan, Ms. Nikita Saraf, and Mr. Pranav Khekare for their help. I would like to acknowledge Mr. Aswin Subramanian, Ms. Sana Rajani, and Ms. Purva Gaikwad for helping the research by testing the application. Finally, I would like to thank my parents for supporting and encouraging me throughout this research. ii Contents 1 Introduction 1 1.1 Common Operating Platform . .1 1.2 Problem Statement . .2 1.3 Motivation . .3 1.4 Existing System . .4 1.5 Proposed Approach . .5 2 Basic Concepts and Definitions 7 2.1 Container and Container Orchestration . .7 2.1.1 Docker[3] . .8 2.1.2 Docker Swarm[5] . .9 2.2 3D Modeling . 10 2.2.1 Pix4DEngine Server[13] . 10 2.2.2 OpenDroneMap[14] . 10 2.2.3 Point Clouds . 11 2.3 Microsoft Azure[22] . 11 2.3.1 Azure File Share[7] . 12 2.4 Web-server . 12 2.4.1 Nginx[24] . 13 2.5 Web Framework . 13 2.5.1 Django[27] . 14 2.6 Database . 15 iii CONTENTS 2.6.1 Oracle Database[8] . 15 2.7 Jenkins[11] . 15 3 System Design and Architecture 17 3.1 Existing System Architecture . 17 3.2 Proposed System Architecture . 21 4 Implementation of Proposed System 25 4.1 Multi-server Architecture . 25 4.1.1 Dockerization of Backend Module . 26 4.1.2 Centralized Storage . 31 4.1.3 Docker Compose file creation . 34 4.1.4 Automation of code by removing hard-coded values . 38 4.1.5 Oracle Database Connectivity . 41 4.2 Other enhancements . 42 4.2.1 Upload Issues . 42 4.2.2 Delete Automation . 43 4.2.3 Logging Server Metrics . 48 5 Installation of Proposed System 49 5.1 System Requirements . 49 5.1.1 Hardware . 49 5.1.2 Software . 50 5.1.3 Docker images . 50 5.2 Software Configurations . 51 5.2.1 Building Docker images for website, backend and Pix4D modules 51 5.2.2 Azure File Share . 52 5.2.3 Oracle Database . 52 5.2.4 Jenkins . 53 5.2.5 Manual Installation . 55 iv CONTENTS 6 Results 57 6.1 Multi Server Architecture . 57 6.2 Upload Limit . 59 6.3 Delete Automation . 60 6.4 Server Metric Logging . 60 7 Conclusion 62 7.1 Future Scope . 62 References 65 v List of Figures 1.1 Common Operating Platform[2] . .2 2.1 Docker Architecture[15] . .8 2.2 Virtual Machine Architecture[15] . .8 2.3 Docker Swarm Architecture[18] . .9 2.4 Point cloud based 3D Model . 11 2.5 Web Server Architecture[23] . 13 2.6 Django Model-Template-View (MTV) Architecture[29] . 14 3.1 Existing System Architecture[2] . 18 3.2 Proposed System Architecture . 22 4.1 Delete Automation Workflow . 43 6.1 Common Operating Platform (Proposed system) . 58 6.2 Processed Model (Proposed System) . 59 6.3 Snippet of delete automation workflow output on website container . 60 6.4 Snippet of delete automation workflow output on backend container . 60 6.5 RAM comparison . 61 6.6 CPU comparison . 61 6.7 Snipet of server metric logging workflow output . 61 vi List of Tables 6.1 Performance analysis of the uploads workflow . 59 vii Listings 4.1 Backend base Docker image . 26 4.2 Complete Backend Docker image . 27 4.3 Build Backend base image . 31 4.4 Build complete Backend image . 31 4.5 Cloudstor plugin install command . 32 4.6 Docker volume build command using Cloudstor plugin . 33 4.7 Running test container using Cloudstor based volume . 33 4.8 Bash script for copying files . 33 4.9 Subprocess function call . 34 4.10 Docker-compose file for COP . 34 4.11 Deploy Docker container stack for COP . 38 4.12 Initial snippet of settings,py(Website) . 38 4.13 Updated snippet of settings.py(Website) . 38 4.14 Initial snippet of settings.py(Backend) . 39 4.15 Updated snippet of pix4d.py . 39 4.16 Updated snippet of entwine.py . 40 4.17 Updated snippet of greyhound.py . 40 4.18 Updated database engine on dettings.py(Website) . 41 4.19 Updated client max body size variable snippet . 42 4.20 Updated keepalive, proxy read and proxy send timeout variables snip- pet..................................... 42 4.21 Supervisor configuration file . 44 viii LISTINGS 4.22 Snippet of delete.sh . 45 4.23 Snippet of file-del.py(Website) . 45 4.24 Snippet of file-del.py(Backend) . 46 4.25 Supervisor configuration file . 48 4.26 Code snippet of metric.sh . 48 5.1 Command to clone code repository . 51 5.2 Command to change directory . 51 5.3 Docker build command to create base images for website and backend containers . 51 5.4 Docker build command to create complete images for website and backend containers . 52 5.5 Docker build command to create Pix4D image . 52 5.6 Jenkins configuration script 1 . 54 5.7 Jenkins configuration script 2 . 54 5.8 Code snippet of start.sh script . 55 5.9 Code snippet of start.sh script . 56 6.1 Code snippet to view Docker stacks . 57 6.2 Code snippet to view Docker services . 57 6.3 Code snippet to view Docker containers . 58 ix Chapter 1 Introduction Distributed system architecture is a type of computing architecture where the com- ponents of the architecture are physically located at different locations but to the end-user, they act as a single coherent system. Distributed cloud system architec- ture is using cloud-based technologies that are at different physical locations but communicate with each other to act as a single system.[1] This chapter discusses the Common Operating Platform[2], the problem statement and motivation for the research, and the basic concepts and definitions discussed throughout the work. 1.1 Common Operating Platform The Common Operating Platform (COP)[2] is a web-based platform that allows the generation and visualization of 3D models. It also allows users to.