Skip to content

build: Add linux-arm64 build #1677

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

Merged
merged 10 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 0 additions & 4 deletions eng/ci/worker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ extends:
name: 1es-pool-azfunc
image: 1es-windows-2022
os: windows
sdl:
codeSignValidation:
enabled: true
break: true

stages:
- stage: Release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<_PythonSupportedRuntime Include="win-x86" WorkerPath="WINDOWS/X86" />
<_PythonSupportedRuntime Include="win-x64" WorkerPath="WINDOWS/X64" />
<_PythonSupportedRuntime Include="linux-x64" WorkerPath="LINUX/X64" />
<_PythonSupportedRuntime Include="linux-arm64" WorkerPath="LINUX/Arm64" />
<_PythonSupportedRuntime Include="osx-x64" WorkerPath="OSX/X64" />
<_PythonSupportedRuntime Include="osx-arm64" WorkerPath="OSX/Arm64" />
</ItemGroup>
Expand Down
55 changes: 55 additions & 0 deletions eng/pack/Microsoft.Azure.Functions.V4.PythonWorker.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Microsoft.Azure.Functions.PythonWorker</id>
<version>1.1.0</version>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Microsoft Azure Functions Python Worker</description>
<copyright>© .NET Foundation. All rights reserved.</copyright>
</metadata>
<files>
<file src="..\..\3.7_WINDOWS_X64\**" target="tools\3.7\WINDOWS\X64" />
<file src="..\..\3.7_WINDOWS_X86\**" target="tools\3.7\WINDOWS\X86" />
<file src="..\..\3.7_LINUX_X64\**" target="tools\3.7\LINUX\X64" />
<file src="..\..\3.7_OSX_X64\**" target="tools\3.7\OSX\X64" />
<file src="..\..\3.8_WINDOWS_X64\**" target="tools\3.8\WINDOWS\X64" />
<file src="..\..\3.8_WINDOWS_X86\**" target="tools\3.8\WINDOWS\X86" />
<file src="..\..\3.8_LINUX_X64\**" target="tools\3.8\LINUX\X64" />
<file src="..\..\3.8_OSX_X64\**" target="tools\3.8\OSX\X64" />
<file src="..\..\3.9_WINDOWS_X64\**" target="tools\3.9\WINDOWS\X64" />
<file src="..\..\3.9_WINDOWS_X86\**" target="tools\3.9\WINDOWS\X86" />
<file src="..\..\3.9_LINUX_X64\**" target="tools\3.9\LINUX\X64" />
<file src="..\..\3.9_OSX_X64\**" target="tools\3.9\OSX\X64" />
<file src="..\..\3.9_OSX_ARM64\**" target="tools\3.9\OSX\Arm64" />
<file src="..\..\3.9_LINUX_ARM64\**" target="tools\3.9\LINUX\Arm64" />
<file src="..\..\3.10_WINDOWS_X64\**" target="tools\3.10\WINDOWS\X64" />
<file src="..\..\3.10_WINDOWS_X86\**" target="tools\3.10\WINDOWS\X86" />
<file src="..\..\3.10_LINUX_X64\**" target="tools\3.10\LINUX\X64" />
<file src="..\..\3.10_OSX_X64\**" target="tools\3.10\OSX\X64" />
<file src="..\..\3.10_OSX_ARM64\**" target="tools\3.10\OSX\Arm64" />
<file src="..\..\3.10_LINUX_ARM64\**" target="tools\3.10\LINUX\Arm64" />
<file src="..\..\3.11_WINDOWS_X64\**" target="tools\3.11\WINDOWS\X64" />
<file src="..\..\3.11_WINDOWS_X86\**" target="tools\3.11\WINDOWS\X86" />
<file src="..\..\3.11_LINUX_X64\**" target="tools\3.11\LINUX\X64" />
<file src="..\..\3.11_OSX_X64\**" target="tools\3.11\OSX\X64" />
<file src="..\..\3.11_OSX_ARM64\**" target="tools\3.11\OSX\Arm64" />
<file src="..\..\3.11_LINUX_ARM64\**" target="tools\3.11\LINUX\Arm64" />
<file src="..\..\3.12_WINDOWS_X64\**" target="tools\3.12\WINDOWS\X64" />
<file src="..\..\3.12_WINDOWS_X86\**" target="tools\3.12\WINDOWS\X86" />
<file src="..\..\3.12_LINUX_X64\**" target="tools\3.12\LINUX\X64" />
<file src="..\..\3.12_OSX_X64\**" target="tools\3.12\OSX\X64" />
<file src="..\..\3.12_OSX_ARM64\**" target="tools\3.12\OSX\Arm64" />
<file src="..\..\3.12_LINUX_ARM64\**" target="tools\3.12\LINUX\Arm64" />
<file src="..\..\3.13_WINDOWS_X64\**" target="tools\3.13\WINDOWS\X64" />
<file src="..\..\3.13_WINDOWS_X86\**" target="tools\3.13\WINDOWS\X86" />
<file src="..\..\3.13_LINUX_X64\**" target="tools\3.13\LINUX\X64" />
<file src="..\..\3.13_OSX_X64\**" target="tools\3.13\OSX\X64" />
<file src="..\..\3.13_OSX_ARM64\**" target="tools\3.13\OSX\Arm64" />
<file src="..\..\3.13_LINUX_ARM64\**" target="tools\3.13\LINUX\Arm64" />
<file src="..\..\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" />
</files>
</package>
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,24 +1,43 @@
parameters:
pythonVersion: ''
artifactName: ''
workerPath: ''

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: ${{ parameters.pythonVersion }}
addToPath: true
- bash: |
major=$(echo $(pythonVersion) | cut -d. -f1)
minor=$(echo $(pythonVersion) | cut -d. -f2)
echo "##vso[task.setvariable variable=pythonMajor]$major"
echo "##vso[task.setvariable variable=pythonMinor]$minor"
echo $pythonMinor
displayName: 'Parse pythonVersion'
- powershell: |
# Parse the Python minor version
$PY_VER = "$(pythonVersion)"
Write-Host "Python version: $PY_VER"
# Extract minor version as integers
$versionParts = $PY_VER.Split('.')
$PY_MINOR = [int]$versionParts[1]
Write-Host "Minor version: $PY_MINOR"

# Set build-related variables based on Python minor version
if( $PY_MINOR -ge 13 )
{
Write-Host "##vso[task.setvariable variable=workerPath;]$(proxyV4Path)"
Write-Host "##vso[task.setvariable variable=proxyWorker;]true"
}
else
{
Write-Host "##vso[task.setvariable variable=workerPath;]$(prodV4Path)"
Write-Host "##vso[task.setvariable variable=proxyWorker;]false"
}
displayName: 'Set necessary variables'
env:
pythonVersion: ${{ parameters.pythonVersion }}
- powershell: |
Write-Host "workerPath: $(workerPath)"
Write-Host "proxyWorker: $(proxyWorker)"
displayName: 'Display variables'
- task: ShellScript@2
inputs:
disableAutoCwd: true
scriptPath: 'pack/scripts/mac_arm64_deps.sh'
scriptPath: 'eng/pack/scripts/mac_arm64_deps.sh'
args: '${{ parameters.pythonVersion }}'
displayName: 'Install Dependencies'
- bash: |
Expand All @@ -28,8 +47,7 @@ steps:
condition: ne(variables['pythonVersion'], '3.7')
- task: CopyFiles@2
inputs:
contents: |
${{ parameters.workerPath }}
contents: '$(workerPath)'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

workerPath is set above. For Python 3.12 & under, the path is python/prodV4/worker.py. For 3.13+, it is python/proxyV4/worker.py

targetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
- task: CopyFiles@2
Expand All @@ -41,7 +59,7 @@ steps:
!grpcio_tools*/*
!build/**
!docs/**
!pack/**
!eng/**
!python/**
!tests/**
!setuptools*/**
Expand All @@ -52,7 +70,7 @@ steps:
!werkzeug/debug/shared/debugger.js
!proxy_worker/**
targetFolder: '$(Build.ArtifactStagingDirectory)'
condition: in(variables['pythonMinor'], '7', '8', '9', '10', '11', '12')
condition: eq(variables['proxyWorker'], false)
displayName: 'Copy azure_functions_worker files'
- task: CopyFiles@2
inputs:
Expand All @@ -63,7 +81,7 @@ steps:
!grpcio_tools*/*
!build/**
!docs/**
!pack/**
!eng/**
!python/**
!tests/**
!setuptools*/**
Expand All @@ -75,5 +93,5 @@ steps:
!azure_functions_worker/**
!dateutil/**
targetFolder: '$(Build.ArtifactStagingDirectory)'
condition: in(variables['pythonMinor'], '13')
condition: eq(variables['proxyWorker'], true)
displayName: 'Copy proxy_worker files'
Original file line number Diff line number Diff line change
@@ -1,24 +1,43 @@
parameters:
pythonVersion: ''
artifactName: ''
workerPath: ''

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: ${{ parameters.pythonVersion }}
addToPath: true
- bash: |
major=$(echo $(pythonVersion) | cut -d. -f1)
minor=$(echo $(pythonVersion) | cut -d. -f2)
echo "##vso[task.setvariable variable=pythonMajor]$major"
echo "##vso[task.setvariable variable=pythonMinor]$minor"
echo $pythonMinor
displayName: 'Parse pythonVersion'
- powershell: |
# Parse the Python minor version
$PY_VER = "$(pythonVersion)"
Write-Host "Python version: $PY_VER"
# Extract minor version as integers
$versionParts = $PY_VER.Split('.')
$PY_MINOR = [int]$versionParts[1]
Write-Host "Minor version: $PY_MINOR"

# Set build-related variables based on Python minor version
if( $PY_MINOR -ge 13 )
{
Write-Host "##vso[task.setvariable variable=workerPath;]$(proxyV4Path)"
Write-Host "##vso[task.setvariable variable=proxyWorker;]true"
}
else
{
Write-Host "##vso[task.setvariable variable=workerPath;]$(prodV4Path)"
Write-Host "##vso[task.setvariable variable=proxyWorker;]false"
}
displayName: 'Set necessary variables'
env:
pythonVersion: ${{ parameters.pythonVersion }}
- powershell: |
Write-Host "workerPath: $(workerPath)"
Write-Host "proxyWorker: $(proxyWorker)"
displayName: 'Display variables'
- task: ShellScript@2
inputs:
disableAutoCwd: true
scriptPath: 'pack/scripts/nix_deps.sh'
scriptPath: 'eng/pack/scripts/nix_deps.sh'
args: '${{ parameters.pythonVersion }}'
displayName: 'Install Dependencies'
- bash: |
Expand All @@ -28,8 +47,7 @@ steps:
condition: ne(variables['pythonVersion'], '3.7')
- task: CopyFiles@2
inputs:
contents: |
${{ parameters.workerPath }}
contents: '$(workerPath)'
targetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
- task: CopyFiles@2
Expand All @@ -41,7 +59,7 @@ steps:
!grpcio_tools*/*
!build/**
!docs/**
!pack/**
!eng/**
!python/**
!tests/**
!setuptools*/**
Expand All @@ -52,7 +70,7 @@ steps:
!werkzeug/debug/shared/debugger.js
!proxy_worker/**
targetFolder: '$(Build.ArtifactStagingDirectory)'
condition: in(variables['pythonMinor'], '7', '8', '9', '10', '11', '12')
condition: eq(variables['proxyWorker'], false)
displayName: 'Copy azure_functions_worker files'
- task: CopyFiles@2
inputs:
Expand All @@ -63,7 +81,7 @@ steps:
!grpcio_tools*/*
!build/**
!docs/**
!pack/**
!eng/**
!python/**
!tests/**
!setuptools*/**
Expand All @@ -75,5 +93,5 @@ steps:
!dateutil/**
!azure_functions_worker/**
targetFolder: '$(Build.ArtifactStagingDirectory)'
condition: in(variables['pythonMinor'], '13')
condition: eq(variables['proxyWorker'], true)
displayName: 'Copy proxy_worker files'
Original file line number Diff line number Diff line change
@@ -1,24 +1,43 @@
parameters:
pythonVersion: ''
artifactName: ''
workerPath: ''

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: ${{ parameters.pythonVersion }}
architecture: ${{ parameters.architecture }}
addToPath: true
- bash: |
major=$(echo $(pythonVersion) | cut -d. -f1)
minor=$(echo $(pythonVersion) | cut -d. -f2)
echo "##vso[task.setvariable variable=pythonMajor]$major"
echo "##vso[task.setvariable variable=pythonMinor]$minor"
echo $pythonMinor
displayName: 'Parse pythonVersion'
- powershell: |
# Parse the Python minor version
$PY_VER = "$(pythonVersion)"
Write-Host "Python version: $PY_VER"
# Extract minor version as integers
$versionParts = $PY_VER.Split('.')
$PY_MINOR = [int]$versionParts[1]
Write-Host "Minor version: $PY_MINOR"

# Set build-related variables based on Python minor version
if( $PY_MINOR -ge 13 )
{
Write-Host "##vso[task.setvariable variable=workerPath;]$(proxyV4Path)"
Write-Host "##vso[task.setvariable variable=proxyWorker;]true"
}
else
{
Write-Host "##vso[task.setvariable variable=workerPath;]$(prodV4Path)"
Write-Host "##vso[task.setvariable variable=proxyWorker;]false"
}
displayName: 'Set necessary variables'
env:
pythonVersion: ${{ parameters.pythonVersion }}
- powershell: |
Write-Host "workerPath: $(workerPath)"
Write-Host "proxyWorker: $(proxyWorker)"
displayName: 'Display variables'
- task: PowerShell@2
inputs:
filePath: 'pack\scripts\win_deps.ps1'
filePath: 'eng\pack\scripts\win_deps.ps1'
arguments: '${{ parameters.pythonVersion }}'
- bash: |
pip install pip-audit
Expand All @@ -27,8 +46,7 @@ steps:
condition: ne(variables['pythonVersion'], '3.7')
- task: CopyFiles@2
inputs:
contents: |
${{ parameters.workerPath }}
contents: '$(workerPath)'
targetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
- task: CopyFiles@2
Expand All @@ -40,7 +58,7 @@ steps:
!grpcio_tools*\*
!build\**
!docs\**
!pack\**
!eng\**
!python\**
!tests\**
!setuptools*\**
Expand All @@ -51,7 +69,7 @@ steps:
!werkzeug\debug\shared\debugger.js
!proxy_worker\**
targetFolder: '$(Build.ArtifactStagingDirectory)'
condition: in(variables['pythonMinor'], '7', '8', '9', '10', '11', '12')
condition: eq(variables['proxyWorker'], false)
displayName: 'Copy azure_functions_worker files'
- task: CopyFiles@2
inputs:
Expand All @@ -62,7 +80,7 @@ steps:
!grpcio_tools*\*
!build\**
!docs\**
!pack\**
!eng\**
!python\**
!tests\**
!setuptools*\**
Expand All @@ -74,5 +92,5 @@ steps:
!dateutil\**
!azure_functions_worker\**
targetFolder: '$(Build.ArtifactStagingDirectory)'
condition: in(variables['pythonMinor'], '13')
condition: eq(variables['proxyWorker'], true)
displayName: 'Copy proxy_worker files'
File renamed without changes.
Loading
Loading