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

build(publish): parallel code gen on azure-sdk-for-net #3153

Merged
merged 23 commits into from
Feb 24, 2023

Conversation

archerzz
Copy link
Member

@archerzz archerzz commented Feb 19, 2023

  • split job Update_azure_sdk_for_net into 3 stages:
    • Update_Generator_Versions: change the generator versions only, create the first commit to new branch auto-update-autorest-${Version}
    • Update_Codes_X_Y and Update_Samples_X_Y: update SDK codes or sample codes from service of which name starts with X to Y.
    • Create_PR: create PR from branch auto-update-autorest-${Version} to main
  • add retry for Update_Codes_X_Y and Update_Samples_X_Y

resolve #3067 #3068


image

Checklist

To ensure a quick review and merge, please ensure:

  • The PR has a understandable title and description explaining the why and what.
  • The PR is opened in draft if not ready for review yet.
    • If opened in draft, please allocate sufficient time (24 hours) after moving out of draft for review
  • The branch is recent enough to not have merge conflicts upon creation.

Ready to Land?

  • Build is completely green
    • Submissions with test failures require tracking issue and approval of a CODEOWNER
  • At least one +1 review by a CODEOWNER
  • All -1 reviews are confirmed resolved by the reviewer
    • Override/Marking reviews stale must be discussed with CODEOWNERS first

- split the script of update `azure-sdk-for-net` into 2 scripts which update codes and samples respectively
- change pipeline to split the job of generating all SDKs into 2 jobs which generate codes and samples respectively

resolve #3067
- expand the steps of generating codes and samples, move PR creation into a separate job which is executed only after success codes/sample generation
- remove `-f` for git push
- change push branch to have version as name suffix to avoid potential conflict
do not generate sdk when updating versions

fix wrong script name

tune update codes task division

fix shallow update

fix pull request not created

also optimize checkout perf

fix repo name and add code gen retry
@archerzz
Copy link
Member Author

Other benefits:

  • Re-running the failed tasks will be much easier. We don't need to start over from the very beginning again.
  • For PR with thousands of changes, people can choose to review each commit (there are 12 commits in total).
  • Each change on auotrest.csharp is now separately published to azure-sdk-for-net. So if a change screws the azure-sdk-for-net, people can still merge all previous changes.

eng/UpdateAzureSdkCodes.ps1 Show resolved Hide resolved
eng/UpdateAzureSdkForNet.ps1 Outdated Show resolved Hide resolved
eng/UpdateAzureSdkGeneratorVersions.ps1 Outdated Show resolved Hide resolved
archerzz and others added 3 commits February 20, 2023 14:48
- remove unnecessary argument `Branch`
- update `UpdateAzureSdkForNet.ps1` to invoke `UpdateAzureSdkCodes.ps1`
- improve parameter validation
Copy link
Member

@m-nash m-nash left a comment

Choose a reason for hiding this comment

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

@mikeharder can you please take a look as well since you are helping in the same area. This gets us from 3+ hours to roughly 35 minutes on the regen portion of the publish pipeline.

If you have even more improvements lets open those as trackers so we can make incremental progress but if you see any major issues with this let us know.

@mikeharder
Copy link
Member

mikeharder commented Feb 22, 2023

@m-nash, @archerzz: Are there example builds before and after this change I can look at?

I see an example build at the top of this PR: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=2201624&view=results. I assume I should just compare this to a similar build from another PR?

@archerzz
Copy link
Member Author

archerzz commented Feb 22, 2023

@m-nash, @archerzz: Are there example builds before and after this change I can look at?

I see an example build at the top of this PR: dev.azure.com/azure-sdk/internal/_build/results?buildId=2201624&view=results. I assume I should just compare this to a similar build from another PR?

@mikeharder Recently we don't change the pipeline except this PR. So any build on feature/v3 branch should be before this change, like this one.

@archerzz
Copy link
Member Author

archerzz commented Feb 23, 2023

Here is the comparison of existing pipeline and new pipeline.

Existing Pipeline

New Pipeline

The changes in two PR are actually identical.

@archerzz archerzz merged commit f3b963a into feature/v3 Feb 24, 2023
@archerzz archerzz deleted the eng/parallel-code-gen branch February 24, 2023 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

build(common): add generate sample into a separate task
7 participants