Skip to content

Commit

Permalink
Release v2020.11.26.1 (#818)
Browse files Browse the repository at this point in the history
* misc: Increase ulimit to 65535 for test env (#756)
* test: Fix frontend CI (#752)
* ui: fix dayjs i18n (#755)
* ui: handle error globally (#757)
* statement, slow_query: support all fields in list page (#749)
* ui: memorize expand/collapse full text in detail pages (#775)
* ui: break loop dependencies (#771)
* ui: fix browser compatibility check (#776)
* ui: Refine store location, add zoom and pan (#772)
* ui: show disk usage information for statement and slow query (#777)
* ui: use qps instead of ops (#786)
* statement: support export (#778)
*: Fix slow query and start_ts not working in some cases (#793)
* ui: fix errors doesn't display (#794)
* ui: fix the error message doesn't show correct (#799)
* slow_queries: support export (#792)
* ui: add MySqlFormatter to customize the sql formatter (#805)
*: fix query statement detail error cause by round (#806)
* ui: copy original content instead of formatted content for CopyLink (#802)
* add min height of topology canvas (#804)
* metrics: Support customize Prometheus address (#808)
* clusterinfo: Refine (#815)
* ui: Open statement and slow log in new tab (#816)
* ui: add more time field for slow query detail page (#810)
* slowlog: Improve descriptions (#817)
* build: add action to check release-version is changed for release branch
* Release v2020.11.26.1
  • Loading branch information
breezewish authored Nov 26, 2020
1 parent 94d8dc3 commit 6c8be22
Show file tree
Hide file tree
Showing 164 changed files with 5,848 additions and 2,801 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- master
- release

jobs:
e2e_test:
Expand All @@ -12,7 +13,7 @@ jobs:
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@master
uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "12.x"
Expand Down Expand Up @@ -46,23 +47,27 @@ jobs:
run: |
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
source /home/runner/.profile
tiup update --nightly
tiup playground nightly --tiflash=0 &
tiup update playground
source /home/runner/.profile
tiup playground v4.0.6 --tiflash=0 &
- name: Build UI
run: |
make ui
env:
NO_MINIMIZE: true
CI: true
REACT_APP_MIXPANEL_TOKEN: ""
- name: Wait TiUP Playground
run: |
chmod u+x scripts/wait_tiup_playground.sh
scripts/wait_tiup_playground.sh 15 20
- name: Debug TiUP
run: |
source /home/runner/.profile
tiup --version
ls /home/runner/.tiup/components/playground/
DATA_PATH=$(ls /home/runner/.tiup/data/)
echo $DATA_PATH
tiup playground display
echo "==== TiDB Log ===="
head -n 3 /home/runner/.tiup/data/$DATA_PATH/tidb-0/tidb.log
echo "==== TiKV Log ===="
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: "1.13.5"
Expand All @@ -32,13 +32,12 @@ jobs:
- name: Check uncommitted lint changes
run: |
git diff --exit-code
frontend:
name: frontend
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "12.x"
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/release-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release Check

on:
pull_request:
branches:
- release

jobs:
check_release_version:
runs-on: ubuntu-latest
steps:
- name: Checkout code and release branch
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Check release version
run: >
! (git diff --name-only --exit-code origin/release -- ./release-version)
|| (echo "Please update the release-version file" && false)
7 changes: 1 addition & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,19 @@ on:
push:
branches:
- release
paths:
- release-version

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "12.x"
- uses: actions/setup-go@v1
with:
go-version: "1.13.5"
- name: Check release version
run: |
git diff --name-only --exit-code ./release-version || (echo "Update the release version file" && false)
- name: Lookup yarn cache
id: yarn_cache
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
104 changes: 23 additions & 81 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ Although TiDB Dashboard can also be integrated into [PD], this form is not conve

### Step 1. Start a TiDB cluster

#### Solution A. Use TiUP (Recommended)

[TiUP] is the offical component manager for [TiDB]. It can help you set up a local TiDB cluster in a few minutes.

Download and install TiUP:
Expand All @@ -40,73 +38,7 @@ Start a local TiDB cluster:
tiup playground nightly
```

> Note: you might notice that there is already a TiDB Dashboard integrated into the PD started by TiUP. For development purpose, we will not use the that TiDB Dashboard. Please keep following the rest of the steps in this document.
#### Solution B. Download and Run Binary Manually

<details>

Alternatively, you can deploy a cluster with binary files manually.

1. Download binaries

Linux:

```bash
mkdir tidb_cluster
cd tidb_cluster
wget https://download.pingcap.org/tidb-nightly-linux-amd64.tar.gz
tar -xzf tidb-nightly-linux-amd64.tar.gz
cd tidb-nightly-linux-amd64
```

MacOS:

```bash
mkdir tidb_cluster
cd tidb_cluster
wget https://download.pingcap.org/tidb-nightly-darwin-amd64.tar.gz
wget https://download.pingcap.org/tikv-nightly-darwin-amd64.tar.gz
wget https://download.pingcap.org/pd-nightly-darwin-amd64.tar.gz
mkdir tidb-nightly-darwin-amd64
tar -xzf tidb-nightly-darwin-amd64.tar.gz -C tidb-nightly-darwin-amd64 --strip-components=1
tar -xzf tikv-nightly-darwin-amd64.tar.gz -C tidb-nightly-darwin-amd64 --strip-components=1
tar -xzf pd-nightly-darwin-amd64.tar.gz -C tidb-nightly-darwin-amd64 --strip-components=1
cd tidb-nightly-darwin-amd64
```

2. Start a PD server

```bash
./bin/pd-server --name=pd --data-dir=pd --client-urls=http://127.0.0.1:2379 --log-file=pd.log
# Now pd-server is listen on port 2379
```

3. Start a TiKV server

Open a new terminal:

```bash
./bin/tikv-server --addr="127.0.0.1:20160" --pd-endpoints="127.0.0.1:2379" --data-dir=tikv --log-file=./tikv.log
# Now tikv-server is listen on port 20160
```

4. Start a TiDB server

Open a new terminal:

```bash
./bin/tidb-server --store=tikv --path="127.0.0.1:2379" --log-file=tidb.log
# Now tidb-server is listen on port 4000
```

5. Use mysql-client to check everything works fine:

```bash
mysql -h 127.0.0.1 -P 4000 -uroot
```

</details>
You might notice that there is already a TiDB Dashboard integrated into the PD started by TiUP. For development purpose, it will not be used intentionally.

### Step 2. Prepare Prerequisites

Expand All @@ -124,7 +56,7 @@ The followings are required for developing TiDB Dashboard:
1. Clone the repository:

```bash
git clone https://github.com/pingcap-incubator/tidb-dashboard.git
git clone https://github.com/pingcap/tidb-dashboard.git
cd tidb-dashboard
```

Expand All @@ -144,34 +76,42 @@ The followings are required for developing TiDB Dashboard:
yarn start
```

1. That's it! You can access TiDB Dashboard now:

TiDB Dashboard UI: http://127.0.0.1:3001

Swagger UI for TiDB Dashboard APIs: http://localhost:12333/dashboard/api/swagger
1. That's it! You can access TiDB Dashboard now: http://127.0.0.1:3001

### Step 4. Run E2E Tests (optional)

Now we have only a few e2e tests in the `ui/tests` folder, you can contribute more for it.

After finishing the above steps, we can run the tests by following commands:
When back-end server and front-end server are both started, E2E tests can be run by:

```bash
cd ui/tests
yarn
yarn test
```

### Step 5. Run Storybook Playground (optional)
> Now we have only a few e2e tests. Contributions are welcome!
## Additional Guides

### Swagger UI

We use [Swagger] to generate the API server and corresponding clients. Swagger provides a web UI in which you can
see all TiDB Dashboard API endpoints and specifications, or even send API requests.

Swagger UI is available at http://localhost:12333/dashboard/api/swagger after the above Step 3 is finished.

### Storybook

We expose some UI components in a playground provided by [React Storybook]. In the playground you can see what
components look like and how to use them.

After finishing the above steps, we can run the storybook playground by following commands:
Storybook can be started using the following commands:

```bash
cd ui
yarn storybook
```

You can add more stories for your components to the playground.
> We have not yet make all components available in the Storybook. Contributions are welcome!
## Contribution flow

Expand Down Expand Up @@ -256,3 +196,5 @@ The body of the commit message should describe why the change was made and at a
[tidb]: https://github.com/pingcap/tidb
[tikv]: https://github.com/tikv/tikv
[tiup]: https://tiup.io
[Swagger]: https://swagger.io
[React Storybook]: https://storybook.js.org
26 changes: 26 additions & 0 deletions etc/manualTestEnv/_shared/Vagrantfile.partial.pubKey.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Vagrant.configure("2") do |config|
ssh_pub_key = File.readlines("#{File.dirname(__FILE__)}/vagrant_key.pub").first.strip

config.vm.box = "hashicorp/bionic64"
config.vm.provision "zsh", type: "shell", privileged: false, inline: <<-SHELL
echo "Installing zsh"
sudo apt install -y zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
sudo chsh -s /usr/bin/zsh vagrant
SHELL

config.vm.provision "private_key", type: "shell", privileged: false, inline: <<-SHELL
echo "Inserting private key"
echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys
SHELL

config.vm.provision "ulimit", type: "shell", privileged: true, inline: <<-SHELL
echo "Setting ulimit"
echo "fs.file-max = 65535" >> /etc/sysctl.conf
sysctl -p
echo "* hard nofile 65535" >> /etc/security/limits.conf
echo "* soft nofile 65535" >> /etc/security/limits.conf
echo "root hard nofile 65535" >> /etc/security/limits.conf
echo "root hard nofile 65535" >> /etc/security/limits.conf
SHELL
end
12 changes: 0 additions & 12 deletions etc/manualTestEnv/_shared/Vagrantfile.partial.pubKey.ruby

This file was deleted.

36 changes: 36 additions & 0 deletions etc/manualTestEnv/complexCase1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# complexCase1

TiDB, PD, TiKV, TiFlash each in different hosts.

## Usage

1. Start the box:

```bash
VAGRANT_EXPERIMENTAL="disks" vagrant up
```

1. Use [TiUP](https://tiup.io/) to deploy the cluster to the box (only need to do it once):

```bash
tiup cluster deploy complexCase1 v4.0.8 topology.yaml -i ../_shared/vagrant_key -y --user vagrant
```

1. Start the cluster in the box:

```bash
tiup cluster start complexCase1
```

1. Start TiDB Dashboard server:

```bash
bin/tidb-dashboard --pd http://10.0.1.31:2379
```

## Cleanup

```bash
tiup cluster destroy complexCase1 -y
vagrant destroy --force
```
40 changes: 40 additions & 0 deletions etc/manualTestEnv/complexCase1/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
load "#{File.dirname(__FILE__)}/../_shared/Vagrantfile.partial.pubKey.rb"

Vagrant.configure("2") do |config|
config.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 1
end

(1..5).each do |i|
config.vm.define "node#{i}" do |node|
node.vm.network "private_network", ip: "10.0.1.#{i+30}"
(1..4).each do |j|
node.vm.disk :disk, size: "10GB", name: "disk-#{i}-#{j}"
end
end
end

config.vm.provision "disk", type: "shell", privileged: false, inline: <<-SHELL
echo "Formatting disks"
sudo mkfs.ext4 -j -L hdd1 /dev/sdb
sudo mkfs.ext4 -j -L hdd2 /dev/sdc
sudo mkfs.ext4 -j -L hdd3 /dev/sdd
sudo mkfs.ext4 -j -L hdd4 /dev/sde
echo "Mounting directories"
sudo mkdir -p /pingcap/tidb-data
echo "/dev/sdb /pingcap/tidb-data ext4 defaults 0 0" | sudo tee -a /etc/fstab
sudo mount /pingcap/tidb-data
sudo mkdir -p /pingcap/tidb-deploy
sudo mkdir -p /pingcap/tidb-data/tikv-1
sudo mkdir -p /pingcap/tidb-data/tikv-2
echo "/dev/sdc /pingcap/tidb-deploy ext4 defaults 0 0" | sudo tee -a /etc/fstab
echo "/dev/sdd /pingcap/tidb-data/tikv-1 ext4 defaults 0 0" | sudo tee -a /etc/fstab
echo "/dev/sde /pingcap/tidb-data/tikv-2 ext4 defaults 0 0" | sudo tee -a /etc/fstab
sudo mount /pingcap/tidb-deploy
sudo mount /pingcap/tidb-data/tikv-1
sudo mount /pingcap/tidb-data/tikv-2
SHELL
end
Loading

0 comments on commit 6c8be22

Please sign in to comment.