Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<file src="..\..\3.14_LINUX_X64\**" target="tools\3.14\LINUX\X64" />
<file src="..\..\3.14_OSX_X64\**" target="tools\3.14\OSX\X64" />
<file src="..\..\3.14_OSX_ARM64\**" target="tools\3.14\OSX\Arm64" />
<file src="..\..\3.14_LINUX_ARM64\**" target="tools\3.14\LINUX\Arm64" />
<file src="..\..\workers\python\prodV4\worker.config.json" target="tools" />
<file src="Microsoft.Azure.Functions.PythonWorker.targets" target="build" />
<file src="..\..\_manifest\spdx_2.2\manifest.spdx.json" target="SBOM\manifest.spdx.json" />
Expand Down
78 changes: 78 additions & 0 deletions eng/pack/scripts/rc_nix_arm64_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/bin/bash

python -m venv .env
source .env/bin/activate
python -m pip install --upgrade pip

version_minor=$(echo $1 | cut -d '.' -f 2)
mkdir -p $BUILD_SOURCESDIRECTORY/deps

# Targeting: grpcio manylinux_2_17_aarch64.whl build

# Starts a docker container using the linux/arm64 platform
# Inside the container, we perform the same steps as our typical builds
# However, since we're running them on the linux/arm64 platform, we ensure
# that we pull in the correct grpc, etc. builds
docker run --privileged --rm tonistiigi/binfmt --install all
docker run --name my-arm64-container --platform linux/arm64 \
-v ./:/src \
-w /src \
python:3.14.0rc3-alpine3.22 sh -c "
ls -la /src # debug: see what files exist
apk update && apk add --no-cache git curl build-base && \
pip install --upgrade pip && \
cd workers && \
pip install . && \
pip install . --target /src && \
pip install invoke && \
cd tests && \
python -m invoke -c test_setup build-protos && \
ls -la /src
"

cd workers

# This copies over the build files from the docker container to the local pipeline
docker cp my-arm64-container:/src/. $BUILD_SOURCESDIRECTORY/all/
docker rm my-arm64-container

# From the container, we have many unnecessary files. Here, we only
# copy over the relevant files to the 'deps/' directory.
copy_list=(
"azure"
"azure_functions_worker"
"azure_functions_runtime"
"azure_functions_runtime_v1"
"azurefunctions"
"dateutil"
"google"
"grpc"
"markupsafe"
"proxy_worker"
"six.py"
"werkzeug"
)

for dir in "${copy_list[@]}"; do
src="$BUILD_SOURCESDIRECTORY/all/$dir"
dest="$BUILD_SOURCESDIRECTORY/deps"

if [ -e $src ]; then
echo "Copying $dir..."
cp -r $src $dest
else
echo "Directory $dir not found in deps — skipping"
fi
done

cp .artifactignore "$BUILD_SOURCESDIRECTORY/deps"

version_minor=$(echo $1 | cut -d '.' -f 2)
if [[ $version_minor -lt 13 ]]; then
cp -r azure_functions_worker/protos "$BUILD_SOURCESDIRECTORY/deps/azure_functions_worker"
else
cp -r proxy_worker/protos "$BUILD_SOURCESDIRECTORY/deps/proxy_worker"
fi

echo "Listing contents of deps directory:"
ls -la $BUILD_SOURCESDIRECTORY/deps
16 changes: 8 additions & 8 deletions eng/pack/templates/macos_64_env_gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ steps:
scriptPath: 'eng/pack/scripts/mac_arm64_deps.sh'
args: '${{ parameters.pythonVersion }}'
displayName: 'Install dependencies'
condition: eq(variables['isRC'], 'false')
- task: ShellScript@2
inputs:
disableAutoCwd: true
scriptPath: 'eng/pack/scripts/rc_mac_arm64_deps.sh'
args: '${{ parameters.pythonVersion }}'
displayName: 'Build dependencies from source'
condition: eq(variables['isRC'], 'true')
# condition: eq(variables['isRC'], 'false')
# - task: ShellScript@2
# inputs:
# disableAutoCwd: true
# scriptPath: 'eng/pack/scripts/rc_mac_arm64_deps.sh'
# args: '${{ parameters.pythonVersion }}'
# displayName: 'Build dependencies from source'
# condition: eq(variables['isRC'], 'true')
- bash: |
pip install pip-audit
cd workers
Expand Down
76 changes: 60 additions & 16 deletions eng/pack/templates/nix_arm64_env_gen.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
parameters:
pythonVersion: ''
artifactName: ''
grpcBuild: ''
grpcBuild: []

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: ${{ parameters.pythonVersion }}
allowUnstable: true
addToPath: true
- powershell: |
# Parse the Python minor version
Expand All @@ -22,6 +23,16 @@ steps:
Write-Host "Minor version: $PY_MINOR"
Write-Host "##vso[task.setvariable variable=minorVersion;]$PY_MINOR"

# Detect if this is an RC build
if ($PY_VER -match "rc") {
Write-Host "RC version detected"
Write-Host "##vso[task.setvariable variable=isRC;]true"
}
else {
Write-Host "Stable version detected"
Write-Host "##vso[task.setvariable variable=isRC;]false"
}

# Set build-related variables based on Python minor version
if( $PY_MINOR -ge 13 )
{
Expand Down Expand Up @@ -51,7 +62,15 @@ steps:
disableAutoCwd: true
scriptPath: 'eng/pack/scripts/nix_arm64_deps.sh'
args: '${{ parameters.pythonVersion }}'
displayName: 'Install Dependencies'
displayName: 'Install dependencies'
condition: eq(variables['isRC'], 'false')
- task: ShellScript@2
inputs:
disableAutoCwd: true
scriptPath: 'eng/pack/scripts/rc_nix_arm64_deps.sh'
args: '${{ parameters.pythonVersion }}'
displayName: 'Build dependencies from scratch'
condition: eq(variables['isRC'], 'true')
- bash: |
pip install pip-audit
cd workers
Expand Down Expand Up @@ -128,14 +147,26 @@ steps:
}
}
# === gRPC check ===
$grpcPattern = "*$(majorVersion)$(minorVersion)-${{ parameters.grpcBuild }}"
$grpcMatch = Get-ChildItem -Path $cythonDir -Name -ErrorAction SilentlyContinue |
Where-Object { $_ -like $grpcPattern }
$grpcPatterns = @()

if (-not $grpcMatch) {
$missing += "grpc/_cython/$grpcPattern"
} else {
Write-Host "✅ Found gRPC binary: $grpcMatch"
foreach ($build in @(${ { parameters.grpcBuild } })) {
$grpcPatterns += "*$($majorVersion)$($minorVersion)-$build"
}

$found = $false

foreach ($pattern in $grpcPatterns) {
$grpcMatch = Get-ChildItem -Path $cythonDir -Name -ErrorAction SilentlyContinue |
Where-Object { $_ -like $pattern }

if ($grpcMatch) {
Write-Host "✅ Found gRPC binary: $grpcMatch"
$found = $true
}
}

if (-not $found) {
$missing += "grpc/_cython/$($grpcPatterns -join ', ')"
}

if ($missing.Count -gt 0) {
Expand Down Expand Up @@ -195,6 +226,7 @@ steps:
"proxy_worker/protos/shared/NullableTypes_pb2.py",
"proxy_worker/protos/shared/NullableTypes_pb2_grpc.py",
"six.py",
"uvloop",
"werkzeug",
"worker.py"
)
Expand All @@ -208,14 +240,26 @@ steps:
}
}
# === gRPC check ===
$grpcPattern = "*$(majorVersion)$(minorVersion)-${{ parameters.grpcBuild }}"
$grpcMatch = Get-ChildItem -Path $cythonDir -Name -ErrorAction SilentlyContinue |
Where-Object { $_ -like $grpcPattern }
$grpcPatterns = @()

if (-not $grpcMatch) {
$missing += "grpc/_cython/$grpcPattern"
} else {
Write-Host "✅ Found gRPC binary: $grpcMatch"
foreach ($build in @(${ { parameters.grpcBuild } })) {
$grpcPatterns += "*$($majorVersion)$($minorVersion)-$build"
}

$found = $false

foreach ($pattern in $grpcPatterns) {
$grpcMatch = Get-ChildItem -Path $cythonDir -Name -ErrorAction SilentlyContinue |
Where-Object { $_ -like $pattern }

if ($grpcMatch) {
Write-Host "✅ Found gRPC binary: $grpcMatch"
$found = $true
}
}

if (-not $found) {
$missing += "grpc/_cython/$($grpcPatterns -join ', ')"
}

if ($missing.Count -gt 0) {
Expand Down
16 changes: 8 additions & 8 deletions eng/pack/templates/nix_env_gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ steps:
scriptPath: 'eng/pack/scripts/nix_deps.sh'
args: '${{ parameters.pythonVersion }}'
displayName: 'Install Dependencies'
condition: eq(variables['isRC'], 'false')
- task: ShellScript@2
inputs:
disableAutoCwd: true
scriptPath: 'eng/pack/scripts/rc_nix_deps.sh'
args: '${{ parameters.pythonVersion }}'
displayName: 'Build dependencies from source'
condition: eq(variables['isRC'], 'true')
# condition: eq(variables['isRC'], 'false')
# - task: ShellScript@2
# inputs:
# disableAutoCwd: true
# scriptPath: 'eng/pack/scripts/rc_nix_deps.sh'
# args: '${{ parameters.pythonVersion }}'
# displayName: 'Build dependencies from source'
# condition: eq(variables['isRC'], 'true')
- bash: |
pip install pip-audit
cd workers
Expand Down
14 changes: 7 additions & 7 deletions eng/pack/templates/win_env_gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ steps:
filePath: 'eng\pack\scripts\win_deps.ps1'
arguments: '${{ parameters.pythonVersion }}'
displayName: 'Install dependencies'
condition: eq(variables['isRC'], 'false')
- task: PowerShell@2
inputs:
filePath: 'eng\pack\scripts\rc_win_deps.ps1'
arguments: '${{ parameters.pythonVersion }}'
displayName: 'Build dependencies from source'
condition: eq(variables['isRC'], 'true')
# condition: eq(variables['isRC'], 'false')
# - task: PowerShell@2
# inputs:
# filePath: 'eng\pack\scripts\rc_win_deps.ps1'
# arguments: '${{ parameters.pythonVersion }}'
# displayName: 'Build dependencies from source'
# condition: eq(variables['isRC'], 'true')
- bash: |
pip install pip-audit
cd workers
Expand Down
7 changes: 6 additions & 1 deletion eng/templates/official/jobs/build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ jobs:
Python313V4:
pythonVersion: '3.13'
normalizedPythonVersion: '3.13'
Python314V4:
pythonVersion: '3.14.0-rc.2'
normalizedPythonVersion: '3.14'
templateContext:
outputParentDirectory: $(Build.ArtifactStagingDirectory)
outputs:
Expand All @@ -249,7 +252,9 @@ jobs:
parameters:
pythonVersion: '$(pythonVersion)'
artifactName: '$(normalizedPythonVersion)_LINUX_ARM64'
grpcBuild: 'aarch64-linux-gnu.so'
grpcBuild:
- 'aarch64-linux-gnu.so'
- 'aarch64-linux-musl.so'

- job: PackageWorkers
dependsOn: ['Build_WINDOWS_X64', 'Build_WINDOWS_X86', 'Build_LINUX_X64', 'Build_OSX_X64', 'Build_OSX_ARM64', 'Build_LINUX_ARM64']
Expand Down
5 changes: 4 additions & 1 deletion workers/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ dependencies = [
"python-dateutil~=2.9.0",
"protobuf~=3.19.3; python_version == '3.7'",
"protobuf~=4.25.3; python_version >= '3.8' and python_version < '3.13'",
"protobuf~=5.29.0; python_version >= '3.13'",
"protobuf~=5.29.0; python_version == '3.13'",
"protobuf~=6.32.1; python_version == '3.14'",
"grpcio-tools~=1.43.0; python_version == '3.7'",
"grpcio-tools~=1.59.0; python_version >= '3.8' and python_version < '3.13'",
"grpcio-tools~=1.70.0; python_version == '3.13'",
"grpcio-tools~=1.75.1; python_version == '3.14'",
"grpcio~=1.43.0; python_version == '3.7'",
"grpcio ~=1.59.0; python_version >= '3.8' and python_version < '3.13'",
"grpcio~=1.70.0; python_version == '3.13'",
"grpcio~=1.75.1; python_version == '3.14'",
"uvloop~=0.21.0; python_version >= '3.13' and sys_platform != 'win32'",
"azurefunctions-extensions-base==1.1.0; python_version >= '3.8'",
"azure-functions-runtime==1.1.0b1; python_version >= '3.13'",
Expand Down
Loading