-
Notifications
You must be signed in to change notification settings - Fork 446
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
Migrate to 1ES templates for internal builds #19016
Conversation
…separate build-pr.yml for PR pipeline to use. Modified CI and normal build.yml to no longer have public conditional logic. Changed to using PT image for migration testing. Updated localization.yml to use the new templates.
…dows agent to PT agent. Fixed Ubuntu agent to PT Ubuntu agent.
…directly without aliases.
…f MicroBuild. Trying only ignoring .packages for component governance.
@@ -1,3 +1,5 @@ | |||
# Pipeline: https://dnceng.visualstudio.com/internal/_build?definitionId=286 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added these pipeline link comments to the top of the YAML files so it is easy to get to them.
/azp run |
Azure Pipelines successfully started running 4 pipeline(s). |
…ter. Trying 1es-ubuntu-2204 since the other is not 1ES PT compatible.
…l (except macOS) since the 1es images should all work with 1ES PT.
@@ -69,36 +69,42 @@ parameters: | |||
default: false | |||
|
|||
jobs: | |||
- template: common/templates/job/job.yml | |||
- template: common/templates-official/job/job.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@self
is only needed when you're providing a path as a parameter for a file in another repo, such as the 1ES template. Here, this file is in this repo and the path is in the repo, so it doesn't need it.
Meaning, template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
sets the context to @1esPipelines
which is a reference to the 1ESPipelineTemplates repo (set in the resources:
node at the top of the pipeline). So, providing parameters to that template will use that path within the context of that repo. Here, that context doesn't exist as this is just a file within the Installer repo with a path to a file within Installer repo. Does that make sense?
@@ -168,7 +174,7 @@ jobs: | |||
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines) | |||
$(_PgoInstrument) | |||
|
|||
- template: /eng/common/templates/variables/pool-providers.yml | |||
- template: /eng/common/templates-official/variables/pool-providers.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See explanation above.
- ${{ if eq(variables['System.TeamProject'], 'internal') }}: | ||
- group: DotNetBuilds storage account read tokens | ||
- name: _InternalRuntimeDownloadArgs | ||
value: /p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal | ||
/p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) | ||
/p:dotnetbuilds-internal-container-read-token-base64=$(dotnetbuilds-internal-container-read-token-base64) | ||
- template: /eng/common/templates-official/variables/pool-providers.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See explanation above.
- template: eng/build.yml@self | ||
parameters: | ||
agentOs: Linux | ||
jobName: Build_CentOS_8_Stream_Debug_x64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these all debug images?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They aren't. That's not specifying the image used. It is just the name of the job. Debug
here means the configuration, specified 2 lines down: buildConfiguration: Debug
…comment with tracking issue.
@MiYanni - This has been causing failures in the Guardian analysis of all the internal CI builds. |
@mthalman True. The failure is the fault of the MicroBuild signing plugin. I've attempted to add baselines that would normally resolve the build issue. However, the file it is failing on, So far, I tested one workaround which did not seem to work with how Arcade is using the plugin. I'm currently trying the brute force method of just disabling the tooling temporarily to unblock builds. I'll have a PR soon if that is successful. |
@mthalman I've merged a temporary fix to allow Installer builds of |
Summary
This effort is to migrate to the 1ES pipeline templates (1ES PT). This repo shows a migration to these templates with a repo that uses Arcade. Arcade pushed an update for their pipeline templates that work with the 1ES templates. This PR extends the 1ES PT and updates the internal pipeline to use the updated Arcade templates. Our internal pipeline uses
.vsts-ci.yml
and our external (PR) pipeline uses.vsts-pr.yml
.Below, I've included my notes on the process as I went through the process of adopting these templates. Note that these notes may have some specifics that apply to only Arcade repos or only this repo, so these instructions aren't complete for every situation.
High-Level Notes
I used this PR as a reference: https://dnceng.visualstudio.com/internal/_git/dotnet-symreader/pullrequest/37739This isn't a great reference as some of the information is wrong/inaccurate, so take it with a grain of saltView -> Appearance -> Render Whitespace
pr
yml fileProcess
Extend 1ES PT
resources:
node or evenrepositories:
under it. This is an additionalrepository
object in that array.Example
stages:
as aparameters:
propertytemplate:
is referencing the repository above and the YAML file in that reposourceAnalysisPool:
sets the pool information for running the SDL tools. See the section on updating build pools for more context.customBuildTags:
adds tags to your pipeline runs for 1ES.Before
After
Update local template paths
/eng/common/templates
with/eng/common/templates-official
@self
to the end of all local (in-repo) template paths (including the Arcade templates)@self
lets the 1ES PT template know to access this file path from within your repository, not the 1ES PT repo.Arcade Templates
Before
After
Non-Arcade Templates
Before
After
Update pool information
windows.vs2022
or1es
will work with 1ES PT.1es
will work with 1ES PT.Before (Windows)
After (Windows)
Before (Linux)
After (Linux)
Before (Mac)
After (Mac)
$(DncEngInternalBuildPool)
variable for the pool name previously, you will need to add this variable template to yourvariables:
sectionExample
Update publish tasks
publish:
tasks withtask: 1ES.PublishPipelineArtifact@1
Before
After
PublishBuildArtifacts@1
with1ES.PublishBuildArtifacts@1
(just prepend1ES.
to the name)Other Notes (but might apply to you)
eng/build.yml
toeng/build-pr.yml
so that the PR pipeline uses the original (non-1ES PT) logic.vsts-pr.yml
to reference theeng/build-pr.yml
template.Builds
https://dnceng.visualstudio.com/internal/_build/results?buildId=2403255https://dnceng.visualstudio.com/internal/_build/results?buildId=2404420