From 544a972b13cf661b03c731a505b0d32e09e4be22 Mon Sep 17 00:00:00 2001 From: yangjiaqi Date: Wed, 16 Nov 2022 20:42:15 +0800 Subject: [PATCH 1/3] set the burst value for the pod to enable the container burst (cherry picked from commit 1123de71cd3a9d5f64229f9b7abeb0f3d9671aed) --- VERSION-openeuler | 2 +- git-commit | 2 +- ...lue-for-the-pod-to-enable-the-contai.patch | 66 +++++++++++++++++++ rubik.spec | 8 ++- series.conf | 1 + 5 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 patch/0003-set-the-burst-value-for-the-pod-to-enable-the-contai.patch diff --git a/VERSION-openeuler b/VERSION-openeuler index 8269426..bfd9ea6 100644 --- a/VERSION-openeuler +++ b/VERSION-openeuler @@ -1 +1 @@ -1.0.0-1 +1.0.0-2 diff --git a/git-commit b/git-commit index 7783d8c..aa31743 100644 --- a/git-commit +++ b/git-commit @@ -1 +1 @@ -7a07f4381da6112fa156b036b0982303bdc2ad32 +55da35c3391d84a6f7af898ce39657d5c45709fe diff --git a/patch/0003-set-the-burst-value-for-the-pod-to-enable-the-contai.patch b/patch/0003-set-the-burst-value-for-the-pod-to-enable-the-contai.patch new file mode 100644 index 0000000..c79c251 --- /dev/null +++ b/patch/0003-set-the-burst-value-for-the-pod-to-enable-the-contai.patch @@ -0,0 +1,66 @@ +From 1817eb44c25980c5ced63965838fe428c8860540 Mon Sep 17 00:00:00 2001 +From: yangjiaqi +Date: Wed, 16 Nov 2022 20:34:20 +0800 +Subject: [PATCH] set the burst value for the pod to enable the container burst + +--- + pkg/quota/quota_burst.go | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +diff --git a/pkg/quota/quota_burst.go b/pkg/quota/quota_burst.go +index 641e514..2d13cec 100644 +--- a/pkg/quota/quota_burst.go ++++ b/pkg/quota/quota_burst.go +@@ -27,7 +27,6 @@ import ( + "isula.org/rubik/pkg/typedef" + ) + +- + // SetPodsQuotaBurst sync pod's burst quota when autoconfig is set + func SetPodsQuotaBurst(podInfos map[string]*typedef.PodInfo) { + for _, pi := range podInfos { +@@ -62,6 +61,7 @@ func setPodQuotaBurst(podInfo *typedef.PodInfo) { + if podInfo.QuotaBurst == constant.InvalidBurst { + return + } ++ // 1. Try to write container burst value + burst := big.NewInt(podInfo.QuotaBurst).String() + for _, c := range podInfo.Containers { + err := setCtrQuotaBurst([]byte(burst), c) +@@ -69,20 +69,27 @@ func setPodQuotaBurst(podInfo *typedef.PodInfo) { + log.Errorf("set container quota burst failed: %v", err) + } + } ++ // 2. Try to write pod burst value ++ const subsys = "cpu" ++ podPath := filepath.Join(podInfo.CgroupRoot, subsys, podInfo.CgroupPath) ++ podBurst := big.NewInt(int64(len(podInfo.Containers)) * podInfo.QuotaBurst).String() ++ setQuotaBurst([]byte(podBurst), podPath) + } + + func setCtrQuotaBurst(burst []byte, c *typedef.ContainerInfo) error { +- const ( +- fname = "cpu.cfs_burst_us" +- subsys = "cpu" +- ) ++ const subsys = "cpu" + cgpath := c.CgroupPath(subsys) +- fpath := filepath.Join(cgpath, fname) ++ return setQuotaBurst(burst, cgpath) ++} + ++func setQuotaBurst(burst []byte, cgpath string) error { ++ const burst_file_name = "cpu.cfs_burst_us" ++ fpath := filepath.Join(cgpath, burst_file_name) ++ // check whether cgroup support cpu burst + if _, err := os.Stat(fpath); err != nil && os.IsNotExist(err) { + return errors.Errorf("quota-burst path=%v missing", fpath) + } +- ++ // try to write cfs_burst_us + if err := ioutil.WriteFile(fpath, burst, constant.DefaultFileMode); err != nil { + return errors.Errorf("quota-burst path=%v setting failed: %v", fpath, err) + } +-- +2.30.0 + diff --git a/rubik.spec b/rubik.spec index 1588d4c..fc4542a 100644 --- a/rubik.spec +++ b/rubik.spec @@ -1,6 +1,6 @@ Name: rubik Version: 1.0.0 -Release: 1 +Release: 2 Summary: Hybrid Deployment for Cloud Native License: Mulan PSL V2 URL: https://gitee.com/openeuler/rubik @@ -50,6 +50,12 @@ install -Dp ./Dockerfile %{buildroot}%{_sharedstatedir}/%{name}/Dockerfile rm -rf %{buildroot} %changelog +* Wed Nov 16 2022 yangjiaqi - 1.0.0-2 +- Type:bugfix +- CVE:NA +- SUG:restart +- DESC:set the burst value for the pod to enable the container burst + * Mon Nov 14 2022 hanchao - 1.0.0-1 - Type:bugfix - CVE:NA diff --git a/series.conf b/series.conf index ceb6f3f..d1dc491 100644 --- a/series.conf +++ b/series.conf @@ -1,3 +1,4 @@ patch/0001-rubik-enable-GO111MODULE-and-Optimized-compilation-i.patch patch/0002-rubik-fix-Dockerfile-build-failed.patch +0003-set-the-burst-value-for-the-pod-to-enable-the-contai.patch #end of file From cd8d8b2c1baf60547bf35f349f5e078830ad15ff Mon Sep 17 00:00:00 2001 From: yangjiaqi Date: Wed, 16 Nov 2022 22:02:18 +0800 Subject: [PATCH 2/3] bump version (cherry picked from commit ac09b026d5a7ae11773ed847d303d15714cad061) --- VERSION-openeuler | 2 +- git-commit | 2 +- rubik.spec | 8 +++++++- series.conf | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/VERSION-openeuler b/VERSION-openeuler index bfd9ea6..4fdf97c 100644 --- a/VERSION-openeuler +++ b/VERSION-openeuler @@ -1 +1 @@ -1.0.0-2 +1.0.0-3 diff --git a/git-commit b/git-commit index aa31743..135ca98 100644 --- a/git-commit +++ b/git-commit @@ -1 +1 @@ -55da35c3391d84a6f7af898ce39657d5c45709fe +08f639805e239742397ecb109d477cae4ec1b3a7 diff --git a/rubik.spec b/rubik.spec index fc4542a..3fd9e2c 100644 --- a/rubik.spec +++ b/rubik.spec @@ -1,6 +1,6 @@ Name: rubik Version: 1.0.0 -Release: 2 +Release: 3 Summary: Hybrid Deployment for Cloud Native License: Mulan PSL V2 URL: https://gitee.com/openeuler/rubik @@ -50,6 +50,12 @@ install -Dp ./Dockerfile %{buildroot}%{_sharedstatedir}/%{name}/Dockerfile rm -rf %{buildroot} %changelog +* Wed Nov 16 2022 yangjiaqi - 1.0.0-3 +- Type:bug fix +- CVE:NA +- SUG:restart +- DESC:bump version + * Wed Nov 16 2022 yangjiaqi - 1.0.0-2 - Type:bugfix - CVE:NA diff --git a/series.conf b/series.conf index d1dc491..4502741 100644 --- a/series.conf +++ b/series.conf @@ -1,4 +1,4 @@ patch/0001-rubik-enable-GO111MODULE-and-Optimized-compilation-i.patch patch/0002-rubik-fix-Dockerfile-build-failed.patch -0003-set-the-burst-value-for-the-pod-to-enable-the-contai.patch +patch/0003-set-the-burst-value-for-the-pod-to-enable-the-contai.patch #end of file From b6355f2195504a4daff3c77c96cfc7a97213d6f4 Mon Sep 17 00:00:00 2001 From: yangjiaqi Date: Mon, 21 Nov 2022 11:08:38 +0800 Subject: [PATCH 3/3] add rubik yaml (cherry picked from commit 5c6a73c53df10364c180beff72bbd2712195ec18) --- VERSION-openeuler | 2 +- git-commit | 2 +- rubik.spec | 10 ++++++++-- rubik.yaml | 3 +++ 4 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 rubik.yaml diff --git a/VERSION-openeuler b/VERSION-openeuler index 4fdf97c..c85b840 100644 --- a/VERSION-openeuler +++ b/VERSION-openeuler @@ -1 +1 @@ -1.0.0-3 +1.0.0-4 diff --git a/git-commit b/git-commit index 135ca98..4f6f58e 100644 --- a/git-commit +++ b/git-commit @@ -1 +1 @@ -08f639805e239742397ecb109d477cae4ec1b3a7 +333208525a24588c45bd34b048a5ae82803efaad diff --git a/rubik.spec b/rubik.spec index 3fd9e2c..f95873c 100644 --- a/rubik.spec +++ b/rubik.spec @@ -1,6 +1,6 @@ Name: rubik Version: 1.0.0 -Release: 3 +Release: 4 Summary: Hybrid Deployment for Cloud Native License: Mulan PSL V2 URL: https://gitee.com/openeuler/rubik @@ -50,8 +50,14 @@ install -Dp ./Dockerfile %{buildroot}%{_sharedstatedir}/%{name}/Dockerfile rm -rf %{buildroot} %changelog +* Mon Nov 21 2022 yangjiaqi - 1.0.0-4 +- Type:bugfix +- CVE:NA +- SUG:restart +- DESC:add yaml + * Wed Nov 16 2022 yangjiaqi - 1.0.0-3 -- Type:bug fix +- Type:bugfix - CVE:NA - SUG:restart - DESC:bump version diff --git a/rubik.yaml b/rubik.yaml new file mode 100644 index 0000000..7aff293 --- /dev/null +++ b/rubik.yaml @@ -0,0 +1,3 @@ +--- +version_control: gitee +src_repo: openEuler/rubik \ No newline at end of file