Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

teuthology-suite: automate -t argument default value #1490

Merged
merged 1 commit into from
Jun 2, 2020

Conversation

kshtsk
Copy link
Contributor

@kshtsk kshtsk commented May 24, 2020

This change is required to determine which teuthology
branch should be used for scheduling a run for the
given ceph branch.

In order to enable the functionality of this patch we need
submit and merge qa/.teuthology to ceph master
with following content:

# cherry-pick this for py3 ready branches
teuthology_branch: master

And add to /etc/teuthology.yaml on sepia server the line

# remove this line when all ceph branches get py3 compatible qa tasks
teuthology_branch: py2

Obviously, all users have to update their teuthology sandboxes.
As far as other branches

@kshtsk kshtsk requested a review from gregsfortytwo May 24, 2020 06:07
@kshtsk kshtsk force-pushed the wip-auto-t branch 3 times, most recently from 8462ba6 to 731e4fd Compare May 24, 2020 06:42
@sebastian-philipp
Copy link
Contributor

Hm. This looks suspiciously similar to a requirements.txt file in ceph/qa to me.

Researching a bit more and it turns out that we already have an explicitly dependency to teuthology in the tox.ini.

I suspect a proper requirements.txt won't work, right?

teuthology/suite/run.py Outdated Show resolved Hide resolved
teuthology/suite/run.py Outdated Show resolved Hide resolved
@kshtsk
Copy link
Contributor Author

kshtsk commented May 24, 2020

Hm. This looks suspiciously similar to a requirements.txt file in ceph/qa to me.

I'm not following what you're referring to?

Researching a bit more and it turns out that we already have an explicitly dependency to teuthology in the tox.ini.

I suspect a proper requirements.txt won't work, right?

I have no idea what you're asking for, teuthology does not use requirements.txt at the moment, for py3 it uses requirements3.txt and for py2 it uses requirements2.txt

Copy link
Contributor

@idryomov idryomov left a comment

Choose a reason for hiding this comment

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

FWIW I don't think this is worth it, both the override file and the tying of teuthology_branch to suite_branch or ceph_branch. Particularly the latter -- teuthology repo is full of stale branches with fairly generic names (wip-fixes and alike).

I think having to specify --teuthology-branch py2 is just fine, but if the consensus is that py2/py3 automation is necessary, then only py2 branch should be treated specially IMO. Instead of adding an override file, perhaps there is a py2-specific marker that can be grepped for in qa/tasks directory?

@kshtsk
Copy link
Contributor Author

kshtsk commented May 24, 2020

FWIW I don't think this is worth it, both the override file and the tying of teuthology_branch to suite_branch or ceph_branch. Particularly the latter -- teuthology repo is full of stale branches with fairly generic names (wip-fixes and alike).

Regarding suite_branch and ceph_branch functionality it was already in the code, I just added a description of this hidden logic. Do you request to delete it? @djgalloway @gregsfortytwo do we need to keep this?

I think having to specify --teuthology-branch py2 is just fine, but if the consensus is that py2/py3 automation is necessary, then only py2 branch should be treated specially IMO.

The point is that to avoid pointing to the right branch by a user, especially for users who do not have a clue which branch to use.

Instead of adding an override file, perhaps there is a py2-specific marker that can be grepped for in qa/tasks directory?

This is overkill, it much easier to add single file.

@idryomov
Copy link
Contributor

FWIW I don't think this is worth it, both the override file and the tying of teuthology_branch to suite_branch or ceph_branch. Particularly the latter -- teuthology repo is full of stale branches with fairly generic names (wip-fixes and alike).

Regarding suite_branch and ceph_branch functionality it was already in the code, I just added a description of this hidden logic. Do you request to delete it? @djgalloway @gregsfortytwo do we need to keep this?

Was suite_branch already there? I thought it was just ceph_branch, which goes back to the early days of ceph, when all tasks lived in the teuthology repo and runs were scheduled with a shell script.

