Skip to content

Commit 2046f85

Browse files
yongmanJaySon-Huang
authored andcommitted
Add workflow actions to build image
Signed-off-by: yongman <[email protected]>
1 parent ba1ad1e commit 2046f85

File tree

5 files changed

+189
-1
lines changed

5 files changed

+189
-1
lines changed

Diff for: .github/workflows/bug-closed.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Bug Closed
2+
3+
on:
4+
issues:
5+
types:
6+
- closed
7+
8+
jobs:
9+
label_issues:
10+
if: |
11+
contains(github.event.issue.labels.*.name, 'type/bug') &&
12+
!(contains(join(github.event.issue.labels.*.name, ', '), 'affects-') &&
13+
contains(join(github.event.issue.labels.*.name, ', '), 'fixes-'))
14+
runs-on: ubuntu-latest
15+
permissions:
16+
issues: write
17+
steps:
18+
- name: Label issues
19+
uses: andymckay/[email protected]
20+
with:
21+
add-labels: "needs-more-info"
22+
repo-token: ${{ secrets.GITHUB_TOKEN }}
23+
- name: Add comment
24+
uses: peter-evans/[email protected]
25+
with:
26+
issue-number: ${{ github.event.issue.number }}
27+
body: |
28+
Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Diff for: .github/workflows/cicd.yml

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: CICD
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
gcr_target:
7+
description: "push to gcr for daily run (leave empty to skip)"
8+
type: choice
9+
required: false
10+
default: ""
11+
options:
12+
- ""
13+
- "tiflash"
14+
- "tiflash-compute"
15+
16+
jobs:
17+
build-arm64:
18+
name: Build ARM64 Image
19+
runs-on: arm64
20+
timeout-minutes: 180
21+
steps:
22+
- name: Checkout repository and submodules
23+
uses: actions/checkout@v2
24+
with:
25+
submodules: recursive
26+
ref: ${{ github.ref_name }}
27+
fetch-depth: 0
28+
29+
- name: Build Docker Image
30+
run: |
31+
docker build -f release-centos7-llvm/dockerfiles/Dockerfile-tiflash-cse-multiarch -t xexplorersun/tiflash:cse-${{ github.sha }}-arm64 .
32+
- name: Push image
33+
run: |
34+
docker push xexplorersun/tiflash:cse-${{ github.sha }}-arm64
35+
build-amd64:
36+
name: Build AMD64 Image
37+
runs-on: amd64
38+
timeout-minutes: 180
39+
outputs:
40+
image: tiflash-cse:${{ github.sha }}-amd64
41+
steps:
42+
- name: Checkout repository and submodules
43+
uses: actions/checkout@v2
44+
with:
45+
submodules: recursive
46+
ref: ${{ github.event.inputs.branch }}
47+
fetch-depth: 0
48+
49+
- name: Build Docker Image
50+
run: |
51+
docker build -f release-centos7-llvm/dockerfiles/Dockerfile-tiflash-cse-multiarch -t xexplorersun/tiflash:cse-${{ github.sha }}-amd64 .
52+
- name: Push image
53+
run: |
54+
docker push xexplorersun/tiflash:cse-${{ github.sha }}-amd64
55+
multi-arch:
56+
name: Create Multi-Architecture Image
57+
runs-on: arm64
58+
needs: ["build-arm64", "build-amd64"]
59+
steps:
60+
- name: create-manifest
61+
run: |
62+
docker manifest create xexplorersun/tiflash:cse-${{ github.sha }} \
63+
--amend xexplorersun/tiflash:cse-${{ github.sha }}-amd64 \
64+
--amend xexplorersun/tiflash:cse-${{ github.sha }}-arm64
65+
- name: push-manifest
66+
run: |
67+
docker manifest push xexplorersun/tiflash:cse-${{ github.sha }}
68+
69+
sync-image-tiflash:
70+
name: Sync image to GCR tiflash
71+
runs-on: arm64
72+
needs: ["multi-arch"]
73+
if: ${{ inputs.gcr_target == 'tiflash' }}
74+
steps:
75+
- name: create-manifest
76+
run: |
77+
docker manifest create xexplorersun/tiflash:v6.6.0 \
78+
--amend xexplorersun/tiflash:cse-${{ github.sha }}-amd64 \
79+
--amend xexplorersun/tiflash:cse-${{ github.sha }}-arm64
80+
- name: push-manifest
81+
run: |
82+
docker manifest push xexplorersun/tiflash:v6.6.0
83+
84+
sync-image-tiflash-compute:
85+
name: Sync image to GCR tiflash-compute
86+
runs-on: arm64
87+
needs: ["multi-arch"]
88+
if: ${{ inputs.gcr_target == 'tiflash-compute' }}
89+
steps:
90+
- name: create-manifest
91+
run: |
92+
docker manifest create xexplorersun/tiflash-compute:v6.6.0 \
93+
--amend xexplorersun/tiflash:cse-${{ github.sha }}-amd64 \
94+
--amend xexplorersun/tiflash:cse-${{ github.sha }}-arm64
95+
- name: push-manifest
96+
run: |
97+
docker manifest push xexplorersun/tiflash-compute:v6.6.0

Diff for: .github/workflows/license-checker.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: License checker
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
check-license:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Check License Header
18+
uses: apache/[email protected]
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
with:
22+
log: info
23+
config: .github/licenserc.yml

Diff for: README.md

-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ python3 release-centos7-llvm/scripts/run-clang-tidy.py -p cmake-build-debug -j 2
396396
# if there are too much errors, you can try to run the script again with `-fix`
397397
python3 format-diff.py --diff_from $merge_base
398398
```
399-
400399
## License
401400

402401
TiFlash is under the Apache 2.0 license. See the [LICENSE](./LICENSE) file for details.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright 2022 PingCAP, Ltd.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM hub.pingcap.net/tiflash/tiflash-llvm-base:multi-arch as builder
16+
17+
# copy tiflash directory to /build/tics
18+
COPY . /build/tics
19+
20+
# build tiflash release
21+
RUN sh /build/tics/release-centos7-llvm/scripts/build-release.sh
22+
23+
# package
24+
FROM hub.pingcap.net/tiflash/centos:7.9.2009-multi-arch
25+
26+
USER root
27+
WORKDIR /root/
28+
29+
ENV HOME /root/
30+
ENV TZ Asia/Shanghai
31+
ENV LD_LIBRARY_PATH /tiflash
32+
33+
RUN yum makecache && \
34+
yum -y install gdb strace net-tools bind-utils lsof tcpdump && \
35+
yum clean all && \
36+
rm -rf /var/cache/yum && \
37+
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
38+
39+
COPY --from=builder /build/tics/release-centos7-llvm/tiflash /tiflash
40+
41+
ENTRYPOINT ["/tiflash/tiflash", "server"]

0 commit comments

Comments
 (0)