-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathairflow.yaml
151 lines (129 loc) · 4.53 KB
/
airflow.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
package:
name: airflow
version: 2.10.4
epoch: 4
description: Platform to programmatically author, schedule, and monitor workflows
options:
# There is a dependency on libarrow.so although it
# is provided in the virtual environment. Enabling no-depends
# works around this
no-depends: true
dependencies:
runtime:
- coreutils # numfmt is required
- netcat-openbsd # nc is required
- posix-libc-utils # genconf is required
- python-3.12
- tzdata
- unixodbc
copyright:
- license: Apache-2.0
environment:
contents:
packages:
- cargo-auditable
- gcc
- glibc-dev
- mariadb-connector-c-dev
- mariadb-dev
- nodejs
- pkgconf-dev
- postgresql-dev
- py3-pip
- py3-xmlsec
- py3.12-build-bin
- py3.12-pip
# Airflow requires python<3.13
- python-3.12
- python-3.12-dev
- rust
- wolfi-base
- xmlsec-dev
- xmlsec-openssl
- yarn
pipeline:
- uses: git-checkout
with:
repository: https://github.com/apache/airflow
tag: ${{package.version}}
expected-commit: c083e456fa02c6cb32cdbe0c9ed3c3b2380beccd
- runs: |
# by default airflow celery provider is not built,but running the upstream helm chart requires it
python patch.py
# remove the patcher
rm -rf patch.py
- uses: patch
with:
patches: requests.patch urllib3.patch
- working-directory: ./airflow/www
runs: |
# front-end build
yarn install --frozen-lockfile
yarn run build
rm -rf node_modules
- runs: |
# requires EPOCH to be later that 1980
export SOURCE_DATE_EPOCH=315532800
# To install mysqlclient wheel
export MYSQLCLIENT_CFLAGS=`mysql_config --cflags`
export MYSQLCLIENT_CFLAGS=`mysql_config --cflags`
python3.12 -m build --wheel
pip3.12 install --verbose \
--prefix="/opt/airflow" --root=${{targets.contextdir}} dist/*.whl
- runs: |
# CVE-2024-6345 GHSA-cx63-2mw6-8hw5
# setuptools comes from airflow/providers/google/provider.yaml having
# gcloud-aio-auth>=4.0.0,<5.0.0 . gcloud-aio-auth 4 is backlevel and has
# setuptools in it's pyproject.toml 'tool.poetry.dependencies'
# The tldr; For that case it is not needed in runtime.
pip3.12 uninstall --yes setuptools
#GHSA-8w49-h785-mj3c/GHSA-8495-4g3g-x7pr/GHSA-27mf-ghqm-j3j8 fixes
pip3.12 install --verbose \
--force-reinstall --prefix=/opt/airflow --root="${{targets.contextdir}}" \
aiohttp>=3.10.11 tornado>=6.4.2 statsd packaging pyparsing
- runs: find . -name '__pycache__' -exec rm -rf {} +
- runs: |
mkdir -p ${{targets.destdir}}/opt/airflow/dags
mkdir -p ${{targets.destdir}}/scripts/docker
# The first time you run Airflow, it will create a file called `airflow.cfg` in
# `$AIRFLOW_HOME` directory
# However, for production case it is advised to generate the configuration
export PYTHONPATH=${{targets.destdir}}/opt/airflow/lib/python3.12/site-packages
${{targets.destdir}}/opt/airflow/bin/airflow config list --defaults > ${{targets.destdir}}/"airflow.cfg"
cp airflow/config_templates/default_webserver_config.py ${{targets.destdir}}/
cp scripts/docker/entrypoint_prod.sh ${{targets.destdir}}/entrypoint
chmod 755 ${{targets.destdir}}/entrypoint
cp scripts/docker/clean-logs.sh ${{targets.destdir}}/clean-logs
chmod 755 ${{targets.destdir}}/clean-logs
cp scripts/docker/airflow-scheduler-autorestart.sh ${{targets.destdir}}/airflow-scheduler-autorestart
chmod 755 ${{targets.destdir}}/airflow-scheduler-autorestart
cp -r scripts/docker/* ${{targets.destdir}}/scripts/docker
chmod 755 ${{targets.destdir}}/scripts/docker
subpackages:
- name: airflow-compat
dependencies:
runtime:
- ${{package.name}}
pipeline:
- runs: |
# Symlink libstdc++ from usr/lib to /usr/lib/$(uname -m)-linux-gnu/
mkdir -p ${{targets.subpkgdir}}/usr/lib/$(uname -m)-linux-gnu
ln -sf /usr/lib/libstdc++.so.6 ${{targets.subpkgdir}}/usr/lib/$(uname -m)-linux-gnu/
update:
enabled: true
ignore-regex-patterns:
- 'rc\d+$'
- 'helm-chart*'
github:
identifier: apache/airflow
test:
environment:
contents:
packages:
- python3
pipeline:
- runs: |
export PATH=/opt/airflow/bin:$PATH
export PYTHONPATH=/opt/airflow/lib/python3.12/site-packages
HOME=/home/build airflow version
python3.12 -c "import airflow"