I'm not requesting that you delete it, but merely trying to discourage adding more tangling. It would be nice to look at whether ceph_branch logic is still needed, though -- there shouldn't be any good reason for it now. It's certainly not needed for any of the recent releases, as we are using the same py2 branch for them.

I think having to specify --teuthology-branch py2 is just fine, but if the consensus is that py2/py3 automation is necessary, then only py2 branch should be treated specially IMO.

The point is that to avoid pointing to the right branch by a user, especially for users who do not have a clue which branch to use.

Instead of adding an override file, perhaps there is a py2-specific marker that can be grepped for in qa/tasks directory?

This is overkill, it much easier to add single file.

Well, conceptually this file is an override for /etc/teuthology.yaml. I would argue that if you introduce an override mechanism, it should handle all options, not just one of them. And that is definitely an overkill for the problem at hand because all we need is for teuthology to detect that py2 tasks would be used and "switch" from py3 to py2. No additional surface area and no configuration files committed anywhere.

@kshtsk
Copy link
Contributor Author

kshtsk commented May 24, 2020

Was suite_branch already there? I thought it was just ceph_branch, which goes back to the early days of ceph, when all tasks lived in the teuthology repo and runs were scheduled with a shell script.

The ceph_branch what I saw has nothing todo with teuthology repo and uses the ceph repo.
If it is not the case, then I misinterpreted the usage of ceph_branch, because in other place the suite_branch is used for for checking out the code of tests from ceph repo, not teuthology. And following that logic I just complemented with logic reflecting ceph_branch and suite_branch substition of options --ceph and --suite-branch arguments.

I'm not requesting that you delete it, but merely trying to discourage adding more tangling. It would be nice to look at whether ceph_branch logic is still needed, though -- there shouldn't be any good reason for it now. It's certainly not needed for any of the recent releases, as we are using the same py2 branch for them.

I think having to specify --teuthology-branch py2 is just fine, but if the consensus is that py2/py3 automation is necessary, then only py2 branch should be treated specially IMO.

The point is that to avoid pointing to the right branch by a user, especially for users who do not have a clue which branch to use.

Instead of adding an override file, perhaps there is a py2-specific marker that can be grepped for in qa/tasks directory?

This is overkill, it much easier to add single file.

Well, conceptually this file is an override for /etc/teuthology.yaml. I would argue that if you introduce an override mechanism, it should handle all options, not just one of them.

It could look like an override for teuthology.yaml but it is not, it should not be, nevertheless, it has same yaml format, it only means to take only teuthology branch parameter.

And that is definitely an overkill for the problem at hand because all we need is for teuthology to detect that py2 tasks would be used and "switch" from py3 to py2. No additional surface area and no configuration files committed anywhere.

Could you elaborate, I'm not following, would it be better to you instead of yaml.safe_load('qa/.teuthology'), use misc.sh('grep py2 qa/.teuthology'). Or you want to try run python3 somepy3only.script? What if those files are missing in code base? The config file is easy to cherrypick. It would be greate to see a PR with your idea how it is the best to detect py2 tasks? ;-)

@idryomov
Copy link
Contributor

Was suite_branch already there? I thought it was just ceph_branch, which goes back to the early days of ceph, when all tasks lived in the teuthology repo and runs were scheduled with a shell script.

The ceph_branch what I saw has nothing todo with teuthology repo and uses the ceph repo.
If it is not the case, then I misinterpreted the usage of ceph_branch, because in other place the suite_branch is used for for checking out the code of tests from ceph repo, not teuthology. And following that logic I just complemented with logic reflecting ceph_branch and suite_branch substition of options --ceph and --suite-branch arguments.

I'm referring to this piece of code, where in the absence of explicit --teuthology-branch foo on the command line (or in the environment) teuthology switches to a teuthology branch with same name as ceph_branch:

...
elif not teuthology_branch:
    # Decide what branch of teuthology to use
    if util.git_branch_exists('teuthology', self.args.ceph_branch):
        teuthology_branch = self.args.ceph_branch

This behaviour goes way back, when all tasks lived in the teuthology repo and one had to use the same branch of ceph and teuthology. Those days are gone and I think we should look into dropping this logic.

This PR adds similar behaviour for suite_branch. I don't see what use case is being addressed by this change and I think it should be dropped regardless of how you choose to proceed with py2/py3.

@kshtsk
Copy link
Contributor Author

kshtsk commented May 24, 2020

This PR adds similar behaviour for suite_branch. I don't see what use case is being addressed by this change and I think it should be dropped regardless of how you choose to proceed with py2/py3.

thanks for the extra explanation, I'm actual fine with dropping it, just don't want to do it by my own will...

@idryomov
Copy link
Contributor

idryomov commented May 24, 2020

Instead of adding an override file, perhaps there is a py2-specific marker that can be grepped for in qa/tasks directory?

This is overkill, it much easier to add single file.

Well, conceptually this file is an override for /etc/teuthology.yaml. I would argue that if you introduce an override mechanism, it should handle all options, not just one of them.

It could look like an override for teuthology.yaml but it is not, it should not be, nevertheless, it has same yaml format, it only means to take only teuthology branch parameter.

And that is definitely an overkill for the problem at hand because all we need is for teuthology to detect that py2 tasks would be used and "switch" from py3 to py2. No additional surface area and no configuration files committed anywhere.

Could you elaborate, I'm not following, would it be better to you instead of yaml.safe_load('qa/.teuthology'), use misc.sh('grep py2 qa/.teuthology').

No.

Or you want to try run python3 somepy3only.script? What if those files are missing in code base? The config file is easy to cherrypick. It would be greate to see a PR with your idea how it is the best to detect py2 tasks? ;-)

Yes, I think it should be relatively easy to detect that py2 branch is be used without any new configuration files, whether by trying to import/parse as python3 or just a grep for some pattern in one of .py files under qa/tasks. If that file is not there, do nothing (i.e. use master).

@kshtsk
Copy link
Contributor Author

kshtsk commented May 24, 2020

Yes, I think it should be relatively easy to detect that py2 branch is be used without any new configuration files, whether by trying to import/parse as python3 or just a grep for some pattern in one of .py files under qa/tasks. If that file is not there, do nothing (i.e. use master).

I disagree and think this is incorrect approach an awkward... teuthology code should NOT be related on any client python code, you anyway need to track exact file, in many branches, you anyway have to made a change, you have much more file operation to make that grep. In fact, grepping is logically the same to loading of exact yaml file, but computationally more expensive.

Summarizing, I do not support this idea, it is not relatively easy (in comparison of just reading a single file with known structure), and since it is out of the scope for this PR, we can continue discussing it in mailing list, where you can advise code examples of how to verify if your whole tree is py2 or py3 only, as well as regex examples.

@djgalloway
Copy link

I don't have a dog in this fight as I don't use teuthology as a developer. Basically strictly a machine locking tool as far as I'm concerned.

@kshtsk
Copy link
Contributor Author

kshtsk commented May 27, 2020

I don't see input from @gregsfortytwo who actually requested the feature.
I'm actually discouraged so I'm ok to close it.

@badone
Copy link
Contributor

badone commented May 28, 2020

@gregsfortytwo ping?

@badone badone requested a review from tchaikov May 28, 2020 23:26
@badone
Copy link
Contributor

badone commented May 28, 2020

@kshtsk I, for one, think we should persist with this because I am seeing confusion about this in day-to-day operations. Let's just see if we can get more eyes on this.

Copy link
Member

@jdurgin jdurgin left a comment

Choose a reason for hiding this comment

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

I think automating this is a good idea. More folks are getting confused by the various branches, and it's not difficult to avoid users needing to consider it at all. The mechanism proposed here seems reasonable to me.

teuthology/suite/run.py Outdated Show resolved Hide resolved
teuthology/suite/run.py Show resolved Hide resolved
teuthology/suite/run.py Outdated Show resolved Hide resolved
@kshtsk kshtsk force-pushed the wip-auto-t branch 2 times, most recently from fb50cfe to eed1939 Compare May 30, 2020 20:58
teuthology/suite/run.py Outdated Show resolved Hide resolved
This change is required to determine which teuthology branch should
be used for scheduling a run for the given ceph branch.

Drop the code using --ceph-branch and when --teuthology-branch is not
supplied, since this mechanism is not used and not supported anymore.

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
Copy link
Contributor

@idryomov idryomov left a comment

Choose a reason for hiding this comment

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

LGTM. Since the consensus is that automating this is a good idea and others have been slow to respond, I'm going to go ahead and merge.

@idryomov
Copy link
Contributor

idryomov commented Jun 2, 2020

Hrm, why is master protected to the point that not everyone can merge? This didn't use to be the case and not a practice we follow in other repos...

@kshtsk
Copy link
Contributor Author

kshtsk commented Jun 2, 2020

Hrm, why is master protected to the point that not everyone can merge? This didn't use to be the case and not a practice we follow in other repos...

as far as I understand the history, only admins allowed, because not everyone wants take responsibility of breaking test infrastructure in sepia lab?

@tchaikov tchaikov removed their request for review June 2, 2020 15:23
@jdurgin jdurgin merged commit 5aab241 into ceph:master Jun 2, 2020
@jdurgin
Copy link
Member

jdurgin commented Jun 2, 2020

@idryomov added you to the list of folks who can merge. perhaps we should revisit that and allow more broad access again

@kshtsk
Copy link
Contributor Author

kshtsk commented Jun 2, 2020

Now we need:

  1. Follow up PR to ceph/master with qa/.teuthology_branch file commit with the contents:
master
  1. Ask @djgalloway to add teuthology_branch: py2 to /etc/teuthology.yaml

@djgalloway
Copy link

Step 2 is done.

@kshtsk
Copy link
Contributor Author

kshtsk commented Jun 2, 2020

ceph/ceph#35349

@kshtsk
Copy link
Contributor Author

kshtsk commented Jun 2, 2020

Step 2 is done.

The order is important, sorry, forgot to notice about that.

@djgalloway
Copy link

K I just commented it back out. No worries, I should have waited.

@djgalloway
Copy link

Uncommented now that ceph/ceph#35349 is merged.

@kshtsk
Copy link
Contributor Author

kshtsk commented Jun 2, 2020

nice, will see how it goes

@kshtsk kshtsk deleted the wip-auto-t branch June 3, 2020 06:44
djgalloway pushed a commit to djgalloway/ceph that referenced this pull request Jun 3, 2020
This is follow up change for:

    teuthology-suite: automate -t argument default value
    ceph/teuthology#1490

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
(cherry picked from commit 07cc36d)
ideepika pushed a commit to ceph/ceph-ci that referenced this pull request Jun 4, 2020
This is follow up change for:

    teuthology-suite: automate -t argument default value
    ceph/teuthology#1490

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
ifed01 pushed a commit to ifed01/ceph that referenced this pull request Jun 9, 2020
This is follow up change for:

    teuthology-suite: automate -t argument default value
    ceph/teuthology#1490

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
(cherry picked from commit 07cc36d)
tchaikov pushed a commit to tchaikov/ceph that referenced this pull request Jun 15, 2020
This is follow up change for:

    teuthology-suite: automate -t argument default value
    ceph/teuthology#1490

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
(cherry picked from commit 07cc36d)
ideepika pushed a commit to ceph/ceph-ci that referenced this pull request Sep 3, 2020
This is follow up change for:

    teuthology-suite: automate -t argument default value
    ceph/teuthology#1490

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants