Skip to content

build: proxy worker build & test setup #1664

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 16 commits into from
Apr 11, 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
1 change: 0 additions & 1 deletion azure_functions_worker/protos/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/_src
*_pb2.py
*_pb2_grpc.py
2 changes: 2 additions & 0 deletions eng/templates/jobs/ci-emulator-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
PYTHON_VERSION: '3.11'
Python312:
PYTHON_VERSION: '3.12'
Python313:
PYTHON_VERSION: '3.13'
steps:
- task: UsePythonVersion@0
inputs:
Expand Down
15 changes: 15 additions & 0 deletions eng/templates/official/jobs/build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
Python312V4:
pythonVersion: '3.12'
workerPath: 'python/prodV4/worker.py'
Python313V4:
pythonVersion: '3.13'
workerPath: 'python/proxyV4/worker.py'
templateContext:
outputParentDirectory: $(Build.ArtifactStagingDirectory)
outputs:
Expand Down Expand Up @@ -62,6 +65,9 @@ jobs:
Python312V4:
pythonVersion: '3.12'
workerPath: 'python/prodV4/worker.py'
Python313V4:
pythonVersion: '3.13'
workerPath: 'python/proxyV4/worker.py'
templateContext:
outputParentDirectory: $(Build.ArtifactStagingDirectory)
outputs:
Expand Down Expand Up @@ -100,6 +106,9 @@ jobs:
Python312V4:
pythonVersion: '3.12'
workerPath: 'python/prodV4/worker.py'
Python313V4:
pythonVersion: '3.13'
workerPath: 'python/proxyV4/worker.py'
templateContext:
outputParentDirectory: $(Build.ArtifactStagingDirectory)
outputs:
Expand Down Expand Up @@ -137,6 +146,9 @@ jobs:
Python312V4:
pythonVersion: '3.12'
workerPath: 'python/prodV4/worker.py'
Python313V4:
pythonVersion: '3.13'
workerPath: 'python/proxyV4/worker.py'
templateContext:
outputParentDirectory: $(Build.ArtifactStagingDirectory)
outputs:
Expand Down Expand Up @@ -168,6 +180,9 @@ jobs:
Python312V4:
pythonVersion: '3.12'
workerPath: 'python/prodV4/worker.py'
Python313V4:
pythonVersion: '3.13'
workerPath: 'python/proxyV4/worker.py'
templateContext:
outputParentDirectory: $(Build.ArtifactStagingDirectory)
outputs:
Expand Down
9 changes: 9 additions & 0 deletions eng/templates/official/jobs/ci-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ jobs:
SQL_CONNECTION: $(LinuxSqlConnectionString312)
EVENTGRID_URI: $(LinuxEventGridTopicUriString312)
EVENTGRID_CONNECTION: $(LinuxEventGridConnectionKeyString312)
Python313:
PYTHON_VERSION: '3.13'
STORAGE_CONNECTION: $(LinuxStorageConnectionString312)
COSMOSDB_CONNECTION: $(LinuxCosmosDBConnectionString312)
EVENTHUB_CONNECTION: $(LinuxEventHubConnectionString312)
SERVICEBUS_CONNECTION: $(LinuxServiceBusConnectionString312)
SQL_CONNECTION: $(LinuxSqlConnectionString312)
EVENTGRID_URI: $(LinuxEventGridTopicUriString312)
EVENTGRID_CONNECTION: $(LinuxEventGridConnectionKeyString312)
steps:
- task: UsePythonVersion@0
inputs:
Expand Down
5 changes: 5 additions & 0 deletions pack/Microsoft.Azure.Functions.V4.PythonWorker.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
<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_X64\**" target="tools\3.12\OSX\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_X64\**" target="tools\3.13\OSX\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" />
Expand Down
8 changes: 7 additions & 1 deletion pack/scripts/mac_arm64_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ python -m invoke -c test_setup build-protos

cd ..
cp .artifactignore "$BUILD_SOURCESDIRECTORY/deps"
cp -r azure_functions_worker/protos "$BUILD_SOURCESDIRECTORY/deps/azure_functions_worker"

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
8 changes: 7 additions & 1 deletion pack/scripts/nix_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ python -m invoke -c test_setup build-protos

cd ..
cp .artifactignore "$BUILD_SOURCESDIRECTORY/deps"
cp -r azure_functions_worker/protos "$BUILD_SOURCESDIRECTORY/deps/azure_functions_worker"

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
16 changes: 14 additions & 2 deletions pack/scripts/win_deps.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
param (
[string]$pythonVersion
)
$versionParts = $pythonVersion -split '\.' # Splitting by dot
$versionMinor = [int]$versionParts[1]

python -m venv .env
.env\Scripts\Activate.ps1
python -m pip install --upgrade pip

python -m pip install .

$depsPath = Join-Path -Path $env:BUILD_SOURCESDIRECTORY -ChildPath "deps"
$protosPath = Join-Path -Path $depsPath -ChildPath "azure_functions_worker/protos"

python -m pip install . azure-functions --no-compile --target $depsPath.ToString()

Expand All @@ -15,4 +20,11 @@ python -m invoke -c test_setup build-protos

cd ..
Copy-Item -Path ".artifactignore" -Destination $depsPath.ToString()
Copy-Item -Path "azure_functions_worker/protos/*" -Destination $protosPath.ToString() -Recurse -Force

if ($versionMinor -lt 13) {
$protosPath = Join-Path -Path $depsPath -ChildPath "azure_functions_worker/protos"
Copy-Item -Path "azure_functions_worker/protos/*" -Destination $protosPath.ToString() -Recurse -Force
} else {
$protosPath = Join-Path -Path $depsPath -ChildPath "proxy_worker/protos"
Copy-Item -Path "proxy_worker/protos/*" -Destination $protosPath.ToString() -Recurse -Force
}
35 changes: 35 additions & 0 deletions pack/templates/macos_64_env_gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ steps:
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'
- task: ShellScript@2
inputs:
disableAutoCwd: true
scriptPath: 'pack/scripts/mac_arm64_deps.sh'
args: '${{ parameters.pythonVersion }}'
displayName: 'Install Dependencies'
- bash: |
pip install pip-audit
pip-audit -r requirements.txt
Expand Down Expand Up @@ -41,4 +50,30 @@ steps:
!pkg_resources/**
!*.dist-info/**
!werkzeug/debug/shared/debugger.js
!proxy_worker/**
targetFolder: '$(Build.ArtifactStagingDirectory)'
condition: in(variables['pythonMinor'], '7', '8', '9', '10', '11', '12')
displayName: 'Copy azure_functions_worker files'
- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)/deps'
contents: |
**
!grpc_tools/**/*
!grpcio_tools*/*
!build/**
!docs/**
!pack/**
!python/**
!tests/**
!setuptools*/**
!_distutils_hack/**
!distutils-precedence.pth
!pkg_resources/**
!*.dist-info/**
!werkzeug/debug/shared/debugger.js
!azure_functions_worker/**
!dateutil/**
targetFolder: '$(Build.ArtifactStagingDirectory)'
condition: in(variables['pythonMinor'], '13')
displayName: 'Copy proxy_worker files'
35 changes: 35 additions & 0 deletions pack/templates/nix_env_gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ steps:
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'
- task: ShellScript@2
inputs:
disableAutoCwd: true
scriptPath: 'pack/scripts/nix_deps.sh'
args: '${{ parameters.pythonVersion }}'
displayName: 'Install Dependencies'
- bash: |
pip install pip-audit
pip-audit -r requirements.txt
Expand Down Expand Up @@ -41,4 +50,30 @@ steps:
!pkg_resources/**
!*.dist-info/**
!werkzeug/debug/shared/debugger.js
!proxy_worker/**
targetFolder: '$(Build.ArtifactStagingDirectory)'
condition: in(variables['pythonMinor'], '7', '8', '9', '10', '11', '12')
displayName: 'Copy azure_functions_worker files'
- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)/deps'
contents: |
**
!grpc_tools/**/*
!grpcio_tools*/*
!build/**
!docs/**
!pack/**
!python/**
!tests/**
!setuptools*/**
!_distutils_hack/**
!distutils-precedence.pth
!pkg_resources/**
!*.dist-info/**
!werkzeug/debug/shared/debugger.js
!dateutil/**
!azure_functions_worker/**
targetFolder: '$(Build.ArtifactStagingDirectory)'
condition: in(variables['pythonMinor'], '13')
displayName: 'Copy proxy_worker files'
34 changes: 34 additions & 0 deletions pack/templates/win_env_gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@ steps:
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'
- task: PowerShell@2
inputs:
filePath: 'pack\scripts\win_deps.ps1'
arguments: '${{ parameters.pythonVersion }}'
- bash: |
pip install pip-audit
pip-audit -r requirements.txt
Expand Down Expand Up @@ -41,4 +49,30 @@ steps:
!pkg_resources\**
!*.dist-info\**
!werkzeug\debug\shared\debugger.js
!proxy_worker\**
targetFolder: '$(Build.ArtifactStagingDirectory)'
condition: in(variables['pythonMinor'], '7', '8', '9', '10', '11', '12')
displayName: 'Copy azure_functions_worker files'
- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)\deps'
contents: |
**
!grpc_tools\**\*
!grpcio_tools*\*
!build\**
!docs\**
!pack\**
!python\**
!tests\**
!setuptools*\**
!_distutils_hack\**
!distutils-precedence.pth
!pkg_resources\**
!*.dist-info\**
!werkzeug\debug\shared\debugger.js
!dateutil\**
!azure_functions_worker\**
targetFolder: '$(Build.ArtifactStagingDirectory)'
condition: in(variables['pythonMinor'], '13')
displayName: 'Copy proxy_worker files'
1 change: 0 additions & 1 deletion proxy_worker/protos/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/_src
*_pb2.py
*_pb2_grpc.py
Loading