Rapport Pfe Sesame ENG
Rapport Pfe Sesame ENG
COMPUTER ENGINEERING
Elaborated by
Bassem GHARSELLAOUI
Host Company
LEANIOS
Internship Supervisor
Mr. Amine BELKHIRIA
SESAME Supervisor
Ms. Lobna KRIAA
i
Contents
List of Figures .................................................................................................................................... iv
List of Tables ..................................................................................................................................... vi
Glossary of Acronyms ......................................................................................................................vii
General Introduction ......................................................................................................................... 1
CHAPTER 1 GENERAL CONTEXT OF THE PROJECT .......................................................... 3
1.1 | Introduction .............................................................................................................................. 3
1.2 | Presentation of the host organization ....................................................................................... 3
1.2.1 Overview............................................................................................................................ 3
1.2.2 Product Overview .............................................................................................................. 4
1.2.3 Organizational chart of LEANIOS .................................................................................... 7
1.3 | Presentation of the project ........................................................................................................ 8
1.3.1 Existent system Study ........................................................................................................ 9
1.3.2 Existing limits .................................................................................................................. 10
1.3.3 Proposed Solution: ........................................................................................................... 11
1.4 | Methodology of work ............................................................................................................. 15
1.4.1 Agile ................................................................................................................................ 15
1.4.2 The Y-shaped life cycle model ........................................................................................ 15
1.4.3 Work adaptation according to the Y model ..................................................................... 17
1.4.4 Project Breakdown........................................................................................................... 18
1.4.5 Formalism ........................................................................................................................ 18
1.5 | Conclusion .............................................................................................................................. 19
CHAPTER 2 PRELIMINARY STUDY ........................................................................................ 20
2.1 | Introduction ............................................................................................................................ 20
2.2 | Single-Tenant approach .......................................................................................................... 20
2.3 | Multi-Tenant approach ........................................................................................................... 21
2.3.1 Multi-Tenancy in Software Architecture ......................................................................... 21
2.3.2 Multi-Tenancy in Cloud Computing Services ................................................................. 21
2.3.3 Multi-Tenant SaaS Architecture Types ........................................................................... 22
2.3.4 Tenant Resolver ............................................................................................................... 23
2.4 | DevOps Concept ..................................................................................................................... 24
2.4.1 Key Elements of DevOps ................................................................................................ 24
2.4.2 Continuous Integration/Continuous Deployment ............................................................ 25
2.5 | The « Cloud Computing » Approach ..................................................................................... 27
2.5.1 Cloud services .................................................................................................................. 27
2.5.2 Cloud Deployment Models .............................................................................................. 29
2.6 | Containerization approach ...................................................................................................... 31
2.7 | Conclusion .............................................................................................................................. 32
CHAPTER 3 TECHNOLOGIES ................................................................................................... 33
3.1 | Introduction ............................................................................................................................ 33
i
3.2 | Ruby On Rails ........................................................................................................................ 33
3.3 | PostgreSQL............................................................................................................................. 33
3.4 | RuboCop ................................................................................................................................. 35
3.5 | Git ........................................................................................................................................... 35
3.6 | Docker .................................................................................................................................... 36
3.7 | Kubernetes .............................................................................................................................. 36
3.8 | GitHub Actions ....................................................................................................................... 37
3.9 | Helm Chart ............................................................................................................................. 38
3.10 | Visual Studio Code ............................................................................................................... 38
3.11 | Visual Paradigm ................................................................................................................... 38
3.12 | Conclusion ............................................................................................................................ 39
CHAPTER 4 SPECIFICATION AND DESIGN .......................................................................... 40
4.1 | Introduction ............................................................................................................................ 40
4.2 | Specification ........................................................................................................................... 40
4.2.1 Analysis of functional and non-functional requirements................................................. 40
4.2.2 Functional Requirements ................................................................................................. 40
4.2.2.1 Hybrid multi-tenancy solution (POC) ............................................................................ 40
4.2.2.2 Deployments Management App (Leanios-org-ops) ....................................................... 41
4.2.3 Technical Requirements .................................................................................................. 41
4.2.4 Identification of Actors .................................................................................................... 42
4.2.5 Use cases diagrams .......................................................................................................... 43
4.2.5.1 POC (Hybrid multi-tenancy Solution) general use cases: .............................................. 43
4.2.5.2 POC Detailed use cases: ................................................................................................. 44
4.2.5.3 LEANIOS-org-ops general use cases ............................................................................. 45
4.2.5.4 LEANIOS-org-ops (Deployments management) Detailed use cases: ............................ 46
4.2.5.5 DevOps pipeline use cases.............................................................................................. 47
4.3 | Design ..................................................................................................................................... 48
4.3.1 Physical Architecture ....................................................................................................... 48
4.3.1.1 Hybrid multi-tenant system architecture ........................................................................ 49
4.3.1.2 CI pipeline architecture for Leanios deployments management App: ........................... 50
4.3.2 Software architecture ....................................................................................................... 51
4.3.2.1 GitHub software Architecture......................................................................................... 51
4.3.2.2 Kubernetes Software Architecture .................................................................................. 52
4.3.2.3 Helm Chart Architecture................................................................................................. 54
4.3.2.4 CI Pipeline Architecture of Leanios deployments management App ............................ 56
4.3.3 Detailed Architecture ....................................................................................................... 56
4.3.3.1 POC (Hybrid multi-tenancy Solution) Class diagram: ................................................... 57
4.3.3.2 Sequence Diagram of the use case << Create Company (Tenant) >> ............................ 57
4.3.3.3 Sequence Diagram of the use case << access to the app with subdomain >> ................ 59
4.3.3.4 Sequence Diagram of the use case << Execute migrations across databases >> ........... 59
4.3.3.5 LEANIOS-org-ops (Deployments management) Class Diagram: ................................. 61
4.3.3.6 Sequence Diagrams of the use case << Create New Company >> Leanios-org-ops: .... 62
ii
4.3.3.7 Sequence Diagrams of the use case << Edit server >> Leanios-org-ops: ...................... 64
4.3.3.8 Sequence Diagram of the use case << Delete database >> Leanios-org-ops: ................ 65
4.3.3.9 LEANIOS-org-ops Deployment Diagram: ..................................................................... 66
4.3.3.10 CI Activity Diagram ..................................................................................................... 66
4.4 | Conclusion .............................................................................................................................. 68
CHAPTER 5 REALISATION ........................................................................................................ 69
5.1 | Introduction ............................................................................................................................ 69
5.2 | Implementation of POC (Hybrid Multi-Tenancy) .................................................................. 69
5.3 | Leanios-org-ops ...................................................................................................................... 73
5.4 | CI Pipeline: ............................................................................................................................. 78
5.5 | Minikube dashboard: ............................................................................................................. 82
5.6 | Conclusion .............................................................................................................................. 82
General Conclusion .......................................................................................................................... 83
Netography/Bibliography ................................................................................................................ 84
iii
List of Figures
iv
Figure 4-13 Sequence diagram <<create company(tenant)>> ........................................................................ 58
Figure 4-14 Sequence diagram <<access to the app with subdomain>> ........................................................ 59
Figure 4-15 Sequence Diagram of the use case << Execute migrations across databases >> ........................ 60
Figure 4-17 LEANIOS-org-ops Class diagram ................................................................................................... 61
Figure 4-18 Sequence Diagram << Create New Company >> ......................................................................... 63
Figure 4-19 Sequence Diagram << Edit server>>............................................................................................. 64
Figure 4-20 Sequence Diagram of the use case << Delete database >>........................................................ 65
Figure 4-21 Deployment diagram of Leanios-org-ops ..................................................................................... 66
Figure 4-22 CI Activity diagram........................................................................................................................ 67
Figure 5-1 add new company interface ........................................................................................................... 69
Figure 5-2 Companies List interface POC ........................................................................................................ 70
Figure 5-3 show company interface ................................................................................................................ 70
Figure 5-4 middleware file............................................................................................................................... 71
Figure 5-5 Custom migration file ..................................................................................................................... 72
Figure 5-6 Login Interface ................................................................................................................................ 74
Figure 5-7 Servers list interface ....................................................................................................................... 75
Figure 5-8 Edit server interface ....................................................................................................................... 75
Figure 5-9 Add database interface .................................................................................................................. 76
Figure 5-10 Edit database interface ................................................................................................................ 76
Figure 5-11 Company List interface ................................................................................................................. 77
Figure 5-12 Add company Interface ................................................................................................................ 77
Figure 5-13 Edit company interface ................................................................................................................ 78
Figure 5-14 Ci-development file ...................................................................................................................... 79
Figure 5-15 CI workflow on GitHub ................................................................................................................. 81
Figure 5-16 Helm chart repository structure................................................................................................... 81
Figure 5-17 Minikube Dashboard .................................................................................................................... 82
v
List of Tables
vi
Glossary of Acronyms
IaaS : Infrastructure-As-A-Service
PaaS: Platform-As-A-Service
SaaS: Software-As-A-Service
vii
General Introduction
The influence of cloud computing and Software-as-a-Service (SaaS) in the enterprise software
domain has been steadily growing. SaaS is known for its ability to share computing resources and
offer software to various customers. To make the most of this capability, SaaS products need an
architecture that can handle the sharing of software instances and databases. This is where the
concept of multi-tenancy comes into play.
In the world of software architecture, multi-tenancy refers to the idea of serving multiple client
organizations through a single instance of a software product. Imagine one copy of the software
residing on the vendor's infrastructure, and multiple customers accessing and using that same
instance. What's interesting about multi-tenancy is that it allows for tailoring the software to meet
the specific needs of different customers. This contrasts with the traditional multi-user model,
where everyone gets the same standard offering. It’s a key factor for software vendors to increase
their profits by benefiting from economies of scale. In simple terms, it's a way for companies to
efficiently serve many customers, leading to higher profit margins.
Furthermore, multi-tenancy is not confined to specific resources, but is applicable at different levels
in a system's architecture, for example on a database or instance level. As a result, various
approaches to a multi-tenant architecture are possible.
Today, moving towards a culture of multi-tenancy and DevOps is at the core of LEANIOS strategies,
a culture well-applied on its cloud platform. It is within this framework that our End-of-Studies
Project takes place. Our goal is to enhance the level of multi-tenancy on this platform to achieve
1
exceptional scalability at the database level. Additionally, we aim to address the needs of certain
clients who require their own instance of this cloud platform, essentially extending LEANIOS solution
to support both multi-tenancy and single-tenancy concepts within this context. To accomplish this,
we will develop an application for managing the deployment of LEANIOS SaaS on the client’s servers.
Starting with Chapter 1, our report initiates with an exploration of LEANIOS, introducing the
company background, addressing prevalent issues, and outlining key project objectives. Chapter 2
seamlessly transitions to the preliminary study, where we define the various approaches employed
in our project. Moving forward to Chapter 3, we delve into the Specification and Design phase,
capturing both functional and technical requirements, and outlining the overall architecture and
design of our solution. Chapter 5 further expounds on the technologies and tools used. Then,
Chapter 6 shifts focus to the practical implementation of the project and finally, we conclude with
a general conclusion.
2
Chapter 1 General Context of the Project
1.1 | Introduction
In this opening chapter, we will commence by conducting an initial analysis of our project. To get
started, we'll introduce the host organization for our graduation project—LEANIOS. highlighting the
areas in which it operates. Next, we will outline the current challenges facing the company, in order
to better understand the objectives of our work. Finally, we will detail the methodology used, the
work planning process as well as the formalism adopted to carry out our project.
LEANIOS [1] is a Tunisian-German startup that appeared in January 2021, located in Blütenstr
15 c/o Base, 80799, Munich, Germany and within novation city Sousse technology parks. Specialized
in the digitalization of industrial processes such as MES (Manufacturing Executing System), ERP
(Enterprise Resource Planning) based on Lean manufacturing. LEANIOS GmbH has developed a
cloud-based production management platform "LEANIOS" used in manufacturing plants for
production planning, control and monitoring, which promotes:
• Planning:
o Tree nomenclature
o Multi-operations
o Capacities per line or machine
o Creating/Importing Production Orders
3
o Order planning and tracking
o Inventory projection
Organize and dispatch the production orders necessary for the manufacture of the products,
taking into account production constraints.
Production follow-up:
Follow production in near real-time with your PC or smartphone, wherever you are.
4
Figure 1-2 Product Planning interface
5
Figure 1-4 KPIs & Results
• Organize orders
a. Client Management
b. Sales Order Management
c. Kanban board
d. Delivery Times
6
• Control inventory in real time
a. Multi-warehouses
b. Input / Output
c. Delivery Slips
d. Automation and Synchronization with Production
LEANIOS has an intelligent solution that ensures communication between the modules of the
factories containing all the functions and compatible with any type of hardware, whether tablets,
smartphones or PCs.
7
Figure 1-7 LEANIOS Organigram
For LEANIOS, the decision to enhance its multi-tenant solution stems from the need to
accommodate a growing user base. This enhancement will empower LEANIOS to scale efficiently,
providing personalized experiences for users while upholding data security and isolation. Such
evolution aligns with LEANIOS's commitment to meeting customer needs, optimizing resources, and
ensuring operational scalability.
Our project is aimed at addressing this requirement by adapting our architecture to meet the
new demands, advancing from a multi-schema approach to a multi-schema and multi-database
framework. In line with this objective, the project will now progress to the next phase where an
application will be developed to simplify the deployment of the LEANIOS application on dedicated
servers according to client requirements, leveraging CI/CD principles for an efficient and streamlined
process.
8
1.3.1 Existent system Study
Multi-tenant architecture involves serving multiple customers using a single instance of the
software and its supporting infrastructure. In this approach, each customer shares the software
application while maintaining data isolation from other tenants.
The current system employs a multi-tenant approach using PostgreSQL, an open-source relational
database known for its extensibility. It leverages multiple schemas within the shared database,
ensuring data isolation among tenants as shown in the figure 1-9. The application relies on Ruby on
Rails, a web development framework known for its simplicity and convention over configuration,
and facilitates database connections and schema switching facilitated by the 'Apartment'1 gem.
1
THE 'APARTMENT' GEM IS A RUBY ON RAILS LIBRARY THAT PROVIDES DATABASE MULTI-TENANCY SUPPORT, ALLOWING DIFFERENT TENANTS
TO HAVE THEIR OWN SEPARATE SCHEMAS WITHIN A SHARED POSTGRESQL DATABASE.
9
Figure 1-9 One shared database and multi-schema
⎯ Data Security and Compliance [3]: The client may have stringent data security and
compliance requirements, especially in highly regulated industries like manufacturing.
They may prefer to have complete control over their data and infrastructure to meet
industry 4.02 specific compliance standards.
2
"Fourth Industrial Revolution", "4IR", or "Industry 4.0" is a buzzword neologism describing rapid technological
advancement in the 21st century
10
⎯ Geographical Requirements: Multi-tenant apps might not always meet strict
geographical, or data localization requirements that single-tenant installations can
address.
⎯ Data Isolation: While multi-schema databases provide data isolation at a logical level,
they may not offer the same level of security and isolation as separate databases. In
highly sensitive industries, such as defence or healthcare, regulatory requirements may
necessitate strict data separation.
11
dedicated hosting solutions. Ensure the continued operation of the existing multi-tenancy
solution.
✓ Greater Control: Clients benefit from increased control over their data and
infrastructure. They can customize and manage their dedicated servers according to
their specific needs and preferences.
✓ Greater Isolation: Each client's data and application are isolated on their dedicated
server, preventing any interference or resource sharing with other tenants.
✓ Flexibility:
12
o It is easier to perform common maintenance operations on a per-tenant basis.
For example, upgrades to the application may be applied to different tenants
at different times.
✓ Data Backup and Recovery: Clients can implement their backup and disaster recovery
solutions to meet their unique needs.
The solution involves adopting a flexible approach that combines the use of multiple
tenants within a shared database and, when necessary, multiple schemas across separate
databases. In this approach, each tenant may utilize their own dedicated schema within the
shared database in this case Tenant1 and Tenant2, or they can opt for their separate
database instance Tenant N case.
13
This versatile approach offers several key advantages:
Data can be partitioned to achieve scalability goals. For example, one can place
different databases into different disks. It also makes it easier to avoid reaching
database physical limits due to excessive table growth.
Before fully committing to this approach, we recognize the importance of conducting a Proof
of Concept (POC). The POC will serve as a pivotal phase in our project, allowing us to rigorously
investigate the feasibility and practicality of this multi-schema, multi-database approach. During the
POC, we will create a controlled environment where we can evaluate the performance, and
manageability of this solution.
The POC will offer valuable insights and lessons, helping us refine and optimize our approach.
Any necessary adjustments will be integrated into the existing solution. This iterative process
ensures alignment with project requirements and tenant needs, reducing risks and ensuring a
successful implementation of our multi-schema, multi-database solution.
14
1.4 | Methodology of work
The choice of development methodology must consider the scope of the project and the
people involved, the time constraints and the tools available, and the specific features of the
architecture.
1.4.1 Agile
At the beginning of the project, the first thought is to try to anticipate everything, which
is not always possible and can sometimes lead to failure. We can therefore mention two
-Risk management: It is impossible to anticipate all risks as unforeseen events can occur
new possibilities and ideas during a project make it impossible to accurately predict all
tasks and their execution methods. These challenges have compelled IT professionals to
the agile method. Agile is an incremental, iterative, and collaborative approach were
projects are divided into multiple sub-parts. The responsible team gradually carries out
The development process adopted to bring the project to a successful conclusion is the 2TUP
"2 Track Unified Process", which follows a Y-shaped life cycle. The "Unified Process" family provides
a common framework for integrating development best practices. A UP process is iterative and
incremental, architecture-centric, driven by user requirements, risk-driven and component-
oriented. The 2TUP process is in this vein, emphasizing the initial non-correlation of functional and
15
technical aspects. "2 Tracks" literally means that the process follows 2 paths. These are the
"functional" and "technical" paths, corresponding to the two axes of change imposed on the IS. The
two branches of study then merge to design the system, resulting in a Y-shaped development
process. The initial dichotomy enables business knowledge to be capitalized on the left-hand
branch, and technical know-how to be reused on the right-hand branch.
⎯ Analysis, which consists in studying the functional specification in detail, to get an idea
of what the system is going to achieve in business terms. The results of analysis are not
dependent on any technology.
16
⎯ The key steps involved in capturing the technical requirements and generic design of
an IT system. The first step is to identify all the constraints and choices influencing the
design of the system, considering the tools selected and the constraints of integration
with existing systems. These elements generally define the prerequisites of the
technical architecture.
⎯ The second stage is generic design, in which the components required to build the
technical architecture are defined. This design is independent of the functional aspects
of the system and aims to standardize and reuse common mechanisms throughout the
system. The technical architecture thus establishes the fundamental framework of the
IT system, while minimizing technical risks.
⎯ Preliminary design: this delicate stage involves integrating the analysis model into the
technical architecture, to map out the system components to be developed.
⎯ Detailed design: this stage examines in detail how each system component is to be
implemented.
⎯ Coding: at this stage, the components are developed, and the code units are tested as
they are created.
⎯ Acceptance: This involves testing and checking that the system meets the specified
requirements.
17
Figure 1-13 2TUP process
1.4.5 Formalism
For the design of this project, we used UML (Unified Modelling Language) to describe
requirements, conceptualize the system and create software architecture sketches. The relevant
diagrams we used are:
18
• Deployment diagram to visualize interactions between objects over time.
• As well as class and sequence diagrams to describe the application's structure and
behaviour.
1.5 | Conclusion
In this first chapter, we have contextualized the project. We began by introducing the host
organization, followed by a presentation of the project problem and the objectives to be achieved.
Finally, we introduced the Y methodology, 2TUP, that we adopted for the development of our
solution, as well as the UML diagrams used to represent the functionalities to be developed. The
following chapter will be devoted to preliminary research aimed at deepening our understanding of
general concepts and examining existing techniques, in order to gain a better grasp of the project
as a whole.
19
Chapter 2 Preliminary Study
2.1 | Introduction
In this chapter, we delve into fundamental concepts related to our work. We begin by
exploring the concepts of the multi-tenancy and DevOps approach, including virtualization,
containerization, and continuous integration/continuous deployment (CI/CD). Then, we describe
the orchestration and deployment strategies for our application. Finally, we address the design of
our application. This chapter will provide us with a thorough understanding of these key concepts
that are essential for the successful implementation of our project.
With a single-tenant system, each tenant's data is backed up separately, ensuring data
recovery in case of any loss. Tenants also have the flexibility to install available updates at their
convenience, rather than waiting for the service provider to do so. This architecture is often adopted
in cloud computing, especially in private cloud services or third-party cloud offerings. In such cases,
individuals or businesses are the sole customers with access to their specific instance, allowing for
individual security, management, and control, making it a popular choice for those seeking
dedicated and customizable software solutions.
20
Figure 2-1 Single Tenant Architecture [5]
21
tenancy extends from the IaaS layer through the PaaS layer, providing a platform for application
development, and further into the SaaS layer, offering ready-to-use applications with business logic,
workflows, databases, and user interfaces. The figure 2-1 describe how multi-tenancy implemented
across the cloud services.
Database-per-tenant: In this model, each tenant receives a dedicated database. The application
tiers can scale either vertically (augmenting resources per node) or horizontally (increasing node
quantity). Nevertheless, databases within the same resource groups can be partitioned into flexible
pools. Vendors have the ability to shift tenant databases among these pools to streamline resource
management as shown in Figure 2-2.
22
Figure 2-3 Database-Per-Tenant
Database-Tables-Per-Tenant / Private Schema: In this approach we isolate tenant data from that
of others, but we consolidate database infrastructure for tenants.
• Manual Selection After Authentication: In this method. The application would then be
available to all tenants through the same URL, such as http://saas.example.org. SO, until the
user is authenticated, the application is generic. Only after authentication is a tenant
resolved and a tenant-specific user interface can be made available.
23
• Automatic Selection by Subdomain: This is the most user-friendly option, which is adopted
also in LEANIOS platform but it's more advanced. Users just open the application in their
browser, log in, and the system takes care of the organization selection in the background
without them noticing the authentication process. For example:
http://tenant1.example.org
http://tenant2.example.org
Segment the application by a tenant-specific sub-directory. We have the same domain for all
tenants, with a tenant-specific sub-directory. A variant is when tenant ID is passed as a query
parameter. For example
https://example.org/tenant1
https://example.org/tenant2
24
✓ CD (Continuous Delivery): This is the ability to deliver code changes quickly and in an
automated manner, ensuring efficient software deployment.
25
the automation of development stages. The core concepts of the CI/CD approach include
continuous integration, continuous delivery, and continuous deployment.
Developers practicing continuous integration regularly merge their changes into the main branch.
These modifications are validated by creating a version and running automated tests. This approach
prevents integration issues that occur when changes are merged only during the release.
Continuous integration places emphasis on test automation to ensure that the application remains
unaffected with each new commit integrated into the main branch.
Continuous delivery extends continuous integration by enabling the swift and dependable
release of new changes to clients. It automates the release process, making it possible to deploy an
application with a single click at any time. In practice, quick releases are preferred for easy issue
resolution.
Continuous deployment takes it a step further by automatically transmitting each change that
passes all stages of the production pipeline to clients without human intervention. Only failed tests
block deployment, which speeds up client feedback and eases the development team's burden.
26
service. This approach is especially valuable in complex IT environments with numerous containers
and Linux hosts.
Orchestration combines automation tasks and their configurations across various machine
and system groups, streamlining the management of the mobile components of the IT environment.
Here is a general orchestration architecture diagram.
27
Infrastructure as a Service (IaaS): This service provides the IT infrastructure, which includes resource
virtualization such as servers, storage, and networks. Users can remotely manage and control these
resources without the need to worry about purchasing, configuring, or physically maintaining
hardware.
Platform as a Service (PaaS): This service provides a development and execution platform for
applications. Developers can create, test, and deploy applications without having to worry about
managing the underlying infrastructure. PaaS platforms offer tools, libraries, and frameworks to
facilitate application development and integration.
Software as a Service (SaaS): This service offers ready-to-use software applications accessible
through the cloud. Users can easily access these applications through a web browser without the
need to install or manage software locally. Software updates and maintenance are handled by the
service provider.
28
2.5.2 Cloud Deployment Models
To define various cloud computing service models, it's important to address two key
questions:
— Who is responsible for cloud management? A company can choose to handle the
management of the entire cloud with its own resources, or it may prefer to delegate this
management to an external partner.
— Who are the clients of the services provided by the cloud? The company can be the sole
user of the cloud services, or these services can be accessible and open to third parties such as
partners, customers, subsidiaries, etc.
The answers to these two questions will facilitate the understanding of the four deployment
models defined by the NIST standard and represented in the following figure:
— Public Cloud: Managed externally, for public use. The cloud infrastructure is accessible to
the public and located at the cloud provider's premises. It can be owned, managed, or operated by
a commercial, academic, or government organization. This model offers the highest level of
resource sharing for its customers, making it the most economically attractive option. However, it
comes with security and potential data confidentiality concerns as trade-offs.
29
— Private Cloud: Managed internally, for private use. The cloud infrastructure is exclusively
for the use of a single organization but may potentially serve multiple consumers, such as various
operational units. It can be managed, owned, or operated by the organization itself (internal private
cloud) or by a third party (external private cloud). The infrastructure can be either on-site or off-
site. A private cloud allows for the optimization of internal resources utilization and the
sustainability of the infrastructure. However, the internal cloud solution is heavily debated, as it may
not provide significant added value compared to traditional infrastructures.
— Community Cloud: Managed internally, for public use. The cloud infrastructure is for the
exclusive use of a community that includes multiple consumers from different organizations with
common interests (e.g., security, compliance requirements, etc.). Like a Private Cloud, the
infrastructure can be managed, owned, or operated by one or more of these organizations or by a
third party and can be on-site or off-site.
— Hybrid Cloud: Managed externally, for private use. The cloud infrastructure consists of two
or more clouds (private, community, or public), which remain distinct entities but are connected by
standardized or proprietary technology, enabling data or application portability (technically known
as "load balancing" for load distribution). This cloud model is the most commonly used by
businesses. The relationship with the provider is essential and ensures data security and service
quality.
Software as a Service (SaaS) is the delivery and management of software applications via the
cloud, rather than through.
manual installation and configuration. With SaaS, applications are hosted and maintained by
external providers, eliminating the need for in-house management and infrastructure setup.
By encapsulating software and making it available through the cloud, users can access
applications from any location with internet connectivity. Software updates and maintenance are
handled by the service provider, ensuring a seamless user experience.
In practical terms, SaaS provides various software applications through subscription models,
allowing businesses to leverage a wide range of applications. This model greatly enhances efficiency
and can reduce the total cost of ownership for software applications, making it an attractive choice
for many organizations.
30
The key advantage of SaaS is that it enables businesses to focus on their core activities, rather
than dealing with software deployment and maintenance.
Software as a Service (SaaS) plays a crucial role in the multi-tenancy approach by enabling
multiple tenants or users to share and access the same software application from a centralized cloud
infrastructure. This approach optimizes resource utilization, cost-efficiency, and scalability, as the
software is designed to serve various tenants simultaneously. SaaS applications are architected to
provide secure, isolated environments for each tenant, ensuring data privacy and customization
while benefiting from economies of scale. By pooling resources and maintaining a single codebase,
SaaS providers can efficiently update and enhance the application, delivering consistent and
feature-rich services to multiple tenants, making it a highly efficient solution for businesses seeking
cost-effective and scalable software access.
31
minimizes resource wastage because each container only contains the application and its associated
binary files or libraries. Consequently, the same host operating system (OS) can be used for multiple
containers. Containerization simplifies the mobility of virtual applications between identical
operating systems and requires fewer storage, RAM, CPU resources, etc. The following figure
provides a comparative diagram between a virtual machine and a container.
2.7 | Conclusion
In this chapter, we've introduced the fundamental concepts of our project, such as multi-
tenancy and DevOps. We've highlighted the importance of multi-tenancy architecture for SaaS
platforms, discussed their key features, and explained the differences between multi-tenancy and
single-tenancy approaches. We've also covered continuous integration, continuous delivery, and
continuous deployment. Finally, we've defined the concepts of containerization and orchestration.
Now, we're moving on to the first practical step of our project, which involves analysing and
specifying both the functional and non-functional requirements and the design.
32
Chapter 3 Technologies
3.1 | Introduction
After finishing the preliminary study, the next step involves selecting the tools necessary to
implement the approaches outlined in the study.
Ruby on Rails, particularly with the "Apartment" gem, simplifies multi-tenancy by effortlessly
managing separate schemas within a single database or even across multiple databases on distinct
servers. This streamlined approach enhances scalability and maintenance, making it an ideal choice
for efficient and organized multi-tenant architectures.
3.3 | PostgreSQL
PostgreSQL, also known as Postgres, is a free and open-source relational database
management system emphasizing extensibility and SQL compliance. It was originally named
POSTGRES, referring to its origins as a successor to the Ingres database developed at the University
of California, Berkeley [10].
Ruby on Rails, paired with PostgreSQL, excels in crafting robust multi-tenancy solutions.
PostgreSQL's native support for schemas aligns seamlessly with Rails, facilitating efficient isolation
of tenants within a single database. This combo ensures simplicity in development, robust security,
and streamlined scalability, making it an ideal choice for building agile and effective multi-tenant
applications.
Here is a summarized table outlining the key distinctions between a Postgres schema and a
database:
33
Postgres Schema Postgres Database
A container for a set of tables and other A collection of schemas and other related data
database objects structures
Provides a way to organize and group related Provides a way to manage and access all the
tables schemas and other data structures within the
database
Allows for multiple schemas to exist within a The highest level of organization in a Postgres
single database, each with its own set of tables database, containing all the schemas, tables,
and other objects and other objects
Can be used to group tables by functional area Can be used to separate different applications
or department or projects within an organization
Tables in different schemas can have the same Schemas within a database cannot have the
name without causing naming conflicts same name
Can be used to set different access permissions Can be used to set different access permissions
for different groups of tables for different users or roles
It’s important to note that a schema is a logical container within a database, it is used to
organize tables and other objects as shown in the next figure3-1, and provide a way to separate
different functional areas, while a database is a physical container that provides a way to manage
and access all the schemas and other data structures within the database.
34
Figure 3-1 Tenants schema within a PostgreSQL database [11]
3.4 | RuboCop
Robocop is a Ruby code style checker (linter) and formatter based on the community-driven.
Robocop is extremely flexible and most aspects of its behaviour can be tweaked via various
configuration options. In practice Robocop supports pretty much every (reasonably popular) coding
style. Apart from reporting problems in the code, RuboCop can also automatically fix some of the
problems automatically [12].
3.5 | Git
Git is a free and open-source tool for tracking changes in software code. It was created by
Linus Torvalds in 2005. Unlike older systems like SVN and CVS, Git is distributed, meaning each
developer has a complete history of their code on their local machine. While the initial copy of the
code might take a bit longer to download, operations like commit, blame, diff, merge, and logs are
much quicker.
Git is great for handling branches, merges, and rewriting the history of a code repository. This
flexibility has led to creative workflows and tools. Pull requests, a popular tool, help teams
collaborate on different branches and review code efficiently. Git is the most widely used version
control system globally and is considered the modern standard for software development [13].
35
3.6 | Docker
Docker [14] is a free containerization platform that lets you bundle your application and all its
needs into a standardized package known as a container. Containers are lightweight, making them
easy to move around, and they're separated from both the underlying infrastructure and other
containers. You can run a Docker image as a Docker container on any machine with Docker installed,
regardless of the operating system.
Efficiency: Efficient use of system resources, as containers share the same OS kernel.
3.7 | Kubernetes
Since in our project we will run our Leanios deployment on Kubernetes cluster, it is important
that we choose the right technology to support our efforts. In this case, the most
36
•High performance: Service discovery and load balancing in Kubernetes enable the automatic
exposure of applications to external users using DNS names and the distribution of traffic
across multiple containers.
GitHub Actions [16] is a continuous integration and continuous delivery (CI/CD) platform
that allows us to automate the build, test, and deployment pipeline. We can create workflows
that build and test every pull request to our repository, or deploy merged pull requests to
production.
GitHub provides Linux, Windows, and macOS virtual machines to run the workflows, or we
can host our own self-hosted runners in a data center or cloud infrastructure.
We can configure a GitHub Actions workflow to be triggered when an event occurs in our
repository, such as a pull request being opened or an issue being created. Our workflow
contains one or more jobs that can run in sequential order or in parallel. Each job will run
inside its own virtual machine runner or inside a container and has one or more steps that
either run a script that we define or run an action, which is a reusable extension that can
simplify our workflow.
37
each handling specific tasks. For instance, one can build and test pull requests, another can deploy
the application with each release, and yet another can label new issues.
A Helm chart [17] is a package format used in Kubernetes for defining, installing, and
upgrading even the most complex Kubernetes applications. It contains pre-configured Kubernetes
resources, such as deployments, services, and ingress rules, packaged together. Helm charts simplify
the deployment process by allowing users to define, version, and manage Kubernetes applications
as a single, deployable unit. Helm, the package manager for Kubernetes, helps streamline
application management, making it easier to share, reuse, and maintain Kubernetes configurations
across different environments.
macOS, and Linux. It comes with built-in support for Ruby on Rails.
and a wide range of features. It supports real-time collaborative editing, allowing multiple
38
users to work on diagrams simultaneously [18].
3.12 | Conclusion
As we conclude our exploration of technologies, each tool introduced plays a vital role in our
system's robust architecture. From the server-side web application framework, Ruby on Rails, to the
advanced container orchestration platform, Kubernetes, and the CI/CD automation with GitHub
Actions, these technologies collectively empower our project's development and deployment,
ensuring efficiency, scalability, and reliability.
39
Chapter 4 Specification and Design
4.1 | Introduction
In this chapter, we will delve into two main sections. We will commence with the specification,
which encapsulates the analysis of needs. Following that, we will explore the design, encompassing
both the general architecture and the detailed architecture.
4.2 | Specification
Within this chapter, we introduce the diverse stakeholders involved in the project and define
their roles and responsibilities. We establish both the functional and technical requirements
essential for the subsequent design and development of the system. The analysis encompasses
functional needs for the Proof of Concept (POC) of a hybrid multi-tenancy solution and a solution
managing LEANIOS Cloud Platform deployment.
We're looking at functional requirements here, which are crucial to meet the functionality
criteria of the solution. Through our investigation, we've pinpointed specific needs. It's worth
mentioning that we'll be dividing these functional requirements into two sections: the first set for
the Proof of Concept (POC) of the hybrid multi-tenancy solution, and the second set for the solution
tasked with managing the deployment of the LEANIOS Cloud Platform on dedicated servers.
• Companies (Tenant) creation, edit and delete in the chosen database by the administrator.
40
4.2.2.2 Deployments Management App (Leanios-org-ops)
• Authentication.
• Servers Management.
• Companies Management.
• Databases Management.
- Deploying application from a generic Helm chart according to the desired specifications.
o Data security is better with the multi-database approach. Now, each tenant has
their own database credentials. Even if there's a rare chance of a leak, not all
tenant data would be at risk. This is different from a single shared database
with the same credentials for everyone.
o In the deployments management app, only the administrator has access to log
in with the provided credentials.
• Scalability:
Scalability sees a significant boost with the introduction of the multi-database solution.
Furthermore, adopting a single-tenant approach further enhances scalability as clients
41
can host their LEANIOS Cloud Platform instances on private servers. This dual strategy
contributes to an overall more scalable and adaptable system.
• Flexibility:
Flexibility is guaranteed through the implemented multi-database and single-tenant
approach. Each tenant has a dedicated database, allowing for tailored configurations
and adaptable solutions. This flexibility enables the system to easily accommodate
diverse requirements, ensuring that each client's specific needs can be met without
affecting the overall system performance.
• Reliability:
We make sure everything works smoothly by being careful in how we set up the
system. Having separate databases for each tenant means that if something goes
wrong, it won't affect everyone, making the system more reliable. This way, any issues
that pop up won't cause big problems for everyone else, keeping things running
smoothly and reliably.
• Tenants: The tenants(clients) serve as the end users of our system, possessing specific
needs and requirements that must be met. They play a crucial role in providing
valuable feedback on the functionality and usability of the system.
• Team lead: A team lead is accountable for guiding and coordinating team efforts,
ensuring project goals are met while fostering a collaborative and productive work
environment. They play a pivotal role in aligning team members with the overall vision
and objectives, driving successful project outcomes.
42
• It ops: bear the responsibility of deploying and maintaining the system. They
collaborate closely with developers to ensure a smooth deployment of the code and
swift resolution of any arising issues.
• Developer: The individuals who write and maintain the code that drives a system are
tasked with designing, constructing, testing, and troubleshooting software
applications. They bear the responsibility for the development and up- keep of the
software code.
This use case diagram illustrates the fundamental interactions and functionalities within the
Proof of Concept (POC) system, involving three primary actors: Administrator, Tenant, and
Developer.
43
▪ Administrator:
Manage Companies: The Administrator actor is responsible for the creation, modification, and
oversight of companies within the system. This includes configuring company settings and ensuring
proper administration.
▪ Developer:
Create and Manage Databases: Developers play a crucial role in the system by creating and
managing databases. They have the authority implement, and maintain databases to meet the
specific requirements of the application.
▪ Tenant:
Access App with Subdomain: Tenants interact with the system through a subdomain,
accessing the application and its functionalities. They have the capability to manage projects.
This detailed use case diagram elaborates on the interactions and functionalities within the
Proof of Concept (POC) system, with a focus on create, edit and delete operations for the three
primary actors: Administrator, Tenant, and Developer.
44
4.2.5.3 LEANIOS-org-ops general use cases
This use case diagram outlines the key functionalities within the LEANIOS-org-ops system,
featuring the Administrator actor who plays a central role in managing companies, servers, and
databases, as well as initiating the deployment of the LEANIOS Cloud Platform on a server.
45
4.2.5.4 LEANIOS-org-ops (Deployments management) Detailed use cases:
As we can see in the Detailed use cases diagram, we can specify one actor:
46
▪ Edit: Adjust server configurations or details to accommodate evolving
requirements.
▪ Delete: Eliminate servers that are obsolete or no longer serve a purpose.
− Databases Management:
▪ Create: Establish new databases, specifying parameters like name, port, and host.
▪ Edit: Make adjustments to the settings or structure of existing databases.
▪ Delete: Remove databases that are no longer relevant or necessary.
− Authentication: Before accessing the management app, the User Administrator
undergoes a secure authentication process to ensure the confidentiality and integrity of
the system.
− Deploy Leanios Cloud platform use case
47
This use case diagram illustrates the collaborative workflow within the DevOps environment,
involving three key actors: IT Ops, Developer, and Team Lead. Each actor contributes to the efficient
development, deployment, and management of software projects.
▪ IT Ops:
Manage DevOps Tools: Oversees and manages DevOps tools for smooth collaboration.
▪ Developer:
Create Merge Requests: Proposes code changes for review and integration.
Collaborate on Code: Works collaboratively using version control and DevOps tools.
▪ Team Lead:
Manage Merge Requests: Makes decisions on code integration, ensuring code quality.
4.3 | Design
After analysing user requirements, we proceed to design the architecture of our system. This
phase falls between requirement specification and the implementation phase. The goal is to define
a functional implementation strategy that addresses identified constraints while optimizing the
system.
48
4.3.1.1 Hybrid multi-tenant system architecture
To explain this process further let us consider a scenario in the figure 5-1,
49
⎯ A user loads a URL *.leanios.com in the browser.
⎯ Once a URL is loaded Leanios cloud platform mapped to the domain receives a request.
The application then resolves a tenant, finds the location of the database where
requested customer data is located.
⎯ After finding data application then processes a request, and returns the requested data
to the client.
⎯ Based on where the request comes (URL) a tenant is resolved and data for a particular
tenant is returned to the requested user.
⎯ Developer machines: These are the physical machines used by developers to make
changes in the source code and develop new features for the application.
⎯ Cloud: This refers to a server environment accessible over the Internet, with software
and databases running on these servers.
This figure illustrates this physical architecture and the protocols used for communication
between the various components.
50
Figure 4-7 Physical architecture of CI
API: GitHub server exposes an API that allows users and third-party applications to interact
with the platform. The API provides functionalities for repository management, user management,
GitHub actions, issues, pull requests, etc.
Collaboration and Issue Tracking: GitHub offers advanced features for collaboration among
developers, such as issues, pull requests, discussions, comments, etc. These features facilitate team
coordination and issue tracking.
Data Storage: GitHub server uses a storage system to store repository data, user data, issues,
etc. Storage systems like relational databases or distributed file systems can be employed based on
scalability and performance requirements.
The software architecture of the GitHub server is designed to deliver a seamless and
performant experience to users while ensuring security, collaboration, and continuous integration
in the software development process.
Master:
• Proxies Kube and kubelets exist on each node, communicating with the API, and
managing the workload of each node.
Cloud-controller-manager:
52
• Connects clusters to the cloud provider's API and executes only cloud-provider-specific
controllers.
etcd:
etcd is a distributed key-value store and the primary data store for Kubernetes.
This Kubernetes architecture includes a control plane (Master) housing essential component,
a distributed storage system (etcd) to maintain the cluster's state, and a set of nodes
(Workers) briefly described above. The Master encompasses various components such as
kube-api server, kube scheduler, cloud-controller-manager, and kube-controller-manager,
while the cloud-controller-manager facilitates the connection to the cloud provider's API.
Lastly, etcd serves as the distributed key-value store, ensuring coherent data storage for
Kubernetes.
Kubelet:
• Functions as an agent within nodes, responsible for running pod cycles on each node.
• Ensures that pods within its residing node are healthy and that the pod state aligns
with the pod specification.
53
Proxy:
• Each computing node includes a network proxy called "kube-proxy," facilitating the
implementation of Kubernetes networking services.
• Utilizes the operating system's packet filtering layer if available; otherwise, it handles
traffic itself.
Scheduler:
54
• Helm Client: Provides the developer to use it a command-line interface (CLI) to work
with Charts, Config, Release, Repositories. Helm Client will interact with Tiller Server,
to perform various actions such as install, upgrade and rollback with Charts, Release.
• Tiller Server: an in-cluster server in the Kubernetes cluster, interacting with the Helm
Client and communicating with the Kubernetes API server. Thus, Helm can easily
manage Kubernetes with tasks such as install, upgrade, query and remove for
Kubernetes resources.
55
Figure 4-11 Config value for different environments of ROR app
56
4.3.3.1 POC (Hybrid multi-tenancy Solution) Class diagram:
These classes model a scenario where companies can be associated with multiple projects,
and each project is uniquely linked to a single company. Otherwise, the Company class represents
an organizational entity with attributes defining its identity and configuration, while the Project class
represents a specific project associated with a company, encapsulating details and actions related
to that project. The methods in each class reflect the actions and management operations
associated with companies and projects, respectively.
4.3.3.2 Sequence Diagram of the use case << Create Company (Tenant) >>
A sequence diagram visually represents the chronological flow of interactions between objects
or components in a system using UML, aiding in understanding dynamic behaviours and
communication patterns.
57
Figure 4-14 Sequence diagram <<create company(tenant)>>
The Sequence Diagram for the <<Create Company (Tenant)>> use case illustrates interactions
between the administrator, middleware handling request resolution for each tenant, and the
company module components, including the apartment gem, library for multitenancy, and the
PostgreSQL database housing our schemas.
58
4.3.3.3 Sequence Diagram of the use case << access to the app with subdomain >>
Initiated by the Tenant entering a subdomain URL, this sequence involves the Apartment Gem
parsing and configuring database connections. Switching to the tenant-specific schema, the
projects Controller efficiently loads the project list from PostgreSQL, streamlining the process
without direct interaction with the Gem.
4.3.3.4 Sequence Diagram of the use case << Execute migrations across databases >>
This sequence diagram addresses the challenge of efficiently applying database migrations
across multiple tenants in a multi-tenant Ruby on Rails application. By leveraging the capabilities
of the Apartment Gem, the task fetches tenant configurations from the Primary Database,
establishes connections to individual Tenant Databases, and applies migrations in a schema-
specific manner. This solution ensures the seamless execution of database migrations across
diverse tenants and databases within the application architecture.
59
Figure 4-16 Sequence Diagram of the use case << Execute migrations across databases >>
60
4.3.3.5 LEANIOS-org-ops (Deployments management) Class Diagram:
61
the Administrator class represents individuals overseeing deployment management. Each
Administrator has the capability to manage multiple servers, reflecting a one-to-many
relationship. Servers are associated with a specific Company, adhering to a one-to-one
relationship, and a Company, in turn, can possess multiple databases, establishing a one-to-
many relationship.
Furthermore, the relationship extends to the Database class, where one or many databases
can be hosted on server, forming a many-to-one relationship. This design allows for a flexible
and scalable deployment management system, accommodating the complex interconnections
between administrators, companies, servers, and databases within the LEANIOS
organizational operations framework.
4.3.3.6 Sequence Diagrams of the use case << Create New Company >> Leanios-org-
ops:
To initiate the deployment of the cloud platform for a company or client service, the sequence
diagram involves the following interactions within the Deployments Management Hub. The
Administrator triggers the <<Create Company (Tenant)>> use case, leading to the involvement of
the Companies section and Database components. The Administrator communicates with the
Companies section to create a new company, and subsequently, the database component is
engaged to set up the required database configurations. This sequence outlines the coordinated
efforts within the Deployments Management Hub to establish the necessary infrastructure for
deploying the cloud platform for a specific company or client service.
62
Figure 4-18 Sequence Diagram << Create New Company >>
63
4.3.3.7 Sequence Diagrams of the use case << Edit server >> Leanios-org-ops:
In the "Edit Server" sequence, an Administrator triggers the <<Edit Server>> use case,
interacting with middleware for request resolution. The middleware collaborates with the server
component to modify configurations as shown in figure 4-19. This sequence emphasizes the
streamlined process of adjusting server settings within the LEANIOS organizational operations
framework.
64
4.3.3.8 Sequence Diagram of the use case << Delete database >> Leanios-org-ops:
Figure 4-20 Sequence Diagram of the use case << Delete database >>
The Sequence Diagram for the <<Delete Database>> use case involves the Administrator
initiating the deletion process. The Administrator communicates with the middleware for
request resolution, which then orchestrates the deletion procedure with the database
component. This sequence illustrates the coordinated steps in removing a record within the
Deployments Management Hub, showcasing the interactions between the Administrator,
middleware, and database components.
65
4.3.3.9 LEANIOS-org-ops Deployment Diagram:
The diagram in Figure 4-22 shows how our solution works physically. It highlights the servers
we've set up and how they communicate. The diagram also includes the tools and virtual machines
we use to make everything run smoothly.
66
Figure 4-22 CI Activity diagram
➢ Textual Description:
⎯ Event Triggering:
Install Dependencies:
If the workflow is triggered, the CI system initiates the installation of project dependencies
necessary for the build and test processes.
67
Lint Code:
Assuming successful dependency installation, the system proceeds to lint the code using tools
like RuboCop to enforce coding standards.
Run Tests:
With successful linting, the system runs automated tests, typically using RSpec, to ensure the
correctness of the code.
Build Image:
The Docker image is built using a specified Dockerfile in the repository. This may involve
executing build commands, installing dependencies, and configuring the environment.
Push Image:
If the tests succeed, the Docker image is pushed to a Docker registry, such as Docker Hub. This
allows storing the image and making it accessible for subsequent deployment.
4.4 | Conclusion
In this chapter, we establish a comprehensive foundation for the project, outlining the key
stakeholders and their roles, as well as presenting a detailed analysis of functional and technical
requirements. The chapter delves into the identification of crucial actors such as tenant,
administrators, It ops, team lead and developers. The design is divided into General architecture
and Detailed architecture section provides a holistic view through use case diagrams, while the we
break down specific use cases with sequence and class diagrams. The focus on security, scalability,
flexibility, and reliability in technical requirements underscores the robustness of the proposed
solutions. Overall, this chapter serves as a crucial roadmap, guiding to the final part of our report,
which is the implementation of the various elements of the work.
68
Chapter 5 Realisation
5.1 | Introduction
In this final chapter, we will cover the work done, explore the different steps to achieve the
final result by detailing each step, and include the necessary screenshots to explain the
implementation of our solutions.
Our Proof of Concept (POC) encompasses three primary concepts to achieve the multi-schema
multi-databases solution:
Company Schema Creation: This involves creating a schema for each company in its dedicated database.
As a first step, we have the company page that allows us to add a new company (tenant) by
specifying their subdomain and the basic database configuration for that company. After
69
creating the company and invoking a callback, the system automatically creates the schema
in the specified database introduced in the input.
70
Middleware Connectivity: The middleware ensures that every tenant's request, based on
their subdomain, is directed to their respective database where their schema is hosted.
Tenant then could access to their space and manage their projects.
71
Database Migrations Handling: The solution manages running database migrations on all the
schemas and databases connected to the application.
Actor Initiation:
The Developer initiates the process by running the custom rake task (rake db: multi_server
[db: migrate]).
If the specified task is not present, an error message is displayed to the Developer.
72
Fetching Tenant Configurations:
If the task is present, the Task Runner communicates with the Apartment Gem to fetch
configurations for all tenants.
The Apartment Gem interacts with the Primary Database to obtain tenant configurations.
Displaying Configurations:
⎯ For each tenant, the Task Runner establishes a connection to the respective Tenant
Database.
⎯ The Task Runner switches to the specific schema for the tenant in the Tenant Database.
After migrating all tenants, the Task Runner re-establishes the connection to the Primary
Database.
The Developer is notified that the task has been successfully completed.
5.3 | Leanios-org-ops
In this part of the solution, our focus is on developing the fundamental functionalities of the
application, laying the groundwork for managing the deployment of the Leanios Cloud Platform in
the future. Additionally, we've established a continuous integration (CI) process, a crucial aspect
73
during this development phase. Manual deployment has been performed locally on a Minikube
Kubernetes cluster.
Here, we can see the Servers section, presenting a list of servers with their parameters. You can
manage, edit, delete, or add servers.
74
Figure 5-7 Servers list interface
Moving on to the Databases section, we find a list of databases with their parameters. We can
manage, edit, delete, or add databases.
75
Here's the Add Database page:
In the Companies section, a list of companies (tenants) is displayed with their parameters,
along with information on the associated server and connected databases.
76
Figure 5-11 Company List interface
We can manage, edit, delete, or add companies. An additional action here is the "Deploy,"
which triggers the automatic deployment of the Leanios Cloud Platform on the dedicated server in
the background. Note that this feature is currently in progress and will be fully added in the future.
As of now, we've prepared the basic functionalities.
77
In the user interface for adding a new company, several key fields are present to capture
essential company details. These include the name, email, subdomain, and deployment information
fields. It's important to note that among these fields, the 'server' field is mandatory, indicating the
necessity of specifying server-related details during the company creation process. Ensuring
accurate input in all these fields is crucial for the successful addition of a new company to the
system.
In the edit page interface, users can efficiently modify key company details such as name,
email, subdomain, and deployment. The 'server' field remains mandatory, even during edits,
emphasizing the continued importance of specifying server-related details for accuracy. This
streamlined process ensures precise updates while maintaining data integrity within the system.
5.4 | CI Pipeline:
GitHub Actions is our continuous integration tool, serving as the orchestrator that
communicates with various CI tools to ensure the smooth execution of all steps in our workflow.
The definition of our pipeline is done through a CI development file, presenting a series of stages
that can be sequential or parallel.
78
Figure 5-14 Ci-development file
Here's a step-by-step breakdown of the provided GitHub Actions workflow file for CI
(Continuous Integration) named "CI-development". Each step is described in detail:
Checkout Code:
Action: actions/[email protected]
Setup Ruby:
Action: ruby/setup-ruby@v1
Cache Gems:
Action: actions/cache@v1
Description: Caches Ruby gems to speed up the workflow by reusing previously downloaded
dependencies.
Install Dependencies:
Description: Installs Bundler, configures the bundle path, and installs project dependencies.
Pre-compile Assets:
79
Description: Precompiles assets using the rake assets: precompile command.
Run Rubocop:
Action: nanasess/setup-chromedriver@master
Action: harmon758/postgresql-action@v1
Setup Database:
Run Tests:
Action: actions/upload-artifact@master
Action: docker/login-action@v1
Action : docker/build-push-action@v2
80
Description: Builds and pushes the Docker image to Docker Hub with specified tags.The
previous steps are seen in this screenshot of the workflow on GitHub:
81
5.5 | Minikube dashboard:
The Minikube Dashboard serves as a user-friendly graphical interface for managing and monitoring
Kubernetes clusters deployed through Minikube. It provides a centralized platform where we can
effortlessly visualize, control, and interact with their local Kubernetes environments. Through the
dashboard, we gain insights into the status of nodes, pods, and deployments, allowing for real-time
monitoring of resource utilization and overall cluster health. Additionally, the Minikube Dashboard
offers a convenient way to manage and scale applications, inspect logs, and troubleshoot potential
issues, making it an invaluable tool for developers and administrators navigating the complexities
of Kubernetes development on a local machine.
5.6 | Conclusion
In this final chapter, we provided a detailed overview of our project, accompanied by
screenshots illustrating the implementation of each functionality within our solution.
82
General Conclusion
This report marks the completion of our end-of-studies project at Sesame Private Higher
School of Engineering, spanning a seven-month period dedicated to collaborative efforts with
LEANIOS STARTUP. Throughout this duration, our primary focus was on investigating the
feasibility of transitioning the LEANIOS cloud platform. Specifically, we explored the shift from
a multi-schema shared database model to a hybrid multi-tenancy solution, encompassing
both multi-schema and multi-database architectures. As part of our deliverables, we
implemented a proof of concept (POC) to validate the viability of this new approach.
Looking ahead, the subsequent phase of this project involves establishing continuous
delivery (CD) for Leanios Org Ops and seamlessly integrating the hybrid multi-tenancy solution
into the LEANIOS cloud platform. This strategic integration promises numerous advantages,
enhancing the platform's scalability, efficiency, and overall performance. The successful
completion of these steps will contribute significantly to the evolution and optimization of
the LEANIOS cloud platform.
83
Netography/Bibliography
[N17] Helm chart, «Helm chart,» [En ligne]. Available: https://helm.sh/docs/topics/charts/. [Access On 17 11
2023].
84
[N19] «devops,» [En ligne]. Available: https://blog.devops.dev/the-kubernetes-architecture-
e1ee01ccb76d?gi=35596b3b5d4c. [Access On 14 11 2023].
85