Skip to content

scttfrdmn/aws-marimo-sagemaker

Repository files navigation

aws-marimo-sagemaker — reactive notebooks, cloud power, built for SageMaker Studio

marimo on Amazon SageMaker Studio

Run marimo — the reactive Python notebook — on Amazon SageMaker Studio.

Python marimo License

Quick start

In a SageMaker Studio JupyterLab space, open a terminal and run:

curl -fsSL https://raw.githubusercontent.com/scttfrdmn/aws-marimo-sagemaker/main/start-marimo.sh | bash

Or, if you'd rather read it before running it:

git clone https://github.com/scttfrdmn/aws-marimo-sagemaker.git
cd aws-marimo-sagemaker
bash start-marimo.sh

It installs marimo (if needed), starts it, and prints a clickable link to open marimo in your browser. Click it.

The notebook renders, cells are editable, and running a cell returns output.

Open a specific notebook

bash start-marimo.sh my_notebook.py

Three notebooks to try are included:

  • notebook_basics.py — a minimal reactive demo. Extras: pip install plotly.
  • notebook_weather.py — reads NOAA weather data from S3, fits a seasonal model, and flags anomalous days live. Extras: pip install polars pyarrow s3fs scikit-learn altair.
  • notebook_ml.py — a full reactive ML workflow (filter → train → evaluate) with a peek at the SageMaker API. Extras: pip install pandas numpy scikit-learn plotly boto3.

Make it persist across restarts

Running the script each session works, but for regular use a Studio lifecycle configuration installs marimo and the bridge once, so they survive space restarts. See lifecycle-config/.

A custom Studio JupyterLab image can bake them in too. Either way, the bridge is required — it's what enables marimo to work on SageMaker.

How it works

marimo runs on localhost:2718. The bridge runs on 2719 — the port you open through SageMaker — and forwards to marimo.

Browser ──▶ SageMaker proxy ──▶ bridge ──▶ marimo
            /proxy/2719/        :2719       127.0.0.1:2718

For what the bridge does and why SageMaker needs it, see docs/why-the-bridge.md.

Requirements

  • A SageMaker Studio JupyterLab space (the current Studio experience).
  • Nothing beyond marimo — the bridge uses libraries marimo already installs (starlette, uvicorn, httpx, websockets).

Not supported

License

MIT — see LICENSE. marimo is Apache 2.0.