Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
miniob
提交
cbddce84
M
miniob
项目概览
oceanbase
/
miniob
1 年多 前同步成功
通知
74
Star
1521
Fork
537
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
M
miniob
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
提交
cbddce84
编写于
4月 11, 2022
作者:
羽飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docker
上级
63d075c1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
79 addition
and
26 deletion
+79
-26
Dockerfile
Dockerfile
+33
-22
README.md
README.md
+46
-4
未找到文件。
Dockerfile
浏览文件 @
cbddce84
# how to use
# docker build -t miniob .
# make sure docker has been installed
FROM
centos:7
FROM
centos:7
ARG
HOME_DIR=/root
ARG
HOME_DIR=/root
...
@@ -6,16 +10,7 @@ ARG GIT_SOURCE=github
...
@@ -6,16 +10,7 @@ ARG GIT_SOURCE=github
ENV
LANG=en_US.UTF-8
ENV
LANG=en_US.UTF-8
# install rpm
# install rpm
RUN
yum
install
-y
make git wget centos-release-scl scl-utils which
RUN
yum
install
-y
make git wget centos-release-scl scl-utils which flex
# clone deps
RUN
mkdir
-p
${
HOME_DIR
}
/deps
WORKDIR
${HOME_DIR}/deps
RUN
wget http://yum-test.obvos.alibaba-inc.com/oceanbase/development-kit/el/7/x86_64/obdevtools-cmake-3.20.2-3.el7.x86_64.rpm
\
&&
rpm
-ivh
obdevtools-cmake-3.20.2-3.el7.x86_64.rpm
RUN
git clone https://github.com/libevent/libevent
-b
release-2.1.12-stable
RUN
git clone https://github.com/open-source-parsers/jsoncpp.git
RUN
git clone https://github.com/google/googletest
# prepare env
# prepare env
RUN
yum
install
-y
devtoolset-11-gcc devtoolset-11-gcc-c++
RUN
yum
install
-y
devtoolset-11-gcc devtoolset-11-gcc-c++
...
@@ -26,28 +21,44 @@ RUN echo "export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH" >> .bashrc
...
@@ -26,28 +21,44 @@ RUN echo "export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH" >> .bashrc
ENV
PATH /opt/rh/devtoolset-11/root/bin:/usr/local/oceanbase/devtools/bin:$PATH
ENV
PATH /opt/rh/devtoolset-11/root/bin:/usr/local/oceanbase/devtools/bin:$PATH
ENV
LD_LIBRARY_PATH /usr/local/lib64:$LD_LIBRARY_PATH
ENV
LD_LIBRARY_PATH /usr/local/lib64:$LD_LIBRARY_PATH
# compile deps
# clone deps and compile deps
RUN
mkdir
-p
${
HOME_DIR
}
/deps/libevent/build
\
RUN
mkdir
-p
${
HOME_DIR
}
/deps
&&
mkdir
-p
${
HOME_DIR
}
/deps/googletest/build
\
WORKDIR
${HOME_DIR}/deps
&&
mkdir
-p
${
HOME_DIR
}
/deps/jsoncpp
RUN
wget http://yum-test.obvos.alibaba-inc.com/oceanbase/development-kit/el/7/x86_64/obdevtools-cmake-3.20.2-3.el7.x86_64.rpm
\
&&
rpm
-ivh
obdevtools-cmake-3.20.2-3.el7.x86_64.rpm
&&
rm
-f
obdevtools-cmake-3.20.2-3.el7.x86_64.rpm
WORKDIR
${HOME_DIR}/deps/libevent/build
RUN
git clone https://github.com/libevent/libevent
-b
release-2.1.12-stable
\
RUN
cmake ..
-DEVENT__DISABLE_OPENSSL
=
ON
&&
make
-j
&&
make
install
&&
mkdir
-p
${
HOME_DIR
}
/deps/libevent/build
\
&&
cmake
-DEVENT__DISABLE_OPENSSL
=
ON
-B
${
HOME_DIR
}
/deps/libevent/build
${
HOME_DIR
}
/deps/libevent
&&
make
-C
${
HOME_DIR
}
/deps/libevent/build
-j
install
\
&&
rm
-rf
${
HOME_DIR
}
/deps/
*
WORKDIR
${HOME_DIR}/deps/googletest/build
RUN
git clone https://github.com/open-source-parsers/jsoncpp.git
\
RUN
cmake ..
&&
make
-j
&&
make
install
&&
mkdir
-p
${
HOME_DIR
}
/deps/jsoncpp/build
\
&&
cmake
-DJSONCPP_WITH_TESTS
=
OFF
-DJSONCPP_WITH_POST_BUILD_UNITTEST
=
OFF
-B
${
HOME_DIR
}
/deps/jsoncpp/build
${
HOME_DIR
}
/deps/jsoncpp/
&&
make
-C
${
HOME_DIR
}
/deps/jsoncpp/build
-j
install
\
&&
rm
-rf
${
HOME_DIR
}
/deps/
*
RUN
git clone https://github.com/google/googletest
\
&&
mkdir
-p
${
HOME_DIR
}
/deps/googletest/build
\
&&
cmake
-B
${
HOME_DIR
}
/deps/googletest/build
${
HOME_DIR
}
/deps/googletest
&&
make
-C
${
HOME_DIR
}
/deps/googletest/build
-j
install
\
&&
rm
-rf
${
HOME_DIR
}
/deps/
*
WORKDIR
${HOME_DIR}/deps/jsoncpp/build
RUN
wget http://ftp.gnu.org/gnu/bison/bison-3.7.tar.gz
\
RUN
cmake
-DJSONCPP_WITH_TESTS
=
OFF
-DJSONCPP_WITH_POST_BUILD_UNITTEST
=
OFF ..
&&
make
-j
&&
make
install
&&
tar
xzvf bison-3.7.tar.gz
\
&&
cd
bison-3.7
\
&&
./configure
--prefix
=
/usr/local
\
&&
make
-j
install
\
&&
rm
-rf
${
HOME_DIR
}
/deps/
*
# clone miniob code
# clone miniob code
RUN
mkdir
-p
${
HOME_DIR
}
/source
RUN
mkdir
-p
${
HOME_DIR
}
/source
WORKDIR
${HOME_DIR}/source
WORKDIR
${HOME_DIR}/source
RUN
git clone https://
${
GIT_SOURCE
}
.com/oceanbase/miniob
RUN
git clone https://
${
GIT_SOURCE
}
.com/oceanbase/miniob
RUN
echo
"mkdir -p build && cd build && cmake .. -DDEBUG=ON -DCMAKE_C_COMPILER=
`
which gcc
`
-DCMAKE_CXX_COMPILER=
`
which g++
`
&& make -j4"
>
${
HOME_DIR
}
/source/miniob/build.sh
&&
chmod
+x
${
HOME_DIR
}
/source/miniob/build.sh
RUN
mkdir
-p
${
HOME_DIR
}
/source/miniob/build
RUN
mkdir
-p
${
HOME_DIR
}
/source/miniob/build
WORKDIR
${HOME_DIR}/source/miniob/build
WORKDIR
${HOME_DIR}/source/miniob/build
RUN
cmake ..
-DDEBUG
=
ON
-DCMAKE_C_COMPILER
=
`
which gcc
`
-DCMAKE_CXX_COMPILER
=
`
which g++
`
\
RUN
cmake
-B
${
HOME_DIR
}
/source/miniob/build
-DDEBUG
=
ON
-DCMAKE_C_COMPILER
=
`
which gcc
`
-DCMAKE_CXX_COMPILER
=
`
which g++
`
${
HOME_DIR
}
/source/miniob/
\
&&
make
-j4
&&
make
-j4
\
&&
rm
-rf
${
HOME_DIR
}
/source/miniob/build
WORKDIR
${HOME_DIR}
WORKDIR
${HOME_DIR}
...
...
README.md
浏览文件 @
cbddce84
## Introduction
# Introduction
miniob设计的目标是让不熟悉数据库设计和实现的同学能够快速的了解与深入学习数据库内核,期望通过miniob相关训练之后,能够对各个数据库内核模块的功能与它们之间的关联有所了解,并能够在
miniob 是 OceanBase与华中科技大学联合开发的、面向"零"基础数据库内核知识同学的一门数据库实现入门教程实践工具。
使用时,设计出高效的SQL。面向的对象主要是在校学生,并且诸多模块做了简化,比如不考虑并发操作。
miniob设计的目标是让不熟悉数据库设计和实现的同学能够快速的了解与深入学习数据库内核,期望通过相关训练之后,能够对各个数据库内核模块的功能与它们之间的关联有所了解,并能够在
使用数据库时,设计出高效的SQL。面向的对象主要是在校学生,并且诸多模块做了简化,比如不考虑并发操作。
注意:此代码仅供学习使用,不考虑任何安全特性。
注意:此代码仅供学习使用,不考虑任何安全特性。
[
GitHub 首页
](
https://github.com/oceanbase/miniob
)
# How to build
# How to build
please refer to docs/how_to_build.md
直接在本地搭建开发环境,可以参考 docs/how_to_build.md。
# Docker
首先要确保本地已经安装了Docker。
-
使用 Dockerfile 构建
Dockerfile: https://github.com/oceanbase/miniob/blob/main/Dockerfile
```
bash
# build
docker build
-t
miniob
.
docker run
-d
--name
=
'miniob'
miniob:lastest
# 进入容器,开发调试
docker
exec
-it
miniob bash
```
-
使用docker hub 镜像运行
```
bash
docker run oceanbase/miniob
```
Docker环境说明:
docker基于
`CentOS:7`
制作。
镜像包含:
-
jsoncpp
-
google test
-
libevent
-
flex
-
bison(3.7)
-
gcc/g++ (version=11)
-
miniob 源码(/root/source/miniob)
docker中在/root/source/miniob目录下载了github的源码,可以根据个人需要,下载自己仓库的源代码,也可以直接使用git pull 拉取最新代码。
/root/source/miniob/build.sh 提供了一个编译脚本,以DEBUG模式编译miniob。
# miniob 题目
# miniob 题目
[
miniob 题目
](
https://oceanbase-partner.github.io/lectures-on-dbms-implementation/miniob-topics
)
[
miniob 题目
](
https://oceanbase-partner.github.io/lectures-on-dbms-implementation/miniob-topics
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录