Skip to content

Commit fa8d9ef

Browse files
meixiezichuanKyle-DwyercqqqqcYongli0510SakuraX99
authored
Reconstruction (FudanSELab#227)
* delete service ticketinfo (FudanSELab#178) * Station food (FudanSELab#177) * 修改station-food-service 主要是重命名 * 修改数据库名称 * 删除不必要的代码文件 * 修改quickstart-k8s中的mongo和service名 * 修改pom.xml * 修改父pom.xml * 修改url调用关系 * feat: 拆分ts-food-map-service为ts-trainfood-service (FudanSELab#179) * Log optimization 20220117 (FudanSELab#183) * log fixed by Chen Miao 0119 * log fixed by Tianyi Zhang 0120 * log fixed by Tianyi Zhang 0120-1 * log fixed by Tianyi Zhang 0120-2 * log fixed by Tianyi Zhang 0121-1 * Service access address configuration collation * nacos初步修改 (FudanSELab#181) * nacos初步修改 * nacos修改硬编码 * nacos k8s cluster * nacos 部署删除不必要文件 * Gateway (FudanSELab#185) * add gateway * fix gateway * fix: gateway中uri用通配符形式匹配 * use NACOS_ADDRS instead of ip Co-authored-by: wangyongli.0510 <wangyongli.0510@bytedance.com> Co-authored-by: Rananism <meixiezichuan@163.com> * 统一数据库为mongo * 版本问题修改 * 版本问题修改 * fix test error * fix dockerfile * nacos数据库修改 * fix gateway and trainFood * Cqq mysql (FudanSELab#187) * 改mysql yml * 改mysql * mysql train * mysql * mysql useSSL=false * update * Ws mysql (FudanSELab#188) * change to mysql yml * change to mysql yml * change to mysql ts-auth * change to mysql ts-auth * change to mysql ts-contacts * revert change to mysql ts-route * change to mysql ts-train * fix bug * change to mysql ts-user * change to mysql ts-consign-price * Update uuid length to 36 Co-authored-by: meixiezichuan <meixiezichuan@163.com> * Reconstruction (FudanSELab#190) * log fixed by Tianyi Zhang mysql modified for delivery-service * log fixed by Tianyi Zhang mysql modified * log fixed by Tianyi Zhang mysql modified * Reconstruction (FudanSELab#191) * log fixed by Tianyi Zhang mysql modified for delivery-service * log fixed by Tianyi Zhang mysql modified * log fixed by Tianyi Zhang mysql modified * fixed by Tianyi Zhang mysql modified * Hd mysql refactoring data access layer transfer to MySQL ts-route ts-food ts-security * mysql (FudanSELab#196) * reconstruction (FudanSELab#195) * reconstruction * reconstructionon_fixURL * adjust the configuration (FudanSELab#198) * Zbc mysql (FudanSELab#194) * ts-travel-service: migrate from mongo to mysql * ts-travel2-service: migrate from mogo to mysql * ts-train-food-service: migrate from mongo to mysql * Fix bug. * mysql modified * Modify mysql config. * adjust the configuration (FudanSELab#198) * ts-travel-service: migrate from mongo to mysql * ts-travel2-service: migrate from mogo to mysql * ts-train-food-service: migrate from mongo to mysql * Fix bug. * mysql modified * Modify mysql config. Co-authored-by: Kyle-Dwyer <34733051+Kyle-Dwyer@users.noreply.github.com> Co-authored-by: meixiezichuan <meixiezichuan@163.com> * Reconstruction (FudanSELab#193) * log fixed by Tianyi Zhang mysql modified for delivery-service * log fixed by Tianyi Zhang mysql modified * log fixed by Tianyi Zhang mysql modified * fixed by Tianyi Zhang mysql modified * fixed by Tianyi Zhang mysql modified * fixed by Tianyi Zhang mysql modified * fixed by Tianyi Zhang mysql modified * fixed by Tianyi Zhang mysql modified * update: mysql config in application.yml * Reconstruction (FudanSELab#204) * inside-payment stop * ts-gateway finished * mysql * change length * fix rabbitmq port type error * rm ts-nacos dir * Use discoveryClient in ts-admin-basic-info-service * Reconstruction (FudanSELab#205) * fixed by Tianyi Zhang mysql modified * adjust the configuration (FudanSELab#206) * Re cqq (FudanSELab#207) * mysql * fix ts-auth ts-consign-price ts-train ts-contacts ts-user * fix nacos related (FudanSELab#209) * fix ts-admin-* & basic & cancel & preserve & rebook to use discoveryclient * fix execute order order-other route-plan seat travel-plan * Fix nacos config. (FudanSELab#211) * Fix getServiceUrl * refactor: nacos config (FudanSELab#213) * fix getServiceUrl for food & security * update gateway service(fix dependency bugs & add sentinal flow control feature) (FudanSELab#212) * fix getServiceUrl for food & security * remove ribbon & openfeign * add dialect for mysql * add jakarta.validation dependency * fix admin-basic application.yaml * Add unique for index of consign price * fix delivery swagger version * fix order, order-other findById * fix payment * fix price findById * Fix entiry defination in payment, insidepsyment, train, travel, travel2 * fix price findById.get * update guava version in verfication-code to fix dependency error * fix station * Fix voucher to use mysql env * fix port type in mysql_config * Fix getServiceUrl and mysqlDriver * Fix route entity duplicated definition * Fix station findById get * Fix travel/travel2 check null before traverse list * remove duplicated Entity of Trip in travel2 * use trip2 in travel2 * add travel/travel2 repository bean * Data (FudanSELab#218) * Tidy data definition * tidy and formalize data * refactor: forwards the service request to Gateway (FudanSELab#217) * remove unique constraint of consign price * Feature update header (FudanSELab#219) * update header (add token) * update header (add token) * Prometheus skywalking (FudanSELab#208) * Add prometheus config. * Add skywalking config. * Change deployment yaml for skywalking. * fix auth-user and user to use same user_id * optimize travel and seat loop dependency * add orderColumn for route_stations and route_distances * rm auto genetate id for price * Modify gateway addr in nginx.conf * query basic infos by batch * feat: Modified the form for adding information and added options. (FudanSELab#221) * feat: Modified the form for adding information and added options. * fix: form for adding new travel. * Fix route plan and travel plan * Format startStation and end Station in route * update deployment file * fix admin bugs (FudanSELab#222) * update: Modified parameters of some interfaces. Updated descriptions of some forms. * fix ticket-office use mysql * user environment var of mysql * Fix trainfood stationFood * add quickstart-k8s deployment * Feature bugs fix (FudanSELab#223) * fix admin bugs * fix bugs * optimize seat Co-authored-by: meixiezichuan <meixiezichuan@163.com> * Fix food service * Ts food delivery service (FudanSELab#220) * Add ts-food-delivery-service. * Add ts-food-delivery-service * Add rpc to station-food-service. * Add rpc to station-food-service. * Test controller. * Solve reviewed problems. * Rename TripInfo. * fix stationfood url * Feature train update fix (FudanSELab#224) * update header (add token) * fix train update * Modify Date type to String * fix Order/Orderother about date type bug * fix: Complete front-end request parameters. (FudanSELab#225) fix: Front-end display problems. * fix travel update method * modify Date to String in Trip * Fix admin-route admin-travel add methoud * fix date type bug * set default price rate when priceconfig not found * edit deployment/ (FudanSELab#226) * edit deployment/ * edit ts-consign-price-mysql * Set tarvel date format yyyy-mm-dd hh:mm:ss * Fix bug in getTripAllDetailInfo * Add Release note 1.0 * Fix get seat bug in travel plan * Completed waiting order service, and modified some configuration files. (FudanSELab#229) * edit deployment/ * edit ts-consign-price-mysql * edit entity * change to Date * edit repository * feature: wait list order service * fix: Judgment of the waiting period * update: Modified configuration file of ts-wait-order-service. Co-authored-by: winterStreet <luwente@163.com> Co-authored-by: WinterStreett <53975807+WinterStreett@users.noreply.github.com> * docs(CHANGLOG-1.0.md) update sentinel part and bugfix part * Fix String2Date * fix contacts * update release note * modify pom * Add deploy file and doc * add nacos helm charts * Update deploy files * fix charts and yamls * update readme & changelog & deploy file * update architecute png * remove datasource from gateway * add sample file for deploy yamls Co-authored-by: Kyle-Dwyer <34733051+Kyle-Dwyer@users.noreply.github.com> Co-authored-by: cqqqqc <50789602+cqqqqc@users.noreply.github.com> Co-authored-by: Yongli0510 <1415193349@qq.com> Co-authored-by: SakuraX99 <57907184+SakuraX99@users.noreply.github.com> Co-authored-by: WangShang <1005284123@qq.com> Co-authored-by: wangyongli.0510 <wangyongli.0510@bytedance.com> Co-authored-by: 程千骞 <1617095973@qq.com> Co-authored-by: akasakaisami <akasaka0623@163.com> Co-authored-by: Deep-Yellow <957822635@qq.com> Co-authored-by: water423 <48052788+water423@users.noreply.github.com> Co-authored-by: zbcdd <52142931+zbcdd@users.noreply.github.com> Co-authored-by: Deep-Yellow <51702118+Deep-Yellow@users.noreply.github.com> Co-authored-by: WinterStreett <53975807+WinterStreett@users.noreply.github.com> Co-authored-by: winterStreet <luwente@163.com>
1 parent 350f620 commit fa8d9ef

File tree

1,696 files changed

+178810
-88081
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,696 files changed

+178810
-88081
lines changed

CHANGELOG-1.0.md

+159
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
2+
3+
* [v1.0.0](#v100-beta0)
4+
* [Deploy v1.0.0](#deploy-v1.0.0)
5+
* [For Quick Start](#for-quick-start)
6+
* [Deploy Mysql Clusters For Each Services](#deploy-mysql-clusters-for-each-services)
7+
* [With Moinitorig](#with-moinitorig)
8+
* [With Distributed Tracing](#with-distributed-tracing)
9+
* [Deploy All](#deploy-all)
10+
* [Customise Deployment](#customise-deployment)
11+
* [Reset Deployment](#reset-deployment)
12+
13+
* [Changelog since 0.2.1](#changelog-since-v021)
14+
* [Features Added](#features-added)
15+
* [Notable Changes](#notable-changes)
16+
* [Test Support](#test-support)
17+
* [Bug fix](#bug-fix)
18+
19+
20+
# v1.0.0
21+
22+
## Deploy v1.0.0
23+
24+
### For Quick Start
25+
```bash
26+
git clone https://github.com/FudanSELab/train-ticket.git release-1.0.0
27+
cd train-ticket
28+
make deploy
29+
30+
```
31+
32+
Note: if you want specify namespace, set Namespace paramter:
33+
34+
```bash
35+
make deploy Namespace=yournamespace
36+
```
37+
38+
### Deploy Mysql Clusters For Each Services
39+
40+
```bash
41+
git clone https://github.com/FudanSELab/train-ticket.git release-1.0.0
42+
cd train-ticket
43+
make deploy DeployArgs="--independent-db"
44+
```
45+
46+
### With Moinitorig
47+
```bash
48+
git clone https://github.com/FudanSELab/train-ticket.git release-1.0.0
49+
cd train-ticket
50+
make deploy DeployArgs="--with-monitoring"
51+
```
52+
53+
### With Distributed Tracing
54+
```bash
55+
git clone https://github.com/FudanSELab/train-ticket.git release-1.0.0
56+
cd train-ticket
57+
make deploy DeployArgs="--with-tracing"
58+
```
59+
60+
### Deploy All
61+
```bash
62+
git clone https://github.com/FudanSELab/train-ticket.git release-1.0.0
63+
cd train-ticket
64+
make deploy DeployArgs="--all"
65+
```
66+
67+
### Customise Deployment
68+
You can freely combine parameters for custom deployment, for example, deploy with monitoring and tracing:
69+
70+
```bash
71+
git clone https://github.com/FudanSELab/train-ticket.git release-1.0.0
72+
cd train-ticket
73+
make deploy DeployArgs="--with-tracing --with-monitoring"
74+
```
75+
76+
### Reset Deployment
77+
78+
```
79+
make reset-deploy
80+
# if you specify namespace when deploy, set namespace as well when reset
81+
# make reset-deploy Namespace=yournamespace
82+
```
83+
84+
## Changelog since v0.2.1
85+
86+
### Features Added
87+
88+
**Service Discovery: Nacos**
89+
90+
Use nacos as service register and discovery component.
91+
92+
Nacos use mysql cluster to store config information.
93+
94+
We use nacos 2.0.1 version, for more infromation of nacos, to see: [https://nacos.io/zh-cn/docs/what-is-nacos.html
95+
](https://nacos.io/zh-cn/docs/what-is-nacos.html)
96+
97+
**Gateway**
98+
99+
Using gateway as the only entry point for all service calls. A series of cross-cutting functions can be completed in the service gateway, such as permission verification, current limiting and monitoring, etc., which can be completed through filters.
100+
101+
We use spring-cloud-gateway to implement the gateway function.
102+
103+
**Flow Control: Sentinel**
104+
105+
We use Sentinel to implement the flow control for gateway. For now, the flow control rule is simply defined in route level. We simply limited the QPS towards admin-basic-info-service to no more than 20.
106+
107+
To customize the flow control rule, update the configuration for Sentinel in `GatewayConfiguration.java` file.
108+
109+
**Monitoring: Promethues+Grafana Deployment**
110+
111+
We support prometheus + grafana solution in k8s deployment.
112+
113+
The deployment manifests of prometheus are located at:deployment/kubernetes-manifests/prometheus
114+
115+
**Distributed Tracing: Skywalking+ES Supoort**
116+
117+
We support skywalking + es solution in k8s deployment.
118+
119+
The deployment manifests of prometheus are located at:deployment/kubernetes-manifests/skywalking
120+
121+
122+
### Notable Changes
123+
124+
**Log Format Unification**
125+
126+
Unified log format for all services
127+
128+
**Framework Upgrade**
129+
130+
Upgrade spring-boot version from 1.5.0 to 2.3.12.RELEASE.
131+
132+
Upgrade related dependency of services.
133+
134+
**Data Structrue Redesign**
135+
136+
Extract the common data structure of the service and put it in ts-common, instead of redefining them each service once. And data field naming is normalized.
137+
138+
**Dynamic Service Configuration**
139+
140+
Each service can dynamically configure its own database information, service discovery information, message queue information etc., (k8s deployment through configmap and secret, docker-compose deployment through environment variables) without the need to repackage the image.
141+
142+
**Mysql Cluster Mode Support**
143+
144+
Because the relational nature of the train ticket business is complex, we use a relational database, ie mysql. To support clustered deployment of mysql, we use randondb's solution for mysql deployment. For more details, see: [https://radondb.io/](https://radondb.io/)
145+
146+
### Test Support
147+
148+
We provide test scripts for functional and performance testing of train-tickets. The script provides some scenarios, such as administrator_operations, normal_query_and_booking, rebooking, rebooking_failure, search_failure, and consign_preserve.
149+
At the same time, the script supports qos parameter setting, which can easily implement performance testing.
150+
Access test scripts at: [https://github.com/FudanSELab/train-ticket-auto-query ](https://github.com/FudanSELab/train-ticket-auto-query)
151+
152+
153+
### Bug Fix
154+
155+
* update order failed by the administrator.
156+
* delete order failed by the administrator.
157+
* delete user failed by the administrator.
158+
* delete price failed by the administrator.
159+
* delete station failed by the administrator.

Makefile

+19-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22

33
Repo=codewisdom
44
Tag=latest
5+
Namespace="default"
6+
DeployArgs=""
7+
58

69
# build image
710
.PHONY: build
811
build: clean-image package build-image
912

1013
.PHONY: package
1114
package:
12-
@mvn clean package -DskipTests
15+
@mvn clean package -Dmaven.test.skip=true
1316

1417
.PHONY: build-image
1518
build-image:
@@ -24,6 +27,21 @@ push-image:
2427
publish-image:
2528
@script/publish-docker-images.sh $(Repo) $(Tag)
2629

30+
# deploy
31+
# DeployArgs "" : deploy train-ticket with all-in-one mysql cluster
32+
# DeployArgs "--independent-db" : deploy train-ticket with mysql cluster each service
33+
# DeployArgs "--with-monitoring" : deploy train-ticket with prometheus
34+
# DeployArgs "--with-tracing" : deploy train-ticket with skywalking
35+
# DeployArgs "--all" : deploy train-ticket with mysql cluster each service
36+
.PHONY: deploy
37+
deploy:
38+
@hack/deploy/deploy.sh $(Namespace) "$(DeployArgs)"
39+
40+
# deploy
41+
.PHONY: reset-deploy
42+
reset-deploy:
43+
@hack/deploy/reset.sh $(Namespace)
44+
2745
.PHONY: clean
2846
clean:
2947
@mvn clean

README.md

+48-30
Original file line numberDiff line numberDiff line change
@@ -14,66 +14,84 @@ You can get more details at [Wiki Pages](https://github.com/FudanSELab/train-tic
1414
![architecture](./image/2.png)
1515

1616
## Quick Start
17-
We provide two options to quickly deploy our application: [Using Docker Compose](#Using-Docker-Compose) and [Using Kubernetes](#Using-Kubernetes).
17+
We provide k8s deployment to quickly deploy our application: [Using Kubernetes](#Using-Kubernetes).
1818

19-
### Using Docker Compose
20-
The easiest way to get start with the Train Ticket application is by using [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/).
21-
22-
> If you don't have Docker and Docker Compose installed, you can refer to [the Docker website](https://www.docker.com/) to install them.
19+
### Using Kubernetes
20+
Here is the steps to deploy the Train Ticket onto any existing Kubernetes cluster.
2321

2422
#### Presequisite
25-
* Docker
26-
* Docker Compose
23+
* An existing Kubernetes cluster
24+
* Helm supported, you can see https://helm.sh/docs/helm/helm_install/ for helm install
25+
* PVC supported, you can see https://openebs.io/docs/2.12.x/user-guides/installation for localPV support.
2726

2827
#### 1. Clone the Repository
2928
```bash
30-
git clone --depth=1 https://github.com/FudanSELab/train-ticket.git
29+
git clone --depth=1 https://github.com/FudanSELab/train-ticket.git
3130
cd train-ticket/
3231
```
3332

34-
#### 2. Start the Application
33+
#### 2. Deploy the application
34+
### For Quick Start
3535
```bash
36-
docker-compose -f deployment/docker-compose-manifests/quickstart-docker-compose.yml up
36+
make deploy
37+
3738
```
38-
Once the application starts, you can visit the Train Ticket web page at [http://localhost:8080](http://localhost:8080).
3939

40-
### Using Kubernetes
41-
Here is the steps to deploy the Train Ticket onto any existing Kubernetes cluster.
40+
Note: if you want specify namespace, set Namespace paramter:
4241

43-
#### Presequisite
44-
* An existing Kubernetes cluster
42+
```bash
43+
make deploy Namespace=yournamespace
44+
```
45+
46+
### Deploy Mysql Clusters For Each Services
4547

46-
#### 1. Clone the Repository
4748
```bash
48-
git clone --depth=1 https://github.com/FudanSELab/train-ticket.git
49-
cd train-ticket/
49+
make deploy DeployArgs="--independent-db"
5050
```
5151

52-
#### 2. Deploy the application
52+
### With Moinitorig
5353
```bash
54-
cd deployment/kubernetes-manifests/quickstart-k8s
55-
56-
# Deploy the databases
57-
kubectl apply -f quickstart-ts-deployment-part1.yml
58-
# Deploy the services
59-
kubectl apply -f quickstart-ts-deployment-part2.yml
60-
# Deploy the UI Dashboard
61-
kubectl apply -f quickstart-ts-deployment-part3.yml
54+
make deploy DeployArgs="--with-monitoring"
55+
```
56+
57+
### With Distributed Tracing
58+
```bash
59+
make deploy DeployArgs="--with-tracing"
60+
```
61+
62+
### Deploy All
63+
```bash
64+
make deploy DeployArgs="--all"
65+
```
66+
67+
### Customise Deployment
68+
You can freely combine parameters for custom deployment, for example, deploy with monitoring and tracing:
69+
70+
```bash
71+
make deploy DeployArgs="--with-tracing --with-monitoring"
72+
```
73+
74+
### Reset Deployment
75+
76+
```
77+
make reset-deploy
78+
# if you specify namespace when deploy, set namespace as well when reset
79+
# make reset-deploy Namespace=yournamespace
6280
```
6381

6482
#### 3. Run `kubectl get pods` to see pods are in a ready state
6583

6684
#### 4. Visit the Train Ticket web page at [http://[Node-IP]:32677](http://[Node-IP]:32677).
6785

68-
### More Deployment Ways
69-
70-
There are many other quick deployment ways in [deployment folder](<https://github.com/FudanSELab/train-ticket/tree/master/deployment>). For example, you can deploy this system [with Jaeger](<https://github.com/FudanSELab/train-ticket/tree/master/deployment/kubernetes-manifests/k8s-with-jaeger>), and then visit the Jaeger Webpage to view traces.
7186

7287
## Build From Source
7388
In the above, We use pre-built images to quickly deploy the application.
7489

7590
If you want to build the application from source, you can refer to [the Installation Guide](https://github.com/FudanSELab/train-ticket/wiki/Installation-Guide).
7691

92+
## test scripts
93+
Use scripts to test train-ticket: [https://github.com/FudanSELab/train-ticket-auto-query](https://github.com/FudanSELab/train-ticket-auto-query)
94+
7795
## Screenshot
7896
![screenshot](./image/main_interface.png)
7997
In order to know how to use the application, you can refer to [the User Guide](https://github.com/FudanSELab/train-ticket/wiki/User-Guide).

0 commit comments

Comments
 (0)