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

correct perf-send-to-helix on windows #42235

Merged
merged 9 commits into from
Sep 17, 2020

Conversation

ooooolivia
Copy link
Contributor

Fixing changes in this commit 0956285
Currently perf jobs on windows are running in bash and not being sent to helix.

@ooooolivia ooooolivia requested a review from trylek September 15, 2020 01:16
@ooooolivia ooooolivia changed the title correct perf helix workitems on windows correct perf-send-to-helix on windows Sep 15, 2020
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.

Looks great, thanks for fixing this!

@@ -24,7 +24,7 @@ parameters:
steps:
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml
parameters:
osGroup: $(Agent.Os)
osGroup: $(Agent.OS)
Copy link
Member

Choose a reason for hiding this comment

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

YAML identifiers should be case insensitive. I think you need to use variables['Agent.Os'] but use a different substitution syntax. I'll look it up after our team meeting, I think it's something like $[[ (instead of ${{) that expands later so that it "waits" until the variable gets populated. @DrewScoggins might remember the syntax off the top of his head.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it possible if we directly use this variable as variables['Agent.Os'] in

- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:

instead of passing it as a parameter?

Copy link
Member

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 think it should be $[ variables('Agent.Os') ], at least I hope so

Copy link
Member

Choose a reason for hiding this comment

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

Well, the problem is that the inner-step is called from three different scripts, we would need to double-check that variables['Agent.Os'] work everywhere, it can likely break for cross-targeting builds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for sending the doc! I'll test $[ variables('Agent.Os') ] first

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From the log it seems the $[ variables['Agent.Os'] ] is not expanded before evaluating the condition:

Begin evaluating template '/eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml'
Evaluating: eq(parameters['osGroup'], 'Windows_NT')
Expanded: eq('$[ variables[''Agent.Os''] ]', 'Windows_NT')
Result: False
Evaluating: ne(parameters['osGroup'], 'Windows_NT')
Expanded: ne('$[ variables[''Agent.Os''] ]', 'Windows_NT')
Result: True

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems that the problem is.. the variable won't be populated until runtime but the condition evaluation happens at compile time? I was thinking we might want to try using runtime expression here $[ ] instead of compile expression

- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
@trylek

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found another place that uses this condition

- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:

but in this case it works because the variable's ready at compile time

@DrewScoggins
Copy link
Member

Looking at eng\common\templates\phases\publish-build-assets.yml it seems that what we should be doing is $(Agent.Os), or at least that is the syntax that is used in that yml file and seems to work.

- task: PublishBuildArtifacts@1
          displayName: Publish Logs to VSTS
          inputs:
            PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)'
            PublishLocation: Container
            ArtifactName: $(Agent.Os)_Asset_Registry_Publish
          continueOnError: true
          condition: always()

@ooooolivia
Copy link
Contributor Author

ooooolivia commented Sep 16, 2020

Looking at eng\common\templates\phases\publish-build-assets.yml it seems that what we should be doing is $(Agent.Os), or at least that is the syntax that is used in that yml file and seems to work.

- task: PublishBuildArtifacts@1
          displayName: Publish Logs to VSTS
          inputs:
            PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)'
            PublishLocation: Container
            ArtifactName: $(Agent.Os)_Asset_Registry_Publish
          continueOnError: true
          condition: always()

We will see whether this will work in the current build. I suppose $(Agent.Os) has value here because it gets expanded in runtime, but the condition that evaluates the parameter OSGroup happens at compile time. @DrewScoggins

@ooooolivia
Copy link
Contributor Author

Works with parameters.osGroup passed to perf-send-to-helix.yml @DrewScoggins https://dev.azure.com/dnceng/public/_build/results?buildId=817998&view=logs&j=e46328bd-abc1-50e1-2136-d10902647fd9&t=09232069-e64e-5111-d89c-2234e5b017ef

@ooooolivia ooooolivia merged commit 3d75475 into dotnet:master Sep 17, 2020
@trylek
Copy link
Member

trylek commented Sep 17, 2020

Thanks so much Olivia for your perseverance in pushing this through!

@ooooolivia
Copy link
Contributor Author

Just noticed arcade is not update with both commits ( 0956285 and this)... will submit both commits to arcade so they won't be overriden.

@akoeplinger
Copy link
Member

@ooooolivia @trylek it looks like 0956285 didn't make it to arcade, only this PR.

@ooooolivia
Copy link
Contributor Author

ooooolivia commented Sep 22, 2020

@ooooolivia @trylek it looks like 0956285 didn't make it to arcade, only this PR.

Missed updating non-perf changes in Arcade; new PR submitted in Arcade dotnet/arcade#6227

@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 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.

6 participants