diff --git a/.github/workflows/build_rpm.yml b/.github/workflows/build_rpm.yml new file mode 100644 index 0000000..2b581de --- /dev/null +++ b/.github/workflows/build_rpm.yml @@ -0,0 +1,53 @@ +name: Build RPM + +on: + workflow_call: + inputs: + centos_release: + required: true + type: string + +env: + build_workspace: /opt/oblogproxy + +jobs: + build-rpm: + runs-on: ubuntu-latest + steps: + - name: Free disk space on Ubuntu runner + uses: kfir4444/free-disk-space@main + with: + tool-cache: false + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: true + + - name: Prepare CentOS container + run: | + docker run --name=centos -v /oblogproxy:${build_workspace} -id centos:${{ inputs.centos_release }} + docker exec -i centos /bin/sh -c "sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*" + docker exec -i centos /bin/sh -c "sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*" + docker exec -i centos yum install -y sudo git which wget make rpm-build gcc-c++ autoconf zlib-devel openssl-devel + + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Build and package + run: | + set -x + + docker cp . centos:${build_workspace} + rm -rf * + + docker exec -i centos /bin/sh -c "export PROJECT_NAME=obbinlog-ce && sh ${build_workspace}/rpm/obbinlog-ce-build.sh ${build_workspace} obbinlog-ce 4.x $(date +%Y%m%d%H)" + + rpm_file=$(docker exec -i centos /bin/sh -c "ls ${build_workspace}/rpm/*.rpm") + docker cp centos:${rpm_file} . + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: rpm-el${{ inputs.centos_release }} + path: "**.rpm" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d29eb62 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: CI + +on: + push: + branches: + - 'v4' + pull_request: + branches: + - 'v4' + +concurrency: + group: ci-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build: + strategy: + matrix: + centos_release: [ "7", "8" ] + uses: ./.github/workflows/build_rpm.yml + with: + centos_release: ${{ matrix.centos_release }} diff --git a/.github/workflows/cmake_build.yml b/.github/workflows/cmake_build.yml deleted file mode 100644 index 6012ff2..0000000 --- a/.github/workflows/cmake_build.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: CMake Build - -on: - pull_request: - branches: [ dev ] - push: - branches: [ dev ] - -jobs: - build: - runs-on: ubuntu-latest - container: 'openanolis/anolisos:8.8' - steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: | - curl -fsSLO --compressed https://cmake.org/files/v3.22/cmake-3.22.3-linux-x86_64.tar.gz - tar -zxvf cmake-3.22.3-linux-x86_64.tar.gz -C /usr --strip-components=1 --no-same-owner - yum install -y which git wget rpm rpm-build cpio gcc gcc-c++ make glibc-devel glibc-headers libstdc++-static binutils openssl-devel libaio-devel zlib zlib-devel bison flex java-11-openjdk - - name: Configure and generate - run: mkdir build && cd build && cmake .. - - name: Compile and link - run: cd build && cmake --build . -j 8 diff --git a/README.md b/README.md index 008800d..2de1699 100644 --- a/README.md +++ b/README.md @@ -1,83 +1,12 @@ -

- - license - - - license - - - Chinese doc - - - last commit - -

- # OBLogProxy -[OBLogProxy](https://github.com/oceanbase/oblogproxy) 是 [OceanBase](https://github.com/oceanbase/oceanbase) 的增量日志代理服务,它可以与 OceanBase 建立连接并进行增量日志读取,为下游服务提供了变更数据捕获(CDC)的能力。 - -## OBLogProxy 功能特点 - -OBLogProxy 有 2 种模式,分别是 Binlog 模式和 CDC 模式。 - -### Binlog 模式 - -Binlog 模式为 OceanBase 兼容 MySQL binlog 而推出,支持现有的 MySQL binlog 增量解析工具实时同步 OceanBase,使 MySQL binlog 增量解析工具可以平滑切换到 OceanBase 数据库。 - -### CDC 模式 - -CDC 模式用于解决数据同步,CDC 模式下 OBLogProxy 可以订阅 OceanBase 数据库中的数据变更,并将这些数据变更实时同步至下游服务,实现数据的实时或准实时复制和同步。 - -**有关于 OBLogProxy 的更多内容,请参考 [OBLogProxy 文档](https://www.oceanbase.com/docs/oblogproxy-doc) 。** - -## 源码构建 OBLogProxy - -### 前提条件 - -安装 CMake,要求版本 3.20 及以上。下载安装,请参考 [CMake 官方网站](https://cmake.org/download) 。 - -### 安装依赖 - -基于 Fedora (包括 CentOS,Fedora,OpenAnolis,RedHat,UOS 等) - -```bash -yum install -y which git wget rpm rpm-build cpio gcc gcc-c++ make glibc-devel glibc-headers libstdc++-static binutils zlib zlib-devel bison flex java-11-openjdk -``` - -### 源码编译 - -```shell -git clone https://github.com/oceanbase/oblogproxy.git -cd oblogproxy -mkdir build -cd build -cmake .. -cmake --build . -j 8 -``` -### 编译选项 - -在执行 CMake 编译时,可以添加编译选项改变默认的行为。例如, 编译出 Demo,成功后,当前目录还会产出 `demo_client` 二进制。 - -```bash -mkdir build -cd build -cmake -DWITH_DEMO=ON .. -cmake --build . -j 8 -``` - -项目中的其他编译选项。 +OBLogProxy 是 OceanBase 数据库的增量日志代理工具,可以用于获取 OceanBase 数据库的增量日志,为下游服务提供变更数据捕获(CDC)的能力。更多信息请参考 [产品文档](https://www.oceanbase.com/docs/oblogproxy-doc)。 -| 选项 | 默认 | 说明 | -|------------|-----|------------------------------------------------------------------------------------| -| WITH_DEBUG | ON | 调试模式带 Debug 符号 | -| WITH_ASAN | OFF | 编译带 [AddressSanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer) | -| WITH_TEST | OFF | 测试 | -| WITH_DEMO | OFF | Demo | +本仓库为 OBLogProxy 社区版的代码仓库。自 4.x 版本开始,OBLogProxy 的产品名已由 `oblogproxy` 变更为 `obbinlog`。 ## 许可 -OBLogProxy 使用 MulanPubL-2.0 许可。当您修改或分发源代码时,请遵守 [MulanPubL-2.0](LICENSE) 。 +本项目使用 MulanPubL-2.0 许可。当您修改或分发源代码时,请遵守 [MulanPubL-2.0](LICENSE) 。 ## 贡献 @@ -88,7 +17,7 @@ OBLogProxy 使用 MulanPubL-2.0 许可。当您修改或分发源代码时,请 ## 支持 -如果您在使用 OBLogProxy 时遇到任何问题,欢迎联系我们寻求帮助: +如果您在使用本项目时遇到任何问题,欢迎联系我们寻求帮助: - [GitHub Issue](https://github.com/oceanbase/oblogproxy/issues) - [问答论坛](https://ask.oceanbase.com/)