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

Add 1es changes for job/matrix generation and publish #7758

Merged
merged 6 commits into from
Mar 4, 2024

Conversation

benbp
Copy link
Member

@benbp benbp commented Feb 26, 2024

Adding these files as separate copies of their originals so we can do a rollout more easily.

  1. Update archetype-sdk-tests-generate.yml to generate-job-matrix.yml. Changes to this file include generating a matrix with corresponding env vars for OS pools/agents, and passing in the now required OSName parameter which cannot be set as a variable for the 1es templates.
  2. Moving publish-artifact.yml to publish-1es-artifact.yml to use the 1es publishing wrapper task. I don't think this task is available in a backwards compatible way without the repo reference and/or onboarding we're having to do, see https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3503459&view=logs&j=96791242-dbf3-587e-3a06-ae5af5c1a705&t=8e5c4a57-b21e-59c3-59e8-95279bb1be65&l=16 for example.

@benbp benbp added the Central-EngSys This issue is owned by the Engineering System team. label Feb 26, 2024
@benbp benbp self-assigned this Feb 26, 2024
@benbp benbp requested a review from scbedd February 26, 2024 23:16
@benbp benbp force-pushed the benbp/common-template-tasks branch from cf61332 to 75d988d Compare February 26, 2024 23:21
jobs:
- job: ${{ parameters.GenerateJobName }}
variables:
- template: /eng/pipelines/templates/variables/image.yml
Copy link
Member

Choose a reason for hiding this comment

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

image.yml should be part of this PR I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

Originally the idea was to have image.yml be repo specific, but it is a hard requirement since this has a reference.

Copy link
Member Author

Choose a reason for hiding this comment

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

@weshaggard maybe this is something we do want in eng/common just to avoid hidden file dependencies in our templates. However if we wanted to roll out image changes per-repo it would not work.

Copy link
Member

Choose a reason for hiding this comment

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

I don't mind having a default one in eng\common and perhaps we can come up with a way to override the image in the language repo if needed. We could even make this a default template parameter that could be set to something as needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

One way would be to have the underlying values get set via coalesce e.g. $[ coalesce(variables.LinuxPoolOverride, variables.LinuxPool) ] but I'm not too excited about the config variable bloat of doubling all the values with *Override.

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

Copy link
Member

@scbedd scbedd left a comment

Choose a reason for hiding this comment

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

Based on offline discussion about image.yml, signing off.

- name: Pool
type: string
default: azsdk-pool-mms-ubuntu-2204-general
- name: OsVmImage
Copy link
Member

Choose a reason for hiding this comment

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

Is this still interesting after the migration?

Copy link
Member

Choose a reason for hiding this comment

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

Similar question for the Pool parameter.

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct me if I'm wrong @scbedd, but we found demands does not work for the Azure Pipelines mac pool, and we still need to pass vmImage for that. Additionally for the migration we'll want to use the main pools and specify the alternate image.

Copy link
Member

@scbedd scbedd Feb 27, 2024

Choose a reason for hiding this comment

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

Correct me if I'm wrong @scbedd, but we found demands does not work for the Azure Pipelines mac pool, and we still need to pass vmImage for that. Additionally for the migration we'll want to use the main pools and specify the alternate image.

Correct. The specific combo of

pool:
  name: 
  vmImage: 
  os: linux|windows|macOS

works for both devops + the additional agent checks. I swear I tried everything else and could not get them to work otherwise.

Copy link
Member

@weshaggard weshaggard left a comment

Choose a reason for hiding this comment

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

A couple questions but otherwise seems fine

steps:
- task: 1ES.PublishPipelineArtifact@1
condition: and(succeeded(), ${{ parameters.CustomCondition }})
${{ if parameters.DisplayName }}:
Copy link
Member

@weshaggard weshaggard Feb 27, 2024

Choose a reason for hiding this comment

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

As mentioned in the other PR I'd suggest just moving to DisplayName everywhere and for the existing places just map them to call DisplayName: Publish ArtifactName Artifacts if we really care about the string being the same. We could also potentially use a coalesce but that might not work as well for the failed condition.

edit: Another option is just to force everyone to use the standard Publish ${{ parameters.ArtifactName }} Artifacts as I'm not sure if we need this flexibility.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated a bit to remove the conditionals. I think keeping the naming for now is helpful but we can go in and remove custom ones after.

Copy link
Member

Choose a reason for hiding this comment

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

Looks like you updated the publish-artifacts.yml file but not this one. Do you plan to keep both for the transition or did you edit the wrong one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for catching that, fixed.

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

benbp added a commit to Azure/azure-sdk-for-js that referenced this pull request Mar 4, 2024
Sync eng/common directory with azure-sdk-tools for PR
Azure/azure-sdk-tools#7758 See [eng/common
workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow)

---------

Co-authored-by: Ben Broderick Phillips <[email protected]>
@benbp benbp enabled auto-merge (squash) March 4, 2024 21:59
@benbp benbp merged commit 7ea5f09 into Azure:main Mar 4, 2024
7 checks passed
@benbp benbp deleted the benbp/common-template-tasks branch March 4, 2024 22:03
displayName: Set Failed Artifact Name

- task: 1ES.PublishPipelineArtifact@1
condition: and(succeeded(), ${{ parameters.CustomCondition }})
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we remove or at least update this condition to be failedOrSucceeded()?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, yes, good catch. I'll do another PR. FYI @scbedd but shouldn't be necessary for your testing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I would suggest succededOrFailed here as well in your pwsh step to set the artifact name. https://learn.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops#succeededorfailed


steps:
- pwsh: |
Write-Host "##vso[task.setvariable variable=PublishArtifactName;]${{ parameters.ArtifactName }}"
Copy link
Member

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Central-EngSys This issue is owned by the Engineering System team.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants