Skip to content

Add installer build/test to the runtime.yml pipeline #705

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

Merged
merged 8 commits into from
Dec 11, 2019

Conversation

dagood
Copy link
Member

@dagood dagood commented Dec 9, 2019

Adds installer build and test to runtime.yml, consuming live artifacts. Preserves the old standalone installer build + test pipeline using cached bits for now, but if it breaks with #494 as expected I won't try to repair it with this PR.

Old WIP PR: #529.

/cc @trylek @safern @jashook

- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: NuGetAuthenticate@0
buildVariables:
CommonMSBuildArgs: >-
Copy link
Member

Choose a reason for hiding this comment

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

Just to learn, what does: >- do?

Copy link
Member

Choose a reason for hiding this comment

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

I'm seeing this for the first time too...

Copy link
Member Author

Choose a reason for hiding this comment

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

> replaces newlines with spaces (vs. | which keeps newlines), - strips the newline at the end. http://yaml-multiline.info/ is a nice resource for this, and it has links to the spec.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, pretty useful 😄

jkoritzinsky and others added 7 commits December 9, 2019 17:49
… minimal changes to the installer jobs.

Fix paths to jobs.

Fix typos

Add platform to parameter lists.

Pass platform to all jobs.

Cleanup variable usages.

Don't pass buildConfig down to installer jobs. They use matrix strategy instead.

Fix variable usage in windows build.

Fix windows platform names.

Add missing platform parameter for Windows_NT_arm

Update last condition re parameters.dockerImage.

Rename dockerImage parameter to productBuildDockerImage to be more explicit.

Use pool and container parameters from platform-matrix in installer build.

Pass rootfs dir via crossrootfsDir to bash-build.yml.

Fix passing down container in runtime-installer pipeline.

Remove unused Linux_x64_raw config.
Includes refactoring the runtime legs to avoid duplicating artifact
transfer logic and preserve the runtime standalone build.
@dagood dagood force-pushed the live-ci-installer branch from 0427f1a to 48ca424 Compare December 9, 2019 23:50
$[] becomes empty string when a variable is undefined. $() sticks around literally if the variable doesn't exist, messing up the command. Unfortunately $[] doesn't seem to work in this context so we must use $() and define the variable as empty string.
@dagood
Copy link
Member Author

dagood commented Dec 10, 2019

In the last CI run, I somehow got AzDO to give me a good runtime pipeline build of Installer using live bits. All the platforms ran but macOS, which was just stalling due to the ongoing AzDO issues.

(The $[] vs. $() issue I fixed caused some benign error messages in the log, no failure.)

@jkoritzinsky @ViktorHofer @safern @trylek PTAL

@dagood
Copy link
Member Author

dagood commented Dec 10, 2019

CI is all green except runtime-coreclr (CoreCLR Pri0 Test Run R2R Windows_NT x86 checked), which timed out trying to send (get?) Helix results. I hit retry.

Would appreciate more reviews. 🙂

Copy link
Member

@trylek trylek left a comment

Choose a reason for hiding this comment

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

OMG, sorry for not signing off, your change looks awesome to me!


# Set the bash script to display each command, and stop if any command exits nonzero.
- name: setScriptToEchoAndFailOnNonZero
value: 'set -xe'
Copy link
Member

Choose a reason for hiding this comment

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

Don't we need separate Windows vs. Linux versions here?

Copy link
Member Author

Choose a reason for hiding this comment

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

We have them, it's just a no-op right now on Win a few lines up:

- name: setScriptToEchoAndFailOnNonZero
  value: ''

Don't know if it's possible to do this (or necessary) in batch.

- Windows_NT_arm64
jobParameters:
${{ insert }}: ${{ parameters }}
skipTests: true
Copy link
Member

Choose a reason for hiding this comment

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

I may be just insufficiently familiar with details of the installer pipeline but wouldn't it be possible to synthesize some of the jobParameters like skipTests or publicRidAgnosticPackages in windows-build so that we could use just one invocation of platform-matrix for all the platform combinations? Non-blocking, just asking.

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 be possible to make skipTests = crossBuild. Based on the current file, that seems correct.

@@ -0,0 +1,173 @@
parameters:
Copy link
Member

Choose a reason for hiding this comment

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

Non-blocking observation that's moreover unrelated to your change as such. Amusingly enough we managed to put the common build-related templates into a different location for each repo - under "installer/jobs" vs. "libraries" vs. "coreclr/templates". Let's ignore this for now but once the changes settle down, I think some shuffles to make this more regular would be beneficial.

value: ''

- ${{ if ne(parameters.liveCoreClrBuildConfig, '') }}:
- name: liveCoreClrLegName
Copy link
Member

Choose a reason for hiding this comment

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

I originally chickened out of Santi's suggestion to put this logic in xplat-setup (and you're not using it, after all) but perhaps we could somehow extract this logic into a separate script to avoid open-coding it in multiple places. I don't yet have a completely clear idea on how exactly this should work and I don't think you should try to address it as part of this change but it might be worth a small design discussion.

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 originally chickened out of Santi's suggestion to put this logic in xplat-setup (and you're not using it, after all)

I actually am using xplat-setup, since I use platform-matrix... or am I misunderstanding?

It makes sense to me to have it in xplat-setup, since the bulk of the transfer is setting up variables, and I think this is the only reasonable mechanism we have to share agent-local variable setup.

Copy link
Member

Choose a reason for hiding this comment

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

I originally chickened out of Santi's suggestion to put this logic in xplat-setup (and you're not using it, after all)

I actually am using xplat-setup, since I use platform-matrix... or am I misunderstanding?

We really need to update our docs on how these templates flow. I'll open a tracking issue for that.

Copy link
Member

Choose a reason for hiding this comment

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

The reasoning was to have all this *ArtifactName variables and LegName defined in xplat-setup so that all templates can benefit from it and just use them without having to actually define it in multiple places. Currently each partition defined this on it's base template.

However the change is not trivial as the right parameters need to be flown to the right templates in order to be able to access the values we need on xplat-setup. So this can be a follow up clean-up change.

I still have to do clean-up on libraries template which I left from my previous PR to unblock work, so I can put it as part of my change.

Copy link
Member

Choose a reason for hiding this comment

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

Please let's make sure we don't get deadlocked by these considerations for now - it's probably up to me to apologize for bringing them up in the first place. I'll be the happiest person in the world to clean this up but it's strictly ordered after standing up the official build and producing signing artifacts so please let's not block on that for now. I'll be happy to play with pipeline cleanups over / after the EOY holidays ;-).

@jkoritzinsky
Copy link
Member

A lot of the Helix queues are very full (the Windows queue that PRs use currently has a queue depth of 2.3k work items), so we might want to wait for the queue to drain before re-running any more if it times out again.

parameters:
liveCoreClrBuildConfig: checked
liveLibrariesBuildConfig: Release
skipPlatforms:
Copy link
Member

Choose a reason for hiding this comment

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

I think we should invert this to instead specify the platforms we want to build for, not the platforms we want to skip. We should do this in a similar manner to the platform-matrix.yml file is done.

Copy link
Member

Choose a reason for hiding this comment

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

Anyway I think it makes sense to add a comment so that whenever we expand the full matrix for all partitions we don't forget adding any platform.

<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="$([System.String]::Copy('%(FileName)').StartsWith('mscordaccore_'))" />
<ReferenceCopyLocalPaths Include="@(CoreCLRFiles)" />

<ReferenceCopyLocalPaths Include="@(CoreCLRFiles)" NuGetPackageId="$(MicrosoftNETCoreRuntimeCoreCLRPackage)" />
Copy link
Member

Choose a reason for hiding this comment

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

Why is the NuGetPackageId metadata required? Is that related to the support in Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk for crossgenning the framework?

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 believe it was a batch somewhere that assumed all items had NuGetPackageId defined. I wouldn't expect it to change any concrete results if the assumption were fixed instead, but this was easy and matches how we're adding this data to the CoreFX items.

</Target>

<!-- !!!BEGIN PATCHING Sharedfx SDK target -->
<Target Name="GetFilesFromPackageResolve">
Copy link
Member

Choose a reason for hiding this comment

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

What part of this target did you have to override/patch?

Copy link
Member Author

Choose a reason for hiding this comment

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

See below:

      <!-- !!!BEGIN CHANGE Persist existing TargetPath. -->
      <RidSpecificFilesToPackage Condition="'%(RidSpecificFilesToPackage.TargetPath)' == ''">
      <!-- !!!END CHANGE -->

Although I guess I neglected mentioning the original: <RidSpecificFilesToPackage>.

Copy link
Member

Choose a reason for hiding this comment

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

The paths without the change should work as-is. Were they not working correctly?

Copy link
Member

Choose a reason for hiding this comment

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

In fact, the paths should have been the same as what they're overridden to here.

Copy link
Member Author

Choose a reason for hiding this comment

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

The cross-target paths get reset by that, and need to be preserved:

<CoreCLRCrossTargetFiles>
<TargetPath>runtimes/$(CoreCLRCrossTargetComponentDirName)_$(TargetArchitecture)/native</TargetPath>
</CoreCLRCrossTargetFiles>

I think they used to work by being added after GetFilesFromPackageResolve rather than before.

Copy link
Member

Choose a reason for hiding this comment

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

Good catch!

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, I did have the benefit of seeing the build fail before I did this. 😄 When the target paths are the same between cross and target archs, the zip gets duplicate entries which fails an unzip step later.

@dagood
Copy link
Member Author

dagood commented Dec 10, 2019

I don't think any of the convos are blockers--I'd like to get this merged to unblock and work on them incrementally. I've filed #749 to track the issues. I'll file PRs for smaller ones really quick when I have gaps in my work on signing/publishing. Any objection (while that CoreCLR leg is finishing up)?

@dagood dagood merged commit 6b78906 into dotnet:master Dec 11, 2019
@dagood dagood deleted the live-ci-installer branch December 11, 2019 00:35
@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