Submission and monitoring of jobs and notebooks using the Yeedu API in Apache Airflow.
Project description
Airflow Yeedu Operator
Note: This version of
airflow-yeedu-operatoris compatible only with Apache Airflow 2.x. Apache Airflow 3.x is not supported.
Installation
To install the Yeedu Operator in your Airflow environment, run:
pip3 install airflow-yeedu-operator
Overview
The YeeduOperator enables Airflow users to submit and monitor Spark jobs and notebooks in Yeedu. It provides a smooth interface to:
- Submit notebooks and jobs to Yeedu
- Monitor job progress and completion
- Handle failures and capture logs in Airflow UI
Prerequisites
- Apache Airflow 2.x environment
- Valid credentials to interact with the Yeedu API.
- Yeedu Authentication (LDAP, AAD, or SSO)
- Valid certificate for SSL if applicable
Airflow Connection Setup
Step 1: Create Airflow Connection
- In the Airflow UI, go to Admin > Connections
- Click the + Add Connection button to create a new connection
Fill in the following fields:
| Field | Value / Example |
|---|---|
| Conn Id | yeedu_connection |
| Conn Type | HTTP |
| Login | Your LDAP/AAD username (if applicable) |
| Password | Your password (if applicable) |
| Extra | JSON with SSL options (see below) |
Extra JSON Field
{
"YEEDU_AIRFLOW_VERIFY_SSL": "true",
"YEEDU_SSL_CERT_FILE": "/path/to/cert/file"
}
Replace
/path/to/cert/filewith the actual path to your certificate file.
SSO Token Setup (Only for SSO auth)
If your Yeedu authentication method is SSO, follow these steps:
- Go to Admin > Variables
- Click + Add Variable
- Enter:
- Key: e.g.,
yeedu_sso_token - Value: your Yeedu login token
- Key: e.g.,
You will refer to this variable in your DAG using token_variable_name.
Example DAG
DAG Definition
from datetime import datetime, timedelta
from airflow import DAG
from yeedu.operators.yeedu import YeeduOperator
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2023, 1, 1),
'retries': 1,
'retry_delay': timedelta(minutes=5),
}
dag = DAG(
'yeedu_job_execution',
default_args=default_args,
description='DAG to execute jobs using Yeedu API',
schedule_interval='@once',
catchup=False,
)
Task Configuration
LDAP / AAD Authentication
Use Login and Password in the Airflow connection:
submit_job_task = YeeduOperator(
task_id='LDAP_TASK',
job_url='https://hostname:{restapi_port}/tenant/tenant_id/workspace/workspace_id/spark/notebook/notebook_id',
#Replace with your Job/Notebook Url
connection_id='yeedu_connection', # Replace with your Connection Id
dag=dag,
)
Copy the Job/Notebook URL from the Yeedu UI and replace the port in the URL with the actual
restapi_portvalue before using it in the DAG.
SSO Authentication
Use a token stored in Airflow Variables:
submit_job_task = YeeduOperator(
task_id='SSO_TASK',
job_url='https://hostname:{restapi_port}/tenant/tenant_id/workspace/workspace_id/spark/notebook/notebook_id',
#Replace with your Job/Notebook Url
connection_id='yeedu_connection',
token_variable_name='yeedu_sso_token', # Replace with your variable key
dag=dag,
)
You must skip
LoginandPasswordin the Airflow connection for SSO.
Execution Steps
- Save your DAG file in the
dags/folder of your Airflow installation. - Ensure the connection and (if needed) token variable are configured correctly.
- Trigger the DAG manually or let it run on the scheduled interval.
- Monitor the Airflow UI/Yeedu UI for execution progress and logs.
Screenshot (Connection Example)
Screenshot (Variable Example)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file airflow_yeedu_operator-2.7.0.tar.gz.
File metadata
- Download URL: airflow_yeedu_operator-2.7.0.tar.gz
- Upload date:
- Size: 18.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e131a7ab8fc20992274dca89d943bb1567dd2b3b9f46a6683af93417b7914d9c
|
|
| MD5 |
7bb9d6442dd53d7b6bd14b7b41b3738d
|
|
| BLAKE2b-256 |
07c8a3968874010419ebf3e5ca8d20ff23e0c055b458664b3d38b2b35598de5a
|
Provenance
The following attestation bundles were made for airflow_yeedu_operator-2.7.0.tar.gz:
Publisher:
publish-to-pypi.yml on yeedu-io/Apache-Airflow-Operator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
airflow_yeedu_operator-2.7.0.tar.gz -
Subject digest:
e131a7ab8fc20992274dca89d943bb1567dd2b3b9f46a6683af93417b7914d9c - Sigstore transparency entry: 250150115
- Sigstore integration time:
-
Permalink:
yeedu-io/Apache-Airflow-Operator@9af7289bafd4b38dad56bcc2e79a0e6c2b6f0c2d -
Branch / Tag:
refs/tags/2.7.0 - Owner: https://github.com/yeedu-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@9af7289bafd4b38dad56bcc2e79a0e6c2b6f0c2d -
Trigger Event:
push
-
Statement type:
File details
Details for the file airflow_yeedu_operator-2.7.0-py3-none-any.whl.
File metadata
- Download URL: airflow_yeedu_operator-2.7.0-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9035dc3c36dfe17c8690205563be329758946b59957af6e7629f61fb70fbf82c
|
|
| MD5 |
942a4a75953ae5c6abbd39c3bc75dc6c
|
|
| BLAKE2b-256 |
aab46f9bb9eb51f35c9a8ff0c5126ca6a73c689a83f73185de213554854007bc
|
Provenance
The following attestation bundles were made for airflow_yeedu_operator-2.7.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on yeedu-io/Apache-Airflow-Operator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
airflow_yeedu_operator-2.7.0-py3-none-any.whl -
Subject digest:
9035dc3c36dfe17c8690205563be329758946b59957af6e7629f61fb70fbf82c - Sigstore transparency entry: 250150118
- Sigstore integration time:
-
Permalink:
yeedu-io/Apache-Airflow-Operator@9af7289bafd4b38dad56bcc2e79a0e6c2b6f0c2d -
Branch / Tag:
refs/tags/2.7.0 - Owner: https://github.com/yeedu-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@9af7289bafd4b38dad56bcc2e79a0e6c2b6f0c2d -
Trigger Event:
push
-
Statement type: