Skip to content

Commit a9ce719

Browse files
authored
build: Add linux-arm64 build (#1677)
* initial changes for linux-arm64 build * fix variable def * fix variable * testing fixes * parse minor version * refactor pack into eng * does not work: initial code for win-arm64 build * refactor workerPath into top-level variables * fix env_gen CopyFiles condition * remove win-arm64 build
1 parent c3899d8 commit a9ce719

15 files changed

+205
-151
lines changed

eng/ci/worker-release.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ extends:
2222
name: 1es-pool-azfunc
2323
image: 1es-windows-2022
2424
os: windows
25-
sdl:
26-
codeSignValidation:
27-
enabled: true
28-
break: true
2925

3026
stages:
3127
- stage: Release

pack/Microsoft.Azure.Functions.PythonWorker.targets renamed to eng/pack/Microsoft.Azure.Functions.PythonWorker.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<_PythonSupportedRuntime Include="win-x86" WorkerPath="WINDOWS/X86" />
99
<_PythonSupportedRuntime Include="win-x64" WorkerPath="WINDOWS/X64" />
1010
<_PythonSupportedRuntime Include="linux-x64" WorkerPath="LINUX/X64" />
11+
<_PythonSupportedRuntime Include="linux-arm64" WorkerPath="LINUX/Arm64" />
1112
<_PythonSupportedRuntime Include="osx-x64" WorkerPath="OSX/X64" />
1213
<_PythonSupportedRuntime Include="osx-arm64" WorkerPath="OSX/Arm64" />
1314
</ItemGroup>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
3+
<metadata>
4+
<id>Microsoft.Azure.Functions.PythonWorker</id>
5+
<version>1.1.0</version>
6+
<authors>Microsoft</authors>
7+
<owners>Microsoft</owners>
8+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
9+
<description>Microsoft Azure Functions Python Worker</description>
10+
<copyright>© .NET Foundation. All rights reserved.</copyright>
11+
</metadata>
12+
<files>
13+
<file src="..\..\3.7_WINDOWS_X64\**" target="tools\3.7\WINDOWS\X64" />
14+
<file src="..\..\3.7_WINDOWS_X86\**" target="tools\3.7\WINDOWS\X86" />
15+
<file src="..\..\3.7_LINUX_X64\**" target="tools\3.7\LINUX\X64" />
16+
<file src="..\..\3.7_OSX_X64\**" target="tools\3.7\OSX\X64" />
17+
<file src="..\..\3.8_WINDOWS_X64\**" target="tools\3.8\WINDOWS\X64" />
18+
<file src="..\..\3.8_WINDOWS_X86\**" target="tools\3.8\WINDOWS\X86" />
19+
<file src="..\..\3.8_LINUX_X64\**" target="tools\3.8\LINUX\X64" />
20+
<file src="..\..\3.8_OSX_X64\**" target="tools\3.8\OSX\X64" />
21+
<file src="..\..\3.9_WINDOWS_X64\**" target="tools\3.9\WINDOWS\X64" />
22+
<file src="..\..\3.9_WINDOWS_X86\**" target="tools\3.9\WINDOWS\X86" />
23+
<file src="..\..\3.9_LINUX_X64\**" target="tools\3.9\LINUX\X64" />
24+
<file src="..\..\3.9_OSX_X64\**" target="tools\3.9\OSX\X64" />
25+
<file src="..\..\3.9_OSX_ARM64\**" target="tools\3.9\OSX\Arm64" />
26+
<file src="..\..\3.9_LINUX_ARM64\**" target="tools\3.9\LINUX\Arm64" />
27+
<file src="..\..\3.10_WINDOWS_X64\**" target="tools\3.10\WINDOWS\X64" />
28+
<file src="..\..\3.10_WINDOWS_X86\**" target="tools\3.10\WINDOWS\X86" />
29+
<file src="..\..\3.10_LINUX_X64\**" target="tools\3.10\LINUX\X64" />
30+
<file src="..\..\3.10_OSX_X64\**" target="tools\3.10\OSX\X64" />
31+
<file src="..\..\3.10_OSX_ARM64\**" target="tools\3.10\OSX\Arm64" />
32+
<file src="..\..\3.10_LINUX_ARM64\**" target="tools\3.10\LINUX\Arm64" />
33+
<file src="..\..\3.11_WINDOWS_X64\**" target="tools\3.11\WINDOWS\X64" />
34+
<file src="..\..\3.11_WINDOWS_X86\**" target="tools\3.11\WINDOWS\X86" />
35+
<file src="..\..\3.11_LINUX_X64\**" target="tools\3.11\LINUX\X64" />
36+
<file src="..\..\3.11_OSX_X64\**" target="tools\3.11\OSX\X64" />
37+
<file src="..\..\3.11_OSX_ARM64\**" target="tools\3.11\OSX\Arm64" />
38+
<file src="..\..\3.11_LINUX_ARM64\**" target="tools\3.11\LINUX\Arm64" />
39+
<file src="..\..\3.12_WINDOWS_X64\**" target="tools\3.12\WINDOWS\X64" />
40+
<file src="..\..\3.12_WINDOWS_X86\**" target="tools\3.12\WINDOWS\X86" />
41+
<file src="..\..\3.12_LINUX_X64\**" target="tools\3.12\LINUX\X64" />
42+
<file src="..\..\3.12_OSX_X64\**" target="tools\3.12\OSX\X64" />
43+
<file src="..\..\3.12_OSX_ARM64\**" target="tools\3.12\OSX\Arm64" />
44+
<file src="..\..\3.12_LINUX_ARM64\**" target="tools\3.12\LINUX\Arm64" />
45+
<file src="..\..\3.13_WINDOWS_X64\**" target="tools\3.13\WINDOWS\X64" />
46+
<file src="..\..\3.13_WINDOWS_X86\**" target="tools\3.13\WINDOWS\X86" />
47+
<file src="..\..\3.13_LINUX_X64\**" target="tools\3.13\LINUX\X64" />
48+
<file src="..\..\3.13_OSX_X64\**" target="tools\3.13\OSX\X64" />
49+
<file src="..\..\3.13_OSX_ARM64\**" target="tools\3.13\OSX\Arm64" />
50+
<file src="..\..\3.13_LINUX_ARM64\**" target="tools\3.13\LINUX\Arm64" />
51+
<file src="..\..\python\prodV4\worker.config.json" target="tools" />
52+
<file src="Microsoft.Azure.Functions.PythonWorker.targets" target="build" />
53+
<file src="..\..\_manifest\spdx_2.2\manifest.spdx.json" target="SBOM\manifest.spdx.json" />
54+
</files>
55+
</package>
File renamed without changes.
File renamed without changes.
File renamed without changes.

pack/templates/macos_64_env_gen.yml renamed to eng/pack/templates/macos_64_env_gen.yml

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,43 @@
11
parameters:
22
pythonVersion: ''
33
artifactName: ''
4-
workerPath: ''
54

65
steps:
76
- task: UsePythonVersion@0
87
inputs:
98
versionSpec: ${{ parameters.pythonVersion }}
109
addToPath: true
11-
- bash: |
12-
major=$(echo $(pythonVersion) | cut -d. -f1)
13-
minor=$(echo $(pythonVersion) | cut -d. -f2)
14-
echo "##vso[task.setvariable variable=pythonMajor]$major"
15-
echo "##vso[task.setvariable variable=pythonMinor]$minor"
16-
echo $pythonMinor
17-
displayName: 'Parse pythonVersion'
10+
- powershell: |
11+
# Parse the Python minor version
12+
$PY_VER = "$(pythonVersion)"
13+
Write-Host "Python version: $PY_VER"
14+
# Extract minor version as integers
15+
$versionParts = $PY_VER.Split('.')
16+
$PY_MINOR = [int]$versionParts[1]
17+
Write-Host "Minor version: $PY_MINOR"
18+
19+
# Set build-related variables based on Python minor version
20+
if( $PY_MINOR -ge 13 )
21+
{
22+
Write-Host "##vso[task.setvariable variable=workerPath;]$(proxyV4Path)"
23+
Write-Host "##vso[task.setvariable variable=proxyWorker;]true"
24+
}
25+
else
26+
{
27+
Write-Host "##vso[task.setvariable variable=workerPath;]$(prodV4Path)"
28+
Write-Host "##vso[task.setvariable variable=proxyWorker;]false"
29+
}
30+
displayName: 'Set necessary variables'
31+
env:
32+
pythonVersion: ${{ parameters.pythonVersion }}
33+
- powershell: |
34+
Write-Host "workerPath: $(workerPath)"
35+
Write-Host "proxyWorker: $(proxyWorker)"
36+
displayName: 'Display variables'
1837
- task: ShellScript@2
1938
inputs:
2039
disableAutoCwd: true
21-
scriptPath: 'pack/scripts/mac_arm64_deps.sh'
40+
scriptPath: 'eng/pack/scripts/mac_arm64_deps.sh'
2241
args: '${{ parameters.pythonVersion }}'
2342
displayName: 'Install Dependencies'
2443
- bash: |
@@ -28,8 +47,7 @@ steps:
2847
condition: ne(variables['pythonVersion'], '3.7')
2948
- task: CopyFiles@2
3049
inputs:
31-
contents: |
32-
${{ parameters.workerPath }}
50+
contents: '$(workerPath)'
3351
targetFolder: '$(Build.ArtifactStagingDirectory)'
3452
flattenFolders: true
3553
- task: CopyFiles@2
@@ -41,7 +59,7 @@ steps:
4159
!grpcio_tools*/*
4260
!build/**
4361
!docs/**
44-
!pack/**
62+
!eng/**
4563
!python/**
4664
!tests/**
4765
!setuptools*/**
@@ -52,7 +70,7 @@ steps:
5270
!werkzeug/debug/shared/debugger.js
5371
!proxy_worker/**
5472
targetFolder: '$(Build.ArtifactStagingDirectory)'
55-
condition: in(variables['pythonMinor'], '7', '8', '9', '10', '11', '12')
73+
condition: eq(variables['proxyWorker'], false)
5674
displayName: 'Copy azure_functions_worker files'
5775
- task: CopyFiles@2
5876
inputs:
@@ -63,7 +81,7 @@ steps:
6381
!grpcio_tools*/*
6482
!build/**
6583
!docs/**
66-
!pack/**
84+
!eng/**
6785
!python/**
6886
!tests/**
6987
!setuptools*/**
@@ -75,5 +93,5 @@ steps:
7593
!azure_functions_worker/**
7694
!dateutil/**
7795
targetFolder: '$(Build.ArtifactStagingDirectory)'
78-
condition: in(variables['pythonMinor'], '13')
96+
condition: eq(variables['proxyWorker'], true)
7997
displayName: 'Copy proxy_worker files'

pack/templates/nix_env_gen.yml renamed to eng/pack/templates/nix_env_gen.yml

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,43 @@
11
parameters:
22
pythonVersion: ''
33
artifactName: ''
4-
workerPath: ''
54

65
steps:
76
- task: UsePythonVersion@0
87
inputs:
98
versionSpec: ${{ parameters.pythonVersion }}
109
addToPath: true
11-
- bash: |
12-
major=$(echo $(pythonVersion) | cut -d. -f1)
13-
minor=$(echo $(pythonVersion) | cut -d. -f2)
14-
echo "##vso[task.setvariable variable=pythonMajor]$major"
15-
echo "##vso[task.setvariable variable=pythonMinor]$minor"
16-
echo $pythonMinor
17-
displayName: 'Parse pythonVersion'
10+
- powershell: |
11+
# Parse the Python minor version
12+
$PY_VER = "$(pythonVersion)"
13+
Write-Host "Python version: $PY_VER"
14+
# Extract minor version as integers
15+
$versionParts = $PY_VER.Split('.')
16+
$PY_MINOR = [int]$versionParts[1]
17+
Write-Host "Minor version: $PY_MINOR"
18+
19+
# Set build-related variables based on Python minor version
20+
if( $PY_MINOR -ge 13 )
21+
{
22+
Write-Host "##vso[task.setvariable variable=workerPath;]$(proxyV4Path)"
23+
Write-Host "##vso[task.setvariable variable=proxyWorker;]true"
24+
}
25+
else
26+
{
27+
Write-Host "##vso[task.setvariable variable=workerPath;]$(prodV4Path)"
28+
Write-Host "##vso[task.setvariable variable=proxyWorker;]false"
29+
}
30+
displayName: 'Set necessary variables'
31+
env:
32+
pythonVersion: ${{ parameters.pythonVersion }}
33+
- powershell: |
34+
Write-Host "workerPath: $(workerPath)"
35+
Write-Host "proxyWorker: $(proxyWorker)"
36+
displayName: 'Display variables'
1837
- task: ShellScript@2
1938
inputs:
2039
disableAutoCwd: true
21-
scriptPath: 'pack/scripts/nix_deps.sh'
40+
scriptPath: 'eng/pack/scripts/nix_deps.sh'
2241
args: '${{ parameters.pythonVersion }}'
2342
displayName: 'Install Dependencies'
2443
- bash: |
@@ -28,8 +47,7 @@ steps:
2847
condition: ne(variables['pythonVersion'], '3.7')
2948
- task: CopyFiles@2
3049
inputs:
31-
contents: |
32-
${{ parameters.workerPath }}
50+
contents: '$(workerPath)'
3351
targetFolder: '$(Build.ArtifactStagingDirectory)'
3452
flattenFolders: true
3553
- task: CopyFiles@2
@@ -41,7 +59,7 @@ steps:
4159
!grpcio_tools*/*
4260
!build/**
4361
!docs/**
44-
!pack/**
62+
!eng/**
4563
!python/**
4664
!tests/**
4765
!setuptools*/**
@@ -52,7 +70,7 @@ steps:
5270
!werkzeug/debug/shared/debugger.js
5371
!proxy_worker/**
5472
targetFolder: '$(Build.ArtifactStagingDirectory)'
55-
condition: in(variables['pythonMinor'], '7', '8', '9', '10', '11', '12')
73+
condition: eq(variables['proxyWorker'], false)
5674
displayName: 'Copy azure_functions_worker files'
5775
- task: CopyFiles@2
5876
inputs:
@@ -63,7 +81,7 @@ steps:
6381
!grpcio_tools*/*
6482
!build/**
6583
!docs/**
66-
!pack/**
84+
!eng/**
6785
!python/**
6886
!tests/**
6987
!setuptools*/**
@@ -75,5 +93,5 @@ steps:
7593
!dateutil/**
7694
!azure_functions_worker/**
7795
targetFolder: '$(Build.ArtifactStagingDirectory)'
78-
condition: in(variables['pythonMinor'], '13')
96+
condition: eq(variables['proxyWorker'], true)
7997
displayName: 'Copy proxy_worker files'
Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,43 @@
11
parameters:
22
pythonVersion: ''
33
artifactName: ''
4-
workerPath: ''
54

65
steps:
76
- task: UsePythonVersion@0
87
inputs:
98
versionSpec: ${{ parameters.pythonVersion }}
109
architecture: ${{ parameters.architecture }}
1110
addToPath: true
12-
- bash: |
13-
major=$(echo $(pythonVersion) | cut -d. -f1)
14-
minor=$(echo $(pythonVersion) | cut -d. -f2)
15-
echo "##vso[task.setvariable variable=pythonMajor]$major"
16-
echo "##vso[task.setvariable variable=pythonMinor]$minor"
17-
echo $pythonMinor
18-
displayName: 'Parse pythonVersion'
11+
- powershell: |
12+
# Parse the Python minor version
13+
$PY_VER = "$(pythonVersion)"
14+
Write-Host "Python version: $PY_VER"
15+
# Extract minor version as integers
16+
$versionParts = $PY_VER.Split('.')
17+
$PY_MINOR = [int]$versionParts[1]
18+
Write-Host "Minor version: $PY_MINOR"
19+
20+
# Set build-related variables based on Python minor version
21+
if( $PY_MINOR -ge 13 )
22+
{
23+
Write-Host "##vso[task.setvariable variable=workerPath;]$(proxyV4Path)"
24+
Write-Host "##vso[task.setvariable variable=proxyWorker;]true"
25+
}
26+
else
27+
{
28+
Write-Host "##vso[task.setvariable variable=workerPath;]$(prodV4Path)"
29+
Write-Host "##vso[task.setvariable variable=proxyWorker;]false"
30+
}
31+
displayName: 'Set necessary variables'
32+
env:
33+
pythonVersion: ${{ parameters.pythonVersion }}
34+
- powershell: |
35+
Write-Host "workerPath: $(workerPath)"
36+
Write-Host "proxyWorker: $(proxyWorker)"
37+
displayName: 'Display variables'
1938
- task: PowerShell@2
2039
inputs:
21-
filePath: 'pack\scripts\win_deps.ps1'
40+
filePath: 'eng\pack\scripts\win_deps.ps1'
2241
arguments: '${{ parameters.pythonVersion }}'
2342
- bash: |
2443
pip install pip-audit
@@ -27,8 +46,7 @@ steps:
2746
condition: ne(variables['pythonVersion'], '3.7')
2847
- task: CopyFiles@2
2948
inputs:
30-
contents: |
31-
${{ parameters.workerPath }}
49+
contents: '$(workerPath)'
3250
targetFolder: '$(Build.ArtifactStagingDirectory)'
3351
flattenFolders: true
3452
- task: CopyFiles@2
@@ -40,7 +58,7 @@ steps:
4058
!grpcio_tools*\*
4159
!build\**
4260
!docs\**
43-
!pack\**
61+
!eng\**
4462
!python\**
4563
!tests\**
4664
!setuptools*\**
@@ -51,7 +69,7 @@ steps:
5169
!werkzeug\debug\shared\debugger.js
5270
!proxy_worker\**
5371
targetFolder: '$(Build.ArtifactStagingDirectory)'
54-
condition: in(variables['pythonMinor'], '7', '8', '9', '10', '11', '12')
72+
condition: eq(variables['proxyWorker'], false)
5573
displayName: 'Copy azure_functions_worker files'
5674
- task: CopyFiles@2
5775
inputs:
@@ -62,7 +80,7 @@ steps:
6280
!grpcio_tools*\*
6381
!build\**
6482
!docs\**
65-
!pack\**
83+
!eng\**
6684
!python\**
6785
!tests\**
6886
!setuptools*\**
@@ -74,5 +92,5 @@ steps:
7492
!dateutil\**
7593
!azure_functions_worker\**
7694
targetFolder: '$(Build.ArtifactStagingDirectory)'
77-
condition: in(variables['pythonMinor'], '13')
95+
condition: eq(variables['proxyWorker'], true)
7896
displayName: 'Copy proxy_worker files'
File renamed without changes.

0 commit comments

Comments
 (0)