Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Build-test.sh handles native test assets #19430

Merged

Conversation

AaronRobinsonMSFT
Copy link
Member

@AaronRobinsonMSFT
Copy link
Member Author

@jashook or @BruceForstall Can one of you kick off the ARM series of tests?

@AaronRobinsonMSFT AaronRobinsonMSFT added area-Build test enhancement Improvements of test source code labels Aug 11, 2018
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 3.0 milestone Aug 11, 2018
@jashook jashook self-requested a review August 11, 2018 00:22
@AaronRobinsonMSFT
Copy link
Member Author

@dotnet-bot test Windows_NT x86 Release Innerloop Build and Test

@@ -152,7 +152,7 @@ generate_layout()
# ===
# =========================================================================================

build_Tests_internal "Restore_Packages" "${__ProjectDir}/tests/build.proj" "Restore product binaries (build tests)" "-BatchRestorePackages"
build_MSBuild_projects "Restore_Packages" "${__ProjectDir}/tests/build.proj" "Restore product binaries (build tests)" "-BatchRestorePackages"

Choose a reason for hiding this comment

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

After checking you PR I have noticed that default settings in config.json for invoking msbuild on unixes do not set maxcpucount parameter what makes all calls non parallel and slows down every msbuild based operation.

Another problem is related to node reuse. AFAIR node reuse was off by default on Linux, however, this could have changed now. In such case we would need -nodereuse=false msbuild parameter. @rainersigwald may know more about current state of node reuse support on Linux.

Copy link
Member

Choose a reason for hiding this comment

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

dotnet build and dotnet msbuild unconditionally insert -maxcpucount into MSBuild's command line.

Node reuse is on by default on all platforms since .NET Core SDK 2.1.300/MSBuild 15.7. Since there are many individual invocations of MSBuild here, I would expect it to provide a performance improvement and wouldn't recommend leaving it off entirely unless there's a pressing need. It might be a good idea to do a dotnet build-server shutdown at the end of the script (even on error paths), depending on the use case.

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't change any MSBuild logic in this review. That is definitely something we should investigate going forward though.

@AaronRobinsonMSFT
Copy link
Member Author

@dotnet-bot test Windows_NT arm64 Cross Debug Innerloop Build
@dotnet-bot test OSX10.12 x64 Checked Innerloop Build and Test
@dotnet-bot test Ubuntu arm Cross Checked Innerloop Build and Test

@AaronRobinsonMSFT
Copy link
Member Author

@dotnet-bot tests Ubuntu arm Cross Checked no_tiered_compilation_innerloop Build and Test

@AaronRobinsonMSFT
Copy link
Member Author

@dotnet-bot test Ubuntu arm Cross Checked no_tiered_compilation_innerloop Build and Test

@jashook
Copy link

jashook commented Aug 14, 2018

@dotnet-bot test Windows_NT arm64 Cross Checked Innerloop Build and Test
@dotnet-bot test Windows_NT arm Cross Checked Innerloop Build and Test

@AaronRobinsonMSFT
Copy link
Member Author

@jashook Any thoughts on why the ARMs are taking so long?
@RussKeldorph Based on the discovered test bug I am much more confident in this PR. Any concerns?

@adityamandaleeka
Copy link
Member

adityamandaleeka commented Aug 15, 2018

@AaronRobinsonMSFT Looks like the ARM pool has dwindled down to just a couple of clients again so the job queue for them has ballooned, causing long delays. @jashook can get the dropped clients back online.

@jashook
Copy link

jashook commented Aug 15, 2018

I have brought a few of them back online; however, the rest are unreachable and will need an os refresh.

@RussKeldorph
Copy link

@AaronRobinsonMSFT No objections. Can you list the configurations you tried in your private testing? For example, do the ARM/ARM64 cross builds build the expected components correctly?

@AaronRobinsonMSFT
Copy link
Member Author

@RussKeldorph I verified Debug/Checked on Windows and MacOS. I didn't do any validation for ARM/ARM64, but I can. I assume I just pass the ARM flag to the respective build scripts?

Copy link

@jashook jashook left a comment

Choose a reason for hiding this comment

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

Looks good to me after a first pass, want to look at it one more time later today.

@RussKeldorph
Copy link

RussKeldorph commented Aug 15, 2018

Instructions for cross building on Unix are here. Essentially you have to build a rootfs and then build with the cross and architecture switches with ROOTFS_DIR set. Assuming this doesn't "just work," I'm ok with commit this PR as is (with appropirate caveat added to the description) and an additional issue opened to handle cross builds.

@janvorli
Copy link
Member

I assume I just pass the ARM flag to the respective build scripts?

No, it is not that simple. You need to build rootfs for ARM and ARM64 first and then add cross arm or cross arm64 to the build.sh options.
To build the rootfs, run sudo cross/build-rootfs.sh arm xenial and sudo cross/build-rootfs.sh arm64 xenial. The xenial is optional, I think I used to have some problems with going with the default (trusty) for ARM / ARM64, but I am not sure.

@jashook
Copy link

jashook commented Aug 15, 2018

The easiest way to do these builds currently is by using docker. An example build for arm and arm64 would be:

Armhf

docker run -i --rm -v <path/to/coreclr/repo/>:/coreclr -w /coreclr -e ROOTFS_DIR=/crossrootfs/arm microsoft/dotnet-buildtools-prereqs:ubuntu-14.04-cross-e435274-20180426002420 /coreclr/build.sh arm cross checked

docker run -i --rm -v <path/to/coreclr/repo/>:/coreclr -w /coreclr -e ROOTFS_DIR=/crossrootfs/arm microsoft/dotnet-buildtools-prereqs:ubuntu-14.04-cross-e435274-20180426002420 /coreclr/build-test.sh arm checked -priority=1

Arm64

Build product

docker run -i --rm -v <path/to/coreclr/repo/>:/coreclr -w /coreclr -e ROOTFS_DIR=/crossrootfs/arm64 microsoft/dotnet-buildtools-prereqs:ubuntu-16.04-cross-arm64-a3ae44b-20180315221921 /coreclr/build.sh arm64 cross checked

Build tests

docker run -i --rm -v <path/to/coreclr/repo/>:/coreclr -w /coreclr -e ROOTFS_DIR=/crossrootfs/arm64 microsoft/dotnet-buildtools-prereqs:ubuntu-16.04-cross-arm64-a3ae44b-20180315221921 /coreclr/build-test.sh arm64 checked -priority=1

@jashook
Copy link

jashook commented Aug 15, 2018

It avoids having to go through our rootfs process, which is time consuming and error prone.

Copy link

@jashook jashook left a comment

Choose a reason for hiding this comment

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

lgtm. I am good without running arm/arm64. As mentioned I think the following are worth validating before checking in:

pri1 run of all jobs
manual run of build-test.sh -priority=1 && runtest.sh ...

Thanks for the work!

@AaronRobinsonMSFT
Copy link
Member Author

Was able to fix the script to do the count check.

Ran and passed with priority 1 on MacOS:

=======================
     Test Results
=======================
# CoreCLR Bin Dir  : 
# Tests Discovered : 12400
# Passed           : 11610
# Failed           : 0
# Skipped          : 790
=======================
41 minutes and 38 seconds taken to run CoreCLR tests.

@jashook
Copy link

jashook commented Aug 16, 2018

@dotnet-bot test OSX10.12 x64 Checked Innerloop Build and Test
@dotnet-bot test Ubuntu arm Cross Checked Innerloop Build and Test
@dotnet-bot test Windows_NT arm64 Cross Checked normal Build and Test
@dotnet-bot test Windows_NT arm Cross Checked normal Build and Test
@dotnet-bot test Windows_NT x64 Build and Test
@dotnet-bot test Windows_NT x86 Build and Test
@dotnet-bot test Ubuntu x64 Build and Test
@dotnet-bot test OSX10.12 x64 Build and Test

@AaronRobinsonMSFT
Copy link
Member Author

@dotnet-bot test Ubuntu arm Cross Checked Innerloop Build and Test

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit f0f42d4 into dotnet:master Aug 16, 2018
@AaronRobinsonMSFT AaronRobinsonMSFT deleted the build_test_sh_handles_native branch August 16, 2018 18:22
@BruceForstall
Copy link

It appears this broke some test builds. I opened https://github.com/dotnet/coreclr/issues/19540 to track.

@BruceForstall
Copy link

btw, it looks like the trigger phrases used above to try to trigger Windows x86/x64 pri-1 runs didn't work, and the x86 trigger phrase was incorrect. This should work:

@dotnet-bot test Windows_NT x86 Checked Build and Test
@dotnet-bot test Windows_NT x64 Build and Test

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure-coreclr test enhancement Improvements of test source code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants