Git Product home page Git Product logo

Comments (20)

gshilei avatar gshilei commented on August 27, 2024 2

Hi @Do-U-Believe-In-Fate 如果还有其他问题,可以继续评论,看到后会第一时间回复。如果上面的回答已经能解决你的问题,为避免少走弯路,可以先将kusciajob_types.go和kuscia api的job.proto改动 贴一下,没问题后再进行后续开发。

from kuscia.

Do-U-Believe-In-Fate avatar Do-U-Believe-In-Fate commented on August 27, 2024 1

【Do-U-Believe-In-Fate Give it to me】

from kuscia.

Do-U-Believe-In-Fate avatar Do-U-Believe-In-Fate commented on August 27, 2024 1

你好,想问一下这个任务可否重新assign一下,刚才误点到unassign了,这周内会重新提交一份

from kuscia.

Do-U-Believe-In-Fate avatar Do-U-Believe-In-Fate commented on August 27, 2024

Hello, I would like to ask a question. Is there any missing steps that cause the task#34 status failing to move from "needs triage" to "in progress" ?

from kuscia.

Candicepan avatar Candicepan commented on August 27, 2024

Hello, I would like to ask a question. Is there any missing steps that cause the task#34 status failing to move from "needs triage" to "in progress" ?

sorry. It has been done~

from kuscia.

Do-U-Believe-In-Fate avatar Do-U-Believe-In-Fate commented on August 27, 2024

根据 Kuscia 现有源代码,总体设计思路如下:
1、定义:在 kusciajob_types.go 文件中,KusciaJob 定义的 KusciaJobSpec.Tasks[].Parties[] 下添加 PartyTemplate 字段,其中包括 LimitedCPU 和 LimitedMemory 两个数值类型的字段,控制各 Party 的资源容量;
2、接口:利用 Protobuf v3.x 开发两个字段对应的 KusciaAPI Job接口,实现 “KusciaAPI Job接口支持配置任务应用容器的资源(CPU/Memory)容量大小” 的功能;
3、输出:修改对应的 crds 文件夹下的 yaml 配置文件,添加 CPU 和 Memory 到 additionalPrinterColumns

问题:
1、任务实现效果类似于通过 kubectl 和新 yaml 来配置 ResourceQuota 中的 limits.cpu 和 limits.memory 吗 (此任务的自定义资源,是 limits 还是 requests,还是都有)
2、kj kt pod 都要输出指定资源信息,指定的时候仅仅指定 kj 的资源吗(也就是指定一个 kj 的资源,其余二者的资源数量关系可以计算出来吗)

from kuscia.

Do-U-Believe-In-Fate avatar Do-U-Believe-In-Fate commented on August 27, 2024

# 可否尽快回复?

第二个问题就是在问,资源的分配是以什么粒度进行的

from kuscia.

gshilei avatar gshilei commented on August 27, 2024

Hi @Do-U-Believe-In-Fate , 感谢积极反馈,建议如下:
根据 Kuscia 现有源代码,总体设计思路如下:
1、定义:在 kusciajob_types.go 文件中,KusciaJob 定义的 KusciaJobSpec.Tasks[].Parties[] 下添加 PartyTemplate 字段,其中包括 LimitedCPU 和 LimitedMemory 两个数值类型的字段,控制各 Party 的资源容量;
--> 这里复用kusciatask_types.go 中的PartyTemplate字段就好了。里面可能不仅包含Resources字段,还会包含其他字段。不过不影响。示例如下:

    type Party struct {
	DomainID string `json:"domainID"`
	// +optional
	Role string `json:"role,omitempty"`
	// +optional
	Template PartyTemplate `json:"template,omitempty"`
}

2、接口:利用 Protobuf v3.x 开发两个字段对应的 KusciaAPI Job接口,实现 “KusciaAPI Job接口支持配置任务应用容器的资源(CPU/Memory)容量大小” 的功能;
--> 基于现有KusciaAPI Job Proto, 仅需添加cpu/memory requests/limits 相关字段定义到 message party 下。实现时,Kuscia API 服务解析该参数,然后创建 KusciaJob时填充到各Party下相关字段中。

3、输出:修改对应的 crds 文件夹下的 yaml 配置文件,添加 CPU 和 Memory 到 additionalPrinterColumns
--> 这个暂时不用加。

问题:
1、任务实现效果类似于通过 kubectl 和新 yaml 来配置 ResourceQuota 中的 limits.cpu 和 limits.memory 吗 (此任务的自定义资源,是 limits 还是 requests,还是都有)
--> 具体开发点 和 cpu/memory 传递流程如下:

  1. (需开发)通过 KusciaAPI 创建kusciaJob 资源,根据请求携带的Party参数,在创建kusciaJob时 将携带的cpu/memory参数 填充到 kusciaJob对应的party[].template下(cpu/memory 的requests和limits大小)
  2. 在完成步骤1时,正常情况下,已经在集群中创建了相关的kusciaJob资源,通过kubectl get kj 命令能查到,然后通过查看该资源的详细信息(kubectl get kj -o yaml)查看是否配置的cpu/memory正确
  3. (需开发)KusciaJob Controller 在创建kusciaTask 资源时,需要把kusciaJob中的party[].template cpu/memory参数 填充到对应的 kusciaTask的Parties[].template下。然后创建相应的kusciaTask资源
  4. 当第3步完成时,正常情况下,已经在集群中创建了相关的kusciatask资源,通过kubectl get kt 命令能查到,然后通过查看该资源的详细信息(kubectl get kt -o yaml)查看是否配置的cpu/memory正确
  5. (需开发)KusciaTask Controller 在处理新创建出来的KusciaTask资源时,需要把kusciaTask中的Parties[].template cpu/memory 参数填充到实际创建的pod.spec.containers.resources中
  6. 查看第5步创建的Pod资源,是否已经含有传递下来的cpu/memory配置。若有且正确,说明全链路已经传递正确。
  7. 在6的基础上,需要边界测试,比如:只设置 requests or limits 等等。

2、kj kt pod 都要输出指定资源信息,指定的时候仅仅指定 kj 的资源吗(也就是指定一个 kj 的资源,其余二者的资源数量关系可以计算出来吗)
--> 参考问题1,问题1里面应该解释了你这里的描述。kj,kt,pod中都会展示相应的资源配置

from kuscia.

Do-U-Believe-In-Fate avatar Do-U-Believe-In-Fate commented on August 27, 2024

ksnip_20230820-1411261
目前字段和接口代码都改好了,这里使用 make manifests 这个命令测试更新 CRD,但是报了这个路径错误。

图中红线标注的是,kuscia/hack/generate-crds.sh 中 $(which controller-gen) paths=xxxxx 中的 /pkg/crd/... 原始路径。

经过 debug,发现 go install 之后,controller-gen 的命令路径依然为空。

后续:已解决

from kuscia.

Do-U-Believe-In-Fate avatar Do-U-Believe-In-Fate commented on August 27, 2024

make gen-proto-code 命令对 protoc 有版本需求,需要安装至最新版本 (>3.0),否则不存在 --go_opt 参数

from kuscia.

Do-U-Believe-In-Fate avatar Do-U-Believe-In-Fate commented on August 27, 2024

make image 命令报如下错:

[stage-2 2/15] RUN yum install -y openssl net-tools which jq && yum clean all && mkdir -p /home/kuscia/bin && mkdir -p /bin/aux && mkdir -p /home/kuscia/scripts && mkdir -p /home/kuscia/var/storage && mkdir -p /home/kuscia/pause:
#0 124.9 AnolisOS-8 - AppStream 0.0 B/s | 0 B 02:04
#0 124.9 Errors during downloading metadata for repository 'AppStream':
#0 124.9 - Curl error (28): Timeout was reached for http://mirrors.openanolis.cn/anolis/8/AppStream/x86_64/os/repodata/repomd.xml [Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds]
#0 125.0 Error: Failed to download metadata for repo 'AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

网络连接没有问题,可以 curl 到这个网址,网上说有可能是 Centos 更新的问题,但是我目前使用的是 ubuntu,这块暂时未知解决方案。

from kuscia.

bulletjet786 avatar bulletjet786 commented on August 27, 2024

make image 命令报如下错:

[stage-2 2/15] RUN yum install -y openssl net-tools which jq && yum clean all && mkdir -p /home/kuscia/bin && mkdir -p /bin/aux && mkdir -p /home/kuscia/scripts && mkdir -p /home/kuscia/var/storage && mkdir -p /home/kuscia/pause: #0 124.9 AnolisOS-8 - AppStream 0.0 B/s | 0 B 02:04 #0 124.9 Errors during downloading metadata for repository 'AppStream': #0 124.9 - Curl error (28): Timeout was reached for http://mirrors.openanolis.cn/anolis/8/AppStream/x86_64/os/repodata/repomd.xml [Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds] #0 125.0 Error: Failed to download metadata for repo 'AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

网络连接没有问题,可以 curl 到这个网址,网上说有可能是 Centos 更新的问题,但是我目前使用的是 ubuntu,这块暂时未知解决方案。

