Skip to content

Commit 76f1a03

Browse files
authored
build: NetIso, pin GH Actions, update 3.15 build templates, fix non-existent image (#1919)
* build: NetIso + minor build fixes * port GitHub actions pinning changes * fix release pipeline * fix redeame
1 parent fcf33b5 commit 76f1a03

18 files changed

Lines changed: 108 additions & 45 deletions

‎.github/dependabot.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
groups:
6+
github-actions:
7+
patterns: ["*"]
8+
schedule:
9+
interval: "weekly"
10+
cooldown:
11+
default-days: 7

‎.github/workflows/linter.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ jobs:
3939
# Checkout the code base #
4040
##########################
4141
- name: Checkout Code
42-
uses: actions/checkout@v2
42+
uses: actions/checkout@0717577d45739eb3c851188b29f50ed6c0b2194e # v2.8.0
4343

4444
################################
4545
# Run Linter against code base #
4646
################################
4747
- name: Lint Code Base
48-
uses: github/super-linter@v4
48+
uses: github/super-linter@985ef206aaca4d560cb9ee2af2b42ba44adc1d55 # v4.10.0
4949
env:
5050
VALIDATE_PYTHON: true
5151
VALIDATE_PYTHON_FLAKE8: true

‎.github/workflows/ogf_workflow.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ jobs:
8080
# if you are making changes. Make sure they are the same.
8181
steps:
8282
- name: Install node and npm
83-
uses: actions/setup-node@v2
83+
uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # v2.5.2
8484
with:
8585
node-version: '16'
8686
check-latest: true
8787

8888
- name: Azure Login
89-
uses: azure/login@v1
89+
uses: azure/login@cb79c773a3cfa27f31f25eb3f677781210c9ce3d # v1.6.1
9090
with:
9191
creds: ${{ secrets.AZURE_CREDENTIALS }}
9292

@@ -103,7 +103,7 @@ jobs:
103103
./k6 version
104104
105105
- name: Setup Azure RG and Storage Account For Functions App
106-
uses: Azure/cli@1.0.4
106+
uses: Azure/cli@4b58c946a0f48d82cc2b6e31c0d15a6604859554 # 1.0.4
107107
with:
108108
azcliversion: 2.16.0
109109
inlineScript: |
@@ -128,7 +128,7 @@ jobs:
128128
sleep 3 # Adding some breathing space for Storage Account creation.
129129
- name: Create new Consumption Azure Function App
130130
if: ${{ matrix.sku == 'cons' }}
131-
uses: Azure/cli@1.0.4
131+
uses: Azure/cli@4b58c946a0f48d82cc2b6e31c0d15a6604859554 # 1.0.4
132132
with:
133133
azcliversion: 2.16.0
134134
inlineScript: |
@@ -391,7 +391,7 @@ jobs:
391391
ls -la $GITHUB_WORKSPACE
392392
393393
- name: Upload a Build Artifact
394-
uses: actions/upload-artifact@v2.2.1
394+
uses: actions/upload-artifact@726a6dcd0199f578459862705eed35cda05af50b # v2.2.1
395395
with:
396396
# Artifact name
397397
name: RawTestRunArchive
@@ -421,7 +421,7 @@ jobs:
421421
needs: test
422422
steps:
423423
- name: Azure Login
424-
uses: azure/login@v1
424+
uses: azure/login@cb79c773a3cfa27f31f25eb3f677781210c9ce3d # v1.6.1
425425
with:
426426
creds: ${{ secrets.AZURE_CREDENTIALS }}
427427
- name: Cleaning up the resource group

‎.github/workflows/pr_title_enforcer.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
name: Validate PR title
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: amannn/action-semantic-pull-request@v5
18+
- uses: amannn/action-semantic-pull-request@e32d7e603df1aa1ba07e981f2a23455dee596825 # v5
1919
env:
2020
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ What are the supported Python versions?
1212

1313
| Azure Functions Runtime | Python 3.11 | Python 3.12 | Python 3.13 | Python 3.14 | Python 3.15 |
1414
|----------------------------------|-------------|-------------|-------------|-------------|-------------|
15-
| Azure Functions 4.0 | ✔ | ✔ | ✔ | ✔ || ✔ |
15+
| Azure Functions 4.0 | ✔ | ✔ | ✔ | ✔ | ✔ |
1616

1717
For information about Azure Functions Runtime, please refer to [Azure Functions runtime versions overview](https://docs.microsoft.com/en-us/azure/azure-functions/functions-versions) page.
1818

‎eng/ci/official-build.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ extends:
4747
codeSignValidation:
4848
enabled: true
4949
break: true
50+
settings:
51+
networkIsolationPolicy: DefaultDeny,CFSClean,CFSClean2
5052

5153
stages:
5254
# Python Worker Build and Test Stages

‎eng/ci/public-build.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ extends:
7373
PROJECT_DIRECTORY: 'workers'
7474
- template: /eng/templates/jobs/r2p2-build.yml@self
7575
parameters:
76-
PYTHON_VERSION: '3.15.0-rc.1'
76+
PYTHON_VERSION: '3.15'
7777
SIMPLE_VERSION: '315'
7878
PROJECT_NAME: 'R2P2 (Python 3.15)'
7979
PROJECT_DIRECTORY: 'workers/r2p2'

‎eng/pack/scripts/r2p2_deps.ps1‎

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,32 +69,57 @@ rustup run $rustToolchain cargo --version
6969
$cargoArguments = @('build', '--release', '--locked')
7070
$binaryPath = Join-Path $WORKER 'target\release\r2p2.exe'
7171
if ($rustTarget) {
72-
if ($PythonVersion -notmatch '^(?<base>\d+\.\d+\.\d+)-(?<level>a|b|rc)\.?(?<serial>\d+)$' -and
73-
$PythonVersion -notmatch '^(?<base>\d+\.\d+\.\d+)$') {
74-
throw "Unsupported Python version format for the CPython download: $PythonVersion"
75-
}
76-
$baseVersion = $Matches.base
77-
$artifactVersion = if ($Matches.level) {
78-
"$baseVersion$($Matches.level)$($Matches.serial)"
72+
if ($PythonVersion -match '^(?<major>\d+)\.(?<minor>\d+)$') {
73+
$requestedMajorMinor = "$($Matches.major).$($Matches.minor)"
74+
$selectedPythonVersions = python -c 'import sys; v = sys.version_info; suffix = "" if v.releaselevel == "final" else {"alpha": "a", "beta": "b", "candidate": "rc"}[v.releaselevel] + str(v.serial); print(f"{v.major}.{v.minor}.{v.micro}|{v.major}.{v.minor}.{v.micro}{suffix}")'
75+
if ($LASTEXITCODE -ne 0) {
76+
throw 'Unable to determine the selected Python interpreter version.'
77+
}
78+
$resolvedVersions = $selectedPythonVersions.Trim() -split '\|', 2
79+
if ($resolvedVersions.Count -ne 2) {
80+
throw "Unexpected selected Python version: $selectedPythonVersions"
81+
}
82+
$baseVersion = $resolvedVersions[0]
83+
$artifactVersion = $resolvedVersions[1]
84+
if ($baseVersion -notmatch '^(?<major>\d+)\.(?<minor>\d+)\.\d+$' -or
85+
"$($Matches.major).$($Matches.minor)" -ne $requestedMajorMinor) {
86+
throw "Python $PythonVersion was requested, but the selected interpreter is $baseVersion."
87+
}
88+
} elseif ($PythonVersion -match '^(?<base>\d+\.\d+\.\d+)-(?<level>a|b|rc)\.?(?<serial>\d+)$') {
89+
$baseVersion = $Matches.base
90+
$artifactVersion = "$baseVersion$($Matches.level)$($Matches.serial)"
91+
} elseif ($PythonVersion -match '^(?<base>\d+\.\d+\.\d+)$') {
92+
$baseVersion = $Matches.base
93+
$artifactVersion = $baseVersion
7994
} else {
80-
$baseVersion
95+
throw "Unsupported Python version format for the CPython download: $PythonVersion"
8196
}
8297
if ($baseVersion -notmatch '^(?<major>\d+)\.(?<minor>\d+)') {
8398
throw "Unable to determine the Python major/minor version from $PythonVersion"
8499
}
85100
$pythonMajorMinor = "$($Matches.major).$($Matches.minor)"
86101
$pythonLibrary = "python$($Matches.major)$($Matches.minor).lib"
87102
$pythonSdk = Join-Path $env:AGENT_TEMPDIRECTORY "cpython-$artifactVersion-arm64"
88-
$pythonArchive = Join-Path $env:AGENT_TEMPDIRECTORY "python-$artifactVersion-arm64.zip"
89-
$pythonUrl = "https://www.python.org/ftp/python/$baseVersion/python-$artifactVersion-arm64.zip"
103+
$pythonArchive = $env:CPYTHON_ARM64_ARCHIVE
104+
if (-not $pythonArchive) {
105+
throw "CPYTHON_ARM64_ARCHIVE must point to a pipeline-staged CPython $artifactVersion ARM64 SDK archive."
106+
}
107+
if (-not (Test-Path $pythonArchive -PathType Leaf)) {
108+
throw "The pipeline-staged CPython archive does not exist: $pythonArchive"
109+
}
90110

91-
Invoke-WebRequest $pythonUrl -OutFile $pythonArchive
92111
Expand-Archive $pythonArchive -DestinationPath $pythonSdk -Force
93112
$pythonHeader = Join-Path $pythonSdk 'include\Python.h'
94113
$pythonImportLibrary = Join-Path $pythonSdk "libs\$pythonLibrary"
95114
if (-not (Test-Path $pythonHeader) -or -not (Test-Path $pythonImportLibrary)) {
96115
throw "The ARM64 CPython SDK is missing $pythonHeader or $pythonImportLibrary."
97116
}
117+
$patchLevelHeader = Join-Path $pythonSdk 'include\patchlevel.h'
118+
$versionMatch = Select-String -Path $patchLevelHeader -Pattern '^#define PY_VERSION\s+"([^"]+)"$'
119+
$sourcePythonVersion = $versionMatch.Matches.Groups[1].Value
120+
if ($sourcePythonVersion -ne $artifactVersion) {
121+
throw "Expected CPython $artifactVersion SDK; archive contains $(if ($sourcePythonVersion) { $sourcePythonVersion } else { 'an unknown version' })."
122+
}
98123

99124
$vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe'
100125
$vsInstall = & $vswhere -latest -products * `
@@ -127,7 +152,10 @@ rustup run $rustToolchain cargo @cargoArguments
127152
Pop-Location
128153

129154
# --- v2 + v1 runtimes + app SDK into the deps tree ------------------------
130-
python -m pip install ./runtimes/v2 ./runtimes/v1 azure-functions `
155+
python -m pip install `
156+
azure-functions-runtime==1.2.1 `
157+
azure-functions-runtime-v1==1.1.0 `
158+
azure-functions `
131159
--no-compile --target $DEPS
132160

133161
# --- Stage the runtime worker-directory layout ----------------------------

‎eng/pack/scripts/r2p2_deps.sh‎

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,15 @@ if [[ "$HOST_OS" == "Linux" && "$ARCHITECTURE" == "arm64" ]]; then
5555
sudo apt-get -o DPkg::Lock::Timeout=300 install -y \
5656
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu make pkg-config
5757

58-
if [[ "$PYTHON_VERSION" =~ ^([0-9]+\.[0-9]+\.[0-9]+)-(a|b|rc)\.?([0-9]+)$ ]]; then
58+
if [[ "$PYTHON_VERSION" =~ ^([0-9]+\.[0-9]+)$ ]]; then
59+
REQUESTED_MAJOR_MINOR="${BASH_REMATCH[1]}"
60+
SELECTED_PYTHON_VERSIONS="$(python -c 'import sys; v = sys.version_info; suffix = "" if v.releaselevel == "final" else {"alpha": "a", "beta": "b", "candidate": "rc"}[v.releaselevel] + str(v.serial); print(f"{v.major}.{v.minor}.{v.micro}|{v.major}.{v.minor}.{v.micro}{suffix}")')"
61+
IFS='|' read -r PYTHON_BASE_VERSION PYTHON_ARTIFACT_VERSION <<< "$SELECTED_PYTHON_VERSIONS"
62+
if [[ "${PYTHON_BASE_VERSION%.*}" != "$REQUESTED_MAJOR_MINOR" ]]; then
63+
echo "Python $PYTHON_VERSION was requested, but the selected interpreter is $PYTHON_BASE_VERSION." >&2
64+
exit 1
65+
fi
66+
elif [[ "$PYTHON_VERSION" =~ ^([0-9]+\.[0-9]+\.[0-9]+)-(a|b|rc)\.?([0-9]+)$ ]]; then
5967
PYTHON_BASE_VERSION="${BASH_REMATCH[1]}"
6068
PYTHON_ARTIFACT_VERSION="${BASH_REMATCH[1]}${BASH_REMATCH[2]}${BASH_REMATCH[3]}"
6169
elif [[ "$PYTHON_VERSION" =~ ^([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
@@ -72,15 +80,26 @@ if [[ "$HOST_OS" == "Linux" && "$ARCHITECTURE" == "arm64" ]]; then
7280
exit 1
7381
fi
7482

83+
if [[ -z "${CPYTHON_ARM64_ARCHIVE:-}" ]]; then
84+
echo "CPYTHON_ARM64_ARCHIVE must point to a pipeline-staged CPython $PYTHON_ARTIFACT_VERSION source archive." >&2
85+
exit 1
86+
fi
87+
if [[ ! -f "$CPYTHON_ARM64_ARCHIVE" ]]; then
88+
echo "The pipeline-staged CPython archive does not exist: $CPYTHON_ARM64_ARCHIVE" >&2
89+
exit 1
90+
fi
91+
7592
PYTHON_CROSS_ROOT="$AGENT_TEMPDIRECTORY/cpython-$PYTHON_ARTIFACT_VERSION-arm64"
7693
PYTHON_SOURCE="$PYTHON_CROSS_ROOT/source"
7794
PYTHON_BUILD="$PYTHON_CROSS_ROOT/build"
7895
PYTHON_SDK="$PYTHON_CROSS_ROOT/sdk"
79-
PYTHON_ARCHIVE="$AGENT_TEMPDIRECTORY/Python-$PYTHON_ARTIFACT_VERSION.tgz"
80-
curl -fsSL "https://www.python.org/ftp/python/$PYTHON_BASE_VERSION/Python-$PYTHON_ARTIFACT_VERSION.tgz" \
81-
-o "$PYTHON_ARCHIVE"
8296
mkdir -p "$PYTHON_SOURCE" "$PYTHON_BUILD" "$PYTHON_SDK/include/python$PYTHON_MAJOR_MINOR" "$PYTHON_SDK/lib"
83-
tar -xzf "$PYTHON_ARCHIVE" -C "$PYTHON_SOURCE" --strip-components=1
97+
tar -xzf "$CPYTHON_ARM64_ARCHIVE" -C "$PYTHON_SOURCE" --strip-components=1
98+
SOURCE_PYTHON_VERSION="$(sed -n 's/^#define PY_VERSION[[:space:]][[:space:]]*"\([^"]*\)"/\1/p' "$PYTHON_SOURCE/Include/patchlevel.h")"
99+
if [[ "$SOURCE_PYTHON_VERSION" != "$PYTHON_ARTIFACT_VERSION" ]]; then
100+
echo "Expected CPython $PYTHON_ARTIFACT_VERSION source; archive contains ${SOURCE_PYTHON_VERSION:-an unknown version}." >&2
101+
exit 1
102+
fi
84103

85104
cat > "$PYTHON_BUILD/config.site" <<'EOF'
86105
ac_cv_file__dev_ptmx=yes
@@ -146,7 +165,10 @@ fi
146165
( cd "$WORKER" && cargo "${CARGO_ARGS[@]}" )
147166

148167
# --- v2 + v1 runtimes + app SDK into the deps tree ------------------------
149-
python -m pip install ./runtimes/v2 ./runtimes/v1 azure-functions \
168+
python -m pip install \
169+
azure-functions-runtime==1.2.1 \
170+
azure-functions-runtime-v1==1.1.0 \
171+
azure-functions \
150172
--no-compile --target "$DEPS"
151173

152174
# --- Stage the runtime worker-directory layout ----------------------------

‎eng/pack/templates/r2p2_env_gen.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# build script and staging a consistent V4 NuGet artifact layout.
99
#
1010
# Parameters:
11-
# pythonVersion : interpreter to link against (e.g. 3.15.0-rc.1)
11+
# pythonVersion : interpreter to link against (e.g. 3.15)
1212
# artifactName : pipeline artifact name (e.g. 3.15_WINDOWS_ARM64)
1313
# osName : WINDOWS | LINUX | OSX (selects the build script)
1414
# architecture : x64 | x86 | arm64; packaged R2P2 target architecture

0 commit comments

Comments
 (0)