From a9c0fe8c30b1952db0f25f47e4f9fdba94144fac Mon Sep 17 00:00:00 2001 From: tison Date: Sun, 10 Jul 2022 21:18:17 +0800 Subject: [PATCH 1/6] ci: debug buildx platforms Signed-off-by: tison --- .github/workflows/daily-ci.yaml | 12 ------------ .travis.yml | 0 2 files changed, 12 deletions(-) create mode 100644 .travis.yml diff --git a/.github/workflows/daily-ci.yaml b/.github/workflows/daily-ci.yaml index 5d043c45fc1..af4d740c71f 100644 --- a/.github/workflows/daily-ci.yaml +++ b/.github/workflows/daily-ci.yaml @@ -27,10 +27,6 @@ on: jobs: build-docker-image: name: Build Docker Image - if: | - (github.event_name != 'pull_request') || - (github.event.action == 'labeled' && github.event.label.name == 'needs-daily-ci') || - (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'needs-daily-ci')) runs-on: ubuntu-18.04 steps: - name: Checkout Code Base @@ -39,13 +35,5 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - name: Available platforms run: echo ${{ steps.buildx.outputs.platforms }} - - - name: Build Docker Image - run: | - docker buildx build --platform linux/amd64,linux/arm64 . diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000000..e69de29bb2d From e239cd44c06aba147a88fee04c62152a95d5cf16 Mon Sep 17 00:00:00 2001 From: tison Date: Sun, 10 Jul 2022 21:31:09 +0800 Subject: [PATCH 2/6] ci: debug buildx platforms on travis Signed-off-by: tison --- .github/workflows/daily-ci.yaml | 39 --------------------------------- .travis.yml | 34 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/daily-ci.yaml diff --git a/.github/workflows/daily-ci.yaml b/.github/workflows/daily-ci.yaml deleted file mode 100644 index af4d740c71f..00000000000 --- a/.github/workflows/daily-ci.yaml +++ /dev/null @@ -1,39 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -name: Daily CI - -on: - pull_request: - types: [opened, synchronize, reopened, labeled] - schedule: - - cron: '0 1 * * *' - workflow_dispatch: - -jobs: - build-docker-image: - name: Build Docker Image - runs-on: ubuntu-18.04 - steps: - - name: Checkout Code Base - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Available platforms - run: echo ${{ steps.buildx.outputs.platforms }} diff --git a/.travis.yml b/.travis.yml index e69de29bb2d..4f918eac082 100644 --- a/.travis.yml +++ b/.travis.yml @@ -0,0 +1,34 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +language: cpp + +arch: + - amd64 + - arm64 + +os: linux + +services: + - docker + +compiler: + - gcc + - clang + +script: + - docker buildx inspect From ae7fe38e85a0a4f212c62c3a51a9c8d12548a39f Mon Sep 17 00:00:00 2001 From: tison Date: Sun, 10 Jul 2022 21:41:49 +0800 Subject: [PATCH 3/6] docker build on amd64 and arm64 Signed-off-by: tison --- .travis.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4f918eac082..be497fb00ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,9 +26,5 @@ os: linux services: - docker -compiler: - - gcc - - clang - script: - - docker buildx inspect + - docker build . From d3296559d6e739c082e41a5dbda2013de2191fd2 Mon Sep 17 00:00:00 2001 From: tison Date: Sun, 10 Jul 2022 22:01:50 +0800 Subject: [PATCH 4/6] stick to focal dist Signed-off-by: tison --- .travis.yml | 1 + Dockerfile | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index be497fb00ae..33ccff8bb1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,7 @@ arch: - arm64 os: linux +dist: focal services: - docker diff --git a/Dockerfile b/Dockerfile index 1b16e699ced..0cb152fa6c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,23 +15,23 @@ # specific language governing permissions and limitations # under the License. -FROM ubuntu:22.04 as build +FROM ubuntu:focal as build -RUN apt update && apt install -y cmake make git autoconf libtool g++ +RUN apt update +RUN apt install -y cmake make git autoconf libtool g++ WORKDIR /kvrocks COPY . . -RUN mkdir docker-build && ./build.sh docker-build +RUN ./build.sh - -FROM ubuntu:22.04 +FROM ubuntu:focal WORKDIR /kvrocks -COPY --from=build /kvrocks/docker-build/kvrocks ./bin/ +COPY --from=build /kvrocks/build/kvrocks ./bin/ COPY ./kvrocks.conf ./conf/ -RUN sed -i -e 's|dir /tmp/kvrocks|dir /var/lib/kvrocks|g' ./conf/kvrocks.conf +RUN sed -i -e 's%dir /tmp/kvrocks%dir /var/lib/kvrocks%g' ./conf/kvrocks.conf VOLUME /var/lib/kvrocks EXPOSE 6666:6666 From 2d0594ead5480111529005bb59377486ef356322 Mon Sep 17 00:00:00 2001 From: tison Date: Sun, 10 Jul 2022 22:17:43 +0800 Subject: [PATCH 5/6] workaround tzdata install hanging Signed-off-by: tison --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 0cb152fa6c0..3d8e00ee950 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,10 @@ FROM ubuntu:focal as build +# workaround tzdata install hanging +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + RUN apt update RUN apt install -y cmake make git autoconf libtool g++ WORKDIR /kvrocks From 3b410c1abbaceff53941cab7adcacd858daeec35 Mon Sep 17 00:00:00 2001 From: tison Date: Sun, 10 Jul 2022 22:21:27 +0800 Subject: [PATCH 6/6] build to build/ Signed-off-by: tison --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3d8e00ee950..f8a88495275 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,7 @@ RUN apt install -y cmake make git autoconf libtool g++ WORKDIR /kvrocks COPY . . -RUN ./build.sh +RUN ./build.sh build FROM ubuntu:focal