Files
stack/infra/images/notebooks.Dockerfile
kert 31c430388b
Some checks failed
CI / skinny-install (aco) (push) Successful in 52s
CI / skinny-install (api) (push) Successful in 31s
CI / skinny-install (bcda) (push) Successful in 27s
CI / skinny-install (bib) (push) Successful in 27s
CI / skinny-install (bls) (push) Successful in 21s
CI / skinny-install (ccw) (push) Successful in 22s
CI / skinny-install (conf) (push) Successful in 25s
CI / skinny-install (cli) (push) Successful in 48s
CI / skinny-install (cms) (push) Successful in 25s
CI / skinny-install (pfs) (push) Successful in 24s
CI / skinny-install (rex) (push) Successful in 23s
CI / lint-test (push) Successful in 6m1s
Infra CI / notebooks (push) Successful in 6s
Infra CI / zotero (push) Successful in 6s
Infra CI / docs (push) Successful in 13s
Infra CI / api (push) Successful in 9s
Infra CI / mc (push) Successful in 6s
Package Supply Chain / pkg-supply-chain (push) Failing after 27s
Deploy / build-scan-report (push) Successful in 3m59s
refactor: separate notebooks content from server config
Move marimo server config, snippets, and patched assets out of
notebooks/ into infra/marimo/, keeping notebooks/ as pure .py content.

- infra/marimo/marimo.toml: merged authoritative config (was split
  across .marimo.toml and .marimo-config/marimo.toml)
- infra/marimo/snippets/: 10 code templates (was notebooks/snippets/)
- infra/marimo/home-page-patched.js: custom home page (was in notebooks/)
- Deleted duplicate loch.css (already served from assets/css/marimo.css)
- Updated compose.yml volume mounts, Dockerfile, stack.toml path_filter
- 18 layout tests enforce separation going forward

Closes #214, closes #215, closes #216, closes #217, closes #218
2026-03-24 21:43:04 -04:00

63 lines
2.1 KiB
Docker

# syntax=docker/dockerfile:1
FROM nvidia/cuda:12.6.0-runtime-ubuntu24.04
ARG USERNAME=kert
ARG USER_UID=1000
ARG USER_GID=1000
ARG PYTHON_VERSION=3.13
# Local package registry (Gitea) — set via --build-arg to pull from mirror
ARG PYPI_INDEX_URL=""
ENV DEBIAN_FRONTEND=noninteractive \
HOME=/home/kert \
PATH="/home/kert/.local/bin:${PATH}" \
NVIDIA_VISIBLE_DEVICES=all \
NVIDIA_DRIVER_CAPABILITIES=compute,utility
# System dependencies
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
curl \
ca-certificates \
git \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Rename existing ubuntu user/group to kert and fix home ownership
RUN groupmod -n ${USERNAME} ubuntu \
&& usermod -l ${USERNAME} -d /home/${USERNAME} -m -s /bin/bash ubuntu \
&& chown -R ${USER_UID}:${USER_GID} /home/${USERNAME}
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
COPY --from=ghcr.io/astral-sh/uv:latest /uvx /usr/local/bin/uvx
# Stay as root for rootless Docker compatibility
# (root in container = host user in rootless Docker)
WORKDIR /home/${USERNAME}
# Initialize uv project and install dependencies
RUN uv python install ${PYTHON_VERSION} \
&& uv init workspace --python ${PYTHON_VERSION} \
&& cd workspace \
&& uv add "marimo[recommended]" polars cudf-polars-cu12 pandas numpy pyarrow \
"pyiceberg[s3,pyarrow]>=0.7.0" "duckdb>=1.0.0" "narwhals>=1.0.0" "trino>=0.328.0" \
"sqlglot>=26.0.0" \
vega_datasets pyzotero obstore s3fs \
--extra-index-url https://pypi.nvidia.com
# Create marimo config directory with minimal defaults.
# Full config (marimo.toml, snippets, loch.css) is mounted at runtime
# from infra/marimo/ via compose.yml volumes.
RUN mkdir -p /home/${USERNAME}/.config/marimo
EXPOSE 2718
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD curl -sf http://localhost:2718/health || exit 1
CMD ["uv", "run", "--project", "/home/kert/workspace", \
"marimo", "edit", \
"--host", "0.0.0.0", "--port", "2718", "--headless", "--no-token", \
"/home/kert/notebooks"]