apache-airflow-multirepo-deploy 2.0.0rc4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- apache_airflow_multirepo_deploy-2.0.0rc4/.github/workflows/ci.yml +38 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/.github/workflows/release.yml +44 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/.gitignore +7 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/.pre-commit-config.yaml +14 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/PKG-INFO +89 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/Readme.md +76 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/hatch_build.py +13 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/images/deployment.png +0 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/images/repos.png +0 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/pyproject.toml +43 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/__init__.py +3 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/_version.py +34 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/plugin.py +554 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/.gitignore +28 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/.prettierignore +5 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/.prettierrc +13 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/README.md +124 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/eslint.config.js +36 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/index.html +13 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/package.json +78 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/pnpm-lock.yaml +6379 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/src/components/AddRepoModal.tsx +360 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/src/context/colorMode/ColorModeProvider.tsx +5 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/src/context/colorMode/index.ts +2 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/src/context/colorMode/useColorMode.tsx +11 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/src/dev.tsx +11 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/src/main.tsx +59 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/src/pages/Deploy.tsx +472 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/src/pages/RepoList.tsx +248 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/src/theme.ts +405 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/src/vite-env.d.ts +1 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/testsSetup.ts +1 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/tsconfig.app.json +30 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/tsconfig.json +8 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/tsconfig.lib.json +15 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/tsconfig.node.json +28 -0
- apache_airflow_multirepo_deploy-2.0.0rc4/src/airflow_multirepo_deploy/ui/vite.config.ts +73 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
pre-commit:
|
|
11
|
+
name: Pre-commit
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v6
|
|
15
|
+
- uses: j178/prek-action@v1
|
|
16
|
+
|
|
17
|
+
lint-test-js:
|
|
18
|
+
name: Lint & Test JS
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- uses: pnpm/action-setup@v4
|
|
23
|
+
with:
|
|
24
|
+
version: latest
|
|
25
|
+
- uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: lts/*
|
|
28
|
+
cache: pnpm
|
|
29
|
+
cache-dependency-path: src/airflow_multirepo_deploy/ui/pnpm-lock.yaml
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: pnpm install --frozen-lockfile
|
|
32
|
+
working-directory: src/airflow_multirepo_deploy/ui
|
|
33
|
+
- name: Lint
|
|
34
|
+
run: pnpm lint
|
|
35
|
+
working-directory: src/airflow_multirepo_deploy/ui
|
|
36
|
+
- name: Test
|
|
37
|
+
run: pnpm test
|
|
38
|
+
working-directory: src/airflow_multirepo_deploy/ui
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "[0-9]*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
name: Build distribution
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
with:
|
|
15
|
+
fetch-depth: 0
|
|
16
|
+
- uses: pnpm/action-setup@v4
|
|
17
|
+
with:
|
|
18
|
+
version: latest
|
|
19
|
+
- uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: lts/*
|
|
22
|
+
cache: pnpm
|
|
23
|
+
cache-dependency-path: src/airflow_multirepo_deploy/ui/pnpm-lock.yaml
|
|
24
|
+
- uses: astral-sh/setup-uv@v5
|
|
25
|
+
- name: Build wheel and sdist
|
|
26
|
+
run: uv build
|
|
27
|
+
- uses: actions/upload-artifact@v4
|
|
28
|
+
with:
|
|
29
|
+
name: dist
|
|
30
|
+
path: dist/
|
|
31
|
+
|
|
32
|
+
publish:
|
|
33
|
+
name: Publish to PyPI
|
|
34
|
+
needs: build
|
|
35
|
+
runs-on: ubuntu-latest
|
|
36
|
+
environment: pypi
|
|
37
|
+
permissions:
|
|
38
|
+
id-token: write
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/download-artifact@v4
|
|
41
|
+
with:
|
|
42
|
+
name: dist
|
|
43
|
+
path: dist/
|
|
44
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v6.0.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: check-merge-conflict
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: trailing-whitespace
|
|
8
|
+
- id: check-ast
|
|
9
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
10
|
+
rev: v0.15.5
|
|
11
|
+
hooks:
|
|
12
|
+
- id: ruff
|
|
13
|
+
args: [ --fix ]
|
|
14
|
+
- id: ruff-format
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: apache-airflow-multirepo-deploy
|
|
3
|
+
Version: 2.0.0rc4
|
|
4
|
+
Summary: Apache Airflow plugin for managing multi-repository DAG deployments
|
|
5
|
+
License: Apache-2.0
|
|
6
|
+
Requires-Python: >=3.9
|
|
7
|
+
Requires-Dist: apache-airflow-core>=3.0.0
|
|
8
|
+
Requires-Dist: cryptography>=45.0.0
|
|
9
|
+
Requires-Dist: gitpython>=3.1.46
|
|
10
|
+
Requires-Dist: pyjwt>=2.10.1
|
|
11
|
+
Requires-Dist: requests>=2.31.0
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
# Airflow Multirepo Deploy plugin
|
|
15
|
+
|
|
16
|
+
Airflow plugin for deploying DAGs from multiple Git repository from Airflow webserver.
|
|
17
|
+
|
|
18
|
+
The plugin scans every folder in Airflow DAGs folder (without subfolders),
|
|
19
|
+
and check if it's a git repository. It's intended to be used in a scenario where DAGs are
|
|
20
|
+
stored in a single shared volume. The volume must be mounted in the webserver too.
|
|
21
|
+
|
|
22
|
+
It's been designed for scenarios where Airflow is deployed in a Kubernetes cluster,
|
|
23
|
+
and multiple teams deploy their DAGs from separate repos.
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
* Deploy DAGs from multiple Git repos
|
|
28
|
+
* See deployed commit for each environment
|
|
29
|
+
* Easily switch between branches
|
|
30
|
+
|
|
31
|
+

|
|
32
|
+

|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
pip install apache-airflow-multirepo-deploy
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Usage
|
|
41
|
+
|
|
42
|
+
### Airflow helm chart
|
|
43
|
+
|
|
44
|
+
To use this plugin with the official Airflow helm chart, you need to configure:
|
|
45
|
+
* `dags.persistence` to create a shared persistent volume
|
|
46
|
+
* `webserver.extraVolumes` and `webserver.extraVolumeMounts` to mount the volume in the webserver
|
|
47
|
+
|
|
48
|
+
### Configuration
|
|
49
|
+
Have a look at this configuration snippet and adjust it to your needs.
|
|
50
|
+
The only required part is the GitHub App configuration if you want to use GitHub App authentication.
|
|
51
|
+
If you don't configure it, the plugin will fall back to using SSH keys for authentication, which is also supported out of the box.
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
[multirepo_deploy]
|
|
55
|
+
# URL prefix for the deployment routes
|
|
56
|
+
url_prefix = deployment
|
|
57
|
+
|
|
58
|
+
# Path to the React app dist folder
|
|
59
|
+
react_app_dir = /path/to/plugin/ui/dist
|
|
60
|
+
|
|
61
|
+
# Optional post-deployment hook (Python callable)
|
|
62
|
+
# post_hook = mymodule.my_function
|
|
63
|
+
|
|
64
|
+
# Optional: restrict which branches can be deployed (comma-separated)
|
|
65
|
+
# allowed_branches = origin/main,origin/develop,origin/staging
|
|
66
|
+
|
|
67
|
+
# GitHub App Configuration (required for GitHub App authentication)
|
|
68
|
+
# To use GitHub App authentication, you need all three of these:
|
|
69
|
+
|
|
70
|
+
# 1. Your GitHub App ID (found in app settings)
|
|
71
|
+
gh_app_id = 123456
|
|
72
|
+
|
|
73
|
+
# 2. Base64-encoded private key for your GitHub App (PEM format)
|
|
74
|
+
# Generate this from your GitHub App settings
|
|
75
|
+
gh_app_private_key = LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQo... (truncated for security)
|
|
76
|
+
|
|
77
|
+
# 3. Installation ID for your organization
|
|
78
|
+
# Find this in the URL when you view the app installation:
|
|
79
|
+
# https://github.com/organizations/YOUR_ORG/settings/installations/INSTALLATION_ID
|
|
80
|
+
gh_app_installation_id = 12345678
|
|
81
|
+
|
|
82
|
+
# Note: If these are not configured, only SSH key method will be available
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Authentication
|
|
86
|
+
While you should configure the Git authentication specific to your environment,
|
|
87
|
+
the plugin supports multiple SSH keys (like GitHub deployment keys) out of the box.
|
|
88
|
+
For a given repo , simply store the SSH key in a file `<repo_folder_name>.key`
|
|
89
|
+
in the parent folder of the repo.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Airflow Multirepo Deploy plugin
|
|
2
|
+
|
|
3
|
+
Airflow plugin for deploying DAGs from multiple Git repository from Airflow webserver.
|
|
4
|
+
|
|
5
|
+
The plugin scans every folder in Airflow DAGs folder (without subfolders),
|
|
6
|
+
and check if it's a git repository. It's intended to be used in a scenario where DAGs are
|
|
7
|
+
stored in a single shared volume. The volume must be mounted in the webserver too.
|
|
8
|
+
|
|
9
|
+
It's been designed for scenarios where Airflow is deployed in a Kubernetes cluster,
|
|
10
|
+
and multiple teams deploy their DAGs from separate repos.
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
* Deploy DAGs from multiple Git repos
|
|
15
|
+
* See deployed commit for each environment
|
|
16
|
+
* Easily switch between branches
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
pip install apache-airflow-multirepo-deploy
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### Airflow helm chart
|
|
30
|
+
|
|
31
|
+
To use this plugin with the official Airflow helm chart, you need to configure:
|
|
32
|
+
* `dags.persistence` to create a shared persistent volume
|
|
33
|
+
* `webserver.extraVolumes` and `webserver.extraVolumeMounts` to mount the volume in the webserver
|
|
34
|
+
|
|
35
|
+
### Configuration
|
|
36
|
+
Have a look at this configuration snippet and adjust it to your needs.
|
|
37
|
+
The only required part is the GitHub App configuration if you want to use GitHub App authentication.
|
|
38
|
+
If you don't configure it, the plugin will fall back to using SSH keys for authentication, which is also supported out of the box.
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
[multirepo_deploy]
|
|
42
|
+
# URL prefix for the deployment routes
|
|
43
|
+
url_prefix = deployment
|
|
44
|
+
|
|
45
|
+
# Path to the React app dist folder
|
|
46
|
+
react_app_dir = /path/to/plugin/ui/dist
|
|
47
|
+
|
|
48
|
+
# Optional post-deployment hook (Python callable)
|
|
49
|
+
# post_hook = mymodule.my_function
|
|
50
|
+
|
|
51
|
+
# Optional: restrict which branches can be deployed (comma-separated)
|
|
52
|
+
# allowed_branches = origin/main,origin/develop,origin/staging
|
|
53
|
+
|
|
54
|
+
# GitHub App Configuration (required for GitHub App authentication)
|
|
55
|
+
# To use GitHub App authentication, you need all three of these:
|
|
56
|
+
|
|
57
|
+
# 1. Your GitHub App ID (found in app settings)
|
|
58
|
+
gh_app_id = 123456
|
|
59
|
+
|
|
60
|
+
# 2. Base64-encoded private key for your GitHub App (PEM format)
|
|
61
|
+
# Generate this from your GitHub App settings
|
|
62
|
+
gh_app_private_key = LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQo... (truncated for security)
|
|
63
|
+
|
|
64
|
+
# 3. Installation ID for your organization
|
|
65
|
+
# Find this in the URL when you view the app installation:
|
|
66
|
+
# https://github.com/organizations/YOUR_ORG/settings/installations/INSTALLATION_ID
|
|
67
|
+
gh_app_installation_id = 12345678
|
|
68
|
+
|
|
69
|
+
# Note: If these are not configured, only SSH key method will be available
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Authentication
|
|
73
|
+
While you should configure the Git authentication specific to your environment,
|
|
74
|
+
the plugin supports multiple SSH keys (like GitHub deployment keys) out of the box.
|
|
75
|
+
For a given repo , simply store the SSH key in a file `<repo_folder_name>.key`
|
|
76
|
+
in the parent folder of the repo.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class CustomBuildHook(BuildHookInterface):
|
|
8
|
+
PLUGIN_NAME = "ui_build"
|
|
9
|
+
|
|
10
|
+
def initialize(self, version, build_data):
|
|
11
|
+
ui_dir = Path(self.root) / "src" / "airflow_multirepo_deploy" / "ui"
|
|
12
|
+
subprocess.run(["pnpm", "install", "--frozen-lockfile"], cwd=ui_dir, check=True)
|
|
13
|
+
subprocess.run(["pnpm", "build"], cwd=ui_dir, check=True)
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling", "hatch-vcs"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "apache-airflow-multirepo-deploy"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Apache Airflow plugin for managing multi-repository DAG deployments"
|
|
9
|
+
readme = "Readme.md"
|
|
10
|
+
license = { text = "Apache-2.0" }
|
|
11
|
+
requires-python = ">=3.9"
|
|
12
|
+
dependencies = [
|
|
13
|
+
"apache-airflow-core>=3.0.0",
|
|
14
|
+
"GitPython>=3.1.46",
|
|
15
|
+
"PyJWT>=2.10.1",
|
|
16
|
+
"cryptography>=45.0.0",
|
|
17
|
+
"requests>=2.31.0",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[project.entry-points."airflow.plugins"]
|
|
21
|
+
multirepo_deploy = "airflow_multirepo_deploy:AirflowMultiRepoDeploymentPlugin"
|
|
22
|
+
|
|
23
|
+
[tool.hatch.version]
|
|
24
|
+
source = "vcs"
|
|
25
|
+
raw-options = { tag_regex = "^(?P<version>[0-9]+\\..*)" }
|
|
26
|
+
|
|
27
|
+
[tool.hatch.build.hooks.vcs]
|
|
28
|
+
version-file = "src/airflow_multirepo_deploy/_version.py"
|
|
29
|
+
|
|
30
|
+
[tool.hatch.build.hooks.custom]
|
|
31
|
+
path = "hatch_build.py"
|
|
32
|
+
|
|
33
|
+
[tool.hatch.build.targets.wheel]
|
|
34
|
+
packages = ["src/airflow_multirepo_deploy"]
|
|
35
|
+
artifacts = [
|
|
36
|
+
"src/airflow_multirepo_deploy/ui/dist/**",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[tool.hatch.build.targets.sdist]
|
|
40
|
+
exclude = ["src/airflow_multirepo_deploy/ui/node_modules"]
|
|
41
|
+
|
|
42
|
+
[tool.ruff]
|
|
43
|
+
line-length = 120
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# file generated by setuptools-scm
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
|
|
4
|
+
__all__ = [
|
|
5
|
+
"__version__",
|
|
6
|
+
"__version_tuple__",
|
|
7
|
+
"version",
|
|
8
|
+
"version_tuple",
|
|
9
|
+
"__commit_id__",
|
|
10
|
+
"commit_id",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
TYPE_CHECKING = False
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from typing import Tuple
|
|
16
|
+
from typing import Union
|
|
17
|
+
|
|
18
|
+
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
+
COMMIT_ID = Union[str, None]
|
|
20
|
+
else:
|
|
21
|
+
VERSION_TUPLE = object
|
|
22
|
+
COMMIT_ID = object
|
|
23
|
+
|
|
24
|
+
version: str
|
|
25
|
+
__version__: str
|
|
26
|
+
__version_tuple__: VERSION_TUPLE
|
|
27
|
+
version_tuple: VERSION_TUPLE
|
|
28
|
+
commit_id: COMMIT_ID
|
|
29
|
+
__commit_id__: COMMIT_ID
|
|
30
|
+
|
|
31
|
+
__version__ = version = '2.0.0rc4'
|
|
32
|
+
__version_tuple__ = version_tuple = (2, 0, 0, 'rc4')
|
|
33
|
+
|
|
34
|
+
__commit_id__ = commit_id = None
|