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

Live-live CI pipeline #294

Merged
merged 25 commits into from
Dec 3, 2019
Merged

Live-live CI pipeline #294

merged 25 commits into from
Dec 3, 2019

Conversation

trylek
Copy link
Member

@trylek trylek commented Nov 26, 2019

I have rebased the change against Santiago's CoreFX YAML refactoring
which simplified the change substantially. I have received an almost green
run and my cursory validation confirmed that live artifacts are indeed being
used.

I hit trouble on Linux x64 that doesn't seem to support Python3, I'm currently
experimenting with downgrading the patch-corefx.py script to not explicitly
target Python3. As a form of instrumentation to simplify development I'm
still hijacking the PR YAML file under CoreCLR for the "live-live pipeline", that's
not to be merged in, otherwise I believe the change to be mostly ready for
review.

I have slightly unified naming of the libraries jobs with the coreclr jobs. There's
a slight wrinkle in CoreCLR supporting three configurations (debug / checked
/ release) wherease CoreFX only supports debug / release. In this change
I have fixed CoreFX YAML scripts to also pretend to support the three configs,
just internally remapping "checked" to "debug" in base-job.yml.

[After all, in the live-live mode, there's technically a difference between debug
and checked version of CoreFX w.r.t. consuming the respective version of
CoreLib. I guess this logic is up to further development to support various
cross-building scenarios, e.g. debug CoreFX builds consuming release CoreLib.
I haven't tried to address these scenarios in my change but they should be
pretty straightforward to implement on top of it.]

As I assume that most people are on the Thanksgiving prolonged weekend,
I continue developing the change as I doubt I'll get it sufficiently reviewed
before next Monday. In particular, I have started working on incorporating
CoreFX testing. If any reviewers happen to be available (if I start receiving
review feedback), I'll fix the instrumentation by moving the YAML file and
I'll finalize the change so that it can be merged in.

Thanks

Tomas

@trylek trylek force-pushed the CombinedBuild2 branch 4 times, most recently from 8e240f9 to 56e396e Compare November 29, 2019 16:18
@trylek trylek changed the title WIP: live-live CI (2nd attempt) Live-live CI pipeline Nov 29, 2019
@trylek trylek requested a review from jkoritzinsky November 29, 2019 16:39
@trylek
Copy link
Member Author

trylek commented Nov 29, 2019

I'm also not clear on what I've broken in the "coreclr-libraries" pipeline so if anyone can help shed light on that, I would be super grateful.

@trylek
Copy link
Member Author

trylek commented Nov 30, 2019

Other than that, I must admit I find it almost impossible to conclusively prove that we're using the live-live artifacts everywhere with so much nuget downloading going on everywhere around; for now I tend to think this needs to be a collective effort after merging in the initial implementation of the live-live CI pipeline involving scrutiny by experts on build logic for the individual subrepos.

@trylek
Copy link
Member Author

trylek commented Nov 30, 2019

I'm also trying to figure out how to incorporate core_setup aka installer testing in the pipeline but I know very little about what actually happens there - I tried to run the "installer" script locally and it seems to have Crossgened the framework and then crashed with some nuget download bug - so I'm in doubt whether I should follow up on that with help from the relevant experts or just merge in a limited version of the change without the installer chores and leave those to people more familiar with this logic.

@trylek trylek force-pushed the CombinedBuild2 branch 2 times, most recently from e5e78e6 to 9701d36 Compare December 1, 2019 22:20
@jaredpar
Copy link
Member

jaredpar commented Dec 2, 2019

I hit trouble on Linux x64 that doesn't seem to support Python3,

@jkoritzinsky where do we document our software requirements around tools like Python for Linux? The Linux requirements document doesn't specify this in the same way that the Windows one does.

@trylek
Copy link
Member Author

trylek commented Dec 2, 2019

According to my best knowledge, this commit should end up with a green runtime-libraries and runtime-coreclr (at this moment still representing my initial implementation of the live-live pipeline). Remaining issues I'm aware of:

  1. Where exactly to put the remapping layer between 3 CoreCLR configs (debug / checked / release) vs. 2 CoreFX configs (Debug / Release)? Today I'm doing this in several places in base-job, build-job, run-test-job and the CoreCLR build-test.sh and cmd scripts. I'm not sure if this is cleanly solvable right now but we should discuss the ideal longer-term state.

  2. I had to open-code some of the variables in eng/pipelines/libraries/variables.yml (sourcesRoot, _buildScriptFileName) - as according to my discussion with Jared and Chris Costa from several months back there's no way to include the variable template "in the middle" of the template tree, just at the root (i.e. in "pipeline" scripts like pr.yml), there's no easy way to import it into the live-live pipeline spanning multiple subrepos.

  3. I think I have managed to stand up the CoreFX test build and execution within the initial live-live pipeline implementation, for now I have abandoned the attempt to include the installer jobs in the pipeline as I'm simply not yet sufficiently familiar with them so that I would probably end up producing some unusable nonsense anyway.

  4. Physically moving the live-live YAML file from its temporary location under eng/pipeline/coreclr/pr.yml (which is most convenient for developing the PR) to its final location; according to initial suggestion from Viktor is should probably become something like eng/pipelines/runtime.yml.

Thanks

Tomas

@@ -5,6 +5,7 @@ parameters:
archType: ''
framework: netcoreapp
isOfficialBuild: false
useLiveCoreClr: false
Copy link
Member

Choose a reason for hiding this comment

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

Going forward when should this ever be false and what would the impact of that be?

Copy link
Member Author

Choose a reason for hiding this comment

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

In this change I haven't yet dropped the support for both "live-live runs" and "partial runs" picking up some artifacts from external locations. I can easily imagine this limitation may be temporary but, in its current form, dropping this condition would invalidate the "legacy" runtime-libraries pipeline. I assume it's up to further discussion in our meetings how exactly to sequence the transformation.

@jashook
Copy link
Contributor

jashook commented Dec 2, 2019

I have started to review. Based on my first pass this looks like great progress thank you @trylek. I have noticed that the coreclr pipeline is loosing coverage. I think this is fine, so long is it is documented and we can work on recovering this in later changes.


I will attempt to document what is being lost as part of my review. My suggestion as a min-bar for testing in this change would be:

  • linux checked arm64 build + test
  • linux checked x64 build + test
  • OSX checked x64 build + test
  • windows checked x64 build + test
  • windows checked x86 build + test
  • windows checked arm build + test
  • windows checked arm64 build
  • windows release x64 build
  • linux release x64 build

Coverage to be re-added

  • crossgen comparison
  • Windows debug x64 build
  • Windows debug x86 build
  • Linux arm checked build + test
  • Linux arm64 checked build + test
  • Linux musl x64 checked build + test
  • Windows checked arm build + test
  • windows checked x64 build + test
  • linux rhel 6 x64 release build
  • Windows arm libraries checked build + test
  • R2R Windows x64 build + test
  • R2R Windows x86 build + test
  • R2R linux x64 build + test
  • R2R OSX x64 build + test
  • Windows x64 formatting job
  • linux x64 formatting job

Coverage lost but I suggest not re-adding

  • osx x64 release build
  • windows arm release build
  • linux arm64 release build
  • linux musl arm64 release build

jashook
jashook previously requested changes Dec 2, 2019
Copy link
Contributor

@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.

This is an overview feedback. This change looks like it is removing the idea of specific pipelines per area path. Either that or it is modifying coreclr/pr.yml into a root pr.yml. Either way I think we should change the direction to do the following:

  1. Create a new root pr.yml without modifying coreclr/py.yml
    • The contents of this pr.yml should be similar to what is currently in this pr. I will make suggestions on what to remove assuming the pr.yml changed in this pr will be the new pr.yml for the root pipeline
  2. Undo the changes to coreclr/pr.yml so that we will not lose coverage. If there is work to be done that is outside of the scope of what has been done already remove/comment out the bits that do not work such that we have minimum coverage detailed Live-live CI pipeline #294 (comment)
  3. Installer will need to have work in its CI, which I expect to be less than corefx and coreclr. This should be done in a subsequent PR.

@jashook
Copy link
Contributor

jashook commented Dec 2, 2019

I will continue a deeper review assuming that the coreclr/pr.yml will be essentially copied to become root/pr.yml

Copy link
Contributor

@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.

The rest looks good. The overview review sounds a bit daunting at first; however, the framework that you guys have built should make it I think pretty smooth to transition.

Thanks for all the great work.

@@ -577,8 +581,10 @@ REM ============================================================================

if NOT "%__LocalCoreFXPath%"=="" (
echo Patch CoreFX from %__LocalCoreFXPath%
set __CoreFXBuildType=Debug
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be the opposite, assume it is release. If the build type is debug then use a debug corefx. That way we can correctly use a release corefx build with a checked runtime.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed, thanks for pointing that out. Ultimately we may want to introduce options for [semi-]arbitrarily combining configuration modes for the individual components (CoreCLR, CoreFX, tests in either subrepos - not sure what degrees of freedom we have) but I think it will be easier to address in a follow-up change.

@@ -136,7 +136,12 @@ patch_corefx_libraries()
{
echo "${__MsgPrefix}Patching CORE_ROOT: '${CORE_ROOT}' with CoreFX libaries from enlistment '${__LocalCoreFXPath}"

patchCoreFXArguments=("-clr_core_root" "${CORE_ROOT}" "-fx_root" "${__LocalCoreFXPath}" "-arch" "${__BuildArch}" "-build_type" "${__BuildType}")
__CoreFXBuildType=Debug
if [ "$__BuildType" == "release" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as the windows file.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@jashook
Copy link
Contributor

jashook commented Dec 2, 2019

CI succeeded excellent work!

- buildScriptFileName: libraries
- _BuildConfig: Debug
- ${{ if eq(parameters.buildConfig, 'release') }}:
- _BuildConfig: Release
Copy link
Member

Choose a reason for hiding this comment

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

Should this be part of xplat-setup.yml?

Copy link
Member

Choose a reason for hiding this comment

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

Btw is comparison here case-sensitive? because in libraries/.azure-ci.yml we pass it down as upper-case.

# Windows variables
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
- _msbuildCommand: powershell -ExecutionPolicy ByPass -NoProfile eng\common\msbuild.ps1 -warnaserror:0 -ci
- _runtimeOSArg: /p:RuntimeOS=win10
- _archiveExtension: '.zip'
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this? This should already be defined in xplat-setup.yml

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh, you're right, this should be no longer necessary with all your refactorings, will remove, thank you!

@@ -37,11 +44,13 @@ jobs:
- EMSDK_PATH: $(Build.BinariesDirectory)/emsdk
- ${{ if eq(parameters.runTests, true) }}:
- _buildAction: -build -buildtests /p:ArchiveTests=true
- ${{ if ne(parameters.framework, 'allConfigurations') }}:
- ${{ if and(ne(parameters.framework, 'allConfigurations'), ne(parameters.useLiveCoreClr, true)) }}:
Copy link
Member

Choose a reason for hiding this comment

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

Why do we want to skip restoring the tests when useLiveCoreClr is not being used?

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'll double-check this, I may have confused this with the other property to not restore the CoreCLR framework (as we're using the live one).

Copy link
Member

Choose a reason for hiding this comment

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

Yeah. That property is to avoid restoring libraries test-projects. AllConfigurations is a special framework which doesn't build libraries test projects at all (it builds custom package tests) so we don't need to restore test projects as part of its restore step.

trylek added 10 commits December 3, 2019 19:26
These complementary properties should let us drop all automatic
transformations of CoreCLR vs. library build modes and thus
substantially simplify the live-live pipeline and make it more
general at the same time. I have reverted the changes to the
build-test scripts that were taking care of this logic on the
local build side as well as the change to
eng/pipelines/libraries/base-job and bits of the other YAML files
on the CI side.

Thanks

Tomas
@trylek trylek force-pushed the CombinedBuild2 branch 5 times, most recently from 993d487 to 12f30fa Compare December 3, 2019 18:42
cleanUnpackFolder: false
artifactFileName: '$(librariesArtifactName)$(archiveExtension)'
artifactName: '$(librariesArtifactName)'
displayName: 'live-built CoreFX'
Copy link
Member

Choose a reason for hiding this comment

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

CoreFX -> Libraries.

dependsOn:
- ${{ format('coreclr_product_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
- ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}:
- ${{ format('libraries_build_{0}_{1}{2}_{3}_{4}', 'netcoreapp', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveLibrariesBuildConfig) }}
Copy link
Member

Choose a reason for hiding this comment

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

It might make sense to remove netcoreapp from the libraries build names when target framework is netcoreapp as libraries is the only subset that builds for other frameworks. That way we don't need to hard code it here. Something to consider on a follow up PR.

- Windows_NT_arm64
jobParameters:
isOfficialBuild: false
testScope: empty
Copy link
Member

Choose a reason for hiding this comment

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

No need to pass this down here. The default is already '' . This is just used when running the tests as part of the build-job.

- librariesDownloadDir: ''

- ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}:
- librariesArtifactName: ${{ format('libraries_bin_{0}_{1}{2}_{3}_{4}', 'netcoreapp', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveLibrariesBuildConfig) }}
Copy link
Member

Choose a reason for hiding this comment

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

It might make sense to move these artifactName variables to xplat-setup template as it is used to upload and download and we already have all the required parameters at that point. Anyway, that can be done in a follow up PR, just calling it out so that we don't forget.

Copy link
Member

@safern safern left a comment

Choose a reason for hiding this comment

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

LGTM from the yml changes. I don't have much context on the coreclr test scripts, but looks good to my small knowledge of it.

@safern safern dismissed jashook’s stale review December 3, 2019 20:49

Feedback addressed.

@trylek trylek merged commit 8bdcba1 into dotnet:master Dec 3, 2019
@trylek trylek deleted the CombinedBuild2 branch December 3, 2019 22:40
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants