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

Git Bisection Automated for build of a kernel #810

Closed
wants to merge 4 commits into from

Conversation

Tejas3772
Copy link

Description

This Pull Request includes a Test_build.py that builds the kernel while checking for build failure, if a build failure is found it directly calls Build_bisector.py that runs the bisection for build using the make.sh file from the test_binaries and finally if the bisection occurred, it returns an output.json file containing the first bad_commit, the email of the Author associated with the commit, failure directory and exit code.

@abdhaleegit abdhaleegit self-requested a review March 13, 2024 10:32
test_binaries/make.sh Outdated Show resolved Hide resolved
testcases/Build_bisector.py Outdated Show resolved Hide resolved
testcases/Build_bisector.py Outdated Show resolved Hide resolved
testcases/Build_bisector.py Show resolved Hide resolved
testcases/Build_bisector.py Outdated Show resolved Hide resolved
testcases/Test_build.py Outdated Show resolved Hide resolved
testcases/Test_build.py Show resolved Hide resolved
testcases/Test_build.py Outdated Show resolved Hide resolved
testcases/Test_build.py Show resolved Hide resolved
testcases/Test_build.py Show resolved Hide resolved
OpTestConfiguration.py Show resolved Hide resolved
test_binaries/make.sh Outdated Show resolved Hide resolved
testcases/Build_bisector.py Outdated Show resolved Hide resolved
Test case for bisecting the Linux kernel using Git Bisect.
This test downloads the Linux kernel from a specified repository,
configures and compiles it, and then uses Git Bisect to find the
commit that introduced a specific issue.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/specific issue/build failure/ will be apt

testcases/Build_bisector.py Show resolved Hide resolved
testcases/Test_build.py Show resolved Hide resolved
testcases/Test_build.py Outdated Show resolved Hide resolved
testcases/Test_build.py Outdated Show resolved Hide resolved
testcases/Test_build.py Outdated Show resolved Hide resolved
testcases/Test_build.py Show resolved Hide resolved
testcases/Test_build.py Outdated Show resolved Hide resolved
testcases/Test_build.py Show resolved Hide resolved
testcases/Test_build.py Outdated Show resolved Hide resolved
@Tejas3772 Tejas3772 force-pushed the git_bisect branch 2 times, most recently from 4e913ee to b303489 Compare March 25, 2024 09:13
OpTestConfiguration.py Outdated Show resolved Hide resolved
test_binaries/make.sh Outdated Show resolved Hide resolved
@Tejas3772 Tejas3772 force-pushed the git_bisect branch 13 times, most recently from 6605c90 to d575d90 Compare April 4, 2024 06:57
@Tejas3772 Tejas3772 force-pushed the git_bisect branch 7 times, most recently from 7844a49 to ec27074 Compare April 17, 2024 10:31
OpTestConfiguration.py Show resolved Hide resolved
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
Copy link
Contributor

Choose a reason for hiding this comment

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

since this is a shell script, this python related line is not required. Remove it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Tejas3772 this is not yet done

# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing
# permissions and limitations under the License.
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

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

Move this to the top of file.

@Tejas3772 Tejas3772 force-pushed the git_bisect branch 2 times, most recently from 0fa3418 to df05273 Compare April 18, 2024 06:56
@Tejas3772 Tejas3772 closed this May 27, 2024
@Tejas3772
Copy link
Author

several changes made and linux-next functionalities added

@Tejas3772 Tejas3772 reopened this May 28, 2024
@Tejas3772 Tejas3772 force-pushed the git_bisect branch 2 times, most recently from 5565e32 to e28cc92 Compare May 28, 2024 07:25
@abdhaleegit abdhaleegit self-requested a review May 28, 2024 09:05
Copy link
Collaborator

@abdhaleegit abdhaleegit left a comment

Choose a reason for hiding this comment

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

Look at the review comments once again.. I do not see it in the latest code

OpTestConfiguration.py Show resolved Hide resolved
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Tejas3772 this is not yet done

test_binaries/make.sh Show resolved Hide resolved
testcases/Build_bisector.py Outdated Show resolved Hide resolved
@Tejas3772 Tejas3772 force-pushed the git_bisect branch 2 times, most recently from b8aefee to 5c0209b Compare May 28, 2024 10:55
Signed-off-by: Tejas Manhas <Tejas.Manhas@ibm.com>
…r multiple uses

Signed-off-by: Tejas Manhas <Tejas.Manhas@ibm.com>
@Tejas3772 Tejas3772 force-pushed the git_bisect branch 5 times, most recently from 944e722 to 7f71edf Compare May 28, 2024 14:10
Tejas Manhas added 2 commits May 28, 2024 19:52
…or if build faiils

Signed-off-by: Tejas Manhas <Tejas.Manhas@ibm.com>
Signed-off-by: Tejas Manhas <Tejas.Manhas@ibm.com>
@abdhaleegit abdhaleegit self-requested a review May 28, 2024 14:27
OpTestConfiguration.py Show resolved Hide resolved
from common.OpTestSOL import OpSOLMonitorThread
from common.OpTestInstallUtil import InstallUtil
from common.Exceptions import CommandFailed
import test_binaries
Copy link
Collaborator

Choose a reason for hiding this comment

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

move import to above and arrange all imports in alphabaticle order

Copy link
Collaborator

Choose a reason for hiding this comment

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

and add one empty line below

self.console_thread = OpSOLMonitorThread(1, "console")
self.host_cmd_timeout = self.conf.args.host_cmd_timeout
self.repo = self.conf.args.git_repo
self.repo_reference = self.conf.args.git_repo_reference
Copy link
Collaborator

Choose a reason for hiding this comment

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

why 2 params for repo ?

self.branch = self.conf.args.git_branch
self.home = self.conf.args.git_home
self.config_path = self.conf.args.git_repoconfigpath
self.config = self.conf.args.git_repoconfig
Copy link
Collaborator

Choose a reason for hiding this comment

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

it can be single config parameter that can take both path or http link

self.config = self.conf.args.git_repoconfig
self.good_commit = self.conf.args.good_commit
self.bad_commit = self.conf.args.bad_commit
self.bisect_script = self.conf.args.bisect_script
Copy link
Collaborator

Choose a reason for hiding this comment

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

why we need script parameter ?

PPC KBOT
""".format(gcc_version, machine_type, error_message,kernel_version, machine_type, gcc_version, commit,commit, commit, fix_description)
print(subject)
print(body)
Copy link
Collaborator

Choose a reason for hiding this comment

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

is print require or for debug only .. you decide to keep or remove


with open("email.json","w") as email:
json.dump({"subject":subject,"body":body},email)
# return subject, body
Copy link
Collaborator

Choose a reason for hiding this comment

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

you should uncomment ? or remove

# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing
# permissions and limitations under the License.
Copy link
Collaborator

Choose a reason for hiding this comment

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

add empty line below and Author name and mail id

from testcases import Email_git
from common.OpTestSystem import OpSystemState
from common.OpTestSOL import OpSOLMonitorThread
from common.Exceptions import CommandFailed
Copy link
Collaborator

Choose a reason for hiding this comment

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

add empty line beflore and 2 empty lines after log line

"""
Build and install the Linux kernel.
"""
self.connection.run_command("wget http://ltc-jenkins.aus.stglabs.ibm.com:81/abdul/ioci/kernel_config -o linux/.config")
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove the config link

@abdhaleegit
Copy link
Collaborator

A new PR is created #849 Which inlcudes all the review comments implemented discussed above and more integrated code

some of the recent review comments

  1. All bisection boot and build libraries should go to common/OpTestUtils.py [DONE]
  2. Move Email.py code into OpTestUtils.py [DONE]
  3. All build and boot linux/os related common methods will go into common/OpTestUtils.py [DONE]
  4. Do not import a testcase inside a testcase, not a good practice [DONE]
  5. Keep build bisection code and email and bisect_flag as separate commit but single PR [DONE]
  6. relook at the linux-next bisection code and push updated code in same PR [DONE]
  7. Rerun the build bisection once with all above changes [DONE]

Once build PR merge, rebase your code and send boot bisection code with new PR

@Tejas3772 Tejas3772 closed this Jul 30, 2024
@Tejas3772
Copy link
Author

new pr merged

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.

5 participants