diff --git a/anolis-courses/KeenTune/auto-tuning/step1.md b/anolis-courses/KeenTune/auto-tuning/step1.md index 4cceca7ad1ffde815c1864bc8c8b987920ac4461..a138309a7fcafa4cc5c38ffe42d0f1acca98580c 100644 --- a/anolis-courses/KeenTune/auto-tuning/step1.md +++ b/anolis-courses/KeenTune/auto-tuning/step1.md @@ -1,2 +1,3 @@ 1. 运行下面的命令启动KeenTune服务 -[[ systemctl restart keentuned keentune-target]] \ No newline at end of file + + [[ systemctl restart keentuned keentune-target]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step2.md b/anolis-courses/KeenTune/auto-tuning/step2.md index 544b5f45c84401dd60d4010556ac9cea1cc42ef7..d307ab8789d1b2dfa0550ad976bab9e285e31312 100644 --- a/anolis-courses/KeenTune/auto-tuning/step2.md +++ b/anolis-courses/KeenTune/auto-tuning/step2.md @@ -1,2 +1,3 @@ -1. KeenTune提供了wrk的执行脚本,运行该脚本获得性能基准值(baseline) -[[ python3 /etc/keentune/benchmark/wrk/wrk_http_long.py localhost ]] \ No newline at end of file +1. KeenTune提供了wrk的执行脚本,运行该脚本获得性能基准值(baseline) + + [[ python3 /etc/keentune/benchmark/wrk/wrk_http_long.py localhost ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step3.md b/anolis-courses/KeenTune/auto-tuning/step3.md index 058df2956db11058ecebc056a927e989f2482c5f..bf96b892132c29719dcda6476d8580ef779d22e1 100644 --- a/anolis-courses/KeenTune/auto-tuning/step3.md +++ b/anolis-courses/KeenTune/auto-tuning/step3.md @@ -1,2 +1,3 @@ -1. 查询KeenTune内置的可调优的参数配置文件 -[[ keentune param list ]] \ No newline at end of file +1. 查询KeenTune内置的可调优的参数配置文件 + + [[ keentune param list ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step4.md b/anolis-courses/KeenTune/auto-tuning/step4.md index 5f1e604412cdfbab0282cc1b7b9d2e8d432a59f0..13485bd61ff91bc6e52841d65eb8fb233c38ffcb 100644 --- a/anolis-courses/KeenTune/auto-tuning/step4.md +++ b/anolis-courses/KeenTune/auto-tuning/step4.md @@ -1,7 +1,13 @@ 我们将会用到sysctl.json和nginx.json两个文件分别对内核参数和nginx参数进行调优 1. 查看要调优的内核参数 -[[ cat /etc/keentune/parameter/sysctl.json ]] + + [[ cat /etc/keentune/parameter/sysctl.json ]] + 2. 查看要调优的nginx配置参数 -[[ cat /etc/keentune/parameter/nginx.json ]] + + [[ cat /etc/keentune/parameter/nginx.json ]] + 3. 这两个参数已经在keentune的配置文件中指定, 可以通过以下命令查看 -[[ cat /etc/keentune/conf/keentuned.conf ]] \ No newline at end of file + + [[ cat /etc/keentune/conf/keentuned.conf ]] + diff --git a/anolis-courses/KeenTune/auto-tuning/step5.md b/anolis-courses/KeenTune/auto-tuning/step5.md index 2622c91cc5fa927ae240521ffb250d06441f4d2e..a0b4ea4008ba3f2afe5475db143a46632669e9a1 100644 --- a/anolis-courses/KeenTune/auto-tuning/step5.md +++ b/anolis-courses/KeenTune/auto-tuning/step5.md @@ -1,2 +1,4 @@ 1. 我们直接使用keentune param tune命令发起一次动态调优,使用-i指定调优轮次,--job指定任务名 -[[ keentune param tune -i 20 --job http_long_test ]] \ No newline at end of file + + [[ keentune param tune -i 20 --job http_long_test ]] + diff --git a/anolis-courses/KeenTune/auto-tuning/step6.md b/anolis-courses/KeenTune/auto-tuning/step6.md index 6b2a8193fcbbbdf17319a43f036a429e10631425..3023aeba9eb334f83a062a89af67983880370b29 100644 --- a/anolis-courses/KeenTune/auto-tuning/step6.md +++ b/anolis-courses/KeenTune/auto-tuning/step6.md @@ -1,3 +1,5 @@ 1. 调优过程会保存在日志中,我们使用tail命令查看调优过程日志 -[[ tail -f /var/log/keentune/http_long_test.log ]] + + [[ tail -f /var/log/keentune/http_long_test.log ]] + 2. 等待调优结束, 日志中出现``[best] Tuning improvement``数据 \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step7.md b/anolis-courses/KeenTune/auto-tuning/step7.md index ff1e629c066da99a9190cdb7135cc08acc199a9e..d596d7531e25e73226e2ea8de3b095b94e4f28e0 100644 --- a/anolis-courses/KeenTune/auto-tuning/step7.md +++ b/anolis-courses/KeenTune/auto-tuning/step7.md @@ -1,2 +1,3 @@ 1. 我们再一次执行benchmark来查看调优效果 -[[ python3 /etc/keentune/benchmark/wrk/wrk_http_long.py localhost ]] \ No newline at end of file + + [[ python3 /etc/keentune/benchmark/wrk/wrk_http_long.py localhost ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step8.md b/anolis-courses/KeenTune/auto-tuning/step8.md index 1e61488fa5efaa68d3edc413fce5e35363509a7b..b31e2e162ac57338817ebbcec7b2521ac34dd303 100644 --- a/anolis-courses/KeenTune/auto-tuning/step8.md +++ b/anolis-courses/KeenTune/auto-tuning/step8.md @@ -1,2 +1,3 @@ -1. 最后我们使用rollback命令恢复环境默认参数 -[[ keentune param rollback ]] \ No newline at end of file +1. 最后我们使用rollback命令恢复环境默认参数 + + [[ keentune param rollback ]] diff --git a/anolis-courses/KeenTune/sensitizing/step4.md b/anolis-courses/KeenTune/sensitizing/step4.md index 41b831762d552e81c3fdd7b808db31be332ac277..ec7e69dd8e901a823f7e3c016d4935e494930ac1 100644 --- a/anolis-courses/KeenTune/sensitizing/step4.md +++ b/anolis-courses/KeenTune/sensitizing/step4.md @@ -1,3 +1,5 @@ 1. 使用tail命令查看参数识别过程日志 -[[ tail -f /var/log/keentune/keentuned-sensitize-train-http_long_train.log ]] + + [[ tail -f /var/log/keentune/keentuned-sensitize-train-http_long_train.log ]] + 2. 等待参数识别完成,我们就可以在日志中看到参数敏感性排序 \ No newline at end of file diff --git a/anolis-courses/abs/create_package/step5.md b/anolis-courses/abs/create_package/step5.md index cd1ab34e7b6fbee63f6ffa6b8d1b5959add53512..d65846273d03bacc699bfa66de32a4bbf4ee33fe 100644 --- a/anolis-courses/abs/create_package/step5.md +++ b/anolis-courses/abs/create_package/step5.md @@ -4,15 +4,15 @@ 2. 在龙蜥实验室的机器上,进入yum配置目录。 -[[ cd /etc/yum.repos.d ]] + [[ cd /etc/yum.repos.d ]] 3. 新建文件,并将1中的yum源文本复制到新建的文件中,保存退出,文件名可以任意,但是必须以.repo结尾,推荐使用AnolisOS-Build.repo。 -[[ vim AnolisOS-Build.repo ]] + [[ vim AnolisOS-Build.repo ]] -4. 使用命令安装已构建的软件包,图为示例。 +5. 使用命令安装已构建的软件包,图为示例。 -[[ yum install dmidecode ]] + [[ yum install dmidecode ]] ![](./assets/abs-task-013.png) diff --git a/anolis-courses/anolis_install_DDE/install_dde/step1.md b/anolis-courses/anolis_install_DDE/install_dde/step1.md index 003f75082c1ffa3bd0d64f186423e7d432b402a1..ec0494ee3aab91a6b0540454270bd0fb510a5ef3 100644 --- a/anolis-courses/anolis_install_DDE/install_dde/step1.md +++ b/anolis-courses/anolis_install_DDE/install_dde/step1.md @@ -2,29 +2,29 @@ 1. 安装软件仓库配置工具。 -[[ sudo yum install yum-utils ]] + [[ sudo yum install yum-utils ]] 2. 开启DDE软件仓库。 -[[ sudo yum-config-manager --enable DDE ]] + [[ sudo yum-config-manager --enable DDE ]] 3. 修改系统软件仓库配置中的仓库地址。 -[[ sed -i "s/\$releasever/8\.4/g" \`find /etc/yum.repos.d/ -name *.repo ]] + [[ sed -i "s/\$releasever/8\.4/g" \`find /etc/yum.repos.d/ -name *.repo ]] 4. 修改Anolis-DDE.repo文件内容。 -[[ - [DDE] - name=AnolisOS-8.4 - DDE - baseurl=http://mirrors.openanolis.cn/anolis/8.4/DDE/$basearch/os - enabled=1 - gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ANOLIS - gpgcheck=1 - [epel] - name=epel - baseurl=https://archives.fedoraproject.org/pub/archive/epel/8.3.2021-05-20/Everything/$basearch/ - enabled=1 - gpgkey=http://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-8 - gpgcheck=0 - ]] + [[ + [DDE] + name=AnolisOS-8.4 - DDE + baseurl=http://mirrors.openanolis.cn/anolis/8.4/DDE/$basearch/os + enabled=1 + gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ANOLIS + gpgcheck=1 + [epel] + name=epel + baseurl=https://archives.fedoraproject.org/pub/archive/epel/8.3.2021-05-20/Everything/$basearch/ + enabled=1 + gpgkey=http://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-8 + gpgcheck=0 + ]] diff --git a/anolis-courses/anolis_install_DDE/install_dde/step2.md b/anolis-courses/anolis_install_DDE/install_dde/step2.md index 2a668d0a6dbaaf05879bce6a483aaa3c1cf1939d..10b755e3dbf3c00baa19576b6971265d402cd0a1 100644 --- a/anolis-courses/anolis_install_DDE/install_dde/step2.md +++ b/anolis-courses/anolis_install_DDE/install_dde/step2.md @@ -1,7 +1,8 @@ 1. 清除系统软件包缓存。 -[[ sudo yum clean all && yum makecache ]] + [[ sudo yum clean all && yum makecache ]] 2. DDE软件包安装。 -[[ sudo yum groupinstall dde ]] + + [[ sudo yum groupinstall dde ]] diff --git a/anolis-courses/anolis_install_DDE/install_dde/step3.md b/anolis-courses/anolis_install_DDE/install_dde/step3.md index 9ce920fc980307a83aed83c75202f9c9456f9a96..95cd658a8f07952fd4733bee4529bb5b932e7605 100644 --- a/anolis-courses/anolis_install_DDE/install_dde/step3.md +++ b/anolis-courses/anolis_install_DDE/install_dde/step3.md @@ -1,6 +1,6 @@ 1. 软件包安装完成后进行系统窗口管理器设置。 -[[ sudo systemctl disable gdm ]] + [[ sudo systemctl disable gdm ]] -[[ sudo systemctl enable lightdm ]] + [[ sudo systemctl enable lightdm ]] diff --git a/anolis-courses/anolis_install_DDE/install_dde/step4.md b/anolis-courses/anolis_install_DDE/install_dde/step4.md index 5336c677578256a1b8bd4acfc5a5988efea28d0d..35cc8106ba1c8d1e73e02809416092dba8c511ba 100644 --- a/anolis-courses/anolis_install_DDE/install_dde/step4.md +++ b/anolis-courses/anolis_install_DDE/install_dde/step4.md @@ -1,6 +1,6 @@ 1. 设置成功,重启即可进入Anolis OS系统 DDE桌面环境。 -[[ reboot ]] + [[ reboot ]] 2. 重新连接并进入系统。 diff --git a/anolis-courses/cloud-native/compile_runD/index.yaml b/anolis-courses/cloud-native/compile_runD/index.yaml index 6ea4faff1ca63ff87655e8d0ef5886478616ab98..a9cd0625050cb6a952d68cd93da8dc484719c7b2 100644 --- a/anolis-courses/cloud-native/compile_runD/index.yaml +++ b/anolis-courses/cloud-native/compile_runD/index.yaml @@ -2,8 +2,8 @@ name: 编译Rust版本RunD并体验结果 desc: 体验Rust语言,并修改runD以及查看修改结果 image: "Anolis OS 8.4 ANCK 64位" live_time: "30 min" -machine: x86_64-104c192g # cpu架构-机器规格,该字段为空,默认 x86_64-2c4g -max_clients: 5 # 最大并发使用数,不填则默认不限制 +machine: x86_64-bare_metal # cpu架构-机器规格,该字段为空,默认 x86_64-2c4g +max_clients: 1 # 最大并发使用数,不填则默认不限制 details: steps: start: start.md diff --git a/anolis-courses/cloud-native/compile_runD/step2.md b/anolis-courses/cloud-native/compile_runD/step2.md index 1ef5c91a8984b65835b544c4934825fe2858b708..cb479a047214ea60b81aac365a05f5946f70b863 100644 --- a/anolis-courses/cloud-native/compile_runD/step2.md +++ b/anolis-courses/cloud-native/compile_runD/step2.md @@ -1,6 +1,9 @@ 1. 默认机器上没有安装git,需要先下载git工具 -[[ yum install git -y ]] + + [[ yum install git -y ]] 2. 下载runD的代码 -[[ git clone https://github.com/openanolis/kata-containers.git ]] -[[ cd kata-containers && git checkout preview ]] + + [[ git clone https://github.com/openanolis/kata-containers.git ]] + + [[ cd kata-containers && git checkout preview ]] diff --git a/anolis-courses/cloud-native/compile_runD/step4.md b/anolis-courses/cloud-native/compile_runD/step4.md index e609ee6f77f50b68f648ce8586d5b85d416d5e26..ff08f8e8180dab770de09dbada546ba7f71521b6 100644 --- a/anolis-courses/cloud-native/compile_runD/step4.md +++ b/anolis-courses/cloud-native/compile_runD/step4.md @@ -1,16 +1,18 @@ 1. 开始编译最新修改的runD代码 -[[ repo-root-dir=/root/kata-containers ]] -[[ container-image=cloud-native-registry.cn-shanghai.cr.aliyuncs.com/runtime/rund:shim-builder-latest ]] + [[ repo-root-dir=/root/kata-containers ]] -[[ nerdctl run --rm -i -v "${repo-root-dir}:${repo-root-dir}" \ - -w "${repo-root-dir}/src/runtime-rs" \ - "${container-image}" \ - bash -c "git config --global --add safe.directory ${repo-root-dir} && make -j8" ]] + [[ container-image=cloud-native-registry.cn-shanghai.cr.aliyuncs.com/runtime/rund:shim-builder-latest ]] + + [[ nerdctl run --rm -i -v "${repo-root-dir}:${repo-root-dir}" \ + -w "${repo-root-dir}/src/runtime-rs" \ + "${container-image}" \ + bash -c "git config --global --add safe.directory ${repo-root-dir} && make -j8" ]] 2. 上面编译需要一段时间,需要等编译完,然后运行下面的命令替换最新的runD,并运行查看日志结果 -[[ cp $repo-root-dir/src/runtime-rs/target/x86_64-unknown-linux-musl/release/containerd-shim-kata-v2 /opt/kata/bin/containerd-shim-rund-v2 ]] -[[ time nerdctl run --runtime io.containerd.rund.v2 busybox /bin/sh -c "uname -a" ]] + [[ cp $repo-root-dir/src/runtime-rs/target/x86_64-unknown-linux-musl/release/containerd-shim-kata-v2 /opt/kata/bin/containerd-shim-rund-v2 ]] + + [[ time nerdctl run --runtime io.containerd.rund.v2 busybox /bin/sh -c "uname -a" ]] -[[ journalctl -t containerd -r | grep "start vm for myself" ]] + [[ journalctl -t containerd -r | grep "start vm for myself" ]] diff --git a/anolis-courses/cloud-native/running_runD/index.yaml b/anolis-courses/cloud-native/running_runD/index.yaml index 605dda6ac8ccfd98775cf43970992517910fce48..cc9769d8fa0324ed971cc934fc1a16baa2b43a11 100644 --- a/anolis-courses/cloud-native/running_runD/index.yaml +++ b/anolis-courses/cloud-native/running_runD/index.yaml @@ -2,8 +2,8 @@ name: 多种运行容器工具体验runD desc: 学习使用nerdctl,ctr,crictl工具运行runD image: "Anolis OS 8.4 ANCK 64位" live_time: "30 min" -machine: x86_64-104c192g # cpu架构-机器规格,该字段为空,默认 x86_64-2c4g -max_clients: 5 # 最大并发使用数,不填则默认不限制 +machine: x86_64-bare_metal # cpu架构-机器规格,该字段为空,默认 x86_64-2c4g +max_clients: 1 # 最大并发使用数,不填则默认不限制 details: steps: start: start.md diff --git a/anolis-courses/cloud-native/running_runD/step1.md b/anolis-courses/cloud-native/running_runD/step1.md index 3e0626358f9063ce3f9e09d515c7b02397c2ccb0..b2193cbf557f56a58c360101f4250d82f8332270 100644 --- a/anolis-courses/cloud-native/running_runD/step1.md +++ b/anolis-courses/cloud-native/running_runD/step1.md @@ -1,4 +1,6 @@ 1. 物理机环境,或者神龙服务器环境,上面不需要安装docker,containerd,nerdctl,只需要一个干净环境即可 运行下面的命令一键式安装与部署runD -[[ curl https://cloud-native.oss-cn-shanghai.aliyuncs.com/runtime/install-rund-nerdctl.sh -sSf | sh -s ]] + + [[ curl https://cloud-native.oss-cn-shanghai.aliyuncs.com/runtime/install-rund-nerdctl.sh -sSf | sh -s ]] + 需要稍微等一会下载安装包与镜像,以及安装部署 diff --git a/anolis-courses/cloud-native/running_runD/step2.md b/anolis-courses/cloud-native/running_runD/step2.md index c578189ee0031671f453a8441e8bdb0c18cc879a..a118b26430f487dfd59be57eb43c38c72fb53d48 100644 --- a/anolis-courses/cloud-native/running_runD/step2.md +++ b/anolis-courses/cloud-native/running_runD/step2.md @@ -1,9 +1,12 @@ 1. 环境已经部署上了nerdctl, 第一步是下载运行容器需要的镜像 -[[ nerdctl pull busybox ]] + + [[ nerdctl pull busybox ]] 2. 直接可以使用runtime为rund来运行下载的busybox镜像,并运行一个命令,现在是uname 同时可以查看当前运行的时间 -[[ time nerdctl run --runtime io.containerd.rund.v2 busybox /bin/sh -c "uname -a" ]] + + [[ time nerdctl run --runtime io.containerd.rund.v2 busybox /bin/sh -c "uname -a" ]] 3. 还可以运行qemu作为安全容器的vmm作为对比,可以看到rund启动时间会快很多 -[[ time nerdctl run --runtime io.containerd.kata-qemu.v2 busybox /bin/sh -c "uname -a" ]] + + [[ time nerdctl run --runtime io.containerd.kata-qemu.v2 busybox /bin/sh -c "uname -a" ]] diff --git a/anolis-courses/cloud-native/running_runD/step3.md b/anolis-courses/cloud-native/running_runD/step3.md index 16572dfdaa20230689c14fdaf5a936a42220c4d2..8251b2d135b7e6c0e3fcbac7f131880396419026 100644 --- a/anolis-courses/cloud-native/running_runD/step3.md +++ b/anolis-courses/cloud-native/running_runD/step3.md @@ -1,5 +1,7 @@ 1. 使用ctr命令同样可以run起来runD,直接通过runtime指定使用rund -[[ time ctr run --runtime "io.containerd.rund.v2" -d docker.io/library/busybox:latest test-rund /bin/sh ]] + + [[ time ctr run --runtime "io.containerd.rund.v2" -d docker.io/library/busybox:latest test-rund /bin/sh ]] 2. 同样可以使用qemu做对比 -[[ time ctr run --runtime "io.containerd.kata-qemu.v2" -d docker.io/library/busybox:latest test-qemu2 /bin/sh ]] + + [[ time ctr run --runtime "io.containerd.kata-qemu.v2" -d docker.io/library/busybox:latest test-qemu2 /bin/sh ]] diff --git a/anolis-courses/cloud-native/running_runD/step4.md b/anolis-courses/cloud-native/running_runD/step4.md index 899efa1747c9f54f7e7407fff2bf78c8f853ffbe..185fd83214ae858d6ba8476aeb8bed788ef3dd17 100644 --- a/anolis-courses/cloud-native/running_runD/step4.md +++ b/anolis-courses/cloud-native/running_runD/step4.md @@ -1,38 +1,44 @@ 1. 下面使用crictl来启动rund,需要先安装crictl命令工具 -[[ wget https://cloud-native.oss-cn-shanghai.aliyuncs.com/runtime/crictl-v1.24.2-linux-amd64.tar.gz ]] + + [[ wget https://cloud-native.oss-cn-shanghai.aliyuncs.com/runtime/crictl-v1.24.2-linux-amd64.tar.gz ]] 2. 解压安装包 -[[ tar -zxvf crictl-v1.24.2-linux-amd64.tar.gz -C /usr/local/bin/ ]] + + [[ tar -zxvf crictl-v1.24.2-linux-amd64.tar.gz -C /usr/local/bin/ ]] 3. 配置crictl命令 -[[ cat << EOF > /etc/crictl.yaml -runtime-endpoint: unix:///run/containerd/containerd.sock -image-endpoint: unix:///run/containerd/containerd.sock -timeout: 10 -debug: false -EOF ]] + + [[ cat << EOF > /etc/crictl.yaml + runtime-endpoint: unix:///run/containerd/containerd.sock + image-endpoint: unix:///run/containerd/containerd.sock + timeout: 10 + debug: false + EOF ]] 4. 使用crictl来pull需要启动的镜像 -[[ crictl pull busybox ]] + + [[ crictl pull busybox ]] 5. 添加运行pod的配置文件 -[[ cat << EOF > sandbox-config.json -{ - "metadata": { - "name": "test-sandbox", - "namespace": "default", - "attempt": 1, - "uid": "95cb1cf47c4abb12d437f3" - }, - "linux": { - "security_context": { - "namespace_options": { - "network" : 2 - } - } + + [[ cat << EOF > sandbox-config.json + { + "metadata": { + "name": "test-sandbox", + "namespace": "default", + "attempt": 1, + "uid": "95cb1cf47c4abb12d437f3" + }, + "linux": { + "security_context": { + "namespace_options": { + "network" : 2 + } + } + } } -} -EOF ]] + EOF ]] 6. 使用rund来运行pod -[[ crictl runp -r rund sandbox-config.json ]] + + [[ crictl runp -r rund sandbox-config.json ]]