diff --git a/.github/workflows/release-oceanbase-ce.yml b/.github/workflows/release-oceanbase-ce.yml index 931d2bf..48b6f0d 100644 --- a/.github/workflows/release-oceanbase-ce.yml +++ b/.github/workflows/release-oceanbase-ce.yml @@ -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 diff --git a/.github/workflows/reusable-build-and-release-oceanbase-ce.yml b/.github/workflows/reusable-build-and-release-oceanbase-ce.yml index 6330323..bcf4267 100644 --- a/.github/workflows/reusable-build-and-release-oceanbase-ce.yml +++ b/.github/workflows/reusable-build-and-release-oceanbase-ce.yml @@ -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" diff --git a/.github/workflows/reusable-test-and-release-oceanbase-ce.yml b/.github/workflows/reusable-test-and-release-oceanbase-ce.yml index 82f3aa4..71edf7e 100644 --- a/.github/workflows/reusable-test-and-release-oceanbase-ce.yml +++ b/.github/workflows/reusable-test-and-release-oceanbase-ce.yml @@ -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 diff --git a/oceanbase-ce/Dockerfile b/oceanbase-ce/Dockerfile index 66d0495..cc3a143 100644 --- a/oceanbase-ce/Dockerfile +++ b/oceanbase-ce/Dockerfile @@ -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 diff --git a/oceanbase-ce/README.md b/oceanbase-ce/README.md index 494bf86..ef331ca 100644 --- a/oceanbase-ce/README.md +++ b/oceanbase-ce/README.md @@ -1,3 +1,4 @@ +English | [中文版](./README_CN.md) # Deploy OceanBase with Docker ## Introduction @@ -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: ``` diff --git a/oceanbase-ce/README_CN.md b/oceanbase-ce/README_CN.md index e40add9..79ec6dd 100644 --- a/oceanbase-ce/README_CN.md +++ b/oceanbase-ce/README_CN.md @@ -1,3 +1,4 @@ +[English](./README.md) | 中文版 # 使用Docker部署OceanBase ## 简介 @@ -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测试: diff --git a/oceanbase-ce/boot/env.sh b/oceanbase-ce/boot/env.sh index 543b3d9..3fb9480 100755 --- a/oceanbase-ce/boot/env.sh +++ b/oceanbase-ce/boot/env.sh @@ -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 diff --git a/oceanbase-ce/boot/start.sh b/oceanbase-ce/boot/start.sh index 135a3ff..6427760 100755 --- a/oceanbase-ce/boot/start.sh +++ b/oceanbase-ce/boot/start.sh @@ -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 /tmp/config.yaml - envsubst >/tmp/config.yaml obd cluster deploy obcluster -c /tmp/config.yaml if [ $? -ne 0 ]; then deploy_failed diff --git a/oceanbase-ce/templates/ob-configserver-template.yaml b/oceanbase-ce/templates/ob-configserver-template.yaml deleted file mode 100644 index bff3ab1..0000000 --- a/oceanbase-ce/templates/ob-configserver-template.yaml +++ /dev/null @@ -1,7 +0,0 @@ -ob-configserver: - servers: - - ${OB_SERVER_IP} - global: - listen_port: 8080 - server_ip: 0.0.0.0 - home_path: /root/obconfigserver diff --git a/oceanbase-ce/templates/observer-template.yaml b/oceanbase-ce/templates/observer-template.yaml index 93ea5ec..a6f72aa 100644 --- a/oceanbase-ce/templates/observer-template.yaml +++ b/oceanbase-ce/templates/observer-template.yaml @@ -1,6 +1,4 @@ oceanbase-ce: - depends: - - ob-configserver servers: - ${OB_SERVER_IP} global: @@ -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