Skip to content
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
5 changes: 5 additions & 0 deletions eng/pack/Microsoft.Azure.Functions.V4.PythonWorker.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
<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="..\..\3.14_WINDOWS_X64\**" target="tools\3.14\WINDOWS\X64" />
<file src="..\..\3.14_WINDOWS_X86\**" target="tools\3.14\WINDOWS\X86" />
<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="..\..\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
64 changes: 64 additions & 0 deletions eng/pack/scripts/rc_mac_arm64_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/bash

echo "=== Upgrading pip and installing build dependencies ==="
python -m pip install --upgrade pip setuptools wheel cython

echo "=== Cloning gRPC repo ==="
rm -rf grpc
git clone --recursive https://github.com/grpc/grpc

echo "=== Building grpcio wheel from source ==="
cd grpc
git submodule update --init --recursive
export GRPC_PYTHON_BUILD_WITH_CYTHON=1

# Build the wheel into dist/
python -m pip wheel . -w dist

# Log contents of dist
echo "=== Checking dist directory ==="
if [ -d dist ]; then
ls -lh dist
else
echo "dist/ directory not found!"
fi

# Log and install grpcio
GRPC_WHEEL=$(ls dist/grpcio-*.whl | head -n 1)
echo "Built grpcio wheel: $(basename "$GRPC_WHEEL")"
echo "=== Install grpcio wheel $(basename "$GRPC_WHEEL") into root ==="
python -m pip install "$GRPC_WHEEL"

cd ..

# Change back to project root
cd workers

echo "=== Install other deps into root ==="
python -m pip install .
python -m pip install grpcio-tools==1.70.0

echo "=== Installing grpcio into deps/ ==="
python -m pip install "$GRPC_WHEEL" --target "$BUILD_SOURCESDIRECTORY/deps"

echo "=== Installing other deps into deps/ ==="
python -m pip install --upgrade pip setuptools wheel cython --target "$BUILD_SOURCESDIRECTORY/deps"
python -m pip install . azure-functions --no-compile --target "$BUILD_SOURCESDIRECTORY/deps" --find-links ../grpc/dist
python -m pip install grpcio-tools==1.70.0 --no-compile --target "$BUILD_SOURCESDIRECTORY/deps" --find-links ../grpc/dist

echo "=== Install invoke and build protos ==="
python -m pip install invoke
cd tests
python -m invoke -c test_setup build-protos

echo "=== Copying .artifactignore ==="
cd ..
cp .artifactignore "$BUILD_SOURCESDIRECTORY/deps"

echo "=== Copying protos ==="
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
28 changes: 28 additions & 0 deletions eng/pack/scripts/rc_nix_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

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

cd workers
python -m pip install .
python -m pip install grpcio~=1.70.0
python -m pip install grpcio-tools~=1.70.0

python -m pip install . --no-compile --target "$BUILD_SOURCESDIRECTORY/deps"
python -m pip install grpcio~=1.70.0 --no-compile --target "$BUILD_SOURCESDIRECTORY/deps"
python -m pip install grpcio-tools~=1.70.0 --no-compile --target "$BUILD_SOURCESDIRECTORY/deps"

python -m pip install invoke
cd tests
python -m invoke -c test_setup build-protos

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

Write-Host "=== Upgrading pip and installing build dependencies ==="
python -m pip install --upgrade pip setuptools wheel cython

Write-Host "=== Cloning gRPC repo ==="
if (Test-Path grpc) {
Remove-Item -Recurse -Force grpc
}
git clone --recursive https://github.com/grpc/grpc

Write-Host "=== Building grpcio from source ==="
Set-Location grpc
$env:GRPC_PYTHON_BUILD_WITH_CYTHON = "1"

# Build the wheel into dist/
python -m pip wheel . -w dist

# Log contents of dist
Write-Host "=== Checking dist directory ==="
if (Test-Path dist) {
Get-ChildItem dist
} else {
Write-Host "dist/ directory not found!"
}

# Log and install grpc
$grpcWheel = Get-ChildItem dist\grpcio-*.whl | Select-Object -First 1
Write-Host "Built grpcio wheel: $($grpcWheel.Name)"
Write-Host "=== Install grpcio wheel $($grpcWheel.Name) into root ==="
$grpcWheel = Get-ChildItem dist\grpcio-*.whl | Select-Object -First 1
python -m pip install $grpcWheel.FullName

cd ..

# Change back to project root
Set-Location workers

Write-Host "=== Install other deps into root ==="
python -m pip install .
python -m pip install grpcio-tools==1.70.0

$depsPath = Join-Path -Path $env:BUILD_SOURCESDIRECTORY -ChildPath "deps"

# Install both grpc wheels into deps
Write-Host "=== Installing grpcio into deps/ ==="
python -m pip install $grpcWheel.FullName --target $depsPath

Write-Host "=== Installing other deps into deps/ ==="
python -m pip install --upgrade pip setuptools wheel cython --target $depsPath
python -m pip install . azure-functions --no-compile --target $depsPath --find-links ..\grpc\dist
python -m pip install grpcio-tools==1.70.0 --no-compile --target $depsPath --find-links ..\grpc\dist

Write-Host "=== Install invoke and build protos ==="
python -m pip install invoke
cd tests
python -m invoke -c test_setup build-protos

Write-Host "=== Copying .artifactignore ==="
cd ..
Copy-Item -Path ".artifactignore" -Destination $depsPath.ToString()

Write-Host "=== Copying protos ==="
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
}
29 changes: 28 additions & 1 deletion eng/pack/templates/macos_64_env_gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ 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 All @@ -45,7 +56,15 @@ steps:
disableAutoCwd: true
scriptPath: 'eng/pack/scripts/mac_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_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 Expand Up @@ -161,6 +180,14 @@ steps:
!werkzeug/debug/shared/debugger.js
!azure_functions_worker/**
!dateutil/**
!Cython/**
!__pycache__/**
!bin/**
!cython.py
!pip/**
!pyximport/**
!typing_extensions.py
!wheel/**
targetFolder: '$(Build.ArtifactStagingDirectory)'
condition: eq(variables['proxyWorker'], true)
displayName: 'Copy proxy_worker files'
Expand Down
19 changes: 19 additions & 0 deletions eng/pack/templates/nix_env_gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ 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 All @@ -46,6 +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')
- bash: |
pip install pip-audit
cd workers
Expand Down
27 changes: 27 additions & 0 deletions eng/pack/templates/win_env_gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ steps:
- task: UsePythonVersion@0
inputs:
versionSpec: ${{ parameters.pythonVersion }}
allowUnstable: true
architecture: ${{ parameters.architecture }}
addToPath: true
- powershell: |
Expand All @@ -23,6 +24,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 All @@ -45,6 +56,14 @@ steps:
inputs:
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')
- bash: |
pip install pip-audit
cd workers
Expand Down Expand Up @@ -160,6 +179,14 @@ steps:
!werkzeug\debug\shared\debugger.js
!dateutil\**
!azure_functions_worker\**
!Cython\**
!__pycache__\**
!bin\**
!cython.py
!pip\**
!pyximport\**
!typing_extensions.py
!wheel\**
targetFolder: '$(Build.ArtifactStagingDirectory)'
condition: eq(variables['proxyWorker'], true)
displayName: 'Copy proxy_worker files'
Expand Down
Loading
Loading