Skip to content

Commit

Permalink
Documentation website built with Docusaurus framework (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
powerfooI authored Mar 29, 2024
1 parent d57ad62 commit ccb5dbe
Show file tree
Hide file tree
Showing 118 changed files with 16,560 additions and 145 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy-docsite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- master
- test-docsite
paths:
- 'docsite/**'

permissions:
contents: write

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
cache-dependency-path: './docsite'
- name: Install dependencies
run: cd docsite && yarn install --frozen-lockfile
- name: Build website
run: cd docsite && yarn build

# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./docsite/build
20 changes: 10 additions & 10 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ test running 6m2s

### 连接集群

通过以下命令查找 observer 的 POD IP,POD 名的规则是 {cluster_name}-{cluster_id}-{zone}-uuid:
通过以下命令查找 observer 的 POD IP,POD 名的规则是 `${cluster_name}-${cluster_id}-${zone}-uuid`

```shell
kubectl get pods -o wide
Expand All @@ -130,7 +130,7 @@ helm repo add ob-operator https://oceanbase.github.io/ob-operator/
helm install oceanbase-dashboard ob-operator/oceanbase-dashboard --version=0.1.0
```

![oceanbase-dashboard-install](./docs/img/oceanbase-dashboard-install.jpg)
![oceanbase-dashboard-install](./docsite/static/img/oceanbase-dashboard-install.jpg)

OceanBase Dashboard 成功安装之后, 会自动创建一个 admin 用户和随机密码,可以通过如下命令查看密码。
```
Expand All @@ -140,18 +140,18 @@ echo $(kubectl get -n default secret oceanbase-dashboard-user-credentials -o jso
```
kubectl get svc oceanbase-dashboard-ob-dashboard
```
![oceanbase-dashboard-service](./docs/img/oceanbase-dashboard-service.jpg)
![oceanbase-dashboard-service](./docsite/static/img/oceanbase-dashboard-service.jpg)

使用 admin 账号和查看到的密码登录。
![oceanbase-dashboard-overview](./docs/img/oceanbase-dashboard-overview.jpg)
![oceanbase-dashboard-overview](./docsite/static/img/oceanbase-dashboard-overview.jpg)

## 项目架构

ob-operator 以 kubebuilder 为基础,通过统一的资源管理器接口、全局的任务管理器实例以及解决长调度的任务流机制完成对 OceanBase 集群及相关应用的控制和管理。ob-operator 的架构大致如下图所示:

![ob-operator 架构设计](./docs/img/ob-operator-arch.png)
![ob-operator 架构设计](./docsite/static/img/ob-operator-arch.png)

有关架构细节可参见[架构设计文档](./docs/zh_CN/arch.md)
有关架构细节可参见[架构设计文档](./docsite/i18n/zh-Hans/docusaurus-plugin-content-docs/current/developer/arch.md)

## 特性

Expand Down Expand Up @@ -185,9 +185,9 @@ ob-operator 使用 [kubebuilder](https://book.kubebuilder.io/introduction) 项

## 文档

- [ob-operator 架构设计](docs/zh_CN/arch.md)
- [部署 ob-operator](docs/zh_CN/deploy.md)
- [开发手册](docs/en_US/development.md)(英文)
- [ob-operator 架构设计](docsite/i18n/zh-Hans/docusaurus-plugin-content-docs/current/developer/arch.md)
- [部署 ob-operator](docsite/i18n/zh-Hans/docusaurus-plugin-content-docs/current/developer/deploy.md)
- [开发手册](docsite/docs/developer/development.md)(英文)
- [用户手册](https://www.oceanbase.com/docs/community-ob-operator-doc-1000000000408367)

## 获取帮助
Expand All @@ -197,7 +197,7 @@ ob-operator 使用 [kubebuilder](https://book.kubebuilder.io/introduction) 项
- [GitHub Issue](https://github.com/oceanbase/ob-operator/issues)
- [官方网站](https://open.oceanbase.com/)
- [Slack](https://oceanbase.slack.com/archives/C053PT371S7)
- 钉钉群([二维码](./docs/img/dingtalk-operator-users.png)
- 钉钉群([二维码](./docsite/static/img/dingtalk-operator-users.png)
- 微信群(请添加小助手微信,微信号: OBCE666)

## 参与开发
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ test running 6m2s

### Connecting to the OceanBase Cluster

Use the following command to find the POD IP of the observer. The naming convention for PODs is {cluster_name}-{cluster_id}-{zone}-uuid:
Use the following command to find the POD IP of the observer. The naming convention for PODs is `${cluster_name}-${cluster_id}-${zone}-uuid`:

```shell
kubectl get pods -o wide
Expand All @@ -131,7 +131,7 @@ helm repo add ob-operator https://oceanbase.github.io/ob-operator/
helm install oceanbase-dashboard ob-operator/oceanbase-dashboard --version=0.1.0
```

![oceanbase-dashboard-install](./docs/img/oceanbase-dashboard-install.jpg)
![oceanbase-dashboard-install](./docsite/static/img/oceanbase-dashboard-install.jpg)

After OceanBase Dashboard is successfully installed, a default user admin is created with a random password, you can check the password using the command printed after installation.
```
Expand All @@ -141,18 +141,18 @@ A service of type NodePort is created by default, you can check the address and
```
kubectl get svc oceanbase-dashboard-ob-dashboard
```
![oceanbase-dashboard-service](./docs/img/oceanbase-dashboard-service.jpg)
![oceanbase-dashboard-service](./docsite/static/img/oceanbase-dashboard-service.jpg)

Login with admin user and password
![oceanbase-dashboard-overview](./docs/img/oceanbase-dashboard-overview.jpg)
![oceanbase-dashboard-overview](./docsite/static/img/oceanbase-dashboard-overview.jpg)

## Project Architecture

ob-operator is built on top of kubebuilder and provides control and management of OceanBase clusters and related applications through a unified resource manager interface, a global task manager instance, and a task flow mechanism for handling long-running tasks. The architecture diagram is approximately as follows:

![ob-operator Architecture](./docs/img/ob-operator-arch.png)
![ob-operator Architecture](./docsite/static/img/ob-operator-arch.png)

For more detailed information about the architecture, please refer to the [Architecture Document](./docs/en_US/arch.md).
For more detailed information about the architecture, please refer to the [Architecture Document](./docsite/docs/developer/arch.md).


## Features
Expand Down Expand Up @@ -186,8 +186,8 @@ ob-operator is built using the [kubebuilder](https://book.kubebuilder.io/introdu

## Documents

- [Architecture](docs/en_US/arch.md)
- [Contributor Guidance](docs/en_US/contributor-guidance.md)
- [Architecture](docsite/docs/developer/arch.md)
- [Contributor Guidance](docsite/docs/developer/contributor-guidance.md)
- [User Manual](https://en.oceanbase.com/docs/community-ob-operator-doc-en-10000000001123466)

## Getting Help
Expand All @@ -197,7 +197,7 @@ If you encounter any issues while using ob-operator, please feel free to seek he
- [GitHub Issue](https://github.com/oceanbase/ob-operator/issues)
- [Official Website](https://open.oceanbase.com/)
- [Slack](https://oceanbase.slack.com/archives/C053PT371S7)
- DingTalk Group ([QRCode](./docs/img/dingtalk-operator-users.png))
- DingTalk Group ([QRCode](./docsite/static/img/dingtalk-operator-users.png))
- WeChat Group (Add the assistant with WeChat ID: OBCE666)

## Contributing
Expand Down
69 changes: 0 additions & 69 deletions docs/en_US/gsoc-ideas.md

This file was deleted.

Binary file removed docs/img/oceanbase-dashboard-install.jpg
Binary file not shown.
Binary file removed docs/img/oceanbase-dashboard-service.jpg
Binary file not shown.
20 changes: 20 additions & 0 deletions docsite/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions docsite/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions docsite/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
5 changes: 1 addition & 4 deletions docs/en_US/arch.md → docsite/docs/developer/arch.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Architecture

该文档也提供[中文版](../zh_CN/arch.md)

This document does not cover the architecture and instructions for managing the OceanBase database itself. If you want to learn more, please refer to the [official documentation](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000217922).

ob-operator follows the [Operator pattern of Kubernetes](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/), focusing on custom resources and their control logic. It is developed based on the Kubernetes Operator development framework, [kubebuilder@v3](https://book.kubebuilder.io/introduction), making its underlying architecture similar to [that of kubebuilder](https://book.kubebuilder.io/architecture). By globally registering a Controller Manager from the Kubernetes control plane and overseeing multiple controllers and webhooks, ob-operator controls custom resources like OBCluster and OBTenant etc.
Expand Down Expand Up @@ -68,9 +66,8 @@ To address this issue, ob-operator adopts task flow mechanism and a global task

The relationship among the control loop, resource manager, and task manager is depicted in the following figure.

![The relationship among the control loop, resource manager, and task manager](../img/ob-operator-arch.png)
![The relationship among the control loop, resource manager, and task manager](/img/ob-operator-arch.png)

## Interaction between Resource Manager and Task Manager

Tasks in the task flow are submitted by the Resource Manager (`ResourceManager`) to the global Task Manager (`TaskManager`) for execution. The overall relationship and interaction flow between the resources, Resource Manager, and Task Manager are illustrated in the following sequence diagram:

Expand Down
53 changes: 53 additions & 0 deletions docsite/docs/developer/contributor-guidance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: Contributor Guidance
---

# Contributor Guidance for Our Project

Welcome and thank you for your interest in contributing to our project! We are excited to have you join our community and look forward to your valuable contributions. This document serves as a guide to help you get started with contributing to our project in a way that is efficient and aligns with our community principles.

By contributing to our project, you'll help achieve simplicity of controlling OceanBase resource like clusters, tenants, backups and so on, making its users more easier to manage OceanBase database and combine on various versions or distributions of Kubernetes.

Whether you are fixing bugs, adding new features, or improving documentation, your work will make a significant impact on the project and its users.

## Code of Conduct

Before you start contributing, we strongly encourage you to review our [Code of Conduct](https://github.com/oceanbase/ob-operator?tab=coc-ov-file). It outlines the expectations for behavior within our community and provides a transparent process for reporting unacceptable behavior. We are committed to providing a welcoming and supportive environment for all contributors.

## Getting Started with Development

To get started with developing for our project, please refer to our [Development Guidelines](develop-locally.md). This document provides the necessary steps to set up the development environment on your laptop.

## Deploying Changes

If you are working on changes that require deployment, look at our [Deployment Guide](develop-locally.md) for detailed instructions on how to deploy and test your changes in a production-like environment. This ensures that all changes are vetted for stability and compatibility before being integrated.

## How to Contribute

Here is a brief overview of how you can contribute to our project:

1. Familiarize Yourself: Get to know the project by reading the documentation, understanding the codebase, and identifying the areas you are interested in.

2. Find an Issue: Look at our issue tracker to find tasks that interest you. We also welcome contributions that improve the project in ways not yet identified in our tracker.

3. Communicate: Before starting to work on an issue, let the community know to avoid duplicate efforts and to get any necessary input or guidance.

4. Fork and Clone: Fork the repository and clone it to your local machine. This will be your private workspace.

5. Make Changes: Implement your changes in your local environment adhering to our development practices and coding standards.

6. Write Tests: Ensure your changes are tested. We strive to maintain a high level of code quality and reliability.

7. Document Your Work: Update existing documents or create new documents as needed. Good documentation is just as important as good code.

8. Create a Pull Request: Once your changes are ready, submit a pull request. Provide a clear description of the problem and solution, including any relevant issues\.

9. Polish the Code: Engage with the code review process, addressing any feedback provided by the project maintainers.

10. Get Merged: Once your pull request has been approved, it will be merged into the main codebase.

## Need Help?

If you have any questions or need further assistance, don't hesitate to reach out to our community via [issues](https://github.com/oceanbase/ob-operator/issues), [slack workspace](https://oceanbase.slack.com) or [dingtalk](/img/dingtalk-operator-users.png). Our maintainers and community members are here to help you and make your contributing experience enjoyable.

Once again, thank you for your interest in contributing to our project. Your efforts will help us build a better and stronger project for everyone. We look forward to your contributions and are thrilled to have you as part of our community!
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You need to install the following softwares before getting started. Installation

Open Docker desktop - Settings - Resources, set `CPU limit`, `Memory limit` and `Virtual disk limit` to match the hardware requirements.

![Docker Limits](../img/docker-limit.png)
![Docker Limits](/img/docker-limit.png)

### 2. Start minikube cluster

Expand Down
2 changes: 0 additions & 2 deletions docs/en_US/deploy.md → docsite/docs/developer/deploy.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Deploy ob-operator

该文档也提供[中文版](../zh_CN/deploy.md)

This article introduces the deployment methods for ob-operator.

## 1. Deployment Dependencies
Expand Down
Loading

0 comments on commit ccb5dbe

Please sign in to comment.