Skip to main content

gke-taskflow

Adds support for Taskflow to the GKEStartPodOperator in Airflow.
This allows us to write cleaner, more pythonic DAGs.

Installation

This backage will need to be installed into the same environment as Airflow in order to function correctly. For Cloud Composer, we'll have to follow the docs.

PIP

Execute the following:

pip install gke-taskflow

Use

After the package is installed, you can define your task using the @task.gke_pod decorator:

from datetime import datetime
from airflow.decorators import dag, task

@dag(
        schedule=None,
        start_date=datetime(2023, 7, 15),
        tags=["testing"]
)
def example_dag_taskflow():
    @task.gke_pod(
            image="python:3.10-slim",
            task_id="test_flow",
            name="test_flow",
            cluster_name="test-cluster",
            namespace="composer-internal",
            location="us-central1",
            project_id="test-cluster-123abc",
    )
    def hello_world_from_container():
        print("hello world from container")

    hello_world_from_container()

example_dag_taskflow()

The keyword arguments supplied to @task.gke_pod are identical to those supplied to Google's GKEStartPodOperator, on which this work is based. The docs for that class are scant, but the source code is available online for review.

Metadata

Release files for gke-taskflow 1.0.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 gke-taskflow 1.0.0
File Size Uploaded Provenance
gke-taskflow-1.0.0.tar.gz 9.2 kB Without provenance Details

Release files / gke-taskflow-1.0.0.tar.gz

Download URL gke-taskflow-1.0.0.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
78b6c3328cd1af4f1146f0e4d2d457573c19ce47610ef061ad243b18e190b321
BLAKE2b-256 checksum
How to use checksums
331b08406dba55fdb22b0e7312263c8681e05ef1cfd7dbe44f1286bba4dbf11a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Security for gke-taskflow 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file No provenance

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