Skip to content

Commit

Permalink
eliminate ob-configserver from oceanbase-ce image (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-sun-star authored Sep 25, 2024
1 parent f34455d commit e408100
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release-oceanbase-ce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
release:
uses: ./.github/workflows/reusable-test-and-release-oceanbase-ce.yml
secrets: inherit
with:
tag_name: ${{ github.ref_name }}
lts: false
8 changes: 4 additions & 4 deletions .github/workflows/reusable-build-and-release-oceanbase-ce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ jobs:
id: set_image_tags
run: |
image_tags="ghcr.io/${{ github.repository_owner }}/oceanbase-ce:${{ inputs.version }}"
image_tags="${image_tags}, ${{ env.DOCKER_PUSH_BASE }}/oceanbase-ce:${{ inputs.version }}"
image_tags="${image_tags}, quay.io/${{ env.QUAY_IO_PUSH_BASE }}/oceanbase-ce:${{ inputs.version }}"
image_tags="${image_tags}, ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:${{ inputs.version }}"
image_tags="${image_tags}, quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:${{ inputs.version }}"
if [[ "${{ inputs.push-lts-images }}" == "true" ]]; then
lts_version="$(echo ${{ inputs.version }} | grep -P '(\d*\.\d*\.\d*)' --only-matching)"
lts_tag="${lts_version}-lts"
image_tags="${image_tags}, ghcr.io/${{ github.repository_owner }}/oceanbase-ce:${lts_tag}"
image_tags="${image_tags}, ${{ env.DOCKER_PUSH_BASE }}/oceanbase-ce:${lts_tag}"
image_tags="${image_tags}, quay.io/${{ env.QUAY_IO_PUSH_BASE }}/oceanbase-ce:${lts_tag}"
image_tags="${image_tags}, ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:${lts_tag}"
image_tags="${image_tags}, quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:${lts_tag}"
image_tags="${image_tags}, ghcr.io/${{ github.repository_owner }}/oceanbase-ce:latest"
image_tags="${image_tags}, ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:latest"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
release:
uses: ./.github/workflows/reusable-build-and-release-oceanbase-ce.yml
needs: [ set-version, build-and-test ]
secrets: inherit
with:
version: ${{ needs.set-version.outputs.version }}
push-images: true
Expand Down
2 changes: 0 additions & 2 deletions oceanbase-ce/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ RUN cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
COPY --from=builder /root/demo /root/demo
COPY --from=builder /root/.obd /root/.obd

RUN yum install -y --downloadonly --downloaddir=/tmp ob-configserver && obd mirror clone /tmp/*.rpm && rm -rf /tmp/*.rpm

COPY boot /root/boot
COPY templates /root/templates
COPY share/cluster /root/.obd/cluster
Expand Down
2 changes: 2 additions & 0 deletions oceanbase-ce/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
English | [中文版](./README_CN.md)
# Deploy OceanBase with Docker

## Introduction
Expand Down Expand Up @@ -74,6 +75,7 @@ Below is a table of supported environment variables for the image:
| OB_TENANT_MINI_CPU | | The oceanbase tenant mini_cpu configuration |
| OB_TENANT_MEMORY_SIZE | | The oceanbase tenant memory_size configuration |
| OB_TENANT_LOG_DISK_SIZE | | The oceanbase tenant log_disk_size configuration |
| OB_CONFIGSERVER_ADDRESS | | Address of ob-configserver e.g. http://1.1.1.1:8080 |
## Running Sysbench Script
The oceanbase-ce image includes the sysbench tool for benchmarking. Use the following command to run a sysbench test:
```
Expand Down
2 changes: 2 additions & 0 deletions oceanbase-ce/README_CN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[English](./README.md) | 中文版
# 使用Docker部署OceanBase

## 简介
Expand Down Expand Up @@ -74,6 +75,7 @@ mysql -h127.0.0.1 -P2881 -uroot@test # 使用通用租户的root账户连接
| OB_TENANT_MINI_CPU | | OceanBase租户mini_cpu配置 |
| OB_TENANT_MEMORY_SIZE | | OceanBase租户memory_size配置 |
| OB_TENANT_LOG_DISK_SIZE | | OceanBase租户log_disk_size配置 |
| OB_CONFIGSERVER_ADDRESS | | ob-configserver 地址, 示例: http://1.1.1.1:8080 |

## 运行Sysbench脚本
oceanbase-ce镜像包含sysbench工具用于基准测试。使用以下命令运行sysbench测试:
Expand Down
4 changes: 4 additions & 0 deletions oceanbase-ce/boot/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ export OB_TENANT_NAME=${OB_TENANT_NAME:-test}
export OB_TENANT_INIT_SQL_DIR=${OB_TENANT_INIT_SQL_DIR:-/root/boot/init.d}

export TELEMETRY_REPORTER="docker_${OB_CLUSTER_NAME}"

if [ -n $OB_CONFIGSERVER_ADDRESS ]; then
export OB_CONFIGURL="${OB_CONFIGSERVER_ADDRESS}/services"
fi
3 changes: 1 addition & 2 deletions oceanbase-ce/boot/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,13 @@ function check_tenant_connectable() {
}

function fastboot() {
cd /root/demo/ && tar -xvzf store.tar.gz
cd /root/demo/ && tar -xvzf store.tar.gz && tar -xvzf etc.tar.gz
obd cluster start demo
}

function boot() {
# generate config based on variables
envsubst <templates/observer-template.yaml >/tmp/config.yaml
envsubst <templates/ob-configserver-template.yaml >>/tmp/config.yaml
obd cluster deploy obcluster -c /tmp/config.yaml
if [ $? -ne 0 ]; then
deploy_failed
Expand Down
7 changes: 0 additions & 7 deletions oceanbase-ce/templates/ob-configserver-template.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions oceanbase-ce/templates/observer-template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
oceanbase-ce:
depends:
- ob-configserver
servers:
- ${OB_SERVER_IP}
global:
Expand All @@ -16,6 +14,7 @@ oceanbase-ce:
log_disk_size: ${OB_LOG_DISK_SIZE}
root_password: ${OB_SYS_PASSWORD}
scenario: ${OB_SCENARIO}
obconfig_url: ${OB_CONFIGURL}
cpu_count: 16
production_mode: false
syslog_level: INFO
Expand Down

0 comments on commit e408100

Please sign in to comment.