Skip to content

feat: x86_64 builds via LAMBDA_ARCH, one-command jolt demo - #2

Merged
burinc merged 1 commit into
b12n-oss:mainfrom
codegod100:feat/x86_64-and-demo
Sep 11, 2026
Merged

burinc merged 1 commit into
b12n-oss:mainfrom
codegod100:feat/x86_64-and-demo

Conversation

@codegod100

Copy link
Copy Markdown

Why

jolt image was pinned to linux/arm64. On an x86_64 Linux Docker host without qemu, the first RUN fails with exec /bin/sh: exec format error. And jolt deploy always created an arm64 function, so an x86_64 binary couldn't be deployed even if you built one by hand.

What

  • LAMBDA_ARCH (bb.edn): jolt image builds under linux/amd64 when LAMBDA_ARCH=x86_64 (or amd64). arm64 stays the default; any other value exits before Docker runs.
  • Architecture-aware deploy (script/aws_lifecycle.clj): reads the architecture from dist/bootstrap's ELF header and passes --architectures on both create-function and update-function-code. A deploy always matches the last build, and switching an existing function's architecture works.
  • jolt demo (script/demo.clj): runs image, deploy and invoke in order. It first checks docker/aws are on PATH, AWS region and credentials (printing the target account), Docker daemon access, and that Docker can run containers for the target platform, so a missing piece stops it before the build or any AWS change.
  • Docs: README, al2023-build.md (arm64 and x86_64, the emulator requirement), getting-started.md, CHANGELOG. Drops "x86_64 builds" from the README's extension points.

No changes to the Dockerfile, the runtime, or the handler.

Testing

  • jolt test: 5 tests, 0 failures.
  • jolt demo end to end on x86_64 Linux (LAMBDA_ARCH=x86_64): built, deployed a new provided.al2023 x86_64 function in us-west-2, invoked successfully (init 935 ms, 311 MB used).
  • Each jolt demo prerequisite check triggered and printed its fix: missing aws, no region, no credentials, Docker permission denied, bad LAMBDA_ARCH.
  • bootstrap-arch against a real x86_64 binary, a synthetic arm64 ELF header, and a rejected 32-bit ARM header.

Not exercised: the arm64 path on this branch (no arm64 host or emulator), and update-function-code switching an existing function's architecture.

jolt probe wasn't run: joltc isn't installed on the test machine. This PR doesn't touch the probe, the runtime, or the mock.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CsPjhLv9dHzRwCbxB81Wco

`jolt image` was pinned to linux/arm64, which fails with `exec format
error` on an x86_64 Linux Docker host without qemu, and `jolt deploy`
always created an arm64 function.

- LAMBDA_ARCH=x86_64 (or amd64) builds under linux/amd64. arm64 stays
  the default.
- deploy reads the architecture from dist/bootstrap's ELF header and
  passes --architectures on both create and update, so it always matches
  the last build and can switch an existing function.
- `jolt demo` runs image, deploy and invoke in order, after checking
  tools, AWS credentials and region, Docker access, and that Docker can
  run containers for the target platform.

Verified end to end on x86_64 Linux: built, deployed to provided.al2023
x86_64 in us-west-2, and invoked successfully.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CsPjhLv9dHzRwCbxB81Wco
@burinc
burinc merged commit 6f6b326 into b12n-oss:main Sep 11, 2026
1 check passed
burinc added a commit that referenced this pull request Sep 11, 2026
PR #2 (merged today) updated README's quickstart, al2023-build.md, and
CHANGELOG.md for LAMBDA_ARCH/jolt demo, but missed four spots:

- architecture.md's whole-flow diagram still said the Lambda function was
  unconditionally arm64, and never mentioned jolt demo at all.
- README's own "How it works" diagram had the same unconditional-arm64
  label.
- Both contributing docs' PR checklist asked what memory tier a change to
  aws_lifecycle.clj/bench_run.clj was tested against, but not which
  architecture, even though aws_lifecycle.clj now reads --architectures
  off the built binary's ELF header rather than a hardcoded string.

Rebuilt docs/site.edn locally (bb site:build) to confirm the diagram
still renders and no template variable broke.
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