Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update github action and readme for v4 #65

Open
wants to merge 2 commits into
base: v4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/build_rpm.yml
Original file line number Diff line number Diff line change
@@ -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"
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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 }}
23 changes: 0 additions & 23 deletions .github/workflows/cmake_build.yml

This file was deleted.

79 changes: 4 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,83 +1,12 @@
<p align="center">
<a href="https://github.com/oceanbase/oblogproxy/blob/dev/LICENSE">
<img alt="license" src="https://img.shields.io/badge/license-MulanPubL--2.0-blue" />
</a>
<a href="https://github.com/oceanbase/oblogproxy/releases/latest">
<img alt="license" src="https://img.shields.io/badge/dynamic/json?color=blue&label=release&query=tag_name&url=https%3A%2F%2Fapi.github.com%2Frepos%2Foceanbase%2Foblogproxy%2Freleases%2Flatest" />
</a>
<a href="https://www.oceanbase.com/docs/oblogproxy-doc">
<img alt="Chinese doc" src="https://img.shields.io/badge/文档-简体中文-blue" />
</a>
<a href="https://github.com/oceanbase/oblogproxy/commits/dev">
<img alt="last commit" src="https://img.shields.io/github/last-commit/oceanbase/oblogproxy/dev" />
</a>
</p>

# 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) 。

## 贡献

Expand All @@ -88,7 +17,7 @@ OBLogProxy 使用 MulanPubL-2.0 许可。当您修改或分发源代码时,请

## 支持

如果您在使用 OBLogProxy 时遇到任何问题,欢迎联系我们寻求帮助:
如果您在使用本项目时遇到任何问题,欢迎联系我们寻求帮助:

- [GitHub Issue](https://github.com/oceanbase/oblogproxy/issues)
- [问答论坛](https://ask.oceanbase.com/)
Loading