Skip to content

Add OceanBase deployment guide #719

@cafe3310

Description

@cafe3310

Background

Technically AWorld supports multiple databases including OceanBase, but currently lacks official deployment documentation. This guide will help users quickly set up OceanBase for AWorld.


Task For Reference

Create a deployment guide at docs/deployment/oceanbase_setup.md covering:

1. OceanBase Docker Setup

  • Launch OceanBase CE using oceanbase/oceanbase-ce:latest
  • Include Docker run command, port mappings, and connection details
  • Provide verification steps (e.g., using mysql CLI)

2. Database Initialization

Create database and tables:

-- Create database
CREATE DATABASE aworld_db;
USE aworld_db;

-- Memory items table
CREATE TABLE IF NOT EXISTS aworld_memory_items (
    id VARCHAR(255) PRIMARY KEY,
    content TEXT NOT NULL,
    created_at VARCHAR(255) NOT NULL,
    updated_at VARCHAR(255) NOT NULL,
    memory_meta TEXT NOT NULL,
    tags TEXT NOT NULL,
    memory_type VARCHAR(50) NOT NULL,
    version INT NOT NULL DEFAULT 1,
    deleted TINYINT(1) NOT NULL DEFAULT 0
);

-- Memory histories table
CREATE TABLE IF NOT EXISTS aworld_memory_histories (
    memory_id VARCHAR(255) NOT NULL,
    history_id VARCHAR(255) NOT NULL,
    created_at VARCHAR(255) NOT NULL,
    PRIMARY KEY (memory_id, history_id),
    FOREIGN KEY (memory_id) REFERENCES aworld_memory_items (id),
    FOREIGN KEY (history_id) REFERENCES aworld_memory_items (id)
);

-- Indexes for performance
CREATE INDEX idx_memory_items_type ON aworld_memory_items (memory_type);
CREATE INDEX idx_memory_items_created ON aworld_memory_items (created_at);
CREATE INDEX idx_memory_items_deleted ON aworld_memory_items (deleted);

3. Python Connection Test

Provide a simple script using PyMySQL to:

  • Connect to OceanBase
  • Insert a test record
  • Verify the insertion

4. Documentation Integration

  • Ensure the file is discoverable in the docs navigation
  • Add reference in relevant sections if needed

Reference


Definition of Done

  • docs/deployment/oceanbase_setup.md created with all sections
  • Docker setup instructions are clear and tested
  • SQL commands work correctly in OceanBase
  • Python verification script runs successfully
  • Documentation is properly indexed
  • End-to-end testing completed

Happy Hacking! This task is associated with "OceanBase Developer Carnival" event.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions