0yukali0 commented on code in PR #341: URL: https://github.com/apache/yunikorn-site/pull/341#discussion_r1341960175
########## i18n/zh-cn/docusaurus-plugin-content-docs/current/developer_guide/build.md: ########## @@ -0,0 +1,186 @@ +--- +id: build +title: 建构和运行 +--- + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +YuniKorn始终与容器编排系统一起使用。目前,在我们的存储库中提供了一个Kubernetes适配器yunikorn-k8shim,您可以利用它来开发YuniKorn调度功能并与Kubernetes集成。本文档描述了如何设置开发环境以及如何进行开发。 + +## 开发环境设置 + +首先阅读[环境设置指南](developer_guide/env_setup.md)以设置Docker和Kubernetes开发环境。 + +## 为Kubernetes构建YuniKorn + +先决条件: +- Golang: 在存储库的根目录中检查 `.go_version` 文件以获取Yunikorn所需的版本。最低版本可能会根据发布分支而变化。较早的Go版本可能会导致编译问题。 + +您可以从 [yunikorn-k8shim](https://github.com/apache/yunikorn-k8shim) 项目构建用于Kubernetes的调度器。 +构建过程将所有组件构建为一个可部署并在Kubernetes上运行的单个可执行文件。 + +通过拉取 `yunikorn-k8shim` 存储库来启动集成构建过程: +```bash +mkdir $HOME/yunikorn/ +cd $HOME/yunikorn/ +git clone https://github.com/apache/yunikorn-k8shim.git +``` +此时,您已经拥有一个允许您构建YuniKorn调度器的集成映像的环境。 + +### 关于Go模块和Git版本的说明 +Go使用Git来获取模块信息。 +如果用于构建的计算机上安装的Git版本较旧,可能无法检索某些模块。 +当首次尝试构建时,可能会记录类似于下面的消息: +```text +go: finding modernc.org/[email protected] +go: modernc.org/[email protected]: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in <location>: exit status 128: + error: RPC failed; result=22, HTTP code = 404 + fatal: The remote end hung up unexpectedly +``` +要解决此问题,请将Git更新到较新的版本。 +已知Git版本1.22或更高版本可以正常工作。 + +### 构建Docker镜像 + +可以通过以下命令触发构建Docker镜像。 + +``` +make image +``` + +带有内置配置的镜像可以直接部署到Kubernetes上。 +可以在 [deployments](https://github.com/apache/yunikorn-k8shim/tree/master/deployments/scheduler) 目录下找到一些示例部署。 +对于使用ConfigMap的部署,您需要在Kubernetes中设置ConfigMap。 +如何使用ConfigMap部署调度器在 [scheduler configuration deployment](developer_guide/deployment.md) 文档中有详细说明。 + +镜像构建命令首先会构建集成可执行文件,然后创建Docker镜像。 +如果您想使用基于发布的预构建镜像,请检查 [Docker Hub repo](https://hub.docker.com/r/apache/yunikorn). + +默认的镜像标签不适用于部署到可访问存储库,因为它使用了硬编码的用户并且会使用正确的凭据推送到Docker Hub。 +您必须更新`Makefile`中的`TAG`变量以推送到可访问存储库。 +在更新镜像标签时,请注意,所提供的部署示例也需要相应更新以反映相同的更改 + +### 检查 Docker 镜像 + +之前构建的Docker镜像包含了一些重要的构建信息,您可以使用Docker的inspect命令来检索这些信息。 + +``` +docker inspect apache/yunikorn:scheduler-amd64-latest +``` + +`amd64`标签取决于您的主机架构(例如,对于`Intel`,它将是`amd64`,对于`Mac M1`,它将是`arm64v8`)。 Review Comment: Current yunikorn image tag on "Mac M1" will be arm64. Replace `arm64v8` with `arm64` in the en and zh-cn pages. ########## i18n/zh-cn/docusaurus-plugin-content-docs/current/developer_guide/build.md: ########## @@ -0,0 +1,186 @@ +--- +id: build +title: 建构和运行 +--- + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +YuniKorn始终与容器编排系统一起使用。目前,在我们的存储库中提供了一个Kubernetes适配器yunikorn-k8shim,您可以利用它来开发YuniKorn调度功能并与Kubernetes集成。本文档描述了如何设置开发环境以及如何进行开发。 Review Comment: [yunikorn-k8shim](https://github.com/apache/yunikorn-k8shim) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
