hera

Hera 讓 Python 程式碼透過原生 Python 整合,輕鬆在 Argo Workflows 上進行編排。它讓您能完全以 Python 建構並提交工作流程。

hera 是什麼?

Hera 讓 Python 程式碼透過原生 Python 整合,輕鬆在 Argo Workflows 上進行編排。它讓您能完全以 Python 建構並提交工作流程。⭐️ 別忘了按星號!

hera 概覽

這是什麼

Hera 是一個用於 Argo Workflows 的 Python SDK,讓使用者能完全在 Python 中建構與提交工作流程。它能將 Python 函式轉換為在 Kubernetes 上執行的容器化模板,提供與 Argo Workflows 的原生 Python 整合。

主要功能

  • 使用 @script 裝飾器將 Python 函式轉換為可重複使用的 Argo Workflows 腳本模板 - 透過 Python 的 context manager 與運算子(如 >>)建構 DAG 工作流程 - 直接透過 w.create() 將工作流程提交至 Argo Workflows 叢集 - 支援 Bearer token 或 ArgoCLITokenGenerator 進行身分驗證 - 可選的 YAML 輸出功能,適用於 GitOps 實務與除錯 - CLI(實驗性功能)可在 YAML 與 Python 原始碼之間轉換工作流程 - 透過 hera[async-client] 支援非同步客戶端,用於非同步工作流程操作

使用情境

  • 資料科學工作流程(於 KubeCon/ArgoCon NA 2024 發表) - 編排火箭模擬(KubeCon/ArgoCon NA 2023) - 訓練大型語言模型(KubeCon/ArgoCon NA 2023) - 擴展基因治療研究(KubeCon/ArgoCon EU 2023) - 將資料管線遷移至 Argo Workflows(DoKC Town Hall #2)

快速開始

從 PyPI 安裝 Hera: pip install hera 以下範例使用 @script 裝飾器與 DAG 建立並提交一個簡單的工作流程: python from hera.workflows import DAG, Workflow, script @script() def echo(message: str): print(message) with Workflow( generate_name='dag-diamond-', entrypoint='diamond', ) as w: with DAG(name='diamond'): A = echo(name='A', arguments={'message': 'A'}) B = echo(name='B', arguments={'message': 'B'}) C = echo(name='C', arguments={'message': 'C'}) D = echo(name='D', arguments={'message': 'D'}) A >> [B, C] >> D w.create() 需要在 Kubernetes 叢集中部署 Argo Workflows 伺服器。身分驗證方式請參閱儲存庫的 README。

授權與價格

Hera 採用 Apache 2.0 授權,為開源軟體。

內容整理自該專案公開的 README 與儲存庫資訊。

將此徽章加入你的 README

Featured on YunoDB 徽章樣式與說明

你是這個專案的維護者嗎?展示它已收錄於 YunoDB。

Markdown[![Featured on YunoDB](https://yunodb.com/badge/argoproj-labshera.svg)](https://yunodb.com/tools/argoproj-labshera?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/argoproj-labshera?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/argoproj-labshera.svg" alt="Featured on YunoDB" height="20"></a>