Skip to content

Commit

Permalink
Reconstruction (#227)
Browse files Browse the repository at this point in the history
* delete service ticketinfo (#178)

* Station food (#177)

* 修改station-food-service
主要是重命名

* 修改数据库名称

* 删除不必要的代码文件

* 修改quickstart-k8s中的mongo和service名

* 修改pom.xml

* 修改父pom.xml

* 修改url调用关系

* feat: 拆分ts-food-map-service为ts-trainfood-service (#179)

* Log optimization 20220117 (#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初步修改 (#181)

* nacos初步修改

* nacos修改硬编码

* nacos k8s cluster

* nacos 部署删除不必要文件

* Gateway (#185)

* add gateway

* fix gateway

* fix: gateway中uri用通配符形式匹配

* use NACOS_ADDRS instead of ip

Co-authored-by: wangyongli.0510 <[email protected]>
Co-authored-by: Rananism <[email protected]>

* 统一数据库为mongo

* 版本问题修改

* 版本问题修改

* fix test error

* fix dockerfile

* nacos数据库修改

* fix gateway and trainFood

* Cqq mysql (#187)

* 改mysql yml

* 改mysql

* mysql train

* mysql

* mysql useSSL=false

* update

* Ws mysql (#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 <[email protected]>

* Reconstruction (#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 (#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 (#196)

* reconstruction (#195)

* reconstruction

* reconstructionon_fixURL

* adjust the configuration (#198)

* Zbc mysql (#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 (#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 <[email protected]>
Co-authored-by: meixiezichuan <[email protected]>

* Reconstruction (#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 (#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 (#205)



* fixed by Tianyi Zhang mysql modified

* adjust the configuration (#206)

* Re cqq (#207)

* mysql

* fix ts-auth ts-consign-price ts-train ts-contacts ts-user

* fix nacos related (#209)

* fix ts-admin-* & basic & cancel & preserve & rebook to use discoveryclient

* fix execute order order-other route-plan seat travel-plan

* Fix nacos config. (#211)

* Fix getServiceUrl

* refactor: nacos config (#213)

* fix getServiceUrl for food & security

* update gateway service(fix dependency bugs & add sentinal flow control feature) (#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 (#218)

* Tidy data definition

* tidy and formalize data

* refactor: forwards the service request to Gateway (#217)

* remove unique constraint of consign price

* Feature update header (#219)

* update header (add token)

* update header (add token)

* Prometheus skywalking (#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. (#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 (#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 (#223)

* fix admin bugs

* fix bugs

* optimize seat

Co-authored-by: meixiezichuan <[email protected]>

* Fix food service

* Ts food delivery service (#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 (#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. (#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/ (#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. (#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 <[email protected]>
Co-authored-by: WinterStreett <[email protected]>

* 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 <[email protected]>
Co-authored-by: cqqqqc <[email protected]>
Co-authored-by: Yongli0510 <[email protected]>
Co-authored-by: SakuraX99 <[email protected]>
Co-authored-by: WangShang <[email protected]>
Co-authored-by: wangyongli.0510 <[email protected]>
Co-authored-by: 程千骞 <[email protected]>
Co-authored-by: akasakaisami <[email protected]>
Co-authored-by: Deep-Yellow <[email protected]>
Co-authored-by: water423 <[email protected]>
Co-authored-by: zbcdd <[email protected]>
Co-authored-by: Deep-Yellow <[email protected]>
Co-authored-by: WinterStreett <[email protected]>
Co-authored-by: winterStreet <[email protected]>
  • Loading branch information
15 people authored Aug 9, 2022
1 parent 350f620 commit fa8d9ef
Show file tree
Hide file tree
Showing 1,696 changed files with 178,810 additions and 88,081 deletions.
159 changes: 159 additions & 0 deletions CHANGELOG-1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@


* [v1.0.0](#v100-beta0)
* [Deploy v1.0.0](#deploy-v1.0.0)
* [For Quick Start](#for-quick-start)
* [Deploy Mysql Clusters For Each Services](#deploy-mysql-clusters-for-each-services)
* [With Moinitorig](#with-moinitorig)
* [With Distributed Tracing](#with-distributed-tracing)
* [Deploy All](#deploy-all)
* [Customise Deployment](#customise-deployment)
* [Reset Deployment](#reset-deployment)

* [Changelog since 0.2.1](#changelog-since-v021)
* [Features Added](#features-added)
* [Notable Changes](#notable-changes)
* [Test Support](#test-support)
* [Bug fix](#bug-fix)
# v1.0.0

## Deploy v1.0.0

### For Quick Start
```bash
git clone https://github.com/FudanSELab/train-ticket.git release-1.0.0
cd train-ticket
make deploy

```

Note: if you want specify namespace, set Namespace paramter:

```bash
make deploy Namespace=yournamespace
```

### Deploy Mysql Clusters For Each Services

```bash
git clone https://github.com/FudanSELab/train-ticket.git release-1.0.0
cd train-ticket
make deploy DeployArgs="--independent-db"
```

### With Moinitorig
```bash
git clone https://github.com/FudanSELab/train-ticket.git release-1.0.0
cd train-ticket
make deploy DeployArgs="--with-monitoring"
```

### With Distributed Tracing
```bash
git clone https://github.com/FudanSELab/train-ticket.git release-1.0.0
cd train-ticket
make deploy DeployArgs="--with-tracing"
```

### Deploy All
```bash
git clone https://github.com/FudanSELab/train-ticket.git release-1.0.0
cd train-ticket
make deploy DeployArgs="--all"
```

### Customise Deployment
You can freely combine parameters for custom deployment, for example, deploy with monitoring and tracing:

```bash
git clone https://github.com/FudanSELab/train-ticket.git release-1.0.0
cd train-ticket
make deploy DeployArgs="--with-tracing --with-monitoring"
```

### Reset Deployment

```
make reset-deploy
# if you specify namespace when deploy, set namespace as well when reset
# make reset-deploy Namespace=yournamespace
```

## Changelog since v0.2.1

### Features Added

**Service Discovery: Nacos**

Use nacos as service register and discovery component.

Nacos use mysql cluster to store config information.

We use nacos 2.0.1 version, for more infromation of nacos, to see: [https://nacos.io/zh-cn/docs/what-is-nacos.html
](https://nacos.io/zh-cn/docs/what-is-nacos.html)

**Gateway**

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.

We use spring-cloud-gateway to implement the gateway function.

**Flow Control: Sentinel**

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.

To customize the flow control rule, update the configuration for Sentinel in `GatewayConfiguration.java` file.

**Monitoring: Promethues+Grafana Deployment**

We support prometheus + grafana solution in k8s deployment.

The deployment manifests of prometheus are located at:deployment/kubernetes-manifests/prometheus

**Distributed Tracing: Skywalking+ES Supoort**

We support skywalking + es solution in k8s deployment.

The deployment manifests of prometheus are located at:deployment/kubernetes-manifests/skywalking


### Notable Changes

**Log Format Unification**

Unified log format for all services

**Framework Upgrade**

Upgrade spring-boot version from 1.5.0 to 2.3.12.RELEASE.

Upgrade related dependency of services.

**Data Structrue Redesign**

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.

**Dynamic Service Configuration**

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.

**Mysql Cluster Mode Support**

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/)

### Test Support

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.
At the same time, the script supports qos parameter setting, which can easily implement performance testing.
Access test scripts at: [https://github.com/FudanSELab/train-ticket-auto-query ](https://github.com/FudanSELab/train-ticket-auto-query)


### Bug Fix

* update order failed by the administrator.
* delete order failed by the administrator.
* delete user failed by the administrator.
* delete price failed by the administrator.
* delete station failed by the administrator.
20 changes: 19 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@

Repo=codewisdom
Tag=latest
Namespace="default"
DeployArgs=""


# build image
.PHONY: build
build: clean-image package build-image

.PHONY: package
package:
@mvn clean package -DskipTests
@mvn clean package -Dmaven.test.skip=true

.PHONY: build-image
build-image:
Expand All @@ -24,6 +27,21 @@ push-image:
publish-image:
@script/publish-docker-images.sh $(Repo) $(Tag)

# deploy
# DeployArgs "" : deploy train-ticket with all-in-one mysql cluster
# DeployArgs "--independent-db" : deploy train-ticket with mysql cluster each service
# DeployArgs "--with-monitoring" : deploy train-ticket with prometheus
# DeployArgs "--with-tracing" : deploy train-ticket with skywalking
# DeployArgs "--all" : deploy train-ticket with mysql cluster each service
.PHONY: deploy
deploy:
@hack/deploy/deploy.sh $(Namespace) "$(DeployArgs)"

# deploy
.PHONY: reset-deploy
reset-deploy:
@hack/deploy/reset.sh $(Namespace)

.PHONY: clean
clean:
@mvn clean
Expand Down
78 changes: 48 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,66 +14,84 @@ You can get more details at [Wiki Pages](https://github.com/FudanSELab/train-tic
![architecture](./image/2.png)

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

### Using Docker Compose
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/).

> If you don't have Docker and Docker Compose installed, you can refer to [the Docker website](https://www.docker.com/) to install them.
### Using Kubernetes
Here is the steps to deploy the Train Ticket onto any existing Kubernetes cluster.

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

#### 1. Clone the Repository
```bash
git clone --depth=1 https://github.com/FudanSELab/train-ticket.git
git clone --depth=1 https://github.com/FudanSELab/train-ticket.git
cd train-ticket/
```

#### 2. Start the Application
#### 2. Deploy the application
### For Quick Start
```bash
docker-compose -f deployment/docker-compose-manifests/quickstart-docker-compose.yml up
make deploy

```
Once the application starts, you can visit the Train Ticket web page at [http://localhost:8080](http://localhost:8080).

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

#### Presequisite
* An existing Kubernetes cluster
```bash
make deploy Namespace=yournamespace
```

### Deploy Mysql Clusters For Each Services

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

#### 2. Deploy the application
### With Moinitorig
```bash
cd deployment/kubernetes-manifests/quickstart-k8s

# Deploy the databases
kubectl apply -f quickstart-ts-deployment-part1.yml
# Deploy the services
kubectl apply -f quickstart-ts-deployment-part2.yml
# Deploy the UI Dashboard
kubectl apply -f quickstart-ts-deployment-part3.yml
make deploy DeployArgs="--with-monitoring"
```

### With Distributed Tracing
```bash
make deploy DeployArgs="--with-tracing"
```

### Deploy All
```bash
make deploy DeployArgs="--all"
```

### Customise Deployment
You can freely combine parameters for custom deployment, for example, deploy with monitoring and tracing:

```bash
make deploy DeployArgs="--with-tracing --with-monitoring"
```

### Reset Deployment

```
make reset-deploy
# if you specify namespace when deploy, set namespace as well when reset
# make reset-deploy Namespace=yournamespace
```

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

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

### More Deployment Ways

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.

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

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).

## test scripts
Use scripts to test train-ticket: [https://github.com/FudanSELab/train-ticket-auto-query](https://github.com/FudanSELab/train-ticket-auto-query)

## Screenshot
![screenshot](./image/main_interface.png)
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).
Expand Down
Loading

0 comments on commit fa8d9ef

Please sign in to comment.