Skip to content

Commit 87de6e2

Browse files
authored
Use ESRP build, sign, release (#142)
* Build + Release pipelines v1 (test) * Pip auth * Loosen filter for test * Bump versions, revert testing changes * Remove old comment * PR feedback
1 parent fc5004b commit 87de6e2

7 files changed

Lines changed: 234 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## Unreleased
99

10+
## v1.5.0
11+
1012
ADDED
1113

1214
- Added `ReplaySafeLogger` and `OrchestrationContext.create_replay_safe_logger()`

durabletask-azuremanaged/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## Unreleased
99

10+
## v1.5.0
11+
12+
- Updates base dependency to durabletask v1.5.0
1013
- Added optional `interceptors`, `channel`, and `channel_options` parameters to
1114
`DurableTaskSchedulerClient`, `AsyncDurableTaskSchedulerClient`, and
1215
`DurableTaskSchedulerWorker` to allow combining custom gRPC interceptors with

durabletask-azuremanaged/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
99

1010
[project]
1111
name = "durabletask.azuremanaged"
12-
version = "1.4.0"
12+
version = "1.5.0"
1313
description = "Durable Task Python SDK provider implementation for the Azure Durable Task Scheduler"
1414
keywords = [
1515
"durable",
@@ -26,13 +26,13 @@ requires-python = ">=3.10"
2626
license = {file = "LICENSE"}
2727
readme = "README.md"
2828
dependencies = [
29-
"durabletask>=1.4.0",
29+
"durabletask>=1.5.0",
3030
"azure-identity>=1.19.0"
3131
]
3232

3333
[project.optional-dependencies]
3434
azure-blob-payloads = [
35-
"durabletask[azure-blob-payloads]>=1.4.0"
35+
"durabletask[azure-blob-payloads]>=1.5.0"
3636
]
3737

3838
[project.urls]

eng/ci/official-build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
variables:
2+
- template: ci/variables/cfs.yml@eng
3+
4+
trigger:
5+
batch: true
6+
branches:
7+
include:
8+
- main
9+
10+
# CI only, does not trigger on PRs.
11+
pr: none
12+
13+
schedules:
14+
# Build nightly to catch any new CVEs and report SDL often.
15+
# We are also required to generate CodeQL reports weekly, so this
16+
# helps us meet that.
17+
- cron: "0 5 * * *"
18+
displayName: Nightly Build
19+
branches:
20+
include:
21+
- main
22+
always: true
23+
24+
resources:
25+
repositories:
26+
- repository: 1es
27+
type: git
28+
name: 1ESPipelineTemplates/1ESPipelineTemplates
29+
ref: refs/tags/release
30+
- repository: eng
31+
type: git
32+
name: engineering
33+
ref: refs/tags/release
34+
35+
extends:
36+
template: v1/1ES.Official.PipelineTemplate.yml@1es
37+
parameters:
38+
pool:
39+
name: 1es-pool-azfunc
40+
image: 1es-ubuntu-22.04
41+
os: linux
42+
${{ if eq( variables['Build.Reason'], 'Schedule' ) }}:
43+
demands:
44+
- Priority -equals Low
45+
sdl:
46+
sourceAnalysisPool:
47+
name: 1es-pool-azfunc
48+
image: 1es-windows-2022
49+
os: windows
50+
51+
stages:
52+
- stage: BuildAndSign
53+
dependsOn: []
54+
jobs:
55+
- template: /eng/templates/build.yml@self

eng/ci/release.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
pr: none
2+
trigger: none
3+
4+
resources:
5+
repositories:
6+
- repository: 1ESPipelineTemplates
7+
type: git
8+
name: 1ESPipelineTemplates/1ESPipelineTemplates
9+
ref: refs/tags/release
10+
pipelines:
11+
- pipeline: DurableTaskPythonBuildPipeline
12+
source: durabletask-python.official
13+
14+
extends:
15+
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
16+
parameters:
17+
pool:
18+
name: 1es-pool-azfunc
19+
image: 1es-ubuntu-22.04
20+
os: linux
21+
22+
stages:
23+
- stage: release
24+
jobs:
25+
- job: durabletask
26+
displayName: "Release durabletask"
27+
templateContext:
28+
type: releaseJob
29+
isProduction: true
30+
inputs:
31+
- input: pipelineArtifact
32+
pipeline: DurableTaskPythonBuildPipeline
33+
artifactName: drop
34+
targetPath: $(System.DefaultWorkingDirectory)/drop
35+
36+
steps:
37+
- task: SFP.release-tasks.custom-build-release-task.EsrpRelease@9
38+
displayName: "ESRP Release durabletask"
39+
inputs:
40+
connectedservicename: "dtfx-internal-esrp-prod"
41+
usemanagedidentity: true
42+
keyvaultname: "durable-esrp-akv"
43+
signcertname: "dts-esrp-cert"
44+
clientid: "0b3ed1a4-0727-4a50-b82a-02c2bd9dec89"
45+
intent: "PackageDistribution"
46+
contenttype: "PyPi"
47+
contentsource: "Folder"
48+
folderlocation: "$(System.DefaultWorkingDirectory)/drop/buildoutputs/durabletask"
49+
waitforreleasecompletion: true
50+
# Auto-populate from the build queuer's identity so we don't
51+
# hardcode personal emails in source. ESRP will send the
52+
# release notification / approval link to whoever clicked
53+
# "Run pipeline". This matches the pattern used by
54+
# Azure/azure-sdk-for-python and microsoft/mcp pipelines.
55+
owners: $(Build.RequestedForEmail)
56+
approvers: $(Build.RequestedForEmail)
57+
serviceendpointurl: "https://api.esrp.microsoft.com"
58+
mainpublisher: "durabletask-java"
59+
domaintenantid: "33e01921-4d64-4f8c-a055-5bdaffd5e33d"
60+
61+
- job: durabletask_azuremanaged
62+
displayName: "Release durabletask-azuremanaged"
63+
templateContext:
64+
type: releaseJob
65+
isProduction: true
66+
inputs:
67+
- input: pipelineArtifact
68+
pipeline: DurableTaskPythonBuildPipeline
69+
artifactName: drop
70+
targetPath: $(System.DefaultWorkingDirectory)/drop
71+
72+
steps:
73+
- task: SFP.release-tasks.custom-build-release-task.EsrpRelease@9
74+
displayName: "ESRP Release durabletask-azuremanaged"
75+
inputs:
76+
connectedservicename: "dtfx-internal-esrp-prod"
77+
usemanagedidentity: true
78+
keyvaultname: "durable-esrp-akv"
79+
signcertname: "dts-esrp-cert"
80+
clientid: "0b3ed1a4-0727-4a50-b82a-02c2bd9dec89"
81+
intent: "PackageDistribution"
82+
contenttype: "PyPi"
83+
contentsource: "Folder"
84+
folderlocation: "$(System.DefaultWorkingDirectory)/drop/buildoutputs/durabletask-azuremanaged"
85+
waitforreleasecompletion: true
86+
owners: $(Build.RequestedForEmail)
87+
approvers: $(Build.RequestedForEmail)
88+
serviceendpointurl: "https://api.esrp.microsoft.com"
89+
mainpublisher: "durabletask-java"
90+
domaintenantid: "33e01921-4d64-4f8c-a055-5bdaffd5e33d"

eng/templates/build.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
jobs:
2+
- job: BuildAndSign
3+
displayName: "Build and sign"
4+
templateContext:
5+
outputs:
6+
- output: pipelineArtifact
7+
path: $(Build.ArtifactStagingDirectory)
8+
artifact: drop
9+
sbomBuildDropPath: "$(System.DefaultWorkingDirectory)"
10+
sbomPackageName: "Durable Task Python SBOM"
11+
12+
steps:
13+
- checkout: self
14+
15+
- task: UsePythonVersion@0
16+
displayName: "Use Python 3.12"
17+
inputs:
18+
versionSpec: "3.12"
19+
addToPath: true
20+
21+
# The 1ES pool is network-isolated, so direct pypi.org access is blocked.
22+
# Authenticate pip to an ADO Artifacts feed that proxies PyPI as upstream.
23+
- task: PipAuthenticate@1
24+
displayName: "Pip Authenticate"
25+
inputs:
26+
artifactFeeds: "internal/PythonSDK_Internal_PublicPackages"
27+
28+
# Install build + lint + test tooling
29+
- script: |
30+
python -m pip install --upgrade pip
31+
python -m pip install build flake8 pytest pytest-asyncio aiohttp
32+
displayName: "Install build tooling"
33+
34+
# Lint core SDK
35+
- script: flake8 .
36+
displayName: "flake8: durabletask"
37+
workingDirectory: durabletask
38+
39+
# Lint azuremanaged provider
40+
- script: flake8 .
41+
displayName: "flake8: durabletask-azuremanaged"
42+
workingDirectory: durabletask-azuremanaged
43+
44+
# Build sdist + wheel for durabletask (core SDK)
45+
- script: |
46+
python -m build --sdist --wheel --outdir $(Build.ArtifactStagingDirectory)/buildoutputs/durabletask .
47+
displayName: "Build durabletask (sdist + wheel)"
48+
49+
# Build sdist + wheel for durabletask-azuremanaged
50+
- script: |
51+
python -m build --sdist --wheel --outdir $(Build.ArtifactStagingDirectory)/buildoutputs/durabletask-azuremanaged ./durabletask-azuremanaged
52+
displayName: "Build durabletask-azuremanaged (sdist + wheel)"
53+
54+
# List staged outputs for visibility in logs
55+
- script: |
56+
ls -la $(Build.ArtifactStagingDirectory)/buildoutputs/durabletask
57+
ls -la $(Build.ArtifactStagingDirectory)/buildoutputs/durabletask-azuremanaged
58+
displayName: "List build outputs"
59+
60+
# Install the built wheels and run unit tests against them. We exclude
61+
# tests marked `dts` (require the Durable Task Scheduler emulator) and
62+
# `azurite` (require the Azurite blob emulator) since those external
63+
# services aren't provisioned in this network-isolated pool. The full
64+
# matrix (including emulator-backed tests) runs in GitHub Actions on
65+
# PRs to main and main itself; this step is defense-in-depth to ensure
66+
# the artifacts we're about to ship are at least importable and pass
67+
# the pure-Python unit tests.
68+
- script: |
69+
set -e
70+
python -m pip install $(Build.ArtifactStagingDirectory)/buildoutputs/durabletask/*.whl
71+
python -m pip install $(Build.ArtifactStagingDirectory)/buildoutputs/durabletask-azuremanaged/*.whl
72+
displayName: "Install built wheels"
73+
74+
- script: pytest -m "not dts and not azurite" --verbose
75+
displayName: "pytest: durabletask (unit tests, no emulators)"
76+
workingDirectory: tests/durabletask
77+
78+
- script: pytest -m "not dts" --verbose
79+
displayName: "pytest: durabletask-azuremanaged (unit tests, no emulators)"
80+
workingDirectory: tests/durabletask-azuremanaged

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
99

1010
[project]
1111
name = "durabletask"
12-
version = "1.4.0"
12+
version = "1.5.0"
1313
description = "A Durable Task Client SDK for Python"
1414
keywords = [
1515
"durable",

0 commit comments

Comments
 (0)