Skip to main content

kraken-re

(Work in progress)

The kraken-re provides a rule engine to describe the components of a project. These components are translated into build tasks using various rules.

The rule engine is strongly inspired by Pants.

Concepts

Targets

A Target is an addressable set of metadata. The metadata is comprised of fields. Each field is of a particular type, and no two fields can be of the same type (subclasses of another field type are accepted).

Field

A Field is a strongly typed description of a piece of data, such as "PythonProjectSourceDirectory". A field may be a subclass of another field, allowing it to be taken into consideration when a generic request of fields matching its parent class is requested.

Rules

A rule describes how to translate a set of input types to an output type. Often, the inputs and output types will be targets, but they can be arbitrary Python types. Every session begins with a set of initial objects that are usually created by a script.

Every object in the rule system must be immutable and hashable. If two rules produce the same result, the results are merged.

Example script

docker_grpc_rust_template(name="template")
docker_image(dockerfile_target=":template", platforms=["linux/arm64", "linux/amd64"])

Example rules

@rule
def get_dockerfile_resource_from_grpc_rust_template(request: DockerGrpcRustTemplateRequest) -> DockerfileResource:
    ...
    return DockerfileResource(path_to_dockerfile)

@rule
def get_docker_build_requests(image: DockerImageTarget) -> DockerBuildRequests:
    ...
    for platform in image[DockerPlatforms]:
        requests.append(...)
    return DockerBuildRequests(requests)

@rule
def build_docker(request: DockerBuildRequest) -> DockerBuildResult:
    ...
    return DockerBuildResult(...)

Metadata

Release files for kraken-re 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kraken-re 0.1.0
File Size Uploaded
kraken-re-0.1.0.tar.gz 11.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kraken-re 0.1.0
File Interpreter ABI Platform
kraken_re-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.1 kB

Release files / kraken-re-0.1.0.tar.gz

Download URL kraken-re-0.1.0.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f3b4a87f5b7afa4d9b787c7d21807d1e66192601f2f183b193fcf555f073076f
BLAKE2b-256 checksum
How to use checksums
e0ec73ec2c8b3988a87f12b94e18b1925b4553a8b779887337ed3db41cebeceb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.3 readme-renderer/35.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.12.0 keyring/23.6.0 rfc3986/2.0.0 colorama/0.4.5 CPython/3.10.2

Release files / kraken_re-0.1.0-py3-none-any.whl

Download URL kraken_re-0.1.0-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2df5766f7d7304ec12ea59f9f25baf424bba65b2ad424c3755d2e88a9e6761d1
BLAKE2b-256 checksum
How to use checksums
6a160b8307da5d328175a99d3d80b6f0f85f2b4221d03ef89b2e52b6c4e8bd79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.3 readme-renderer/35.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.12.0 keyring/23.6.0 rfc3986/2.0.0 colorama/0.4.5 CPython/3.10.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page