This is an archive of the discontinued LLVM Phabricator instance.

[Zorg][PowerPC] Move RHEL bot back to cmake clang factory and add cmake option for test-suite
ClosedPublic

Authored by Conanap on Aug 26 2021, 12:40 PM.

Details

Summary

This patch moves the RHEL buildbot back to clang factory with the cmake option implemented.
The patch was tested locally with a test buildmaster server. The patch also makes sure lld is enabled.

Diff Detail

Event Timeline

Conanap created this revision.Aug 26 2021, 12:40 PM
Conanap requested review of this revision.Aug 26 2021, 12:40 PM
jsji added a comment.Aug 26 2021, 1:23 PM

What is the reason of moving back to clang builder? Looks like we need to add the cmake test-suite for ClangBuilder here as well. Any particular reason that we can not add it as an optional step in UnifiedTreeBuilder?

What is the reason of moving back to clang builder? Looks like we need to add the cmake test-suite for ClangBuilder here as well. Any particular reason that we can not add it as an optional step in UnifiedTreeBuilder?

The Unified Tree builder did not have a test suite step, so it was easier to use cmake clang builder which already have a test suite step for us to take advantage of.

jsji added a comment.Aug 26 2021, 1:40 PM

The Unified Tree builder did not have a test suite step, so it was easier to use cmake clang builder which already have a test suite step for us to take advantage of.

OK ... Thanks.
But since we have to add the cmake steps anyhow, the only difference is about source checkout, which should be easy in Unified Tree as well?
Anyway, let us see what is Galina's comments about this first.

The Unified Tree builder did not have a test suite step, so it was easier to use cmake clang builder which already have a test suite step for us to take advantage of.

OK ... Thanks.
But since we have to add the cmake steps anyhow, the only difference is about source checkout, which should be easy in Unified Tree as well?
Anyway, let us see what is Galina's comments about this first.

I did initially look into adding this step into unified tree builder, although ran into a bit more problems with the variables and stuff. I'm sure I can figure it out if that is what we much prefer, although personally I don't see a big benefit unified tree builder may have over cmake clang builder.

jsji added a comment.Aug 26 2021, 2:00 PM

I'm sure I can figure it out if that is what we much prefer, although personally I don't see a big benefit unified tree builder may have over cmake clang builder.

Thanks! My understanding is that UnifiedTreeBuilder is the builder that the community want to promote , especially for all future new builders.
If we extend the UnifiedTreeBuilder, it may be easier for others to add test-suites into their builders.

jsji edited reviewers, added: saghir; removed: Ahsan.Aug 26 2021, 7:39 PM
amyk added a subscriber: amyk.Aug 30 2021, 7:15 AM

Could you also please update the patch with full context?

buildbot/osuosl/master/config/builders.py
642

Unrelated change?

Conanap updated this revision to Diff 369785.Aug 31 2021, 1:44 PM

Changed implementation to UnifiedTreeBuilder. I kept the clang factory builder implementation too in case that could be useful to others, but can be removed if we think it's not necessary.

Conanap marked an inline comment as done.Aug 31 2021, 1:44 PM
jsji added a comment.Sep 1 2021, 8:13 AM

Thanks for the great job. Some more feedback regarding UnifiedTreeBuilder extension. Thanks!

zorg/buildbot/builders/UnifiedTreeBuilder.py
248 ↗(On Diff #369785)

obj_dir -> maybe compiler_dir is better? and then we don't need compiler_path assignment anymore.

249 ↗(On Diff #369785)

targets, checks, install_dir , stage_name are not used at all in testsuite step. Can we remove them.

260 ↗(On Diff #369785)

test_suite_dir -> test_suite_src_dir?

271 ↗(On Diff #369785)

What is the reason that we choose Makefiles instead of Ninja?

UnifiedTree default to use Ninja to build clang, so I think it would be great if we can align with it (so that we don't need to require both ninja and make in buildbot machines.

273 ↗(On Diff #369785)

Do we need the full path defined above as lit = utils.Interploate.. instead of using the one in path?

276 ↗(On Diff #369785)

It would be great if we can make the -k and -j20 as parameters instead of hardcoding here, so that users can configure for their buildbots.

If we use Ninja, I don't think we need the -j20 anymore.

280 ↗(On Diff #369785)

Should we use LitTestCommand and pass through env and **kwargs ?

283 ↗(On Diff #369785)

Maybe add a test-suite-wordir = utils.Interpolate(...) above and use them here in all steps?

377 ↗(On Diff #369785)

nit: ident is off for f?

jsji added inline comments.Sep 1 2021, 8:16 AM
zorg/buildbot/builders/UnifiedTreeBuilder.py
267 ↗(On Diff #369785)

Should we use CmakeCommand instead of ShellCommand here?

275 ↗(On Diff #369785)

If we use Ninja, we should be able to use NinjaCommand instead of ShellCommand here too.

Conanap updated this revision to Diff 370488.Sep 2 2021, 11:29 PM
Conanap marked 2 inline comments as done.

Improved implementation

Conanap marked 8 inline comments as done.Sep 2 2021, 11:30 PM

Thanks for the suggestions @jsji , I think this should address all of your comments.

zorg/buildbot/builders/UnifiedTreeBuilder.py
280 ↗(On Diff #369785)

For this comment, I found that it seems to work without env and kwargs, so I'm wondering if it's preferred for us to not pass it if we don't need it or if we should pass it anyways.

jsji added inline comments.Sep 3 2021, 5:24 AM
zorg/buildbot/builders/UnifiedTreeBuilder.py
280 ↗(On Diff #369785)

should pass it anyways so that others may try to pass additional env/args to control the tests in their buildbots.

NeHuang added a subscriber: NeHuang.Sep 3 2021, 6:57 AM
NeHuang added inline comments.
zorg/buildbot/builders/ClangBuilder.py
472 ↗(On Diff #370488)

nit: comment indentation

549 ↗(On Diff #370488)

nit: indentation. same issue from line 549 - 584

jsji accepted this revision.Sep 3 2021, 7:24 AM

LGTM with some nits. Thanks for working on this!

buildbot/osuosl/master/config/builders.py
671

Just to double confirm that you have tested 96 in our buildbot? Wanna to make sure we don't set it too large .

zorg/buildbot/builders/UnifiedTreeBuilder.py
246 ↗(On Diff #370488)

llvm_srcdir is not used , can we remove it.

257 ↗(On Diff #370488)

Add

test_suite_workdir='test/sandbox/test-suite',
267 ↗(On Diff #370488)
workdir= `test_suite_workdir`.
276 ↗(On Diff #370488)
workdir= `test_suite_workdir`.
281 ↗(On Diff #370488)
workdir= `test_suite_workdir`.
282 ↗(On Diff #370488)

-j20?
Should this flag be derived from the LLVM_LIT_ARGS that is passed down in extra_configure_args from clang-ppc64le-rhel builders.

But yeah, this is small enhancement, can be done in a follow up patch. Thanks.

This revision is now accepted and ready to land.Sep 3 2021, 7:24 AM
Conanap marked 9 inline comments as done.Sep 7 2021, 1:32 PM
Conanap added inline comments.
buildbot/osuosl/master/config/builders.py
671

yup! tested on our buildbot machine

zorg/buildbot/builders/UnifiedTreeBuilder.py
282 ↗(On Diff #370488)

I agree with this, although I'm not actually quite sure how to do this. I'll look into it a bit more; if I can't figure it out today I'll leave it for a future patch.

Would also appreciate any input and concerns you might have @gkistanova. Thank you!

Conanap updated this revision to Diff 371172.Sep 7 2021, 1:36 PM
Conanap marked an inline comment as done.

Addressed Jinsong's comments

amyk added inline comments.Sep 8 2021, 7:08 AM
zorg/buildbot/builders/UnifiedTreeBuilder.py
273 ↗(On Diff #371172)

Do you mean:

Conanap updated this revision to Diff 371331.Sep 8 2021, 7:26 AM

Added a way for lit arguments to be parsed

Conanap updated this revision to Diff 371333.Sep 8 2021, 7:29 AM

Updated descriptions

Conanap marked 2 inline comments as done.Sep 8 2021, 7:30 AM
Conanap added inline comments.Sep 8 2021, 7:31 AM
zorg/buildbot/builders/UnifiedTreeBuilder.py
342 ↗(On Diff #371333)

@jsji This is what I came up with for parsing the lit arguments. Tested works, but I'm not sure if this is optimal. I could not find a built-in way to derive these arguments.

jsji added inline comments.Sep 8 2021, 12:33 PM
zorg/buildbot/builders/UnifiedTreeBuilder.py
342 ↗(On Diff #371333)

Looks OK for me. Thanks.

Conanap marked an inline comment as done.Sep 9 2021, 7:44 AM
This revision was landed with ongoing or failed builds.Sep 9 2021, 12:48 PM
This revision was automatically updated to reflect the committed changes.
gkistanova added a comment.EditedSep 9 2021, 1:56 PM

Hello everyone.

Sorry for being late to the discussion.

Unless I'm missing something, we are here after 2 stages: (1) build the compiler and tools, and then (2) build and run LLVM test-suite by using just built compiler and tools.

It doesn't seem extending either UnifiedTreeBuilder or ClangBuilder by adding extra parameters and if-else logic looks good, with all due respect to the work already done in this review.

How about introducing a new TestSuiteBuilder instead, which would use UnifiedTreeBuilder to do the stage 1 (configure,build+unit tests), and then add missing test-suite checkout, configuration, build and run step? Should be a nice clean build factory. Something similar to how this is done in zorg/buildbot/builders/ABITestsuitBuilder.py should do.

What do you think?

jsji added a comment.Sep 9 2021, 2:15 PM

How about introducing a new TestSuiteBuilder instead, which would use UnifiedTreeBuilder to do the stage 1 (configure,build+unit tests), and then add missing test-suite checkout, configuration, build and run step? Should be a nice clean build factory. Something similar to how this is done in zorg/buildbot/builders/ABITestsuitBuilder.py should do.

What do you think?

test-suite test should be quite common and can be similar to lit test, that is why we extending ClangBuilder/UnifiedTreeBuilder to do it.

The TestsuiteBuilder proposal treats test-suite as *out of tree* repo/test instead, but yeah, that is not a big deal , OK to me.

Thanks for the feedback.

Are we talking about the same test-suite?
https://github.com/llvm/llvm-test-suite is out of tree.

jsji added a comment.Sep 9 2021, 2:59 PM

Are we talking about the same test-suite?
https://github.com/llvm/llvm-test-suite is out of tree.

Yes, you are right. It is out of tree from llvm-project.

I'm happy to reimplement this as a separate builder; would you like me to revert the commit or is it alright for me to have the other builder implemented and revert the changes in that commit as well?

Hi Albion,

I think you can keep the UnifiedTreeBuilder changes till you are ready with the new build factory and can switch the builder, then revert.
But please revert the ClangBuilder changes before some will start using that.

Another option is reverting the commit, and temporarily staging your patch for UnifiedTreeBuilder.

Sorry again for being late with the feedback and thanks for your patience.

I'll go ahead and revert the commit so that no one goes and use these options. Thanks!

Conanap updated this revision to Diff 372775.Sep 15 2021, 12:41 PM

Removed .gitignore changes, fixed import naming, removed jobs option.