Skip to content

teuthology/suite: pass the base config to scripts - #2008

Merged
zmc merged 4 commits into
ceph:mainfrom
batrick:fragment-merge-base-config
Oct 25, 2024
Merged

zmc merged 4 commits into
ceph:mainfrom
batrick:fragment-merge-base-config

Conversation

@batrick

@batrick batrick commented Oct 17, 2024 •

Copy link
Copy Markdown
Member

This PR is to support: ceph/ceph#60386

Also, this PR fixes a bug: teuthology/tasks/kernel: default branch should be "distro". When the kernel dictionary is empty, the kernel task should assume distro.

@batrick
batrick requested review from vshankar and xiubli October 18, 2024 12:35
@batrick
batrick force-pushed the fragment-merge-base-config branch 2 times, most recently from 4f3fa41 to 44e3d73 Compare October 18, 2024 14:14
So it's easier to see its value before any configs are generated.

Signed-off-by: Patrick Donnelly <[email protected]>
For inspection by scripts.

Signed-off-by: Patrick Donnelly <[email protected]>
@batrick
batrick force-pushed the fragment-merge-base-config branch 4 times, most recently from 7b0d07a to ba3002e Compare October 18, 2024 17:21
batrick added a commit to batrick/ceph that referenced this pull request Oct 18, 2024
Normally, the fs suite overrides the kernel branch whenever the kernel client
is used, according to the matrix of configs. This prevents easily testing a new
kernel with the -k option to teuthology-suite. So, using the base config passed
to the script, detect if an alternate testing kernel is desired and use that
instead.

The scheduler still needs to do some work:

    $ teuthology-suite ... --verbose -k wip-pdonnell-i66704 --filter k-testing
    ...
    2024-10-18 00:29:43,875.875 DEBUG:teuthology.suite.merge:base kernel {'branch': 'wip-pdonnell-i66704', 'kdb': 1, 'sha1': '745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03', 'flavor': 'default'}
    2024-10-18 00:29:43,875.875 DEBUG:teuthology.suite.merge:overriding testing kernel with {'branch': 'wip-pdonnell-i66704', 'kdb': 1, 'sha1': '745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03', 'flavor': 'default'}

vs.

    $ teuthology-suite ... --verbose --filter k-testing
    ...
    2024-10-17 20:04:52,265.265 DEBUG:teuthology.suite.merge:base kernel {'branch': 'distro', 'kdb': 1, 'sha1': 'distro'}

Which will only select jobs using the "testing" kernel.

See-also: ceph/teuthology#2008
Fixes: https://tracker.ceph.com/issues/68603
Signed-off-by: Patrick Donnelly <[email protected]>
@batrick
batrick force-pushed the fragment-merge-base-config branch 6 times, most recently from af3ae9e to 60ca0e7 Compare October 18, 2024 19:27
@batrick

batrick commented Oct 21, 2024 •

Copy link
Copy Markdown
Member Author

batrick added a commit to batrick/ceph that referenced this pull request Oct 21, 2024
Normally, the fs suite overrides the kernel branch whenever the kernel client
is used, according to the matrix of configs. This prevents easily testing a new
kernel with the -k option to teuthology-suite. So, using the base config passed
to the script, detect if an alternate testing kernel is desired and use that
instead.

The scheduler still needs to do some work:

    $ teuthology-suite ... --verbose -k wip-pdonnell-i66704 --filter k-testing
    ...
    2024-10-18 00:29:43,875.875 DEBUG:teuthology.suite.merge:base kernel {'branch': 'wip-pdonnell-i66704', 'kdb': 1, 'sha1': '745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03', 'flavor': 'default'}
    2024-10-18 00:29:43,875.875 DEBUG:teuthology.suite.merge:overriding testing kernel with {'branch': 'wip-pdonnell-i66704', 'kdb': 1, 'sha1': '745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03', 'flavor': 'default'}

vs.

    $ teuthology-suite ... --verbose --filter k-testing
    ...
    2024-10-17 20:04:52,265.265 DEBUG:teuthology.suite.merge:base kernel {'branch': 'distro', 'kdb': 1, 'sha1': 'distro'}

Which will only select jobs using the "testing" kernel.

See-also: ceph/teuthology#2008
Fixes: https://tracker.ceph.com/issues/68603
Signed-off-by: Patrick Donnelly <[email protected]>

@zmc zmc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice! I just have one question

Comment thread teuthology/suite/merge.py Outdated
log.debug("configuring Lua randomseed to %d", seed)
L.execute(f'local math = require"math"; math.randomseed({seed});')
new_script = L.eval('new_script')
base_config_yaml = yaml.safe_load(str(base_config))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's not immediately obvious why we'd need to create a copy of base_config here and then again on 133 - could you explain the reasoning?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's to basically enforce a read-only view of the base_config.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I tried to do copy.deepcopy(base_config) below but ran into inscrutable recursion errors that didn't seem worth debugging. So I'm just reloading it as a legit yaml dictionary here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think I would suggest just doing a yaml_complete_obj = copy.deepcopy(base_config.to_dict()) on 133 and dropping this statement.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ack

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

@batrick
batrick force-pushed the fragment-merge-base-config branch from 9bdfb74 to ab123ee Compare October 22, 2024 21:04
Comment thread teuthology/suite/merge.py Resolved
Presently the code tries to merge the base_config when the worker starts
running. There's no need to construct it this way and it prevents sharing the
"defaults" with the fragment merging infrastructure. It also prevents
overriding defaults like:

    kernel
        branch: wip-pdonnell-i66704
        client:
            branch: wip-pdonnell-i66704
            flavor: default
            kdb: 1
            sha1: 745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03
        flavor: default
        kdb: 1
        sha1: 745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03

A YAML fragment can set kernel.client but it cannot delete the defaults for
kernel.(branch|flavor|kdb|sha1) because there's no way to remove YAML elements
via a deep merge.

Signed-off-by: Patrick Donnelly <[email protected]>
Generally, we don't want to install any kernel by default. There also is no
"main" branch for the ceph-client.git project.

Signed-off-by: Patrick Donnelly <[email protected]>
@batrick
batrick force-pushed the fragment-merge-base-config branch from ab123ee to 65f6bfa Compare October 23, 2024 01:18
@batrick

batrick commented Oct 24, 2024

Copy link
Copy Markdown
Member Author

@zmc good to go?

@zmc
zmc merged commit d61fe8c into ceph:main Oct 25, 2024
JonBailey1993 pushed a commit to JonBailey1993/ceph that referenced this pull request Dec 2, 2024
Normally, the fs suite overrides the kernel branch whenever the kernel client
is used, according to the matrix of configs. This prevents easily testing a new
kernel with the -k option to teuthology-suite. So, using the base config passed
to the script, detect if an alternate testing kernel is desired and use that
instead.

The scheduler still needs to do some work:

    $ teuthology-suite ... --verbose -k wip-pdonnell-i66704 --filter k-testing
    ...
    2024-10-18 00:29:43,875.875 DEBUG:teuthology.suite.merge:base kernel {'branch': 'wip-pdonnell-i66704', 'kdb': 1, 'sha1': '745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03', 'flavor': 'default'}
    2024-10-18 00:29:43,875.875 DEBUG:teuthology.suite.merge:overriding testing kernel with {'branch': 'wip-pdonnell-i66704', 'kdb': 1, 'sha1': '745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03', 'flavor': 'default'}

vs.

    $ teuthology-suite ... --verbose --filter k-testing
    ...
    2024-10-17 20:04:52,265.265 DEBUG:teuthology.suite.merge:base kernel {'branch': 'distro', 'kdb': 1, 'sha1': 'distro'}

Which will only select jobs using the "testing" kernel.

See-also: ceph/teuthology#2008
Fixes: https://tracker.ceph.com/issues/68603
Signed-off-by: Patrick Donnelly <[email protected]>
kulahe3 pushed a commit to kulahe3/ceph that referenced this pull request Dec 10, 2024
Normally, the fs suite overrides the kernel branch whenever the kernel client
is used, according to the matrix of configs. This prevents easily testing a new
kernel with the -k option to teuthology-suite. So, using the base config passed
to the script, detect if an alternate testing kernel is desired and use that
instead.

The scheduler still needs to do some work:

    $ teuthology-suite ... --verbose -k wip-pdonnell-i66704 --filter k-testing
    ...
    2024-10-18 00:29:43,875.875 DEBUG:teuthology.suite.merge:base kernel {'branch': 'wip-pdonnell-i66704', 'kdb': 1, 'sha1': '745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03', 'flavor': 'default'}
    2024-10-18 00:29:43,875.875 DEBUG:teuthology.suite.merge:overriding testing kernel with {'branch': 'wip-pdonnell-i66704', 'kdb': 1, 'sha1': '745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03', 'flavor': 'default'}

vs.

    $ teuthology-suite ... --verbose --filter k-testing
    ...
    2024-10-17 20:04:52,265.265 DEBUG:teuthology.suite.merge:base kernel {'branch': 'distro', 'kdb': 1, 'sha1': 'distro'}

Which will only select jobs using the "testing" kernel.

See-also: ceph/teuthology#2008
Fixes: https://tracker.ceph.com/issues/68603
Signed-off-by: Patrick Donnelly <[email protected]>
Jayaprakash-ibm pushed a commit to ceph/ceph-ci that referenced this pull request Dec 24, 2024
Normally, the fs suite overrides the kernel branch whenever the kernel client
is used, according to the matrix of configs. This prevents easily testing a new
kernel with the -k option to teuthology-suite. So, using the base config passed
to the script, detect if an alternate testing kernel is desired and use that
instead.

The scheduler still needs to do some work:

    $ teuthology-suite ... --verbose -k wip-pdonnell-i66704 --filter k-testing
    ...
    2024-10-18 00:29:43,875.875 DEBUG:teuthology.suite.merge:base kernel {'branch': 'wip-pdonnell-i66704', 'kdb': 1, 'sha1': '745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03', 'flavor': 'default'}
    2024-10-18 00:29:43,875.875 DEBUG:teuthology.suite.merge:overriding testing kernel with {'branch': 'wip-pdonnell-i66704', 'kdb': 1, 'sha1': '745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03', 'flavor': 'default'}

vs.

    $ teuthology-suite ... --verbose --filter k-testing
    ...
    2024-10-17 20:04:52,265.265 DEBUG:teuthology.suite.merge:base kernel {'branch': 'distro', 'kdb': 1, 'sha1': 'distro'}

Which will only select jobs using the "testing" kernel.

See-also: ceph/teuthology#2008
Fixes: https://tracker.ceph.com/issues/68603
Signed-off-by: Patrick Donnelly <[email protected]>
batrick added a commit to batrick/ceph that referenced this pull request Jan 9, 2025
Normally, the fs suite overrides the kernel branch whenever the kernel client
is used, according to the matrix of configs. This prevents easily testing a new
kernel with the -k option to teuthology-suite. So, using the base config passed
to the script, detect if an alternate testing kernel is desired and use that
instead.

The scheduler still needs to do some work:

    $ teuthology-suite ... --verbose -k wip-pdonnell-i66704 --filter k-testing
    ...
    2024-10-18 00:29:43,875.875 DEBUG:teuthology.suite.merge:base kernel {'branch': 'wip-pdonnell-i66704', 'kdb': 1, 'sha1': '745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03', 'flavor': 'default'}
    2024-10-18 00:29:43,875.875 DEBUG:teuthology.suite.merge:overriding testing kernel with {'branch': 'wip-pdonnell-i66704', 'kdb': 1, 'sha1': '745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03', 'flavor': 'default'}

vs.

    $ teuthology-suite ... --verbose --filter k-testing
    ...
    2024-10-17 20:04:52,265.265 DEBUG:teuthology.suite.merge:base kernel {'branch': 'distro', 'kdb': 1, 'sha1': 'distro'}

Which will only select jobs using the "testing" kernel.

See-also: ceph/teuthology#2008
Fixes: https://tracker.ceph.com/issues/68603
Signed-off-by: Patrick Donnelly <[email protected]>
(cherry picked from commit 4b084c6)
batrick added a commit to batrick/ceph that referenced this pull request Jan 9, 2025
Normally, the fs suite overrides the kernel branch whenever the kernel client
is used, according to the matrix of configs. This prevents easily testing a new
kernel with the -k option to teuthology-suite. So, using the base config passed
to the script, detect if an alternate testing kernel is desired and use that
instead.

The scheduler still needs to do some work:

    $ teuthology-suite ... --verbose -k wip-pdonnell-i66704 --filter k-testing
    ...
    2024-10-18 00:29:43,875.875 DEBUG:teuthology.suite.merge:base kernel {'branch': 'wip-pdonnell-i66704', 'kdb': 1, 'sha1': '745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03', 'flavor': 'default'}
    2024-10-18 00:29:43,875.875 DEBUG:teuthology.suite.merge:overriding testing kernel with {'branch': 'wip-pdonnell-i66704', 'kdb': 1, 'sha1': '745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03', 'flavor': 'default'}

vs.

    $ teuthology-suite ... --verbose --filter k-testing
    ...
    2024-10-17 20:04:52,265.265 DEBUG:teuthology.suite.merge:base kernel {'branch': 'distro', 'kdb': 1, 'sha1': 'distro'}

Which will only select jobs using the "testing" kernel.

See-also: ceph/teuthology#2008
Fixes: https://tracker.ceph.com/issues/68603
Signed-off-by: Patrick Donnelly <[email protected]>
(cherry picked from commit 4b084c6)
afreen23 pushed a commit to rhcs-dashboard/ceph that referenced this pull request Jul 29, 2026
Normally, the fs suite overrides the kernel branch whenever the kernel client
is used, according to the matrix of configs. This prevents easily testing a new
kernel with the -k option to teuthology-suite. So, using the base config passed
to the script, detect if an alternate testing kernel is desired and use that
instead.

The scheduler still needs to do some work:

    $ teuthology-suite ... --verbose -k wip-pdonnell-i66704 --filter k-testing
    ...
    2024-10-18 00:29:43,875.875 DEBUG:teuthology.suite.merge:base kernel {'branch': 'wip-pdonnell-i66704', 'kdb': 1, 'sha1': '745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03', 'flavor': 'default'}
    2024-10-18 00:29:43,875.875 DEBUG:teuthology.suite.merge:overriding testing kernel with {'branch': 'wip-pdonnell-i66704', 'kdb': 1, 'sha1': '745cacd8f31e50d7f3b6039bbd8c9a8dfc07bf03', 'flavor': 'default'}

vs.

    $ teuthology-suite ... --verbose --filter k-testing
    ...
    2024-10-17 20:04:52,265.265 DEBUG:teuthology.suite.merge:base kernel {'branch': 'distro', 'kdb': 1, 'sha1': 'distro'}

Which will only select jobs using the "testing" kernel.

See-also: ceph/teuthology#2008
Fixes: https://tracker.ceph.com/issues/68603
Signed-off-by: Patrick Donnelly <[email protected]>
(cherry picked from commit 8359ba1)
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.

2 participants