感觉是到yum这边的网络比较慢,要不你这边多试几次?docker是有cache的,你这边只要成功一次后面的就不需要重复拉取了。

from kuscia.

Do-U-Believe-In-Fate avatar Do-U-Believe-In-Fate commented on August 27, 2024

make image 命令报如下错:

[stage-2 2/15] RUN yum install -y openssl net-tools which jq && yum clean all && mkdir -p /home/kuscia/bin && mkdir -p /bin/aux && mkdir -p /home/kuscia/scripts && mkdir -p /home/kuscia/var/storage && mkdir -p /home/kuscia/pause: #0 124.9 AnolisOS-8 - AppStream 0.0 B/s | 0 B 02:04 #0 124.9 Errors during downloading metadata for repository 'AppStream': #0 124.9 - Curl error (28): Timeout was reached for http://mirrors.openanolis.cn/anolis/8/AppStream/x86_64/os/repodata/repomd.xml [Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds] #0 125.0 Error: Failed to download metadata for repo 'AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
网络连接没有问题,可以 curl 到这个网址,网上说有可能是 Centos 更新的问题,但是我目前使用的是 ubuntu,这块暂时未知解决方案。

感觉是到yum这边的网络比较慢,要不你这边多试几次?docker是有cache的,你这边只要成功一次后面的就不需要重复拉取了。

想问一下能否提供一下 repo 源,尝试换源但是多个源都不太支持,目前都是卡在同一组 yum 命令上

最新:已解决,换了机器

from kuscia.

Do-U-Believe-In-Fate avatar Do-U-Believe-In-Fate commented on August 27, 2024

kubectl get kj -o yaml

目前能够通过请求填入参数,但是存在直接 kubectl get kj 不会显示资源的问题

把kusciaJob中的party[].template cpu/memory参数 填充到对应的 kusciaTask的Parties[].template下,这步大致是如何实现的,直接修改 job_service.go 文件会报错

from kuscia.

gshilei avatar gshilei commented on August 27, 2024

Hi @Do-U-Believe-In-Fate , 后面我们俩约个会,解答下你的疑问。

from kuscia.

Do-U-Believe-In-Fate avatar Do-U-Believe-In-Fate commented on August 27, 2024

代码已提交一个版本,出现以下问题:
1、提交以后出现一些定义重复的问题导致 unit-test无法通过
图片
2、make image 的时候有一定几率导致 Alice 无法创建,报错为[Error] Probe gateway in namespace 'alice' failed. Please check the log,但 master 节点可以正常创建

from kuscia.

gshilei avatar gshilei commented on August 27, 2024

代码已提交一个版本,出现以下问题: 1、提交以后出现一些定义重复的问题导致 unit-test无法通过 图片 2、make image 的时候有一定几率导致 Alice 无法创建,报错为[Error] Probe gateway in namespace 'alice' failed. Please check the log,但 master 节点可以正常创建

因为你这个PR时间太长了,我们已经进行了很多迭代。请先把github上最新的代码拉到本地,本地解决下冲突。如果发现有些字段冲突了,且冲突的字段和你定义的字段内容一致,你可以直接用这些字段。

另外,请保证在本地通过改动的代码构建镜像,然后进行手动测试,是否符合预期。测试过程中,把结果贴一下。

from kuscia.

Do-U-Believe-In-Fate avatar Do-U-Believe-In-Fate commented on August 27, 2024

代码已提交一个版本,出现以下问题: 1、提交以后出现一些定义重复的问题导致 unit-test无法通过 图片 2、make image 的时候有一定几率导致 Alice 无法创建,报错为[Error] Probe gateway in namespace 'alice' failed. Please check the log,但 master 节点可以正常创建

因为你这个PR时间太长了,我们已经进行了很多迭代。请先把github上最新的代码拉到本地,本地解决下冲突。如果发现有些字段冲突了,且冲突的字段和你定义的字段内容一致,你可以直接用这些字段。

另外,请保证在本地通过改动的代码构建镜像,然后进行手动测试,是否符合预期。测试过程中,把结果贴一下。

好的,我这边尽快完成修改和手动测试

from kuscia.

Do-U-Believe-In-Fate avatar Do-U-Believe-In-Fate commented on August 27, 2024

【Do-U-Believe-In-Fate Give it to me】

from kuscia.

gshilei avatar gshilei commented on August 27, 2024

你好,想问一下这个任务可否重新assign一下,刚才误点到unassign了,这周内会重新提交一份

好的,重新assign了

from kuscia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.