Skip to content

Build function images with Nix instead of the up CLI #10

Description

@negz

What problem are you facing?

The up CLI's Python function builder tars each function directory (following symlinks) and injects it into a base image. This works for simple functions but creates friction for a project of Modelplane's size:

  • Shared library requires symlinks. The top-level lib/ directory is symlinked into each function directory so functions can import shared code. This is a workaround, not a feature.
  • No third-party packages. Functions are limited to the standard library and the function SDK. We store CRDs as JSON instead of YAML because we can't depend on pyyaml.
  • Type checking in CI doesn't work. Function directories aren't Python packages on disk — they have no __init__.py or pyproject.toml, so type checkers like pyright and ty can't resolve relative imports. IDE-based type checking generally works, but we can't run type checks in CI.

How could Modelplane help solve your problem?

Once crossplane/cli#21 lands, switch to building function runtime images with Nix (or Docker) and passing them to the up CLI as pre-built images. The CLI would skip the build step and just add the Crossplane package metadata layer.

This lets us structure the project as a standard Python monorepo — a real package with pyproject.toml, dependencies declared in one place, shared library installed via normal packaging, type checking and test runners that work out of the box.

Blocked on crossplane/cli#21.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions