Repository navigation
refactor(extras): move microvm into compute - #919
Merged
Merged
Conversation
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.
This comment has been minimized.
This comment has been minimized.
The longer module path pushed the import past the line limit.
ParidelPooya
had a problem deploying
to
ai-pr-review-runtime
November 9, 2026 22:27 — with
GitHub Actions
Failure
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.
Contributor
Codex AI reviewFour approach findings remain:
Tests were not executed, as required by the read-only review constraints. Suppressed repeats
Reviewed commit |
hln33
approved these changes
Nov 9, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The MicroVM operations move from
aws_durable_execution_sdk_python_extras.microvmtoaws_durable_execution_sdk_python_extras.compute.microvm.A new
ComputeErroris the base class ofMicrovmError. Bothcomputeandcompute.microvmexport it.Why
@aws/durable-execution-sdk-js-extras/compute/microvm, with aComputeErrorbase, in refactor(extras): compute/microvm subpath, ComputeError, optional AWS SDK clients aws-durable-execution-sdk-js#1166. So the two SDKs now match.compute.Design
The public API change is the module path and one new base class. The options:
extras.microvmextras.microvmas an aliasComputeErrorC 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.
ComputeErroradds no behavior. It is a base class, like the JavaScriptComputeError. No operation raises it, so it is not registered with the SDK's error registry.Evidence that nothing is published
aws-durable-execution-sdk-python-extrasandaws-durable-execution-sdk-python-microvm-worker, checked on 2026-11-09 withhttps://pypi.org/pypi/<name>/json.mainand has an execution in flight. Such an execution replays its MicroVM error as a plainMicrovmError, as described below.Change
git mvofmicrovm/tocompute/microvm/, and oftests/microvm/totests/compute/microvm/.compute/__init__.pyandcompute/errors.pywithComputeError(DurableOperationError).MicrovmErrornow extendsComputeError.docs/microvm.md. The README notes that everyMicrovmErroris aComputeError.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 plainMicrovmError.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: theSTATE_ERRORconstant, which 7 tests use (...compute.microvm.lifecycle.MicrovmStateError).New or changed checks:
errors_test.py:test_every_microvm_error_is_a_compute_errorreplacestest_every_microvm_error_is_a_durable_operation_error. It checks thatComputeErroris aDurableOperationError, thatMicrovmErroris aComputeError, and that both modules export the same class.errors_test.py:test_registers_each_class_with_the_sdkalso checks that each error rebuilt from its checkpointed type is aComputeError. So a caller that catchesComputeErrorcatches it on replay too.Testing
ruff format,ruff check, andmypypass on the extras package.aws_durable_execution_sdk_python_extras.microvmraisesModuleNotFoundError.ComputeErroracross 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.