Skip to content

Move "detect host CPUs" into mantle#1287

Merged
openshift-merge-robot merged 1 commit intocoreos:masterfrom
cgwalters:qemu-ncpus-host
Apr 1, 2020
Merged

Move "detect host CPUs" into mantle#1287
openshift-merge-robot merged 1 commit intocoreos:masterfrom
cgwalters:qemu-ncpus-host

Conversation

@cgwalters
Copy link
Copy Markdown
Member

Today if you type cosa run you get the host CPUs, but
all invocations of kola (including kola spawn to log in
via SSH, as well as all tests) use exactly 1 processor.

This doesn't make sense - it's just a historical artifact.

This continues the move of cosa qemu logic into mantle so
we can use it for tests. For now though, kola qemuexec learns a
-C argument to guess the number of CPUs.

Yes, the technical debt reduction from the mantle/cosa merger
is STILL GOING!

With a few more patches cmd-run will turn into just
exec kola qemuexec [a few args].

Copy link
Copy Markdown
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly LGTM - a few comments

Comment thread mantle/system/nproc.go
Comment thread mantle/platform/qemu.go
Comment thread mantle/cmd/kola/qemuexec.go Outdated
Today if you type `cosa run` you get the host CPUs, but
all invocations of `kola` (including `kola spawn` to log in
via SSH, as well as all tests) use exactly 1 processor.

This doesn't make sense - it's just a historical artifact.

This continues the move of cosa qemu logic into mantle so
we can use it for tests.  For now though, `kola qemuexec` learns a
`-C` argument to guess the number of CPUs.

With a few more patches `cmd-run` will turn into just
`exec kola qemuexec [a few args]`.
@dustymabe
Copy link
Copy Markdown
Member

/lgtm

Nice work @cgwalters

@openshift-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cgwalters, dustymabe

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [cgwalters,dustymabe]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cgwalters
Copy link
Copy Markdown
Member Author

/test sanity

@openshift-merge-robot openshift-merge-robot merged commit aacffac into coreos:master Apr 1, 2020
jlebon added a commit to jlebon/rpm-ostree that referenced this pull request Jan 21, 2021
Otherwise, it defaults to `_SC_NPROCESSORS_ONLN` (via `%make_build` ->
`%_smp_mflags` -> `%_smp_build_ncpus` -> `%{getncpus}` ->
https://github.com/rpm-software-management/rpm/blob/48c0f28834eb377a54f27ee0b6950af7e6d537b8/rpmio/macro.c#L583).
And that's going to be wrong in Kubernetes because we're constrained via
cgroups.

The `%_smp_build_ncpus` macro allows overriding this logic via
`RPM_BUILD_NCPUS`.

See: coreos/coreos-ci#23
See: coreos/coreos-assembler#1287
jlebon added a commit to jlebon/rpm-ostree that referenced this pull request Jan 21, 2021
Otherwise, it defaults to `_SC_NPROCESSORS_ONLN` (via `%make_build` ->
`%_smp_mflags` -> `%_smp_build_ncpus` -> `%{getncpus}` ->
https://github.com/rpm-software-management/rpm/blob/48c0f28834eb377a54f27ee0b6950af7e6d537b8/rpmio/macro.c#L583).
And that's going to be wrong in Kubernetes because we're constrained via
cgroups.

The `%_smp_build_ncpus` macro allows overriding this logic via
`RPM_BUILD_NCPUS`.

See: coreos/coreos-ci#23
See: coreos/coreos-assembler#632
See: coreos/coreos-assembler#1287
openshift-merge-robot pushed a commit to coreos/rpm-ostree that referenced this pull request Jan 21, 2021
Otherwise, it defaults to `_SC_NPROCESSORS_ONLN` (via `%make_build` ->
`%_smp_mflags` -> `%_smp_build_ncpus` -> `%{getncpus}` ->
https://github.com/rpm-software-management/rpm/blob/48c0f28834eb377a54f27ee0b6950af7e6d537b8/rpmio/macro.c#L583).
And that's going to be wrong in Kubernetes because we're constrained via
cgroups.

The `%_smp_build_ncpus` macro allows overriding this logic via
`RPM_BUILD_NCPUS`.

See: coreos/coreos-ci#23
See: coreos/coreos-assembler#632
See: coreos/coreos-assembler#1287
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants