Skip to content

Commit

Permalink
Remove .NET Core install templates from pipelines (Azure#5968)
Browse files Browse the repository at this point in the history
I believe we can finally remove the .NET Core install templates from our pipelines because either:
1. The pipelines are running on 1ES-hosted agents, which already have the latest version of .NET Core 2.1 and 3.1 installed
2. The pipelines are running on MS-hosted agents, which [already have recent version of .NET Core 2.1 and 3.1 installed](https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-Readme.md#net-core-sdk)

This change removes the templates and their references. The templates were installing a hard-coded, much older version of the SDK, and therefore missed the latest security patches and other fixes. I also updated the Functions binding project to replace some deprecated properties that were causing errors when built against the latest .NET Core SDK.

Note that this PR does not remove the template that configures the default SDK on Linux.

I tested the three pipelines impacted by this change: dotnet checkin, dotnet CI, and images release.

## Azure IoT Edge PR checklist:

This checklist is used to make sure that common guidelines for a pull request are followed.

### General Guidelines and Best Practices
- [X] I have read the [contribution guidelines](https://github.com/azure/iotedge#contributing).
- [X] Title of the pull request is clear and informative.
- [X] Description of the pull request includes a concise summary of the enhancement or bug fix.

### Testing Guidelines
- [X] Pull request includes test coverage for the included changes.
- Description of the pull request includes 
	- [X] concise summary of tests added/modified
	- [X] local testing done.
  • Loading branch information
damonbarry authored Jan 8, 2022
1 parent b91cbe3 commit 497108e
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 21 deletions.
1 change: 0 additions & 1 deletion builds/checkin/dotnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs:
pool:
vmImage: "ubuntu-18.04"
steps:
- template: ../templates/install-dotnet3.yaml
- task: Bash@3
displayName: Install Prerequisites
inputs:
Expand Down
1 change: 0 additions & 1 deletion builds/ci/dotnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
IotDevice3ConnStr2,
IotHubConnStr2,
IotHubMqttHeadCert
- template: ../templates/install-dotnet3.yaml
- task: Bash@3
displayName: Install Prerequisites
inputs:
Expand Down
4 changes: 0 additions & 4 deletions builds/misc/images-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,11 @@ stages:
dependsOn: []
jobs:
- job: BuildDotnetComponents
# This job is run on a hosted linux agent, which needs dotnet 2 and 3 installed as a manual step.
# The code sign steps will fail unless we explicitly say to use dotnet 2 before.
# This means we have to toggle back and forth between primary dotnet installations for the sign and build.
# TODO: Investigate why we have to toggle primary installs on linux, when we didn't have to do this on windows (now removed).
displayName: Build Dotnet Components
steps:
# Dotnet 2 needed for codesign
- template: ../templates/install-dotnet2.yaml
- template: ../templates/install-dotnet3.yaml
- template: ../templates/dotnet3-globaljson.yaml # use dotnet 3 as primary install for build
# Build
- task: ShellScript@2
Expand Down
2 changes: 1 addition & 1 deletion builds/templates/dotnet2-globaljson.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ steps:
displayName: 'Use dotnet 2'
inputs:
targetType: 'inline'
script: 'dotnet new globaljson --force --sdk-version 2.2.207'
script: 'dotnet new globaljson --force --sdk-version 2.1'
2 changes: 1 addition & 1 deletion builds/templates/dotnet3-globaljson.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ steps:
displayName: 'Use dotnet 3'
inputs:
targetType: 'inline'
script: 'dotnet new globaljson --force --sdk-version 3.1.202'
script: 'dotnet new globaljson --force --sdk-version 3.1'
6 changes: 0 additions & 6 deletions builds/templates/install-dotnet2.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions builds/templates/install-dotnet3.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@
<Title>Microsoft Azure Edge Function extension</Title>
<Authors>Microsoft</Authors>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseUrl>https://github.com/Azure/iotedge/blob/master/LICENSE</PackageLicenseUrl>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Description>This package contains binding extensions for IoTEdge.</Description>
<PackageIconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</PackageIconUrl>
<PackageIcon>icon.png</PackageIcon>
<PackageProjectUrl>https://github.com/Azure/iotedge</PackageProjectUrl>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageTags>IoT Microsoft Azure IoTEdge Functions</PackageTags>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\..\..\..\LICENSE" Pack="true" PackagePath=""/>
<None Include="images\icon.png" Pack="true" PackagePath=""/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.36.3" />
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.27" />
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 497108e

Please sign in to comment.