How to run GrimoireLab Gitee - X-lab2017/grimoirelab GitHub Wiki
注:以下内容与 How-to-run-GrimoireLab 内容相差不大,仅为部分配置文件差异。
建议:4GB 以上内存。
GrimoireLab 在 GNU/Linux 平台下开发、测试通过。在 Windows 下(包括WSL)可能会出现问题。以下内容在 ubuntu18.04 测试通过。
- 安装 Docker:https://docs.docker.com/engine/install/ubuntu/
- 安装 Docker-Compose:https://docs.docker.com/compose/install/
- 设置系统 vm 参数:https://github.com/chaoss/grimoirelab-sirmordred/blob/master/Getting-Started.md#low-virtual-memory-
# Linux
$ sudo sysctl -w vm.max_map_count=262144
# Mac
$ $ screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
sysctl -w vm.max_map_count=262144
$ git clone https://github.com/X-lab2017/grimoirelab
$ cd grimoirelab/docker-compose
# 启动时指定.yml文件
sudo docker-compose -f docker-compose-secured-gitee.yml up -d
默认加载的是 default-grimoirelab-settings 中的配置文件,如需修改配置,直接修改这些配置文件即可。
启动后即可查看 http://localhost:5601/ 。
- 安装 Docker:https://docs.docker.com/engine/install/ubuntu/
- 安装 Docker-Compose:https://docs.docker.com/compose/install/
- 设置系统 vm 参数:https://github.com/chaoss/grimoirelab-sirmordred/blob/master/Getting-Started.md#low-virtual-memory-
- Python 与 Pip3
# python 3.5/3.6/3.7
$ python3 --version
Python 3.6.9
# 安装 python3-venv
sudo apt update
sudo apt -y install python3-venv
# pip3
$ pip3 --version
pip 20.1.1 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)
# 如果未安装 pip:
$ sudo apt install -y python3-pip
# 升级
$ sudo pip3 install --upgrade pip
使用 docker-compose 启动:
$ git clone https://github.com/X-lab2017/grimoirelab.git
$ cd grimoirelab/docker-compose
# 指定配置文件为 docker-compose-infra-secured.yml 并启动
$ sudo docker-compose -f docker-compose-infra-secured.yml up -d
编译工具位于 grimoirelab/utils/ , build_grimoirelab 各参数的意思可以通过 build_grimoirelab --help查看,或者参考:https://github.com/X-lab2017/grimoirelab/tree/master/utils
$ cd ../utils
$ ./build_grimoirelab -l debug --logfile /tmp/log --build --install --check \
--relfile ../releases/gitee/0.1.0 --reposdir /tmp/repos --reposfile repos-for-gitee.json \
--venv /tmp/venv --install_venv /tmp/ivenv
以上参数意思为:
- -l 指定日志等级
- --logfile 指定日志文件
- --relfile 指定 release 版本文件
- --reposdir 指定下载好的repo存放位置
- --reposfile 指定 repo 源地址配置文件
- --venv 指定用户 build 各模块的 venv
- --install_venv 指定安装各模块的venv
安装好的 venv 位于 /tmp/ivenv:
$ source /tmp/ivenv/bin/activate
可使用 pip3 list 查看已安装的包:
$ pip3 list
运行 sirmodred,默认参数配置文件位于 default-grimoirelab-settings,可根据需要修改,特别是 projects-gitee.json:
$ cd ../default-grimoirelab-settings/
$ sirmordred -c setup-secured-gitee-source-code.cfg
大功告成!打开 http://localhost:5601/ 即可看到效果。
- Q:访问 Kibiter 默认的账号和密码是多少?
A:admin / admin
- Q:在
setup-secured-gitee-source-code.cfg
中需要配置 Gitee 的 token 吗?
A:Gitee 不需要,留空就可以。如果是 GitHub Issues/PRs 需要。
- Q:从 GitHub 拉取仓库速度慢,怎么办?
A:可指定仓库地址文件 reposfile ,切换到从 Gitee 上拉取镜像仓库:
$ ./build_grimoirelab -l debug --logfile /tmp/log --build --install --check \
--relfile ../releases/gitee/0.1.0 --reposdir /tmp/repos --reposfile repos-for-gitee-from-gitee.json \
--venv /tmp/venv --install_venv /tmp/ivenv
其中 repos-for-gitee-from-gitee.json 文件内容见 附录1.
输出结果见 附录2.
repos-for-gitee-from-gitee.json 文件内容如下:
{
"perceval-gitee": [
{
"name": "perceval-gitee",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-perceval-gitee",
"version_file": "setup.py",
"check_run": "perceval gitee --help"
}
],
"grimoireelk": [
{
"name": "grimoire-elk",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-elk-xlab",
"version_file": "grimoire_elk/_version.py",
"check_run": "p2o.py --help"
}
],
"grimoireelk-gitee": [
{
"name": "grimoire-elk-gitee",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-elk-gitee",
"version_file": "setup.py"
}
],
"sigils": [
{
"name": "grimoirelab-panels",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-sigils-gitee",
"version_file": "panels/_version.py"
}
],
"grimoirelab": [
{
"name": "grimoirelab",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-gitee",
"version_file": "grimoirelab/_version.py"
}
],
"grimoirelab-toolkit": [
{
"name": "grimoirelab-toolkit",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-toolkit",
"version_file": "grimoirelab-toolkit/_version.py"
}
],
"perceval": [
{
"name": "perceval",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-perceval",
"version_file": "perceval/_version.py",
"check_run": "perceval --help"
}
],
"perceval-mozilla": [
{
"name": "perceval-mozilla",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-perceval-mozilla",
"version_file": "setup.py",
"check_run": "perceval kitsune --help"
}
],
"perceval-opnfv": [
{
"name": "perceval-opnfv",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-perceval-opnfv",
"version_file": "setup.py",
"check_run": "perceval functest --help"
}
],
"perceval-puppet": [
{
"name": "perceval-puppet",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-perceval-puppet",
"version_file": "setup.py",
"check_run": "perceval puppetforge --help"
}
],
"perceval-finos": [
{
"name": "perceval-finos",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-perceval-finos",
"version_file": "setup.py",
"check_run": "perceval finosmeetings --help"
}
],
"kingarthur": [
{
"name": "kingarthur",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-kingarthur",
"version_file": "arthur/_version.py",
"check_run": "arthurd --help"
}
],
"sortinghat": [
{
"name": "sortinghat",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-sortinghat",
"version_file": "sortinghat/_version.py",
"check_run": "sortinghat --help"
}
],
"kidash": [
{
"name": "kidash",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-kidash",
"version_file": "kidash/_version.py",
"check_run": "kidash --help"
}
],
"manuscripts": [
{
"name": "manuscripts",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-manuscripts",
"version_file": "manuscripts/_version.py",
"check_run": "manuscripts --help"
}
],
"sirmordred": [
{
"name": "sirmordred",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-sirmordred",
"version_file": "sirmordred/_version.py",
"check_run": "sirmordred --help"
}
],
"cereslib": [
{
"name": "cereslib",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-cereslib",
"version_file": "cereslib/_version.py"
}
],
"graal": [
{
"name": "graal",
"dir": "",
"repo_url": "https://gitee.com/heming6666/grimoirelab-graal",
"version_file": "graal/_version.py",
"check_run": "graal --help"
}
]
}
Output:
GrimoireLab release: 0.2.43
Building...
Built module grimoirelab: OK
Built module grimoirelab-toolkit: OK
Built module perceval: OK
Built module perceval-mozilla: OK
Built module perceval-opnfv: OK
Built module perceval-puppet: OK
Built module perceval-finos: OK
Built module kingarthur: OK
Built module grimoire-elk: OK
Built module sortinghat: OK
Built module kidash: OK
Built module grimoirelab-panels: OK
Built module manuscripts: OK
Built module sirmordred: OK
Built module cereslib: OK
Built module graal: OK
Built module perceval-gitee: OK
Built module grimoire-elk-gitee: OK
Installing...
Installed modules: grimoirelab,grimoirelab-toolkit,perceval,perceval-mozilla,perceval-opnfv,perceval-puppet,perceval-finos,kingarthur,grimoire-elk,sortinghat,kidash,grimoirelab-panels,manuscripts,sirmordred,cereslib,graal,perceval-gitee,grimoire-elk-gitee
Checking...
Checking versions...
Checked version for grimoirelab: Fail
Checked version for grimoirelab-toolkit: OK
Checked version for perceval: OK
Checked version for perceval-mozilla: OK
Checked version for perceval-opnfv: OK
Checked version for perceval-puppet: OK
Checked version for perceval-finos: OK
Checked version for kingarthur: OK
Checked version for grimoire-elk: Fail
Checked version for sortinghat: OK
Checked version for kidash: OK
Checked version for grimoirelab-panels: Fail
Checked version for manuscripts: OK
Checked version for sirmordred: OK
Checked version for cereslib: OK
Checked version for graal: OK
Checked version for perceval-gitee: Fail
Checked version for grimoire-elk-gitee: Fail
Checking installable (all modules at once)...OK
Checking installable (grimoirelab)...OK
Checking installable (grimoirelab-toolkit)...OK
Checking installable (perceval)...OK
Checking run (perceval)...OK
Checking installable (perceval-mozilla)...OK
Checking run (perceval-mozilla)...OK
Checking installable (perceval-opnfv)...OK
Checking run (perceval-opnfv)...OK
Checking installable (perceval-puppet)...OK
Checking run (perceval-puppet)...OK
Checking installable (perceval-finos)...OK
Checking run (perceval-finos)...OK
Checking installable (kingarthur)...OK
Checking run (kingarthur)...OK
Checking installable (grimoire-elk)...OK
Checking run (grimoire-elk)...OK
Checking installable (sortinghat)...OK
Checking run (sortinghat)...OK
Checking installable (kidash)...OK
Checking run (kidash)...OK
Checking installable (grimoirelab-panels)...OK
Checking installable (manuscripts)...OK
Checking run (manuscripts)...Fail
Checking installable (sirmordred)...OK
Checking run (sirmordred)...OK
Checking installable (cereslib)...OK
Checking installable (graal)...OK
Checking run (graal)...OK
Checking installable (perceval-gitee)...OK
Checking run (perceval-gitee)...OK
Checking installable (grimoire-elk-gitee)...OK
Installed modules (all):
Venv for building in /tmp/venv
Repos for source code in /tmp/repos
Distribution packages in /tmp/tmp86fb2jvu
Installed modules in /tmp/ivenv