Skip to content

Commit 44b700c

Browse files
Copilotrichlander
andcommitted
Merge main (f92d3fc) into branch; resolve delete/modify conflicts for Alpine 3.21/3.22 amd64 in favor of deletion
Co-authored-by: richlander <2608468+richlander@users.noreply.github.com>
1 parent bb3c26a commit 44b700c

18 files changed

Lines changed: 276 additions & 114 deletions

File tree

eng/pipelines/renovate.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Renovate Dependency Update Pipeline
2+
# This pipeline runs Renovate to automatically create PRs for dependency updates.
3+
4+
trigger: none
5+
6+
schedules:
7+
- cron: '0 8 * * 1' # Runs every Monday at 8:00 AM UTC
8+
displayName: Weekly Renovate Run
9+
branches:
10+
include:
11+
- main
12+
always: true
13+
14+
parameters:
15+
- name: dryRun
16+
displayName: Dry Run (preview without creating PRs)
17+
type: boolean
18+
default: false
19+
- name: forceRecreatePR
20+
displayName: Force Recreate PR (recreate even if closed)
21+
type: boolean
22+
default: false
23+
24+
variables:
25+
- name: gitHubRepo
26+
value: 'dotnet/dotnet-buildtools-prereqs-docker'
27+
28+
resources:
29+
repositories:
30+
- repository: arcade
31+
type: git
32+
name: internal/dotnet-arcade
33+
ref: refs/heads/dev/mthalman/renovate
34+
35+
extends:
36+
template: /eng/common/core-templates/stages/renovate.yml@arcade
37+
parameters:
38+
dryRun: ${{ parameters.dryRun }}
39+
forceRecreatePR: ${{ parameters.forceRecreatePR }}
40+
gitHubRepo: ${{ variables.gitHubRepo }}
41+
arcadeRepoResource: arcade
42+
selfRepoName: dotnet-dotnet-buildtools-prereqs-docker
43+
arcadeRepoName: dotnet-arcade

eng/renovate.json

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"enabledManagers": [
4+
"custom.regex"
5+
],
6+
"vulnerabilityAlerts": {
7+
"enabled": false
8+
},
9+
"customManagers": [
10+
{
11+
"description": "Updates PowerShell version in Dockerfiles",
12+
"customType": "regex",
13+
"managerFilePatterns": [
14+
"/(^|/)Dockerfile$/"
15+
],
16+
"matchStrings": [
17+
"ENV POWERSHELL_VERSION=(?<currentValue>\\d+\\.\\d+\\.\\d+)"
18+
],
19+
"depNameTemplate": "PowerShell/PowerShell",
20+
"datasourceTemplate": "github-releases"
21+
},
22+
{
23+
"description": "Updates LLVM version and checksums (via postUpgradeTasks) in Dockerfiles",
24+
"customType": "regex",
25+
"managerFilePatterns": [
26+
"/(^|/)Dockerfile$/"
27+
],
28+
"matchStrings": [
29+
"LLVM_VERSION=(?<currentValue>\\d+\\.\\d+\\.\\d+)"
30+
],
31+
"depNameTemplate": "llvm/llvm-project",
32+
"datasourceTemplate": "github-releases",
33+
"extractVersionTemplate": "^llvmorg-(?<version>.*)$"
34+
},
35+
{
36+
"description": "Updates scancode-toolkit version in Dockerfiles",
37+
"customType": "regex",
38+
"managerFilePatterns": [
39+
"src/azurelinux/**/Dockerfile"
40+
],
41+
"matchStrings": [
42+
"ENV SCANCODE_VERSION=(?<currentValue>\\d+\\.\\d+\\.\\d+)"
43+
],
44+
"depNameTemplate": "nexB/scancode-toolkit",
45+
"datasourceTemplate": "github-releases"
46+
},
47+
{
48+
"description": "Updates Python version from Azure Artifacts NuGet feed",
49+
"customType": "regex",
50+
"managerFilePatterns": [
51+
"/(^|/)(nanoserver|windowsservercore)/.+/Dockerfile$/"
52+
],
53+
"matchStrings": [
54+
"ENV PYTHON_VERSION=(?<currentValue>\\d+\\.\\d+\\.\\d+)"
55+
],
56+
"depNameTemplate": "python",
57+
"datasourceTemplate": "nuget",
58+
"registryUrlTemplate": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json"
59+
},
60+
{
61+
"description": "Updates Git for Windows version in Dockerfiles",
62+
"customType": "regex",
63+
"managerFilePatterns": [
64+
"/(^|/)Dockerfile$/"
65+
],
66+
"matchStrings": [
67+
"ARG GIT_WINDOWS_VERSION=(?<currentValue>\\d+\\.\\d+\\.\\d+)"
68+
],
69+
"depNameTemplate": "git-for-windows/git",
70+
"datasourceTemplate": "github-releases",
71+
"extractVersionTemplate": "^v(?<version>\\d+\\.\\d+\\.\\d+)\\.windows\\.\\d+$"
72+
},
73+
{
74+
"description": "Updates Renovate version in manifest.json based on npm package version",
75+
"customType": "regex",
76+
"managerFilePatterns": [
77+
"src/azurelinux/manifest.json"
78+
],
79+
"matchStrings": [
80+
"\"renovateVersion\":\\s*\"(?<currentValue>\\d+)\""
81+
],
82+
"depNameTemplate": "renovate",
83+
"datasourceTemplate": "npm",
84+
"extractVersionTemplate": "^(?<version>\\d+)",
85+
"versioningTemplate": "loose"
86+
}
87+
],
88+
"packageRules": [
89+
{
90+
"description": "Only allow minor/patch updates for LLVM to stay on the respective major version",
91+
"matchDepNames": [
92+
"llvm/llvm-project"
93+
],
94+
"matchUpdateTypes": [
95+
"major"
96+
],
97+
"enabled": false
98+
},
99+
{
100+
"description": "Allow major LLVM updates in net11.0 directories",
101+
"matchDepNames": [
102+
"llvm/llvm-project"
103+
],
104+
"matchUpdateTypes": [
105+
"major"
106+
],
107+
"matchFileNames": [
108+
"**/net11.0/**"
109+
],
110+
"enabled": true
111+
}
112+
],
113+
"postUpgradeTasks": {
114+
"commands": ["bash eng/update-llvm-checksums.sh"],
115+
"dataFileTemplate": "{{{depName}}}\n{{{packageFile}}}\n{{{newVersion}}}",
116+
"fileFilters": ["src/**/Dockerfile"]
117+
}
118+
}

eng/update-llvm-checksums.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
# This script is called by Renovate's postUpgradeTasks to update LLVM checksums
3+
# in a Dockerfile after a version bump. Renovate provides the target file and
4+
# new version via a data file (RENOVATE_POST_UPGRADE_COMMAND_DATA_FILE).
5+
6+
set -euo pipefail
7+
8+
if [ -z "${RENOVATE_POST_UPGRADE_COMMAND_DATA_FILE:-}" ]; then
9+
echo "Error: RENOVATE_POST_UPGRADE_COMMAND_DATA_FILE is not set" >&2
10+
exit 1
11+
fi
12+
13+
dep_name=$(sed -n '1p' "$RENOVATE_POST_UPGRADE_COMMAND_DATA_FILE")
14+
dockerfile=$(sed -n '2p' "$RENOVATE_POST_UPGRADE_COMMAND_DATA_FILE")
15+
version=$(sed -n '3p' "$RENOVATE_POST_UPGRADE_COMMAND_DATA_FILE")
16+
17+
# Only process LLVM upgrades
18+
if [ "$dep_name" != "llvm/llvm-project" ]; then
19+
exit 0
20+
fi
21+
22+
if [ -z "$dockerfile" ] || [ -z "$version" ]; then
23+
echo "Error: Data file must contain package file path and version" >&2
24+
exit 1
25+
fi
26+
27+
# Check if this file has checksum lines to update
28+
if ! grep -q 'sha256sum -c' "$dockerfile"; then
29+
echo "No checksum lines found in $dockerfile, skipping"
30+
exit 0
31+
fi
32+
33+
echo "Updating checksums in $dockerfile for LLVM $version"
34+
35+
base_url="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}"
36+
37+
# Download and compute checksum for the .sig file
38+
sig_checksum=$(curl -sL "${base_url}/llvm-project-${version}.src.tar.xz.sig" | sha256sum | cut -d ' ' -f 1)
39+
# Download and compute checksum for the .tar.xz file
40+
tar_checksum=$(curl -sL "${base_url}/llvm-project-${version}.src.tar.xz" | sha256sum | cut -d ' ' -f 1)
41+
42+
echo " sig checksum: $sig_checksum"
43+
echo " tar checksum: $tar_checksum"
44+
45+
# Replace the sig checksum (the line echoing the checksum for llvm-project.src.tar.xz.sig)
46+
sed -i -E "s|echo \"[0-9a-f]{64} llvm-project.src.tar.xz.sig\"|echo \"${sig_checksum} llvm-project.src.tar.xz.sig\"|" "$dockerfile"
47+
48+
# Replace the tar checksum (the line echoing the checksum for llvm-project.src.tar.xz")
49+
sed -i -E "s|echo \"[0-9a-f]{64} llvm-project.src.tar.xz\"|echo \"${tar_checksum} llvm-project.src.tar.xz\"|" "$dockerfile"

src/alpine/3.23/amd64/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM amd64/alpine:3.23
22

3+
ENV POWERSHELL_VERSION=7.5.4
4+
35
RUN apk add --upgrade --no-cache \
46
# Install .NET and test dependencies
57
autoconf \
@@ -58,10 +60,9 @@ RUN apk add --upgrade --no-cache \
5860
# Azure DevOps container job requirements
5961
nodejs
6062

61-
# Install the latest non-preview powershell release.
63+
# Install PowerShell
6264
RUN apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache lttng-ust \
63-
&& LATEST_TAG=$(curl -L https://api.github.com/repos/powershell/powershell/releases/latest | jq -r '.tag_name') \
64-
&& curl -L https://github.com/PowerShell/PowerShell/releases/download/$LATEST_TAG/powershell-${LATEST_TAG#*v}-linux-musl-x64.tar.gz -o /tmp/powershell.tar.gz \
65+
&& curl -L https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell-${POWERSHELL_VERSION}-linux-musl-x64.tar.gz -o /tmp/powershell.tar.gz \
6566
&& mkdir -p /opt/microsoft/powershell \
6667
&& tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell \
6768
&& chmod +x /opt/microsoft/powershell/pwsh \

src/azurelinux/3.0/net11.0/source-build-test/amd64/Dockerfile

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/azurelinux/3.0/net11.0/source-build-test/amd64/run-scancode.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/azurelinux/3.0/net8.0/source-build-test/amd64/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ARG DOTNET_VERSION
22
FROM mcr.microsoft.com/dotnet/sdk:$DOTNET_VERSION-azurelinux3.0-amd64 AS installer
3+
ENV SCANCODE_VERSION=32.5.0
34

45
# Install dependencies for building pyicu wheel from source (dependency of scancode-toolkit)
56
RUN tdnf update -y \
@@ -15,8 +16,7 @@ RUN tdnf update -y \
1516
# Include scancode
1617
# Install instructions: https://scancode-toolkit.readthedocs.io/en/latest/getting-started/install.html#installation-as-a-library-via-pip
1718
# See latest release at https://github.com/nexB/scancode-toolkit/releases
18-
RUN SCANCODE_VERSION="32.5.0" \
19-
&& python3 -m venv /venv \
19+
RUN python3 -m venv /venv \
2020
&& source /venv/bin/activate \
2121
&& pip install scancode-toolkit==$SCANCODE_VERSION
2222

src/azurelinux/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,7 @@
14221422
"platforms": [
14231423
{
14241424
"architecture": "amd64",
1425-
"dockerfile": "src/azurelinux/3.0/net11.0/source-build-test/amd64",
1425+
"dockerfile": "src/azurelinux/3.0/net8.0/source-build-test/amd64",
14261426
"os": "linux",
14271427
"osVersion": "azurelinux3.0",
14281428
"tags": {

src/fedora/43/amd64/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM library/fedora:43
22

3+
ENV POWERSHELL_VERSION=7.5.4
4+
35
RUN dnf upgrade --refresh -y \
46
&& dnf config-manager addrepo --from-repofile=https://packages.microsoft.com/fedora/43/prod/config.repo \
57
&& dnf install --setopt=install_weak_deps=False --setopt tsflags=nodocs -y \
@@ -51,9 +53,8 @@ RUN dnf upgrade --refresh -y \
5153
icu \
5254
&& dnf clean all
5355

54-
# Install the latest non-preview powershell release.
55-
RUN LATEST_TAG=$(curl -L https://api.github.com/repos/powershell/powershell/releases/latest | jq -r '.tag_name') \
56-
&& curl -L https://github.com/PowerShell/PowerShell/releases/download/$LATEST_TAG/powershell-${LATEST_TAG#*v}-linux-x64.tar.gz -o /tmp/powershell.tar.gz \
56+
# Install PowerShell
57+
RUN curl -L https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell-${POWERSHELL_VERSION}-linux-x64.tar.gz -o /tmp/powershell.tar.gz \
5758
&& mkdir -p /opt/microsoft/powershell \
5859
&& tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell \
5960
&& chmod +x /opt/microsoft/powershell/pwsh \

src/nanoserver/1809/helix/amd64/Dockerfile

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# escape=`
22
FROM mcr.microsoft.com/windows/servercore:ltsc2019 AS installer
33

4+
ENV POWERSHELL_VERSION=7.5.4
5+
46
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
57

6-
RUN $apiUrl = 'https://api.github.com/repos/PowerShell/PowerShell/releases/latest'; `
7-
$response = Invoke-RestMethod -Uri $apiUrl; `
8-
$url = $response.assets | Where-Object { $_.browser_download_url -match 'win-x64.zip' } | Select-Object -ExpandProperty browser_download_url; `
9-
Invoke-WebRequest -Uri $url -OutFile C:\powershell.zip; `
8+
RUN Invoke-WebRequest -Uri "https://github.com/PowerShell/PowerShell/releases/download/v${env:POWERSHELL_VERSION}/PowerShell-${env:POWERSHELL_VERSION}-win-x64.zip" -OutFile C:\powershell.zip; `
109
Expand-Archive -Path C:\powershell.zip -DestinationPath C:\powershell; `
1110
Remove-Item -Path C:\powershell.zip
1211

@@ -17,20 +16,18 @@ USER ContainerAdministrator
1716

1817
COPY --from=installer [ "C:\\powershell\\", "C:\\Program Files\\PowerShell\\" ]
1918

19+
ENV PYTHON_VERSION=3.14.3
20+
2021
RUN setx /M VIRTUAL_ENV "C:\Python-env" && `
2122
setx /M PATH "%PATH%;C:\Program Files\PowerShell\;%VIRTUAL_ENV%\Scripts;C:\Python;C:\python\scripts" && `
2223
setx /M PYTHONPATH "C:\Python\Lib;C:\Python\DLLs;"
2324

24-
# Install latest stable version of Python
25+
# Install Python
2526
RUN pwsh -Command " `
2627
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
27-
$apiUrl = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/flat2/python/index.json'; `
28-
$response = Invoke-RestMethod -Uri $apiUrl; `
29-
$versions = @($response.versions | Where-Object { $_ -notmatch '-' } | Sort-Object { [version]$_ } -Descending); `
30-
$latestVersion = $versions[0]; `
31-
echo \"Downloading Python $latestVersion\"; `
28+
echo \"Downloading Python ${env:PYTHON_VERSION}\"; `
3229
$pythonZip = \"$env:TEMP\python.zip\"; `
33-
Invoke-WebRequest -Uri https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/flat2/python/$latestVersion/python.$latestVersion.nupkg -OutFile $pythonZip; `
30+
Invoke-WebRequest -Uri https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/flat2/python/${env:PYTHON_VERSION}/python.${env:PYTHON_VERSION}.nupkg -OutFile $pythonZip; `
3431
$pythonTemp = 'C:\PythonTemp'; `
3532
md $pythonTemp; `
3633
tar -zxf $pythonZip -C $pythonTemp; `

0 commit comments

Comments
 (0)