From c4ac63f4bf4ab4e4ef843068ad7d8af03f49af75 Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Tue, 13 Feb 2024 11:31:05 -0500 Subject: [PATCH] Mothball the project Signed-off-by: Cole Miller --- .github/workflows/build-and-test.yml | 106 ----------------------- .github/workflows/cla-check.yml | 11 --- .github/workflows/configure.yml | 123 --------------------------- .github/workflows/coverity.yml | 52 ----------- .github/workflows/downstream.yml | 95 --------------------- .github/workflows/linting.yml | 19 ----- .github/workflows/packages.yml | 61 ------------- .github/workflows/xarch.yml | 28 ------ .travis.yml | 46 ---------- CONTRIBUTING | 2 - README.md | 22 ++++- README_CH.md | 21 ++++- 12 files changed, 40 insertions(+), 546 deletions(-) delete mode 100644 .github/workflows/build-and-test.yml delete mode 100644 .github/workflows/cla-check.yml delete mode 100644 .github/workflows/configure.yml delete mode 100644 .github/workflows/coverity.yml delete mode 100644 .github/workflows/downstream.yml delete mode 100644 .github/workflows/linting.yml delete mode 100644 .github/workflows/packages.yml delete mode 100644 .github/workflows/xarch.yml delete mode 100644 .travis.yml delete mode 100644 CONTRIBUTING diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml deleted file mode 100644 index 0b7ce6fe4..000000000 --- a/.github/workflows/build-and-test.yml +++ /dev/null @@ -1,106 +0,0 @@ -name: CI Tests - -on: - - push - - pull_request - -jobs: - build-and-test: - strategy: - fail-fast: false - matrix: - os: - - ubuntu-20.04 - - ubuntu-22.04 - compiler: - - gcc - - clang - tracing: - - LIBRAFT_TRACE=1 - - NOLIBRAFT_TRACE=1 - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v3 - - name: Setup dependencies - run: | - sudo apt-get update -qq - sudo apt-get install -qq lcov linux-libc-dev liblz4-dev libuv1-dev btrfs-progs xfsprogs zfsutils-linux - - - name: Build - env: - CC: ${{ matrix.compiler }} - run: | - git clone --depth 1 https://github.com/edlund/amalgamate.git - export PATH=$PATH:$PWD/amalgamate - autoreconf -i - ./configure --enable-example --enable-debug --enable-code-coverage --enable-sanitize - amalgamate.py --config=amalgamation.json --source=$(pwd) - $CC raft.c -c -D_GNU_SOURCE -DHAVE_LINUX_AIO_ABI_H -Wall -Wextra -Wpedantic -fpic - - - name: Test - env: - CC: ${{ matrix.compiler }} - run: | - export ${{ matrix.tracing }} - ./test/lib/fs.sh setup - make check $(./test/lib/fs.sh detect) || (cat ./test-suite.log && false) - ./test/lib/fs.sh teardown - - - name: Coverage - env: - CC: ${{ matrix.compiler }} - run: if [ "${CC}" = "gcc" ]; then make code-coverage-capture; fi - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 - with: - verbose: true - - build-and-test-nolz4: - strategy: - fail-fast: false - matrix: - os: - - ubuntu-20.04 - - ubuntu-22.04 - compiler: - - gcc - - clang - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v3 - - name: Setup dependencies - run: | - sudo apt-get update -qq - sudo apt-get install -qq lcov linux-libc-dev libuv1-dev btrfs-progs xfsprogs zfsutils-linux - - - name: Build - env: - CC: ${{ matrix.compiler }} - run: | - git clone --depth 1 https://github.com/edlund/amalgamate.git - export PATH=$PATH:$PWD/amalgamate - autoreconf -i - ./configure --enable-example --enable-debug --enable-code-coverage --enable-sanitize --disable-lz4 - amalgamate.py --config=amalgamation.json --source=$(pwd) - $CC raft.c -c -D_GNU_SOURCE -DHAVE_LINUX_AIO_ABI_H -Wall -Wextra -Wpedantic -fpic - - - name: Test - env: - CC: ${{ matrix.compiler }} - run: | - ./test/lib/fs.sh setup - make check CFLAGS=-O0 $(./test/lib/fs.sh detect) || (cat ./test-suite.log && false) - ./test/lib/fs.sh teardown - - - name: Coverage - env: - CC: ${{ matrix.compiler }} - run: if [ "${CC}" = "gcc" ]; then make code-coverage-capture; fi - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - verbose: true diff --git a/.github/workflows/cla-check.yml b/.github/workflows/cla-check.yml deleted file mode 100644 index b49bbeb18..000000000 --- a/.github/workflows/cla-check.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Canonical CLA - -on: - - pull_request - -jobs: - cla-check: - runs-on: ubuntu-20.04 - steps: - - name: Check if CLA signed - uses: canonical/has-signed-canonical-cla@v1 diff --git a/.github/workflows/configure.yml b/.github/workflows/configure.yml deleted file mode 100644 index f6e0fc845..000000000 --- a/.github/workflows/configure.yml +++ /dev/null @@ -1,123 +0,0 @@ -# Check that the ./configure script behaves as expected in various scenarios -name: Configure - -on: - - push - - pull_request - -jobs: - check: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Check that no optional dependency is installed - run: | - # Remove liblz4-dev which is installed by default on the runner - sudo apt-get remove liblz4-dev - # Check that there are no dependencies installed - ! pkg-config --exists libuv - ! pkg-config --exists liblz4 - - - name: Run autoreconf - run: | - autoreconf -i - - - name: With no deps ./configure - run: | - # Succeed, since we are not explicitly requiring libuv. - ./configure - - - name: With no deps ./configure --enable-uv - run: | - # Fail, since libuv is not installed. - ! ./configure --enable-uv 2>errors - tail -1 errors | grep -q "libuv required but not found" || (cat errors && false) - - - name: With no deps ./configure --with-lz4 - run: | - # Fail, since using lz4 makes sense only if libuv is used too. - ! ./configure --with-lz4 2>errors - tail -1 errors | grep -q "liblz4 can be used only if libuv is used too" || (cat errors && false) - - - name: Install libuv - run: | - sudo apt-get install -qq linux-libc-dev libuv1-dev - - - name: With libuv only ./configure - run: | - # Fail, since libuv is installed but liblz4 is not. - ! ./configure 2>errors - tail -1 errors | grep -q "liblz4 required but not found" || (cat errors && false) - - - name: With libuv only ./configure --with-lz4 - run: | - # Fail, since liblz4 is not installed. - ! ./configure --with-lz4 2>errors - tail -1 errors | grep -q "liblz4 required but not found" || (cat errors && false) - - - name: With libuv only ./configure --without-lz4 - run: | - # Succeed, since we support building without lz4 even if libuv is found, - # as long --without-lz4 is passed. - ./configure --without-lz4 - - - name: With libuv only ./configure --disable-uv --with-lz4 - run: | - # Fail, since using lz4 makes sense only if libuv is used too. - ! ./configure --disable-uv --with-lz4 2>errors - tail -1 errors | grep -q "liblz4 can be used only if libuv is used too" || (cat errors && false) - - - name: With libuv only ./configure --enable-lz4 - run: | - # Fail, since liblz4 is not installed. - ! ./configure --enable-lz4 2>errors - tail -1 errors | grep -q "liblz4 required but not found" || (cat errors && false) - - - name: Install liblz4 - run: | - sudo apt-get install -qq liblz4-dev - - - name: With libuv and liblz4 ./configure - run: | - # Succeed, since all optional dependencies are found and used. - ./configure - - - name: With libuv and liblz4 ./configure --without-lz4 - run: | - # Succeed, since we support building without lz4 even if both libuv and - # liblz4 are found. - ./configure --without-lz4 - - - name: With libuv and liblz4 ./configure --without-lz4 --enable-lz4 - run: | - # Fail, since enabling compression by default only makes sense if liblz4 - # is used. - ! ./configure --without-lz4 --enable-lz4 2>errors - tail -1 errors | grep -q "snapshot compression (either by default or not) requires liblz4" || (cat errors && false) - - - name: With libuv and liblz4 ./configure --without-lz4 --disable-lz4 - run: | - # Fail, since disabling compression by default only makes sense if - # liblz4 is used. - ! ./configure --without-lz4 --disable-lz4 2>errors - tail -1 errors | grep -q "snapshot compression (either by default or not) requires liblz4" || (cat errors && false) - - - name: With libuv and liblz4 ./configure --with-lz4 --enable-lz4 - run: | - # Succeed, since liblz4 is found and used. - ./configure --with-lz4 --enable-lz4 - - - name: With libuv and liblz4 ./configure --with-lz4 --disable-lz4 - run: | - # Succeed, since liblz4 is found and used. - ./configure --with-lz4 --disable-lz4 - - - name: With libuv and liblz4 ./configure --enable-lz4 - run: | - # Succeed, since liblz4 is used by default if found. - ./configure --enable-lz4 - - - name: With libuv and liblz4 ./configure --disable-lz4 - run: | - # Succeed, since liblz4 is used by default if found. - ./configure --disable-lz4 diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml deleted file mode 100644 index fd5ea8e4c..000000000 --- a/.github/workflows/coverity.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Coverity -on: - push: - branches: - - master - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Download Coverity Build Tool - run: | - wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=canonical/raft" -O cov-analysis-linux64.tar.gz - mkdir cov-analysis-linux64 - tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 - env: - TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} - - - name: Install dependencies - run: | - sudo apt-get update -qq - sudo apt-get install -qq lcov linux-libc-dev liblz4-dev libuv1-dev btrfs-progs xfsprogs zfsutils-linux - - - name: Run coverity - run: | - export PATH="$(pwd)/cov-analysis-linux64/bin:${PATH}" - - # Configure - autoreconf -i - mkdir build - cd build - ../configure - - # Build - cov-build --dir cov-int make -j4 - tar czvf raft.tgz cov-int - - # Submit the results - curl \ - --form project=canonical/raft \ - --form token=${TOKEN} \ - --form email=mathieu.bordere@canonical.com \ - --form file=@raft.tgz \ - --form version=master \ - --form description="${GITHUB_SHA}" \ - https://scan.coverity.com/builds?project=canonical/raft - env: - TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} - diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml deleted file mode 100644 index 9b0f0b5b8..000000000 --- a/.github/workflows/downstream.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: Downstream checks - -on: - issue_comment: - types: [created, edited] - -jobs: - dqlite: - if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, 'please test downstream') }} - runs-on: ubuntu-22.04 - steps: - - name: Install apt deps - run: | - sudo apt-get update -qq - sudo apt-get install -qq automake libtool gcc make liblz4-dev libuv1-dev libsqlite3-dev - - - name: Check out libbacktrace - uses: actions/checkout@v3 - with: - repository: ianlancetaylor/libbacktrace - path: libbacktrace - - - name: Install libbacktrace - run: | - cd libbacktrace - autoreconf -i - ./configure - sudo make -j$(nproc) install - sudo ldconfig - - - name: Check out raft - uses: actions/checkout@v3 - with: - ref: refs/pull/${{ github.event.issue.number }}/head - path: raft - - - name: Install raft - run: | - cd raft - autoreconf -i - ./configure --enable-debug --enable-uv --enable-sanitize --enable-backtrace - sudo make -j$(nproc) install - sudo ldconfig - - - name: Check out dqlite - uses: actions/checkout@v3 - with: - repository: canonical/dqlite - path: dqlite - - - name: Test and install dqlite - run: | - cd dqlite - autoreconf -i - ./configure --enable-debug --enable-sanitize --enable-backtrace - sudo make -j$(nproc) check || (cat ./test-suite.log && false) - sudo make install - sudo ldconfig - - - name: Install Go - uses: actions/setup-go@v4 - - - name: Check out go-dqlite - uses: actions/checkout@v3 - with: - repository: canonical/go-dqlite - path: go-dqlite - - - name: Test go-dqlite - env: - GO_DQLITE_MULTITHREAD: '1' - run: | - cd go-dqlite - go get -tags libsqlite3 -t ./... - go test -asan -v ./... - VERBOSE=1 ASAN=-asan ./test/dqlite-demo.sh - VERBOSE=1 ASAN=-asan DISK=1 ./test/dqlite-demo.sh - VERBOSE=1 ASAN=-asan ./test/roles.sh - VERBOSE=1 ASAN=-asan DISK=1 ./test/roles.sh - VERBOSE=1 ASAN=-asan ./test/recover.sh - VERBOSE=1 ASAN=-asan DISK=1 ./test/recover.sh - - jepsen: - if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, 'please test downstream') }} - uses: canonical/jepsen.dqlite/.github/workflows/test-build-run.yml@master - with: - raft-ref: refs/pull/${{ github.event.issue.number }}/head - workloads: > - ['append', 'bank', 'set'] - nemeses: > - ['none', 'partition', 'kill', 'stop', 'disk', 'member', - 'partition,stop', 'partition,kill', 'partition,member', - 'packet,stop', 'pause'] - disk: > - ['0'] diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml deleted file mode 100644 index 55ac9f4fb..000000000 --- a/.github/workflows/linting.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Linting - -on: - - push - - pull_request - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: DoozyX/clang-format-lint-action@v0.14 - with: - source: 'src test example' - exclude: 'test/lib/munit.*' - extensions: 'c,h' - clangFormatVersion: 14 - style: file \ No newline at end of file diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml deleted file mode 100644 index 9b4a049c6..000000000 --- a/.github/workflows/packages.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Build PPA source packages -on: - push: - branches: - - master -jobs: - build: - if: github.repository == 'canonical/raft' - strategy: - fail-fast: false - matrix: - target: - - focal - - jammy - - mantic - - noble - runs-on: ubuntu-20.04 - environment: - name: ppa - steps: - - name: Clone the repositories - run: | - git clone https://github.com/canonical/raft - git clone https://github.com/canonical/dqlite-ppa -b raft --depth 1 - - - name: Setup dependencies - run: | - sudo apt-get update -qq - sudo apt-get install -qq debhelper devscripts gnupg - - - name: Setup GPG signing key - env: - PPA_SECRET_KEY: ${{ secrets.PPA_SECRET_KEY }} - run: | - echo "$PPA_SECRET_KEY" > private-key.asc - gpg --import --batch private-key.asc - - - name: Delete GPG signing key file - if: always() - run: | - rm -f private-key.asc - - - name: Build source package - env: - DEBFULLNAME: "Github Actions" - DEBEMAIL: "dqlitebot@lists.canonical.com" - TARGET: ${{ matrix.target }} - run: | - cp -R dqlite-ppa/debian raft/ - cd raft/ - VERSION="$(git describe --tags | sed -e "s/^v//" -e "s/-/+git/")" - dch --create \ - --distribution ${TARGET} \ - --package raft-canonical \ - --newversion ${VERSION}~${TARGET}1 \ - "Automatic build from Github" - debuild -S -sa -d -k${{ vars.PPA_PUBLIC_KEY }} - - - name: Upload to Launchpad - run: | - dput -U -u ppa:dqlite/dev *.changes diff --git a/.github/workflows/xarch.yml b/.github/workflows/xarch.yml deleted file mode 100644 index d203d779a..000000000 --- a/.github/workflows/xarch.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: CI tests (32-bit) - -on: - - push - - pull_request - -jobs: - build: - strategy: - fail-fast: false - runs-on: ubuntu-22.04 - container: - image: ubuntu:22.04 - - steps: - - uses: actions/checkout@v3 - - name: Setup dependencies - run: | - dpkg --add-architecture i386 - apt-get update -qq - apt-get install -qq git build-essential python3 python-is-python3 gcc liblz4-dev:i386 libuv1-dev:i386 gcc-multilib - - - name: Build - run: | - git clone --depth 1 https://github.com/edlund/amalgamate.git - amalgamate/amalgamate.py --config=amalgamation.json --source=$(pwd) - gcc -std=gnu11 raft.c -m32 -shared -fPIC -o libraft.so -DHAVE_LINUX_AIO_ABI_H -DLZ4_AVAILABLE -DLZ4_ENABLED -Wall -Wextra -Wpedantic -Werror -luv -llz4 - ldd libraft.so diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 50b4226e4..000000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -language: c -addons: - apt: - packages: - - lcov - - linux-libc-dev - - libuv1-dev - - liblz4-dev - - btrfs-progs - - xfsprogs - - zfsutils-linux - -jobs: - include: - - if: type != pull_request - compiler: gcc - dist: bionic - arch: s390x - - - if: type == pull_request - compiler: gcc - dist: bionic - arch: arm64 - - - if: type != pull_request - compiler: clang - dist: bionic - arch: ppc64le - -before_script: - - git clone --depth 1 https://github.com/edlund/amalgamate.git - - export PATH=$PATH:$PWD/amalgamate - -script: - - autoreconf -i - - | - if [ $TRAVIS_CPU_ARCH = "s390x" ] || [ $TRAVIS_CPU_ARCH = "arm64" ]; then - ./configure --enable-example --enable-debug - else - ./configure --enable-example --enable-debug --enable-sanitize - fi - - amalgamate.py --config=amalgamation.json --source=$(pwd) - - $CC raft.c -c -D_GNU_SOURCE -DHAVE_LINUX_AIO_ABI_H -Wall -Wextra -Wpedantic -fpic - - ./test/lib/fs.sh setup - - make check $(./test/lib/fs.sh detect) || (cat ./test-suite.log && false) - - ./test/lib/fs.sh teardown diff --git a/CONTRIBUTING b/CONTRIBUTING deleted file mode 100644 index 8d97e1237..000000000 --- a/CONTRIBUTING +++ /dev/null @@ -1,2 +0,0 @@ -All contributors are asked to sign the Canonical Contributor Agreement Form at -https://ubuntu.com/legal/contributors/agreement diff --git a/README.md b/README.md index 0a624bc1b..eabf62f84 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,27 @@ -[![CI Tests](https://github.com/canonical/raft/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/canonical/raft/actions/workflows/build-and-test.yml) [![codecov](https://codecov.io/gh/canonical/raft/branch/master/graph/badge.svg)](https://codecov.io/gh/canonical/raft) [![Documentation Status](https://readthedocs.org/projects/raft/badge/?version=latest)](https://raft.readthedocs.io/en/latest/?badge=latest) +This project is unmaintained +============================ [English](./README.md)|[简体中文](./README_CH.md) +The dqlite team is no longer maintaining our raft implementation as an +independent project. Instead, the raft source code has been incorporated into +[canonical/dqlite](https://github.com/canonical/dqlite) as a private +implementation detail. v0.18.1 is the last release of dqlite's libraft. We +regret any inconvenience caused by this change. + +If you depend on dqlite but not on raft directly, see +[canonical/dqlite](https://github.com/canonical/dqlite) for up-to-date +instructions on how to use dqlite's bundled raft build configuration. If you +formerly depended on dqlite's libraft, you should switch to the maintained fork +[cowsql/raft](https://github.com/cowsql/raft). + +[A discussion thread](https://github.com/canonical/dqlite/discussions/620) is +open on the dqlite repository for any questions about this change. + +The remainder of this README is of historical interest only. + +----- + Fully asynchronous C implementation of the Raft consensus protocol. The library has modular design: its core part implements only the core Raft diff --git a/README_CH.md b/README_CH.md index d6e0878d0..d315cb1f2 100644 --- a/README_CH.md +++ b/README_CH.md @@ -1,6 +1,23 @@ -# c-raft +# This project is unmaintained -[![CI Tests](https://github.com/canonical/raft/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/canonical/raft/actions/workflows/build-and-test.yml) [![codecov](https://codecov.io/gh/canonical/raft/branch/master/graph/badge.svg)](https://codecov.io/gh/canonical/raft) [![Documentation Status](https://readthedocs.org/projects/raft/badge/?version=latest)](https://raft.readthedocs.io/en/latest/?badge=latest) +The dqlite team is no longer maintaining our raft implementation as an +independent project. Instead, the raft source code has been incorporated into +[canonical/dqlite](https://github.com/canonical/dqlite) as a private +implementation detail. v0.18.1 is the last release of dqlite's libraft. We +regret any inconvenience caused by this change. + +If you depend on dqlite but not on raft directly, see +[canonical/dqlite](https://github.com/canonical/dqlite) for up-to-date +instructions on how to use dqlite's bundled raft build configuration. If you +formerly depended on dqlite's libraft, you should switch to the maintained fork +[cowsql/raft](https://github.com/cowsql/raft). + +[A discussion thread](https://github.com/canonical/dqlite/discussions/620) is +open on the dqlite repository for any questions about this change. + +The remainder of this README is of historical interest only. + +----- **注意**:中文文档有可能未及时更新,请以最新的英文[readme](./README.md)为准。