当前位置:网站首页>Learn how to compile basic components of rainbow from the source code

Learn how to compile basic components of rainbow from the source code

2022-07-07 08:18:00 Rainbond

Rainbond It mainly consists of the following three projects , Refer to the official website for details Technology Architecture

Business side Rainbond-UI https://github.com/goodrain/rainbond-ui

Rainbond-Console https://github.com/goodrain/rainbond-console

Rainbond-UI and Rainbond-Console Together, it forms the business layer . The business layer is a front-end and back-end separation mode .UI It is the front-end code of the business layer ,Console Is the back-end code of the business layer .

Cluster end Rainbond https://github.com/goodrain/rainbond

Rainbond It is the implementation of the platform cluster side , Mainly with Kubernetes Clusters interact .

Compile the project

Be careful : Need to install docker Environmental Science

Business layer source code compilation

Compile front end Rainbond-UI Mirror image

  1. First of all, will Rainbond-UI Project clone to local
git clone https://github.com/goodrain/rainbond-ui.git
  1. Use... Under the root directory of the project build.sh The script builds the image :
VERSION=v5.5.0-release ./build.sh

VERSION Specify the time after the image is built tag, The image packaged from the front end will be used as the basic image of the back-end code .

Compile backend Rainbond-console Mirror image

  1. First of all, will Rainbond-console Project clone to local
git clone https://github.com/goodrain/rainbond-console.git
  1. Use... Under the root directory of the project release.sh The script builds the image :
VERSION=v5.5.0-release ./release.sh allinone

VERSION Specify the time after the image is built tag, Because the image of the front-end code is the basic image , Therefore, this place should be connected with the front-end project tag bring into correspondence with . Please use the following command to compile the front-end and back-end code together , Form a system that can finally run directly allinone Mirror image .

Run the business layer image

When the compilation is complete allinone After mirroring , You can refer to the following commands , Replace the image name in the last line with the image name you packaged , Run the image .

docker run -d -p 7070:7070 \--name=rainbond-allinone --restart=always \-v ~/.ssh:/root/.ssh \-v ~/rainbonddata:/app/data \rainbond/rainbond:v5.5.0-release-allinone

When the image is running , Access to the machine 7070 port , You can enter Rainbond Console .

Cluster side source code compilation

The cluster side is deployed in Kubernetes On Cluster , At the same time, there are many components , So you can compile individual components as needed .

Single component compilation

Single component compilation in the actual development process ⾮ Always important , Usually, after we modify a component in the process of secondary development , You can compile a component separately and make ⽤ The latest component image directly replaces the image in the installed development test environment .

  1. First of all, will Rainbond Project clone to local
git clone https://github.com/goodrain/rainbond.git
  1. Use... Under the root directory of the project release.sh The script builds the image , With chaos Component as an example , stay rainbond Execute the code in the main directory
./release.sh chaos

Single component compilation supports the following components :

rbd-chaos

chaos Component correspondence Rainbond Application building services , Main treatment CI The process , Include input sources Source code or Docker Mirror image or Application market application To analyze 、 compile 、 pack , The resulting application ( Components ) Version media .

rbd-api

api Component correspondence Rainbond Data Center API service ,API Service is the core control service of data center level abstraction , External provision Restful Style API service , It is the only entrance to the data center control request .

rbd-gateway

gateway Component correspondence Rainbond Application gateway service , The application gateway is an external traffic entry gateway Rainbond The only entrance to the tenant's internal components , Provide HTTP, HTTPs route , TCP/UDP service , Load Balancer , Advanced routing (A/B test , Grayscale Publishing ), fictitious IP Support and other functions .

rbd-monitor

monitor Component correspondence Rainbond Monitoring service ,Rainbond be based on Prometheus Encapsulates the Monitor Components , By getting from etcd、Kubernetes Automatically discover applications in clusters 、 colony 、 All kinds of monitoring objects served by cluster nodes and complete Prometheus Monitor target configuration , Incorporate monitoring objectives into Prometheus Monitoring range .

rbd-mq

mq Component correspondence Rainbond Message oriented middleware services ,MQ Components are based on Etcd Implementation of lightweight distributed 、 Message middleware with message persistence and global consistency . This component maintains asynchronous task messages , Provide multi topic message publishing and subscription capabilities .

rbd-webcli

webcli Component correspondence Rainbond application Web Terminal control service , The component realizes the function of web The way to connect to the container console . The component is connected with UI Conduct WebSocket signal communication , Users can simulate Web The terminal sends various messages shell command ,webcli adopt kube-apiserver Provided exec Method executes the command in the container and returns the result to Web terminal .

rbd-worker

worker Component correspondence Rainbond Application runtime control service , The application runtime control service will Rainbond-Application Model Instantiate into Kubernetes Resource model , Allocate various resources required for application operation , Complete the running part of the application life cycle , It can be understood as CD Control services , The key design point of the service is to support the life cycle supervision of a large number of applications .

rbd-eventlog

eventlog Component correspondence Rainbond Event and log processing service , It mainly processes user asynchronous operation logs 、 Application build log and application run log .

rbd-mesh-data-panel

mesh-data-panel Components handle dependencies between components .

rbd-grctl

grctl Component provides command line tools , Used to query information about components in the cluster .

rbd-node

node Component correspondence Rainbond colony 、 Node management services ,Node Components are Rainbond Basic services for cluster formation , All nodes in the cluster need to run this component . Provide node information collection 、 Cluster service maintenance 、 Application log collection 、 Key capabilities such as application runtime support .

Package and compile the complete installation package

Compile the complete installation package ⽤ After changing more source code , again ⽣ Installation package . stay rainbond Code master ⽬ Record the record ⾏

./release.sh all

Run the cluster side image

Because the data center is deployed in Kubernetes On the cluster , Therefore, the following preconditions need to be met , In order to run the compiled component image .

Prerequisite

  1. Installed Rainbond Test environment for
  2. Kubectl command , Refer to the documentation install Kubectl

Running the mirror

Rainbond Components on the data center side , It's all by rbdcomponent This CRD Resources are defined . When you compile the image of a component , Need to run , It needs to be modified rbdcomponent This resource .

With chaos Component as an example , Suppose you compiled it chaos The image is called

rainbond/rbd-chaos:v5.5.0-release

Do the following in turn , Replace the component image in the cluster .

  1. Edit the corresponding rbdcomponent file
kubectl edit rbdcomponent rbd-chaos -n rbd-system
  1. Find the mirror address column , Modify the mirror , Such as
spec:  image: rainbond/rbd-chaos:v5.5.0-release
  1. Save and exit , At this time, execute the following command , You should see that the corresponding component is being updated . wait for pod After the update .
kubectl get pod -n rbd-system

About Rainbond

Rainbond It is an open source cloud native application management platform , Easy to use , You don't need to understand containers and Kubernetes, Support management of multiple Kubernetes colony , Provide full lifecycle management for enterprise applications , Functions include application development environment 、 Application market 、 Microservice architecture 、 Application continuous delivery 、 Application operation and maintenance 、 Application level multi cloud management, etc .

Github:https://github.com/goodrain/rainbond

Official website :https://www.rainbond.com

Wechat group : Focus on Rainbond The official account is joined by the technical exchange group.

Nail group : Please search for nail group number 31096419

原网站

版权声明
本文为[Rainbond]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207070508281744.html