From a8ade7ff60b2a3836d513c0a2467a764e4a78e40 Mon Sep 17 00:00:00 2001 From: Zhixiong Chi Date: Mon, 29 Nov 2021 15:55:27 +0800 Subject: [PATCH] stx tool: Export the env variable MAX_CPUS to builder container To add the jobs during the package building, we export the env variable MAX_CPUS to the builder container. Story: 2008862 Task: 44081 Depends-On: https://review.opendev.org/c/starlingx/tools/+/819596 Signed-off-by: Zhixiong Chi Change-Id: I5bd15232209e69d4836bb5ae134ad5bd2912aab6 --- stx/lib/stx/stx_control.py | 3 +++ stx/stx-build-tools-chart/stx-builder/configmap/localrc.sample | 2 ++ 2 files changed, 5 insertions(+) diff --git a/stx/lib/stx/stx_control.py b/stx/lib/stx/stx_control.py index e302b71e..c580e150 100644 --- a/stx/lib/stx/stx_control.py +++ b/stx/lib/stx/stx_control.py @@ -64,6 +64,8 @@ class HandleControlTask: def finish_configure(self): '''Before starting, we need to finish the setup''' + max_cpus = os.environ['MINIKUBECPUS'] + projectname = self.stxconfig.getConfig('project', 'name') builder_uid = self.stxconfig.getConfig('builder', 'uid') builder_myuname = self.stxconfig.getConfig('builder', 'myuname') @@ -157,6 +159,7 @@ stx-pkgbuilder/configmap/') line = line.replace("@HOSTUSERNAME@", hostusername) line = line.replace("@CENGNURL@", cengnurl) line = line.replace("@OSTREE_OSNAME@", ostree_osname) + line = line.replace("@MAX_CPUS@", max_cpus) if sourceslist: line = line.replace("@fetch@", "true") line = line.replace("@SOURCESLIST@", sourceslist) diff --git a/stx/stx-build-tools-chart/stx-builder/configmap/localrc.sample b/stx/stx-build-tools-chart/stx-builder/configmap/localrc.sample index a4d63f1c..ac63742b 100644 --- a/stx/stx-build-tools-chart/stx-builder/configmap/localrc.sample +++ b/stx/stx-build-tools-chart/stx-builder/configmap/localrc.sample @@ -51,3 +51,5 @@ export REPOMGR_DEPLOY_URL=http://@PROJECT@-stx-repomgr:80/ export BUILDER_URL=http://@PROJECT@-stx-pkgbuilder:8080/pkgbuilder/ export OSTREE_OSNAME=@OSTREE_OSNAME@ + +export MAX_CPUS=@MAX_CPUS@