Skip to content

Commit

Permalink
working package compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Victoria Hall committed Jan 29, 2025
1 parent 3f1a774 commit ecf4d99
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 33 deletions.
3 changes: 0 additions & 3 deletions eng/ci/official-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ extends:
- stage: Build
jobs:
- template: /eng/templates/official/jobs/build-artifacts.yml@self
- stage: Format
jobs:
- template: /eng/templates/official/jobs/format-artifacts.yml@self
- stage: RunUnitTests
dependsOn: Build
jobs:
Expand Down
8 changes: 2 additions & 6 deletions eng/scripts/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@ python -m pip install --upgrade pip
python -m pip install -U azure-functions --pre
python -m pip install -U -e .[dev]

if [[ $1 != "3.7" ]]; then
python -m pip install --pre -U -e .[test-http-v2]
fi
if [[ $1 != "3.7" && $1 != "3.8" ]]; then
python -m pip install --pre -U -e .[test-deferred-bindings]
fi
python -m pip install --pre -U -e .[test-http-v2]
python -m pip install --pre -U -e .[test-deferred-bindings]
4 changes: 2 additions & 2 deletions eng/templates/jobs/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
os: linux

variables:
# Extract the version number from the branch name
pythonVersion: $[substring(variables['Build.SourceBranchName'], 4, 2)] # Extract last two digits from dev-xxx
# Extract the last two digits from the branch name
pythonVersion: $[substring(variables['Build.SourceBranchName'], 4, 2)]

steps:
- script: |
Expand Down
42 changes: 24 additions & 18 deletions eng/templates/official/jobs/aggregate-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,32 @@ jobs:
name: 1es-pool-azfunc
image: 1es-ubuntu-22.04
os: linux

templateContext:
outputParentDirectory: $(Build.ArtifactStagingDirectory)
outputs:
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/final_package
artifactName: "azure-functions-worker"

steps:
- task: DownloadBuildArtifacts@0
# Add download task for each artifact
- task: DownloadPipelineArtifact@2
displayName: 'Download Python Worker Artifact'
inputs:
buildType: 'specific'
project: $(System.TeamProject)
pipeline: 652 # official build pipeline ID
buildVersionToDownload: 'specific'
specificBuildId: $(BuildId1) # exact build ID
downloadPath: $(Build.ArtifactStagingDirectory)
displayName: 'Download Artifacts from Specific Build'

buildType: specific
project: 'internal'
definition: 652
buildVersionToDownload: specific
pipelineId: $(BuildId1)
artifactName: 'azure-functions-worker-py313'
targetPath: "azure-functions-worker-py313"
# Compiles the python packages
- script: |
# Assuming each branch build produced a wheel or tar.gz, merge them.
# This can depend on your packaging logic.
mkdir -p $(Build.ArtifactStagingDirectory)/final_package
cp $(Build.ArtifactStagingDirectory)/dev-*/dist/* $(Build.ArtifactStagingDirectory)/dist/
mkdir -p $(Build.SourcesDirectory)/final_package
cp $(Build.SourcesDirectory)/azure-functions-worker-py3*/*.whl $(Build.SourcesDirectory)/final_package/
displayName: 'Merge and Compile Python Packages'
- publish: $(Build.ArtifactStagingDirectory)/dist
artifact: azure-functions-worker
displayName: 'Publish Final Python Package'

- script: |
echo "Contents of final_package folder:"
ls -al $(Build.SourcesDirectory)/final_package
displayName: 'Verify folder contents post compilation'
8 changes: 4 additions & 4 deletions eng/templates/official/jobs/build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:

variables:
# Extract the version number from the branch name
pythonVersion: $[substring(variables['Build.SourceBranchName'], 4, 2)] # Extract last two digits from dev-xxx
pythonVersion: $[substring(variables['Build.SourceBranchName'], 4, 2)]

templateContext:
outputParentDirectory: $(Build.c)
outputParentDirectory: $(Build.ArtifactStagingDirectory)
outputs:
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/dist
artifactName: "azure-functions-worker"
artifactName: "azure-functions-worker-py3$(pythonVersion)"

steps:
- script: |
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
package_version=$(echo $branch_name | sed 's|^release/\([^/]*\)-.*|\1|')
if [[ ! "$package_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([a-zA-Z]+[0-9]*)?$ ]]; then
echo "Invalid package version detected. Setting to default: 1.0.0a13"
echo "Invalid package version detected. Setting to default: 1.0.0"
package_version="1.0.0"
fi
Expand Down

0 comments on commit ecf4d99

Please sign in to comment.