Skip to content

run-bench w/ thread-blocking workflows #829

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- "releases/*"

jobs:

nightly:
uses: ./.github/workflows/run-bench.yml

# Build and test the project
build-lint-test:
strategy:
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/run-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,3 @@ jobs:
- run: poe run-bench --workflow-count 100 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }}
- run: poe run-bench --workflow-count 100 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }}
- run: poe run-bench --workflow-count 100 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }}

- run: poe run-bench --workflow-count 1000 --max-cached-workflows 1000 --max-concurrent 1000 ${{ inputs.sandbox-arg }}
- run: poe run-bench --workflow-count 1000 --max-cached-workflows 1000 --max-concurrent 1000 ${{ inputs.sandbox-arg }}
- run: poe run-bench --workflow-count 1000 --max-cached-workflows 1000 --max-concurrent 1000 ${{ inputs.sandbox-arg }}

- run: poe run-bench --workflow-count 1000 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }}
- run: poe run-bench --workflow-count 1000 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }}
- run: poe run-bench --workflow-count 1000 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }}

- run: poe run-bench --workflow-count 10000 --max-cached-workflows 10000 --max-concurrent 10000 ${{ inputs.sandbox-arg }}
- run: poe run-bench --workflow-count 10000 --max-cached-workflows 10000 --max-concurrent 10000 ${{ inputs.sandbox-arg }}

- run: poe run-bench --workflow-count 10000 --max-cached-workflows 1000 --max-concurrent 1000 ${{ inputs.sandbox-arg }}
- run: poe run-bench --workflow-count 10000 --max-cached-workflows 1000 --max-concurrent 1000 ${{ inputs.sandbox-arg }}
18 changes: 17 additions & 1 deletion scripts/run_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ async def bench_activity(name: str) -> str:
return f"Hello, {name}!"


@workflow.defn
class DeadlockInterruptibleWorkflow:
@workflow.run
async def run(self) -> None:
# Infinite loop, which is interruptible via PyThreadState_SetAsyncExc
while True:
pass


async def main():
logging.basicConfig(
format="%(asctime)s.%(msecs)03d %(levelname)-8s %(message)s",
Expand Down Expand Up @@ -86,6 +95,13 @@ async def report_mem():
logger.debug("Starting %s workflows", args.workflow_count)
pre_start_seconds = time.monotonic()
handles = [
await env.client.start_workflow(
DeadlockInterruptibleWorkflow.run,
id=f"deadlock-interruptible-workflow-{i}-{uuid.uuid4()}",
task_queue=task_queue,
)
for i in range(1)
] + [
await env.client.start_workflow(
BenchWorkflow.run,
f"user-{i}",
Expand All @@ -101,7 +117,7 @@ async def report_mem():
async with Worker(
env.client,
task_queue=task_queue,
workflows=[BenchWorkflow],
workflows=[BenchWorkflow, DeadlockInterruptibleWorkflow],
activities=[bench_activity],
workflow_runner=SandboxedWorkflowRunner()
if args.sandbox
Expand Down
Loading