From 71c15fac91ce965266649778a5e06a2b612049dd Mon Sep 17 00:00:00 2001 From: lance6716 Date: Fri, 28 May 2021 09:59:35 +0800 Subject: [PATCH] This is an automated cherry-pick of #1698 Signed-off-by: ti-chi-bot --- .github/workflows/binlog-999999.yml | 4 +- .github/workflows/chaos-mesh.yml | 70 ++++++++++++++++++++++++++ .github/workflows/upgrade-via-tiup.yml | 53 +++++++++++++++++++ .github/workflows/upstream-switch.yml | 10 ++++ CONTRIBUTING.md | 2 +- Dockerfile | 2 +- go.mod | 2 +- go.sum | 3 -- step_by_step_contribute.md | 2 +- tests/tiup/docker/control/Dockerfile | 2 +- tests/tiup/docker/node/Dockerfile | 2 +- tools/go.mod | 2 +- 12 files changed, 142 insertions(+), 12 deletions(-) diff --git a/.github/workflows/binlog-999999.yml b/.github/workflows/binlog-999999.yml index b43afc81db..c56ea20c81 100644 --- a/.github/workflows/binlog-999999.yml +++ b/.github/workflows/binlog-999999.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-18.04 steps: - - name: Set up Go 1.13 + - name: Set up Go 1.16 uses: actions/setup-go@v2 with: - go-version: 1.13 + go-version: 1.16 - name: Check out code uses: actions/checkout@v2 diff --git a/.github/workflows/chaos-mesh.yml b/.github/workflows/chaos-mesh.yml index 19a82a4794..8e2a3038d4 100644 --- a/.github/workflows/chaos-mesh.yml +++ b/.github/workflows/chaos-mesh.yml @@ -49,6 +49,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: +<<<<<<< HEAD # Set up Go for building DM, now it's v1.16 - name: Set up Go 1.16 uses: actions/setup-go@v2 @@ -73,6 +74,75 @@ jobs: path: | **/tools key: ${{ runner.os }}-dm-tools-${{ hashFiles('**/tools/go.sum') }} +======= + # Set up Go for building DM, now it's v1.16 + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: 1.16 + - name: Print Go version + run: go version + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Check out code + uses: actions/checkout@v2 + + - name: Cache go modules + uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-dm-${{ hashFiles('**/go.sum') }} + + - name: Cache tools + uses: actions/cache@v2 + with: + path: | + **/tools + key: ${{ runner.os }}-dm-tools-${{ hashFiles('**/tools/go.sum') }} + + # Set up Kubernetes IN Docker + # - name: Set up kind cluster + # uses: helm/kind-action@v1.0.0 + # with: + # cluster_name: dm-chaos + # Set up Kubernetes with K3s + - name: Set up K3s cluster + run: | + curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.18.9+k3s1 sh -s - \ + --write-kubeconfig-mode=644 \ + "${k3s_disable_command:---disable}" metrics-server \ + "${k3s_disable_command:---disable}" traefik \ + --flannel-backend=none \ + --docker + shell: bash + # this may be failed sometimes, and I want to exit the workflow directly if failed, + # but GitHub Actions doesnt' support early-exit yet, see https://github.com/actions/runner/issues/662. + # so, simply wait for a long time. + - name: Wait for coredns + run: | + kubectl rollout status --watch --timeout 600s deployment/coredns -n kube-system + shell: bash + env: + KUBECONFIG: /etc/rancher/k3s/k3s.yaml + - name: Export KUBECONFIG environment variable + run: | + echo 'KUBECONFIG=/etc/rancher/k3s/k3s.yaml' >> $GITHUB_ENV + shell: bash + - name: Print cluster information + run: | + kubectl config view + kubectl cluster-info + kubectl get nodes + kubectl get pods -n kube-system + kubectl get sc + kubectl version + + # Disable AppArmor for MySQL, see https://github.com/moby/moby/issues/7512#issuecomment-61787845 + - name: Disable AppArmor for MySQL + run: | + sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ + sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld +>>>>>>> 0ec1f8df9 (*: update go version to 1.16 (#1698)) # Set up Kubernetes IN Docker # - name: Set up kind cluster diff --git a/.github/workflows/upgrade-via-tiup.yml b/.github/workflows/upgrade-via-tiup.yml index 788d63f707..46b9bb26c5 100644 --- a/.github/workflows/upgrade-via-tiup.yml +++ b/.github/workflows/upgrade-via-tiup.yml @@ -22,6 +22,7 @@ jobs: working-directory: ${{ github.workspace }}/go/src/github.com/pingcap/dm steps: +<<<<<<< HEAD - name: Set up Go 1.16 uses: actions/setup-go@v2 with: @@ -34,6 +35,20 @@ jobs: - name: Setup containers working-directory: ${{ env.working-directory }} run: | +======= + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: 1.16 + - name: Check out code + uses: actions/checkout@v2 + with: + path: go/src/github.com/pingcap/dm + + - name: Setup containers + working-directory: ${{ env.working-directory }} + run: | +>>>>>>> 0ec1f8df9 (*: update go version to 1.16 (#1698)) cd ${{ env.working-directory }}/tests/tiup/docker GOPATH=${GITHUB_WORKSPACE}/go docker-compose up -d @@ -77,6 +92,7 @@ jobs: previous_v2: ["v2.0.0", "v2.0.1", "v2.0.3", "v2.0.4"] steps: +<<<<<<< HEAD - name: Set up Go 1.16 uses: actions/setup-go@v2 with: @@ -94,6 +110,26 @@ jobs: - name: Package files if: ${{ github.ref != 'refs/heads/master' }} run: | +======= + + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: 1.16 + - name: Check out code + uses: actions/checkout@v2 + with: + path: go/src/github.com/pingcap/dm + + - name: Build + if: ${{ github.ref != 'refs/heads/master' }} + working-directory: ${{ env.working-directory }} + run: make build nolint=true + + - name: Package files + if: ${{ github.ref != 'refs/heads/master' }} + run: | +>>>>>>> 0ec1f8df9 (*: update go version to 1.16 (#1698)) mkdir ${{ github.workspace }}/package cd ${{ github.workspace }}/package @@ -188,6 +224,7 @@ jobs: env: working-directory: ${{ github.workspace }}/go/src/github.com/pingcap/dm steps: +<<<<<<< HEAD - name: Set up Go 1.16 uses: actions/setup-go@v2 with: @@ -202,6 +239,22 @@ jobs: - name: Setup containers working-directory: ${{ env.working-directory }} run: | +======= + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: 1.16 + + - name: Check out code + uses: actions/checkout@v2 + with: + path: go/src/github.com/pingcap/dm + + # TODO: support more versions + - name: Setup containers + working-directory: ${{ env.working-directory }} + run: | +>>>>>>> 0ec1f8df9 (*: update go version to 1.16 (#1698)) cd ${{ env.working-directory }}/tests/tiup/docker sed -i "s/tidb:v4.0.7/tidb:v3.0.19/g" docker-compose.yml GOPATH=${GITHUB_WORKSPACE}/go docker-compose up -d diff --git a/.github/workflows/upstream-switch.yml b/.github/workflows/upstream-switch.yml index f0752def26..9a84b1a537 100644 --- a/.github/workflows/upstream-switch.yml +++ b/.github/workflows/upstream-switch.yml @@ -14,10 +14,20 @@ jobs: runs-on: ubuntu-18.04 steps: +<<<<<<< HEAD - name: Set up Go 1.16 uses: actions/setup-go@v2 with: go-version: 1.16 +======= + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: 1.16 + + - name: Check out code + uses: actions/checkout@v2 +>>>>>>> 0ec1f8df9 (*: update go version to 1.16 (#1698)) - name: Check out code uses: actions/checkout@v2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d2f729e34d..31503c5648 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,7 @@ See [Step by Step Contribute Example](step_by_step_contribute.md) for a more det Developing DM requires: -* [Go 1.13+](http://golang.org/doc/code.html) +* [Go 1.16+](http://golang.org/doc/code.html) * An internet connection to download the dependencies Simply run `make` to build the program. diff --git a/Dockerfile b/Dockerfile index d228127e68..0663009aa2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.13-alpine as builder +FROM golang:1.16-alpine as builder MAINTAINER siddontang RUN apk add --no-cache git make diff --git a/go.mod b/go.mod index 5b8473bc5d..24eccefe7a 100644 --- a/go.mod +++ b/go.mod @@ -48,4 +48,4 @@ require ( gopkg.in/yaml.v2 v2.4.0 ) -go 1.13 +go 1.16 diff --git a/go.sum b/go.sum index 8c8bcabdc7..9f4580e88b 100644 --- a/go.sum +++ b/go.sum @@ -165,7 +165,6 @@ github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMe github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/codahale/hdrhistogram v0.9.0 h1:9GjrtRI+mLEFPtTfR/AZhcxp+Ii8NZYWq5104FbZQY0= github.com/codahale/hdrhistogram v0.9.0/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/colinmarc/hdfs/v2 v2.1.1/go.mod h1:M3x+k8UKKmxtFu++uAZ0OtDU8jR3jnaZIAc6yK4Ue0c= github.com/coocood/badger v1.5.1-0.20200515070411-e02af0688441/go.mod h1:klY8SfH2lNZ/23/SIxwHoJw+T6wYGB12YPCF9MUoiu0= @@ -271,7 +270,6 @@ github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHqu github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= github.com/frankban/quicktest v1.11.1 h1:stwUsXhUGliQs9t0ZS39BWCltFdOHgABiIlihop8AD4= github.com/frankban/quicktest v1.11.1/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsouza/fake-gcs-server v1.15.0/go.mod h1:HNxAJ/+FY/XSsxuwz8iIYdp2GtMmPbJ8WQjjGMxd6Qk= github.com/fsouza/fake-gcs-server v1.17.0/go.mod h1:D1rTE4YCyHFNa99oyJJ5HyclvN/0uQR+pM/VdlL83bw= @@ -1094,7 +1092,6 @@ github.com/xitongsys/parquet-go v1.5.1/go.mod h1:xUxwM8ELydxh4edHGegYq1pA8NnMKDx github.com/xitongsys/parquet-go v1.5.5-0.20201110004701-b09c49d6d457 h1:tBbuFCtyJNKT+BFAv6qjvTFpVdy97IYNaBwGUXifIUs= github.com/xitongsys/parquet-go v1.5.5-0.20201110004701-b09c49d6d457/go.mod h1:pheqtXeHQFzxJk45lRQ0UIGIivKnLXvialZSFWs81A8= github.com/xitongsys/parquet-go-source v0.0.0-20190524061010-2b72cbee77d5/go.mod h1:xxCx7Wpym/3QCo6JhujJX51dzSXrwmb0oH6FQb39SEA= -github.com/xitongsys/parquet-go-source v0.0.0-20200817004010-026bad9b25d0 h1:a742S4V5A15F93smuVxA60LQWsrCnN8bKeWDBARU1/k= github.com/xitongsys/parquet-go-source v0.0.0-20200817004010-026bad9b25d0/go.mod h1:HYhIKsdns7xz80OgkbgJYrtQY7FjHWHKH6cvN7+czGE= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xo/dburl v0.0.0-20191219122722-3cca8608d645/go.mod h1:A47W3pdWONaZmXuLZgfKLAVgUY0qvfTRM5vVDKS40S4= diff --git a/step_by_step_contribute.md b/step_by_step_contribute.md index 21d95140ce..22357b5672 100644 --- a/step_by_step_contribute.md +++ b/step_by_step_contribute.md @@ -30,7 +30,7 @@ git remote -v # Confirms that your remote makes sense > **Note:** > - > DM uses [`Go Modules`](https://github.com/golang/go/wiki/Modules) to manage dependencies. The version of Go should be **1.13** or above. + > DM uses [`Go Modules`](https://github.com/golang/go/wiki/Modules) to manage dependencies. The version of Go should be **1.16** or above. You'll need `GOPATH` defined, and `PATH` modified to access your Go binaries. A common setup is the following but you could always google a setup for your own diff --git a/tests/tiup/docker/control/Dockerfile b/tests/tiup/docker/control/Dockerfile index 2f181107e9..4259330abc 100644 --- a/tests/tiup/docker/control/Dockerfile +++ b/tests/tiup/docker/control/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.13 +FROM golang:1.16 RUN apt-get -y -q update && \ apt-get -y -q install software-properties-common && \ diff --git a/tests/tiup/docker/node/Dockerfile b/tests/tiup/docker/node/Dockerfile index 687ec5fc91..afef0f4fe6 100644 --- a/tests/tiup/docker/node/Dockerfile +++ b/tests/tiup/docker/node/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.13 +FROM golang:1.16 RUN apt-get update && \ apt-get -y install \ diff --git a/tools/go.mod b/tools/go.mod index d597b81966..0acb7e8e68 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,6 +1,6 @@ module github.com/pingcap/dm/tools -go 1.13 +go 1.16 require ( github.com/gogo/protobuf v1.3.1