-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
212aa59
commit a3d35d9
Showing
17 changed files
with
178 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source build/envsetup.sh | ||
# 这里同步pixel4对应的设备代码 flame | ||
breakfast flame |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 这里git配置请按照自己的github账号配置,以便能够从GitHub同步代码仓库 | ||
git config --global user.email user@localhost | ||
git config --global user.name user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# 创建源代码目录 | ||
mkdir -p ~/android/lineage/ | ||
cd ~/android/lineage/ | ||
|
||
# 初始化仓库(这里需要根据设备对应的代码分支): | ||
repo init -u https://github.com/LineageOS/android.git -b lineage-20.0 --git-lfs | ||
|
||
# 代码同步 | ||
repo sync |
12 changes: 12 additions & 0 deletions
12
source/android/build/build_lineageos_20_pixel_4/repo_sync_err
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Downloading Repo source from https://gerrit.googlesource.com/git-repo | ||
repo: Updating release signing keys to keyset ver 2.3 | ||
/home/admin/android/lineage/.repo/repo/main.py:569: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead | ||
logger.warn("\n... A new version of repo (%s) is available.", exp_str) | ||
|
||
... A new version of repo (2.37) is available. | ||
/home/admin/android/lineage/.repo/repo/main.py:571: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead | ||
logger.warn( | ||
... You should upgrade soon: | ||
cp /home/admin/android/lineage/.repo/repo/repo /home/admin/bin/repo | ||
|
||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
.. _md_sync_speed: | ||
|
||
===================== | ||
``mdadm`` 同步速度 | ||
===================== | ||
|
||
.. warning:: | ||
|
||
当你调整系统默认配置时,务必充分理解参数含义以及影响,并做好详细记录。本文是 **我的一次经验教训总结** | ||
|
||
我在 :ref:`mdadm_raid10` 实践时,由于服务器硬件规格极大,采用了 4TB 的 :ref:`nvme` ,所以在构建 ``RAID10`` 初始化RAID的 ``sync`` 同步非常耗时,原因是默认同步限速是 ``200MB/s`` ,对于海量存储来说完成首次全量同步可能会需要以天为计量单位。 | ||
|
||
例如,我的实践 :ref:`mdadm_raid10` ,刚完成 ``RAID10`` 构建时检查 ``mdstat`` : | ||
|
||
.. literalinclude:: mdadm_raid10/mdstat | ||
:caption: 检查md状态 | ||
|
||
可以看到同步速度是 ``207272K/sec`` 也就是大约 ``200MB/s`` ,预估完成时间 ``1803min`` (30小时): | ||
|
||
.. literalinclude:: mdadm_raid10/mdstat_output | ||
:caption: 检查md状态可以看到RAID正在构建 | ||
|
||
对于构建 :ref:`deploy_lvm_mdadm_raid10` 底层基础工作,虽然没有明显影响(raid同步时依然可以读写),但是还是会带来一些不便(主要是想快速完成部署和验证 :ref:`gluster` 性能) | ||
|
||
检查同步速度 | ||
============= | ||
|
||
对于同步限制的主要参数调整是 ``md`` 设备 ``sync_speed_max`` ,这个参数可以通过 ``/sys/block/md10/md/sync_speed_max`` 检查: | ||
|
||
- 检查 ``md`` 设备同步速度: | ||
|
||
.. literalinclude:: md_sync_speed/md_sync_speed_max | ||
:caption: 检查 ``md`` 设备 ``md10`` 的 ``sync_speed_max`` 限速 | ||
|
||
默认值是 ``200000`` 也就是 ``200MB/s`` : | ||
|
||
.. literalinclude:: md_sync_speed/md_sync_speed_max_output | ||
:caption: ``md`` 设备默认 ``sync_speed_max`` 限速是 ``200MB/s`` | ||
|
||
- 此外还有一个默认的 ``md_sync_speed_min`` : | ||
|
||
.. literalinclude:: md_sync_speed/md_sync_speed_min | ||
:caption: 检查 ``md`` 设备 ``md10`` 的 ``sync_speed_min`` 最小同步速度(下限) | ||
|
||
默认值是 ``1000`` 也就是 ``1MB/s`` : | ||
|
||
.. literalinclude:: md_sync_speed/md_sync_speed_min | ||
:caption: 检查 ``md`` 设备 ``md10`` 的 ``sync_speed_min`` 最小同步速度(下限) | ||
|
||
调整同步速度 | ||
============== | ||
|
||
- 可以在线调整同步速度: | ||
|
||
.. literalinclude:: md_sync_speed/adjust_md_sync_speed | ||
:caption: 在线调整 ``md`` 设备 ``md10`` 同步速率 | ||
|
||
.. warning:: | ||
|
||
``md`` 配置默认 ``200MB/s`` 同步速度是有一定道理的,我在这里踩了一个坑(见下文) |
3 changes: 3 additions & 0 deletions
3
source/linux/storage/software_raid/md_sync_speed/adjust_md_sync_speed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 我在构建RAID的初始化时调整放宽了同步速率10倍 | ||
sysctl -w dev.raid.speed_limit_max=2000000 | ||
sysctl -w dev.raid.speed_limit_min=10000 |
1 change: 1 addition & 0 deletions
1
source/linux/storage/software_raid/md_sync_speed/md_sync_speed_max
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cat /sys/block/md10/md/sync_speed_max |
1 change: 1 addition & 0 deletions
1
source/linux/storage/software_raid/md_sync_speed/md_sync_speed_max_output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
200000 (system) |
1 change: 1 addition & 0 deletions
1
source/linux/storage/software_raid/md_sync_speed/md_sync_speed_min
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cat /sys/block/md10/md/sync_speed_min |
1 change: 1 addition & 0 deletions
1
source/linux/storage/software_raid/md_sync_speed/md_sync_speed_min_output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1000 (system) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.. _raid-check: | ||
|
||
================== | ||
raid-check | ||
================== | ||
|
||
在完成 :ref:`mdadm_raid10` 之后,运维过程中发现默认系统配置了每周一次 ``raid-check`` ,也就是在 :ref:`cron` 配置了一个 ``/etc/cron.d/raid-check`` : | ||
|
||
.. literalinclude:: raid-check/cron | ||
:caption: 默认配置每周日凌晨1点进行 ``raid-check`` | ||
|
||
在实际生产环境中,由于现代存储容量非常巨大(单块 :ref:`nvme` 容量达到4T,组合 :ref:`mdadm_raid10` 达到数十T),这个 ``mdadm`` 的检查耗时会非常长: | ||
|
||
- 默认同步速度限制为 ``200MB/sec`` (可修改,但是我踩了一个 :ref:`md_sync_speed` 调整的坑 ) | ||
|
||
参考 | ||
====== | ||
|
||
- `Weekly RAID check affecting my system - any way to mitigate? <https://serverfault.com/questions/1100760/weekly-raid-check-affecting-my-system-any-way-to-mitigate>`_ | ||
- `mdadm RAID5 RAID6 how to check consistency on running array <https://serverfault.com/questions/1064838/mdadm-raid5-raid6-how-to-check-consistency-on-running-array>`_ | ||
- `Check RAID software: my status <https://serverfault.com/questions/721364/check-raid-software-my-status>`_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Run system wide raid-check once a week on Sunday at 1am by default | ||
0 1 * * Sun root /usr/sbin/raid-check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
source/machine_learning/fauxpilot/opensource_ai_coding_assistant.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.. _opensource_ai_coding_assistant: | ||
|
||
============================= | ||
开源AI编程辅助工具 | ||
============================= | ||
|
||
随着 :ref:`llm` 迅速发展,开源实现类似 :ref:`gpt` 和 ``GitHub Copilot`` 的实现方案不断涌现,这里我尝试汇总相关开源项目,并选择比较全面和优秀的架构进行实践 | ||
|
||
- :ref:`intro_fauxpilot` |