Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 11 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,24 @@
#========================================
# builder layer
#========================================
FROM python:3.13-slim AS builder

# install uv and use system python
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
ENV UV_SYSTEM_PYTHON=1

COPY pyproject.toml pyproject.toml
COPY uv.lock uv.lock

RUN uv export --no-dev --format requirements.txt -o /requirements.txt

#========================================
# final image
#========================================
FROM python:3.13-slim

# install git
RUN apt-get update && \
apt-get install -y --no-install-recommends git ca-certificates
apt-get install -y --no-install-recommends git ca-certificates && \
rm -rf /var/lib/apt/lists/*

# install uv and use system python
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
ENV UV_SYSTEM_PYTHON=1

# get pylock.toml from builder layer
COPY --from=builder /requirements.txt /requirements.txt
WORKDIR /app

# Copy project metadata
COPY pyproject.toml uv.lock* ./

# install dependencies to global python
RUN uv pip install -r /requirements.txt
# Copy CLI source
COPY launcher ./launcher

# copy application
WORKDIR /app
COPY ./launcher /app/launcher
# Install package into system python, includes "marimo-launcher" script
RUN uv pip install --system .

EXPOSE 2718

ENTRYPOINT ["python", "-m", "launcher.cli"]
ENTRYPOINT ["marimo-launcher", "run"]
CMD []
12 changes: 5 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,18 @@ ruff-apply: # Resolve 'fixable errors' with 'ruff'
# CLI
####################################
cli-test-inline-run:
uv run python -m launcher.cli \
uv run marimo-launcher \
run \
--mount=tests/fixtures/inline_deps

cli-test-reqs-txt-run:
uv run python -m launcher.cli \
uv run marimo-launcher \
run \
--mount=tests/fixtures/static_deps_reqs_txt \
--requirements=requirements.txt

cli-test-token-authenticated:
uv run python -m launcher.cli \
uv run marimo-launcher \
run \
--mount=tests/fixtures/inline_deps \
--token="iamsecret"
Expand All @@ -104,10 +104,8 @@ docker-test-run: # Test local docker container with test fixture notebook
docker run \
-p "2718:2718" \
-v "$(CURDIR)/tests/fixtures:/tmp/fixtures" \
-e NOTEBOOK_MOUNT="/tmp/fixtures" \
-e NOTEBOOK_PATH="helloworld.py" \
marimo-launcher:latest \
run
-e NOTEBOOK_MOUNT="/tmp/fixtures/inline_deps" \
marimo-launcher:latest

####################################
# Terraform
Expand Down
12 changes: 10 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[project]
name = "marimo-launcher"
version = "1.0.0"
version = "1.1.0"
requires-python = ">=3.13"

dependencies = [
Expand All @@ -31,7 +31,7 @@ line-length = 90
[tool.mypy]
disallow_untyped_calls = true
disallow_untyped_defs = true
exclude = ["tests/"]
exclude = ["tests/","build/"]

[tool.pytest.ini_options]
log_level = "INFO"
Expand Down Expand Up @@ -95,3 +95,11 @@ max-doc-length = 90

[tool.ruff.lint.pydocstyle]
convention = "google"

[project.scripts]
marimo-launcher = "launcher.cli:cli"
mitlib-marimo-launcher = "launcher.cli:cli"
Copy link
Contributor Author

@ghukill ghukill Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll be interesting to discuss this more as a team.

Now that we can start to theoretically install our CLIs and applications as standalone tools, we may want to consider giving them a namespace prefix like mitlib-*. Imagine we had a tool we called... oh I don't know.... transform (link). This could collide with other linux, homebrew, or a myriad of other scripts on our machines.

If we were to start prefixing our uv tools / entrypoints with mitlib-* we might be able to start to build an ecosystem of terminal / CLI tooling from our own applications.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, looking forward to that discussion!


[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"
6 changes: 3 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.