Skip to content

refactor(extras): move microvm into compute - #919

Merged
ParidelPooya merged 3 commits into
mainfrom
refactor/extras-compute-namespace
Nov 9, 2026
Merged

ParidelPooya merged 3 commits into
mainfrom
refactor/extras-compute-namespace

Conversation

@ParidelPooya

@ParidelPooya ParidelPooya commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What

The MicroVM operations move from aws_durable_execution_sdk_python_extras.microvm to aws_durable_execution_sdk_python_extras.compute.microvm.

A new ComputeError is the base class of MicrovmError. Both compute and compute.microvm export it.

from aws_durable_execution_sdk_python_extras.compute.microvm import (
    ComputeError,
    MicrovmConfig,
    microvm,
)

Why

Design

The public API change is the module path and one new base class. The options:

Option Matches JS Cost now Cost later
A. Keep extras.microvm no none the SDKs differ, or a move after publish with an alias
B. Move, and keep extras.microvm as an alias yes an alias module to maintain the alias must be deprecated and removed
C. Move, with no alias (this PR) yes none none
D. Move, with no ComputeError path only none a base class added after publish changes the error tree of a public API

C is chosen. A leaves the two SDKs with different layouts, or moves the problem to after the first publish. B keeps an alias for users that do not exist. D leaves the error trees of the two SDKs different.

ComputeError adds no behavior. It is a base class, like the JavaScript ComputeError. No operation raises it, so it is not registered with the SDK's error registry.

Evidence that nothing is published

  • PyPI returns 404 for aws-durable-execution-sdk-python-extras and aws-durable-execution-sdk-python-microvm-worker, checked on 2026-11-09 with https://pypi.org/pypi/<name>/json.
  • The repository has no tag and no GitHub release for the extras package.
  • So no release wrote a checkpoint with the old error types.
  • Unverified: a user that installed the package from a git ref of main and has an execution in flight. Such an execution replays its MicroVM error as a plain MicrovmError, as described below.

Change

  • git mv of microvm/ to compute/microvm/, and of tests/microvm/ to tests/compute/microvm/.
  • New compute/__init__.py and compute/errors.py with ComputeError(DurableOperationError).
  • MicrovmError now extends ComputeError.
  • Imports updated in the four MicroVM examples, the README, and docs/microvm.md. The README notes that every MicrovmError is a ComputeError.
  • The old module path is removed, with no alias.

Checkpoint note

The checkpointed error type is the module path plus the class name. So the error types of the MicroVM errors change, for example to aws_durable_execution_sdk_python_extras.compute.microvm.errors.MicrovmLaunchError. A checkpoint that an older build wrote replays its MicroVM error as a plain MicrovmError.

Tests whose expectations change

Each of these tests compares a checkpointed error type string. Only the module path in the string changes. The class and the behavior stay the same.

  • operation_test.py: test_raises_the_same_class_after_the_handler_stops_catching (...compute.microvm.errors.MicrovmJobFailedError).
  • operation_test.py: test_fails_at_once_when_get_microvm_is_denied (...compute.microvm.lifecycle.MicrovmStateError).
  • session_test.py: test_fails_at_once_when_the_state_check_is_denied (...compute.microvm.lifecycle.MicrovmStateError).
  • request_ids_test.py: the STATE_ERROR constant, which 7 tests use (...compute.microvm.lifecycle.MicrovmStateError).

New or changed checks:

  • errors_test.py: test_every_microvm_error_is_a_compute_error replaces test_every_microvm_error_is_a_durable_operation_error. It checks that ComputeError is a DurableOperationError, that MicrovmError is a ComputeError, and that both modules export the same class.
  • errors_test.py: test_registers_each_class_with_the_sdk also checks that each error rebuilt from its checkpointed type is a ComputeError. So a caller that catches ComputeError catches it on replay too.

Testing

  • The extras tests pass: 436 tests.
  • The MicroVM example tests pass, and the four examples import.
  • ruff format, ruff check, and mypy pass on the extras package.
  • The old path aws_durable_execution_sdk_python_extras.microvm raises ModuleNotFoundError.
  • No cloud e2e test raises a MicroVM error yet. A cloud test of ComputeError across a failed job needs a new failing-job example. It is left for a follow-up.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The MicroVM operations move from
aws_durable_execution_sdk_python_extras.microvm to
aws_durable_execution_sdk_python_extras.compute.microvm. This matches
the JavaScript subpath compute/microvm of the extras package. More
compute types can then sit next to MicroVM.

A new ComputeError is the base class of MicrovmError, as in
JavaScript. Catch it to handle a failure of any compute type.
compute and compute.microvm both export it.

The old module path is removed, with no alias. The package is not on
PyPI yet, so no user imports it.

The checkpointed error type is the module path and the class name.
So the error types of the MicroVM errors change. A checkpoint that an
older build wrote replays its MicroVM error as a plain MicrovmError.
No release wrote such a checkpoint.
@ParidelPooya
ParidelPooya deployed to ai-pr-review-runtime November 9, 2026 22:20 — with GitHub Actions Active
@ParidelPooya
ParidelPooya deployed to ai-pr-review-runtime November 9, 2026 22:21 — with GitHub Actions Active
@github-actions

This comment has been minimized.

The longer module path pushed the import past the line limit.
Replay rebuilds a MicroVM error from its checkpointed type. The
registry test now also checks that the rebuilt error is a
ComputeError. So a caller that catches ComputeError catches it on
replay too.
@ParidelPooya
ParidelPooya deployed to ai-pr-review-runtime November 9, 2026 22:29 — with GitHub Actions Active
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Codex AI review

Four approach findings remain:

  • Design note: packages/aws-durable-execution-sdk-python-extras/src/aws_durable_execution_sdk_python_extras/compute/errors.py:11
  • Compatibility evidence: packages/aws-durable-execution-sdk-python-extras/src/aws_durable_execution_sdk_python_extras/compute/microvm/errors.py:42
  • End-to-end coverage: packages/aws-durable-execution-sdk-python-extras/tests/compute/microvm/errors_test.py:111
  • Changed test expectations: packages/aws-durable-execution-sdk-python-extras/tests/compute/microvm/operation_test.py:631

Tests were not executed, as required by the read-only review constraints.

Suppressed repeats

  • arf_v1_cd7cbtk67tvao43c7bbod44btf — deferred (maintainer verdict)

Reviewed commit 08c2832823d559e54971426007c4d56cfed3ef8d. Workflow run

@ParidelPooya
ParidelPooya merged commit 6bfe300 into main Nov 9, 2026
77 of 78 checks passed
@ParidelPooya
ParidelPooya deleted the refactor/extras-compute-namespace branch November 9, 2026 22:51

This branch was successfully deployed

1 active deployment
ai-pr-review-runtime — 08c28328 Deployed Nov 9, 2026 by ParidelPooya via ai-pr-review / Codex review / Generate Codex review #2994
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants