Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
reprotest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reproducible Builds
reprotest
Commits
9d0562db
You need to sign in or sign up before continuing.
Commit
9d0562db
authored
1 year ago
by
Vagrant Cascadian
Browse files
Options
Downloads
Patches
Plain Diff
draft attempt at enabling specific number of CPUs.
parent
f2c04a3f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#645534
failed
1 year ago
Stage: provisioning
Stage: build
Stage: publish
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
reprotest/build.py
+14
-1
14 additions, 1 deletion
reprotest/build.py
with
14 additions
and
1 deletion
reprotest/build.py
+
14
−
1
View file @
9d0562db
...
...
@@ -333,12 +333,19 @@ def aslr(ctx, build, vary):
def
num_cpus
(
ctx
,
build
,
vary
):
_
=
build
_
=
_
.
append_setup_exec_raw
(
'
CPU_MAX=$(nproc)
'
)
if
ctx
.
num_cpus
.
cpus
:
_
=
_
.
append_setup_exec_raw
(
'
CPU_MAX=$(nproc)
'
)
else
:
_
=
_
.
append_setup_exec_raw
(
'
CPU_MAX=%s
'
%
ctx
.
num_cpus
.
cpus
)
_
=
_
.
append_setup_exec_raw
(
'
CPU_MIN=$({ echo $CPU_MAX; echo %s; } | sort -n | head -n1)
'
%
ctx
.
min_cpus
)
if
ctx
.
min_cpus
<=
0
:
raise
ValueError
(
"
--min-cpus must be a positive integer:
"
%
ctx
.
min_cpus
)
if
not
vary
:
_
=
_
.
append_setup_exec_raw
(
'
CPU_NUM=$CPU_MIN
'
)
if
ctx
.
num_cpus
.
cpus
:
_
=
_
.
append_setup_exec_raw
(
'
CPU_NUM=$(if [ $CPU_MIN = $CPU_MAX ];
\
then echo $CPU_MIN; echo >&2
"
only 1 CPU is available; num_cpus is ineffective
"
;
\
else echo %s; fi)
'
%
ctx
.
num_cpus
.
cpus
)
else
:
# random number between min_cpus and $(nproc)
_
=
_
.
append_setup_exec_raw
(
'
CPU_NUM=$(if [ $CPU_MIN = $CPU_MAX ];
\
...
...
@@ -582,6 +589,11 @@ class LocalesVariation(collections.namedtuple('_LocaleVariation', 'locale')):
def
default
(
cls
):
return
cls
(
mdiffconf
.
strlist_set
(
"
;
"
))
class
NumCpusVariation
(
collections
.
namedtuple
(
'
_LocaleVariation
'
,
'
cpus
'
)):
@classmethod
def
default
(
cls
):
return
None
class
VariationSpec
(
mdiffconf
.
ImmutableNamespace
):
@classmethod
def
default
(
cls
,
variations
=
VARIATIONS
):
...
...
@@ -591,6 +603,7 @@ class VariationSpec(mdiffconf.ImmutableNamespace):
"
time
"
:
TimeVariation
.
default
(),
"
domain_host
"
:
DomainHostVariation
.
default
(),
"
locales
"
:
LocalesVariation
.
default
(),
"
num_cpus
"
:
NumCpusVariation
.
default
(),
}
return
cls
(
**
{
k
:
default_overrides
.
get
(
k
,
True
)
for
k
in
variations
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment