Repository navigation
refactor(worker): rename microvm-worker to compute-worker - #922
Merged
Merged
Conversation
The worker package is renamed from microvm-worker to compute-worker. The MicroVM code moves to the microvm subpackage. The new import is aws_durable_execution_sdk_python_compute_worker.microvm. It exports the same names as the old top-level package. A later worker for another compute type can then be a sibling subpackage. The extras package uses the same compute.microvm layout. The worker is not on PyPI yet. So no published import breaks. The PyPI publish workflow is unchanged.
hln33
reviewed
Nov 9, 2026
hln33
left a comment
Contributor
There was a problem hiding this comment.
Looks good, just want some clarification on the changes within js_examples/run.py before approving
The js_examples harness builds a checkout of any JS ref. A ref from before the worker rename has only microvm-worker, and a ref from after it has only compute-worker. The comments now say so, and say why microvm-worker stays after the JS rename merges.
hln33
approved these changes
Nov 10, 2026
ParidelPooya
added a commit
to aws/aws-durable-execution-sdk-js
that referenced
this pull request
Nov 10, 2026
) ## What This PR renames the npm package `@aws/durable-execution-sdk-js-microvm-worker` to `@aws/durable-execution-sdk-js-compute-worker`. - The package directory becomes `packages/aws-durable-execution-sdk-js-compute-worker`. - The MicroVM worker moves to the `./microvm` subpath: `@aws/durable-execution-sdk-js-compute-worker/microvm`. - The subpath exports the same names as the old root entry. So a user changes only the import path. - The package version stays `0.1.0-alpha.0`. This PR does not change behavior. It adds no code for other compute types. Twin PR: aws/aws-durable-execution-sdk-python#922 ## Why 1. The worker runs jobs from durable functions on compute that is defined outside the function. Today the only compute type is the Lambda MicroVM. 2. Later compute types, such as EC2 or ECS, need their own worker code. A package named `microvm-worker` cannot hold that code without a misleading name. 3. The extras package already groups the operations under a compute namespace: `@aws/durable-execution-sdk-js-extras/compute/microvm`. So a `compute-worker` package with a `microvm` subpath matches that layout. 4. The old package is published on npm as `0.1.0-alpha.0`. It is experimental and alpha. So the rename is an allowed breaking change. The old version stays on npm unchanged. ## Design The PR compares three options. 1. Keep the name `microvm-worker`. A second compute type then needs a second worker package. The shared code would have to live in one of them or in a third package. 2. Rename to `compute-worker` with a `microvm` subpath. This is the chosen option. One package holds every compute type. A later compute type adds a sibling subpath. It can import the shared code from the package root. 3. Publish one package per compute type, plus a shared package. This adds a package to publish and version for each compute type. No second compute type exists today. So this cost buys nothing yet. ## Change - `git mv` moves the package directory, the sources, and the tests. So history follows the files. - `src/microvm/` holds `index.ts`, `worker.ts`, `payload.ts`, and the tests. - `src/callback-reporter.ts` stays at the top of `src/`. It imports only `@aws-sdk/client-lambda`. It has no MicroVM logic. Its comments describe MicroVM behavior, and those comments stay. - The root entry `src/index.ts` exports only the callback reporter names: `CallbackReporter`, `CallbackReporterOptions`, `isTerminalCallbackError`, `MAX_CALLBACK_RESULT_BYTES`, `ResultSerializationError`, and `ResultTooLargeError`. The `./microvm` subpath re-exports them too. - The Python twin keeps `callback_reporter` under `microvm`. The Python module takes a MicroVM-named logger type. The JS module takes no such type. So the JS module can move and the Python module cannot without an API change. - `package.json` adds the `./microvm` entry to `exports`. It uses the same shape as the `./compute/microvm` entry in the extras package. `rollup.config.mjs` adds the `microvm` input, as the extras package does. Rollup puts the shared code in a `callback-reporter` chunk. ### References updated - Root `package.json`: the `build` and `test` scripts. - `package-lock.json`: regenerated with `npm install`. - `.github/workflows/unit-tests.yml`: the `extras` shard and its comment. - `.github/workflows/lintcommit.js`: the scope `microvm-worker` becomes `compute-worker`. - `.github/workflows/iterate-publish-npm.sh` and `RELEASING.md`: the comment about packages that wait for a first publication. The worker was not in the publish list before. This PR does not add it. - `packages/aws-durable-execution-sdk-js-telemetry-mcp/src/packaging.test.ts`: the list of packages whose first publication is deferred. - Extras package: the dev dependency, the `pretest` script, the contract and composed tests, the e2e app and script, the TSDoc in `request.ts` and `types.ts`, the README, and the docs. - Examples package: the dev dependency and `microvm-image/app.ts`. - The root README, the worker README, and `docs/worker.md`. - `CHANGELOG.md`: a new entry under Unreleased. Old entries keep the old name. ## Checkpoint and error types The worker sends `error.name` as the `ErrorType` of a failed callback. No error class name changes in this PR. No error type string contains the package name or a path. So the durable execution history and replay see the same values as before. ## Follow-ups - After the new package is released, a maintainer should deprecate the old package: `npm deprecate @aws/durable-execution-sdk-js-microvm-worker "Renamed to @aws/durable-execution-sdk-js-compute-worker"` - The new package needs the same first-publication setup that the old package waited for. The publish script still defers it. ## Testing Run on Node 24.22.2. - `npm ci` and root `npm run build`: pass. - Compute worker tests: 4 files, 305 tests pass. - Extras tests: 26 files, 427 tests pass. - Examples tests: 127 files pass, 4 skipped. 277 tests pass, 4 skipped. - Telemetry MCP tests, which include the packaging test: 18 files, 553 tests pass. - `npm run lint:ci` (biome): pass. - `node .github/workflows/lintcommit.js test`: 30 tests pass. - `verify-declared-files-shipped.mjs`: the compute worker pack includes all 6 files that `package.json` points at. - Resolution from the extras package, with `require` and `import`: - `@aws/durable-execution-sdk-js-compute-worker` resolves with 5 runtime exports. - `@aws/durable-execution-sdk-js-compute-worker/microvm` resolves with 14 runtime exports. The old root entry had 14. - `@aws/durable-execution-sdk-js-microvm-worker` fails with `MODULE_NOT_FOUND`. - `git grep` for `microvm-worker` finds only `CHANGELOG.md`: the new entry and old entries.
ParidelPooya
marked this pull request as ready for review
November 10, 2026 18:21
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
This PR renames the worker package from
aws-durable-execution-sdk-python-microvm-workertoaws-durable-execution-sdk-python-compute-worker. The MicroVM code moves to themicrovmsubpackage.aws_durable_execution_sdk_python_microvm_worker.aws_durable_execution_sdk_python_compute_worker.microvm.compute_worker.microvmexports the same 23 names as the old top-level package. So a user changes only the import path.aws_durable_execution_sdk_python_compute_workerexports only__version__.The PR changes no behavior other than the names listed under "Visible name changes".
Twin PR: aws/aws-durable-execution-sdk-js#1204
Why
aws_durable_execution_sdk_python_extras.compute.microvm. So the worker now matches extras.Design
We compared three options.
microvm-worker. A worker for another compute type would then need a second package. Code that every worker shares, such as callback reporting, would then live in a MicroVM-named package or be copied.compute-workerwith amicrovmsubpackage. This is the chosen option. One package holds every compute type. A later compute type adds a subpackage. Shared code can move to the top level when a second compute type needs it.Change
git mvmoves the package directory, the source modules, and the tests. So history follows the files.src/aws_durable_execution_sdk_python_compute_worker/microvm/holds every module.__about__.pyandpy.typedstay at the package top level.tests/microvm/holds the test modules.tests/conftest.pystays at the top, so every subdirectory uses it.Shared modules
The brief named three candidates for the top level:
callback_reporter,heartbeats, andlogger. Each one stays undermicrovm. This PR does not split any module.loggerdefines the public typeMicrovmWorkerLogger. A MicroVM-named type at the compute-neutral top level would need a rename. A rename changes the public API. Sologgerstays undermicrovm.callback_reportertakes aMicrovmWorkerLoggerargument. Its docstrings describe MicroVM image snapshots and MicroVM credentials. If it moved to the top level, it would import frommicrovm. So it stays undermicrovm.heartbeatsimportsis_finite_numberfrom the MicroVMpayloadmodule. Its jitter design exists because Lambda restores many MicroVMs from one snapshot. So it stays undermicrovm.Visible name changes
aws-durable-execution-sdk-python-microvm-workerbecomesaws-durable-execution-sdk-python-compute-worker.aws_durable_execution_sdk_python_microvm_workerbecomesaws_durable_execution_sdk_python_compute_worker.microvm. The name follows the new module path.Serverheader of the worker:aws-durable-execution-sdk-python-microvm-workerbecomesaws-durable-execution-sdk-python-compute-worker. The extras composed test checks this header, and the PR updates that test.dev-microvm-workerbecomesdev-compute-worker.References updated
pyproject.toml: pytesttestpaths, thedev-extrasworkspace members, thedev-compute-workerenv, and ruffknown-first-party.pyproject.toml: the distribution name, wheel packages, legal-file targets, version path, coverage source, and ruffknown-first-party..github/scripts/type-checks.sh: the mypy paths..github/scripts/js_examples/run.py: the JS build list now includespackages/aws-durable-execution-sdk-js-compute-worker. The list keepspackages/aws-durable-execution-sdk-js-microvm-worker. A JS ref has at most one of the two directories. The script already skips an optional directory that a ref does not have. So the harness builds JS refs from before and after the JS rename..github/scripts/tests/test_js_examples.pyuses the new directory.AGENTS.md: the package list.README.md: the title, a paragraph about the subpackage layout, the install name, imports, the logger name, and links.docs/worker.mdkeeps its MicroVM text.README.md,docs/microvm.md, docstrings incompute/microvm/config.py,job.py, andrequest.py, and the imports in three tests.microvm-image/app.py,scripts/ensure_microvm_image.py,test/test_microvm_image_app.py, andtest/README.md.@aws/durable-execution-sdk-js-compute-worker. The JS twin PR makes that rename. Until it merges, the JS GitHub link inextras/docs/microvm.mdpoints to a directory that does not exist yet..github/workflows/pypi-publish.ymlis unchanged. Publishing waits for a PyPI pending publisher for the new name.The repository has no CHANGELOG files, lock files, release-please config, or changesets. So the PR changes none.
Checkpoint and error-type note
The worker reports a failed job with an
ErrorType. The worker setsErrorTypetotype(error).__name__. That value is the class name only. It holds no module path. So the move changes noErrorTypestring. No code in the worker reads__module__or__qualname__.Follow-ups
aws-durable-execution-sdk-python-compute-worker. Then add the package to.github/workflows/pypi-publish.ymlin a separate PR.npm deprecate @aws/durable-execution-sdk-js-microvm-worker "Renamed to @aws/durable-execution-sdk-js-compute-worker".Testing
All checks ran locally on Python 3.13 in a uv venv with editable installs of core, testing, extras, compute-worker, and examples.
.github/scripts/tests/test_js_examples.py: 65 passed.hatch fmt --checkpasses in the worker, extras, and examples packages.import aws_durable_execution_sdk_python_microvm_workerraisesModuleNotFoundError.microvm.__all__equals the old top-level__all__, and every name resolves.hatch build -t wheelbuildsaws_durable_execution_sdk_python_compute_worker-0.0.1-py3-none-any.whl. The wheel contains themicrovmsubpackage,LICENSE, andNOTICE.git grepfor the old names finds only the JS directory name inrun.py, which the harness keeps for older JS refs.