Repository navigation
181 lines (173 loc) · 7.31 KB
/
Copy pathagent_gateway_ci.yml
File metadata and controls
181 lines (173 loc) · 7.31 KB
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Agent Gateway CI
on:
push:
branches:
- master
- 'release-*'
paths:
- 'hudi-agent-gateway/**'
- 'hudi-ai-operator/**'
- 'hudi-lakehouse/**'
- '.github/workflows/agent_gateway_ci.yml'
pull_request:
branches:
- master
paths:
- 'hudi-agent-gateway/**'
- 'hudi-ai-operator/**'
- 'hudi-lakehouse/**'
- '.github/workflows/agent_gateway_ci.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
superset-spark-connect-tests:
name: Superset Spark Connect dialect tests (PyArrow ${{ matrix.pyarrow }})
runs-on: ubuntu-24.04
strategy:
matrix:
pyarrow: ['16.1.0', '18.1.0']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
cache-dependency-path: hudi-lakehouse/superset-spark-connect/pyproject.toml
- name: Install adapter
run: pip install ./hudi-lakehouse/superset-spark-connect 'pyarrow==${{ matrix.pyarrow }}'
- name: Run offline dialect tests
run: python -m unittest discover -s hudi-lakehouse/superset-spark-connect -p 'test_dialect.py' -v
gateway-tests:
name: gateway pytest + lint (python ${{ matrix.python }})
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python: ['3.11', '3.12']
defaults:
run:
working-directory: hudi-agent-gateway
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: hudi-agent-gateway/pyproject.toml
- name: Install
run: pip install -e ".[dev,spark-connect]"
- name: Fetch pinned Hudi Architect baseline
run: >-
git fetch --no-tags --depth=1 origin
refs/tags/release-1.2.0:refs/tags/release-1.2.0
- name: Validate Hudi Architect references
run: |
python ../hudi-ai-operator/skills/hudi-architect/validate_config_keys.py
python ../hudi-ai-operator/skills/hudi-architect/validate_flink_capabilities.py --verify-source
python ../hudi-ai-operator/skills/hudi-architect/validate_flink_design.py \
--input tests/fixtures/hudi_architect/flink_pr2/stable_key.json \
--emit-sql > /dev/null
python ../hudi-ai-operator/skills/hudi-architect/validate_flink_design.py \
--input tests/fixtures/hudi_architect/flink_pr3/mutable_cow.json \
--emit-sql > /dev/null
python ../hudi-ai-operator/skills/hudi-architect/validate_flink_design.py \
--input tests/fixtures/hudi_architect/flink_pr4/mutable_mor.json \
--emit-sql > /dev/null
python ../hudi-ai-operator/skills/hudi-architect/validate_flink_existing_table.py \
--input tests/fixtures/hudi_architect/flink_pr5/compatible_mutable_cow.json
- name: Test
run: python -m pytest tests -q
- name: Lint
run: >-
ruff check src tests
../hudi-ai-operator/skills/hudi-architect/redact_sensitive_values.py
../hudi-ai-operator/skills/hudi-architect/flink_writer_contract.py
../hudi-ai-operator/skills/hudi-architect/validate_flink_capabilities.py
../hudi-ai-operator/skills/hudi-architect/validate_flink_design.py
../hudi-ai-operator/skills/hudi-architect/validate_flink_existing_table.py
- name: Type-check
run: >-
mypy src
../hudi-ai-operator/skills/hudi-architect/flink_writer_contract.py
../hudi-ai-operator/skills/hudi-architect/validate_flink_capabilities.py
../hudi-ai-operator/skills/hudi-architect/validate_flink_design.py
../hudi-ai-operator/skills/hudi-architect/validate_flink_existing_table.py
- name: Test guardrails with minimum sqlglot
# Read the lower bound from project metadata so this test follows future bumps.
run: |
sqlglot_min_requirement=$(python - <<'PY'
import tomllib
with open("pyproject.toml", "rb") as f:
dependencies = tomllib.load(f)["project"]["dependencies"]
print(next(dep for dep in dependencies if dep.startswith("sqlglot>=")).replace(">=", "==", 1))
PY
)
python -m pip install "$sqlglot_min_requirement"
python -m pytest tests/test_guardrails.py -q
flink-sql-fixtures:
name: Hudi 1.2.0 / Flink 1.20.1 SQL fixtures
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '11'
cache: maven
cache-dependency-path: hudi-agent-gateway/fixtures/hudi-architect-flink-1.20/pom.xml
- name: Test generated SQL with the pinned factory and planner
run: >-
mvn -B
-f hudi-agent-gateway/fixtures/hudi-architect-flink-1.20/pom.xml
test
chart-lint:
name: helm lint + template
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Spark Connect chart contract tests
run: |
pip install PyYAML==6.0.3
python -m unittest discover -s hudi-lakehouse/tests -v
# helm is preinstalled on GitHub-hosted ubuntu runners. Do NOT add
# azure/setup-helm or other third-party actions here: the apache org
# allowlist only permits GitHub-created actions (actions/*) and a
# curated set, and anything else startup-fails the whole workflow.
- name: Lint charts
run: |
# hudi-trino intentionally fails fast on default values (metastore
# uri is required), so render with local-dev values when present.
for chart in hudi-lakehouse/charts/*/; do
if [ -f "$chart/values-local-dev.yaml" ]; then
helm lint "$chart" -f "$chart/values-local-dev.yaml"
helm template "$chart" -f "$chart/values-local-dev.yaml" > /dev/null
else
helm lint "$chart"
helm template "$chart" > /dev/null
fi
done
helm lint hudi-lakehouse/charts/hudi-agent-gateway \
-f hudi-lakehouse/charts/hudi-agent-gateway/values-spark-connect.yaml
helm template hudi-lakehouse/charts/hudi-agent-gateway \
-f hudi-lakehouse/charts/hudi-agent-gateway/values-spark-connect.yaml > /dev/null