runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Enable CI support for Linux Arm32

Open gkhanna79 opened this issue 9 years ago • 38 comments

CC @hqueue @kouvel @wtgodbe

gkhanna79 avatar Dec 14 '16 18:12 gkhanna79

I think CI for Linux Arm32 will be based on cross build as in CoreCLR, right?

hqueue avatar Dec 15 '16 04:12 hqueue

@hqueue Correct. CI build is just like a developer build, but happens automatically for PRs.

gkhanna79 avatar Dec 15 '16 05:12 gkhanna79

@hqueue Since you brought up Arm32 CI support for CoreCLR, can you look into bringin this up as well? It will also help the Tizen armel build that you have been bringing up post the filing of this issue.

gkhanna79 avatar Jan 23 '17 15:01 gkhanna79

@gkhanna79 Sorry for late reply. I almost missed this issue. I will take a look at this. It seems that CI for core-setup has somewhat difference structure than CoreCLR. Please let me know anything where I can start, including docuement, CI scripts and etc.

hqueue avatar Jan 25 '17 07:01 hqueue

@hqueue The CI script is the same (netci.groovy) though its contents would be different. CoreCLR's arm32 CI support is implemented in https://github.com/dotnet/coreclr/commits/master/tests/scripts/arm32_ci_script.sh and was enabled by @prajwal-aithal.

This should be a good starting point. CoreCLR CI integration is done at https://github.com/dotnet/coreclr/blob/master/netci.groovy#L2132.

Let me know if there are other questions I can help answer.

gkhanna79 avatar Jan 25 '17 17:01 gkhanna79

@gkhanna79 Oh, I think I misunderstood this task somewhat. At first, I thought this task is about arm32 CI for Core-Setup. You are talking about arm (hardfp) CI for CoreCLR, right ?

BTW glad to see that packages for ubuntu.14.04-arm and ubuntu.16.04-arm are published. Thank you :)

hqueue avatar Jan 26 '17 00:01 hqueue

I thought this task is about arm32 CI for Core-Setup

@hqueue Yes, it is :) You had asked for pointers on how to go about doing it, so I pointed you to how it was enabled for CoreCLR.

gkhanna79 avatar Jan 26 '17 00:01 gkhanna79

@gkhanna79 Please ignore my last comment above :) I find out that there is netci.groovy here and I will take a look into it. Sorry for any confusion I made.

Added: thank you for quick response. Got it :)

hqueue avatar Jan 26 '17 00:01 hqueue

@gkhanna79 Are we using same CI machine for Core-Setup and CoreCLR ? We need ARM Emulator installed in CI machine to enable arm32 CI and I think "configuring CI host environment" is out-of-scope of netci.groovy. If not, I think we have to configure CI machine to test netci.groovy and script files for arm32.

BTW When do you think this arm32 CI is availble ? Because current arm32 CI has several problem we experienced several issues (including https://github.com/dotnet/corefx/pull/15311, https://github.com/dotnet/coreclr/pull/9077) , we are planning to refactor and re-structure current arm32 CI for CoreCLR and CoreFX soon within few weeks.

Therefore if this task is not urgent, I think we have better to bring up arm32 CI for Core-Setup, CoreCLR, CoreFX altogether with more well-structured one. What do you think of it?

hqueue avatar Jan 26 '17 00:01 hqueue

Are we using same CI machine for Core-Setup and CoreCLR

I believe this is true but I will let @mmitche confirm as well.

I think we have better to bring up arm32 CI for Core-Setup, CoreCLR, CoreFX altogether with more well-structured one

When do you think this will be done? I am fine with this approach assuming it is not too far out since the goal is to ensure Core-Setup PRs do not break Arm32

gkhanna79 avatar Jan 26 '17 01:01 gkhanna79

When do you think this will be done? I am fine with this approach assuming it is not too far out since the goal is to ensure Core-Setup PRs do not break Arm32

@gkhanna79 We are planning to start working on it from next Wednesday and will work on it as a top priority for a while. It may also include configuration changes of CI host itself and we may need your supoort for configuring CI host machine too.

In short, we will do it ASAP from next Wednesday and we hope it be done within a few weeks but we don't know how it will take exactly yet depending on scope we are going to refactor.

/cc: @wateret /cc: @lemmaa @jyoungyun @hseok-oh @chunseoklee

hqueue avatar Jan 26 '17 03:01 hqueue

@hqueue Your plan sounds good to me. Definitely let me know if you need any help. Is there an existing issue to track bringing up CI for Arm32 for CoreFX that we can add to the corresponding line-item at https://github.com/dotnet/core-setup/issues/725?

gkhanna79 avatar Jan 26 '17 04:01 gkhanna79

@gkhanna79 I see. There are existing old issues but we will make new issues about refactoring and bring up arm32 CI for CoreCLR and CoreFX next week, because old issues are not talking about refactoring. I will add them when ready. Thanks.

hqueue avatar Jan 26 '17 05:01 hqueue

@gkhanna79 As I've already described at https://github.com/dotnet/core-setup/issues/725#issuecomment-275324269, we have to use recent version of llvm for ARM release.

In short, we have to upgrade llvm to recent version in host machines used for CI and pipeline build for ARM release, since llvm has bug related to TLS for ARM when using -O3 optimization.

Next week, we will test clang-3.8 and above and decide which version might be suitable. However even clang-3.8 has bug and we use patched clang-3.8 for ARM build now. See https://github.com/dotnet/coreclr/blob/master/Documentation/building/linux-instructions.md#how-to-enable--o3-optimization-level-for-armlinux

What do you think of this ? I think we all have to discuss and decide which version of llvm (clang) we are going to use in CI and pipile build.

BTW does CI and pipeline build system use same environment ? This might be another issue and should be considered.

I'm out-of-office until next Monday, because of lunar new year's day here :) Happy new year again!

hqueue avatar Jan 26 '17 07:01 hqueue

@hqueue FYI, we found out that building .NET Core for aarch64 (not arm32) using clang3.8 doesn't always work (see dotnet/coreclr#8927 for the full discussion); clang3.9 did work.

qmfrederik avatar Jan 26 '17 16:01 qmfrederik

@hqueue For Arm32, at minimum, we need to be able to produce .NET Core SharedFX (out of the core-setup repo) that can be used by folks. To achieve this, for the time being, can we switch Arm32 builds across CoreCLR/CoreFX/Core-setup repos to use -O1 flag? Based upon the description at https://github.com/dotnet/coreclr/blob/master/Documentation/building/linux-instructions.md#additional-optimization-levels-for-armlinux--oz-and--ofast, -O3 seems to be an optimization over -O1 but correctness-wise, -O1 should still work. This approach will produce a consumable Arm32 build.

If the above sounds reasonable to you, I would suggest that you make PRs to make this switch so that everything continues to work with the current toolset for cross build (clang 3.6) that is provisioned in CI and pipeline build. Once you have identified the appropriate version of clang that supports -O3 for Arm, we can then look into updating it across the board (including the Docker images that perform the Arm32 builds in pipeline build infrastructure).

In general, for eventual shipping, we should be using an officially supported toolset rather than building one on our own.

As an aside, CoreCLR repo specifies clang 3.6 for cross builds (https://github.com/dotnet/coreclr/blob/master/build.sh#L747) but CoreFX does not (see https://github.com/dotnet/corefx/blob/master/src/Native/build-native.sh). I have filed https://github.com/dotnet/corefx/issues/15511 and assigned it to you.

gkhanna79 avatar Jan 26 '17 16:01 gkhanna79

FYI, we found out that building .NET Core for aarch64 (not arm32) using clang3.8 doesn't always work (see dotnet/coreclr#8927 for the full discussion); clang3.9 did work.

@qmfrederik Thank you for sharing the thread :) That thread also gave me a lot information regarding clang 3.8 and 3.9.

hqueue avatar Feb 01 '17 03:02 hqueue

CI support for core-setup will be done along with CoreCLR (https://github.com/dotnet/coreclr/issues/9273).

hqueue avatar Feb 03 '17 12:02 hqueue

@gkhanna79 For corefx and corefx, we are almost done for arm32 cross-building in docker by now. (dotnet/corefx#15900 (merged), dotnet/coreclr#9445 (not merged yet)) For core-setup, @jyoungyun will handle it.

Therefore I think it's time to discuss on (1) enabling auto-PR test and (2) unit tests for coreclr and corefx. Can we start discussion here ? or in the new issue ? I think we can make a seperate issue for each, because they are not related much.

hqueue avatar Feb 17 '17 12:02 hqueue

@gkhanna79 @jyoungyun Let' discuss about "default triggers" and "on-demand triggers" for arm32 in core-setup, coreclr and corefx. Following is a draft plan. For Core-Setup, I think you have similar plan in mind. What do you think of it ?

  • Core-Setup default triggers
    Ubuntu arm Release Ubuntu16.04 arm Release Tizen armel Release

  • CoreCLR & CoreFX default triggers Ubuntu arm Release Tizen armel Release

    on-demand triggers Ubuntu arm Debug
    Ubuntu16.04 arm Release Ubuntu16.04 arm Debug Tizen armel Debug

hqueue avatar Feb 22 '17 06:02 hqueue