Harmont docs
Pipeline SDKReferenceToolchains

Base images

Generated reference for the harmont Base images API.

apt_base

Create a standalone apt-base step sharable across toolchains.

Emits apt-get update && apt-get install -y \<packages> with a daily TTL cache. Pass the returned step as base= to any toolchain constructor to share one apt-base across multiple toolchains.

apt_base(*, packages, image=None, label=':apt: base') -> Step
ParameterTypeDefaultDescription
packagestuple[str, ...]requiredapt package names to install.
imagestr | NoneNoneLocal-mode Docker base image override for this step.
labelstr':apt: base'Human-facing label shown in the UI.

Returns Step — A Step that installs the given apt packages.

Examples

>>> import harmont as hm
>>> base = hm.apt_base(packages=("git", "curl"))
>>> tc = hm.rust.toolchain(base=base)

BaseImage

Create a BaseImage annotation marker for a target parameter.

Use as Annotated[Step, BaseImage("ubuntu-24.04")] on a parameter of a @hm.target() function. The runtime decorator injects a scratch-rooted Step with the given image set as the parameter value. The first .sh() call on that step inherits the image, so the first emitted IR step carries image in the v0 wire format.

BaseImage(image) -> _BaseImageMarker
ParameterTypeDefaultDescription
imagestrrequiredNon-empty Docker image string (e.g. "ubuntu-24.04").

Returns _BaseImageMarker — A _BaseImageMarker for use in Annotated[Step, ...].

Examples

>>> import harmont as hm
>>> from typing import Annotated
>>> @hm.target()
... def my_target(base: Annotated[hm.Step, hm.BaseImage("ubuntu-24.04")]) -> hm.Step:
...     return base.sh("apt-get update")

On this page