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

Update PipelineGenerator target framework from netcoreapp3.1 to net6.0 #4915

Merged
merged 5 commits into from
Dec 12, 2022

Conversation

konrad-jamrozik
Copy link
Contributor

@konrad-jamrozik konrad-jamrozik commented Dec 8, 2022

This PR, in tandem with PR #4930, addresses #4888 by updating the PipelineGenerator tool target framework from netcoreapp3.1 to net60 (version reference). The net60 SDK is supported both by the Ubuntu pool image we are pinning too, 20.04 (see analysis below), as well as should future-proof us at list until November 12, 2024, as this is when net6.0 support ends.

This PR also contributes to solving #4934 and #4935, together with PR #4937.

Why the version bump, and will it work?

I have identified two pipeline kinds calling into the PipelineGenerator tool:

  1. The azure-sdk / internal / Pipelines / automation / automation - pipeline-generation pipeline, using azure-sdk-tools / pipeline-generation.yml.
  2. The azure-sdk / internal / Pipelines / <lang> / prepare-pipelines / prepare-pipelines pipelines, for each applicable value of <lang>, e.g.: azure-sdk / internal / Pipelines / net / prepare-pipelines / prepare-pipelines. These pipelines are ultimately deriving its source from azure-sdk-tools / prepare-pipelines.yml.

The .yml file used in 1. case is using the following pool:

pool:
  name: azsdk-pool-mms-ubuntu-2004-general
  vmImage: MMSUbuntu20.04

Re case 1 - pipeline-generation.yml

According to 1ES hosted pools doc on MMS images (Microsoft-internal) this image has .NET Core 6.0.403 SDK installed, hence the pipeline should work after the update.

Re case 2 - prepare-pipelines.yml

The image for these pipelines is set to ubuntu-latest, as explained in #4888. It has net6.0 installed, as explained in #4888 (comment).

@konrad-jamrozik
Copy link
Contributor Author

konrad-jamrozik commented Dec 8, 2022

This PR currently fails to build because the pipeline building the modified code, the public / tools - pipeline-generator - ci, is using .NET Core SDK 3.1.405. Example failed run.

This SDK version is used because the pipeline ci.yml uses the archetype-sdk-tool-dotnet.yml which uses a .NET Core SDK inclusion task with version as provided by variables, which are defined in global.yml as DotNetCoreVersion: '3.1.405'.

I submitted PR #4916 to update the globals.yml value to 6.0.405.

UPDATE 12/9/2022 7:55 PM PST:
I applied a workaround. See comment below.

@konrad-jamrozik
Copy link
Contributor Author

Turns out I can unblock this PR by passing explicit SDK version just for the ci.yml, which I did. See this PR commits.

@weshaggard let's merge this PR to unblock #4888, while I separately work on PR #4916 ?

@konrad-jamrozik konrad-jamrozik merged commit c7f236a into main Dec 12, 2022
@konrad-jamrozik konrad-jamrozik deleted the users/kojamroz/iss_4880_net60 branch December 12, 2022 21:50
ghost pushed a commit that referenced this pull request Dec 12, 2022
… to use Ubuntu 20.04 (#4930)

This PR, in tandem with PRs #4915 and #4916, addresses #4888. This PR subsumes the abandoned PR of #4911.

Specifically, this PR ensures that `prepare-pipelines.yml` is configured to use specific `pool`, set to use Ubuntu 20.04:

```
pool:
  name: azsdk-pool-mms-ubuntu-2004-general
  vmImage: MMSUbuntu20.04
```

Without the [pool](https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/pool?view=azure-pipelines) definition pointing to Ubuntu 20.04, the steps within the file used an implicit default, which resolves to `ubuntu-latest`. This caused breakage as explained in #4888. Setting the pool to Ubuntu 20.04 will allow us to:

- Immediately unblock the language repos `prepare-pipelines.yml` pipelines [1], as Ubuntu 20.04 has the .NET Core version used by it [2];
- Allow us to migrate our tooling to .NET 6 as both Ubuntu 20.04 and `ubuntu-latest`, which is Ubuntu 22.04 [3], have .NET on them [4]. This step is accomplished by PRs #4916 and #4915;
- Allow us to migrate to Ubuntu 22.04 once we migrate to .NET 6.

## Technical considerations of the changes

- The current `prepare-pipelines.yml` has only [steps](https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/steps?view=azure-pipelines) definition, which does not support `pool` definition. One needs to wrap the steps in [job](https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/jobs-job?view=azure-pipelines) definition to support `pool` [5].
- Because the `.yml` file is located in `eng/common/pipelines/templates/steps/` directory (note the `steps`), we cannot wrap the steps in job and leave it there; the introduction of `job` necessitates introducing the changes in `eng/common/pipelines/templates/jobs/` directory instead (note the `jobs`), which is done in this PR.
- Because this PR introduces a new file, once this PR is merged, the language-specific `prepare-pipelines.yml` language pipelines need to be rewired to point to the newly introduced file. This approach was proposed in #4911 (comment). 
  - Language repos PRs doing the rewiring: 
    Azure/azure-sdk-for-net#32999 
    ... more to come!

## Testing done

I have confirmed the proposed modification to the `.yml` file will work [by modifying the existing `prepare-pipelines.yml` directly](Azure/azure-sdk-for-java@f8cef4c) to have exactly the same contents as the `/jobs/prepare-pipelines.yml` introduced in this PR, and observing the [relevant build succeeds on azure-sdk-for-java](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=2044120&view=logs&j=7f42699e-eeb0-56c8-40c2-c88ae4093e4f&t=a02502cb-238e-5603-14ee-8bb7bd07f0c6):

![image](https://user-images.githubusercontent.com/4429827/206805076-b01baf33-871a-4ff2-816e-fa8458fa0063.png)

while it failed before this change:

![image](https://user-images.githubusercontent.com/4429827/206805129-b3bd8ebb-b97b-444b-8785-e6edf68c9720.png)

# Footnotes

[1] for example, [internal / java / prepare-pipelines](https://dev.azure.com/azure-sdk/internal/_build?definitionId=2158&_a=summary) pipeline, or [internal / net / prepare-pipelines](https://dev.azure.com/azure-sdk/internal/_build?definitionId=2179) pipeline.

[2] as evidenced by the [Ubuntu 20.04 image software page](https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md#net-core-sdk), it has .NET Core 3.1. The pool definition value points to a 1ES hosted image which has the software listed on that page, as explained by this comment: #4888 (comment).

[3] See this comment: #4888 (comment).

[4] as evidenced by the [Ubuntu 22.04 image software page](https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#net-core-sdk).

[5] Observe that on [pool definition](https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/pool?view=azure-pipelines) YAML reference page, we can read:

> Properties that use this definition: pipeline.pool, stages.stage.pool, jobs.job.pool, jobs.deployment.pool.

i.e. `steps.pool` is not listed.
@konrad-jamrozik konrad-jamrozik changed the title Update PipelineGenerator target framework from netcoreapp3.1 to net6.0 Update PipelineGenerator target framework from netcoreapp3.1 to net6.0 Jan 10, 2023
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
None yet
Development

Successfully merging this pull request may close these issues.

2 participants