Repository navigation
Airflow plugin Phase 2: clean-room rebuild of openmetadata-airflow-apis (steps 0-7) - #151
Conversation
…ctory/builders, AirflowBackend.deploy, store protocol + handlers rewrite, packaging fix)
…nId conf-first, file-streamed logs + TaskLogReader fallback)
…ypted workflow, MySQL test connection)
…ackend (DB-first delete, fail unfinished runs, real host ip)
…OnError omission for profiler; mysql source reads authType password (fixes 1045 on server-fetched configs)
…exemption via FAB csrf, startup script, DAG image, airflow compose service; postgres authType password fix
|
The Java checkstyle failed. Please run You can install the pre-commit hooks with |
…d writeback (B-2), CSRF 12 exemptions (B-3)
|
The Java checkstyle failed. Please run You can install the pre-commit hooks with |
verify-rebuild treated compose service 'airflow' as CCL. Product path now keeps Apache Airflow + smartmetadata-airflow-apis as a required rebuild service; CCL names (ingestion, openmetadata-ui/mcp, fuseki) stay forbidden. Docs/ADR/tests updated. mvn spotless:apply for Metric* unused imports.
|
CI fix pushed ( |
…red dag_id; N-10 non-dict filter pattern is a deploy 400
…ine names; N-11 malformed sourceConfig shapes are a deploy 400
…l /openmetadata prefixes
The offline rebuild gate installs smartmetadata-airflow-apis/[test] only (flask + pytest, no Airflow by design), but 11 tests added in #151 build real DAGs (via build_dag -> 'from airflow import DAG') or load the plugin entry point, which degrades to None without Airflow. Add pytest.importorskip('airflow') - the same pattern the sibling tests in test_plugin.py already use - so the 11 tests skip in the gate venv and still run where Airflow is installed (80 passed locally in the Airflow venv). Gate venv: 66 passed, 14 skipped, 0 failed (was 11 failed).
Airflow 插件重建 Phase 2:clean-room 重建官方 openmetadata-airflow-apis
将官方 CCL 插件
openmetadata-airflow-apis(pina3012259ca)按 server 调用契约 clean-room 重写,落在产品包smartmetadata-airflow-apis上,并补齐启动脚本、DAG 镜像与 compose 接线。官方 Airflow 本体是 Apache-2.0,用官方镜像,不重建;只重写集成层。分支已从新主干
6b9faf35(#155 合入后)更新,头6267cb94。53 文件,+5467/−221,对主干零冲突(dry-run treec9d394c1,mergeable_state clean)。Ruling:
~/workspace/work/airflow-plugin/RULING.md(Phase 1 深研 + 步 2–7 定案与纠正);实施日志:~/workspace/work/airflow-plugin/IMPLEMENTATION.md;verify-rebuild 修复记录:~/workspace/work/pr151-verify-rebuild/FIX.md。验收(当前状态)
smartmetadata-ingestion/)。6267cb94上 SUCCESS;service-unit-tests、java-checkstyle、ui/py-checkstyle 均绿;maven-sonarcloud-ci 未跑(path-filter,未碰openmetadata-service/**)。verify-rebuild 修复(
f889c4ea,7 行)门禁 venv 不装 Airflow(by design),11 个测试因
ModuleNotFoundError: No module named 'airflow'失败。修复:在test_builders.py(6 行)与test_plugin.py(1 行)加pytest.importorskip("airflow"),与plugin.py的降级约定一致。零产品代码改动。本地核验:门禁 venv 66 passed + 14 skipped,Airflow venv 80 passed。残留:11 个测试在 CI 里 skip
修复后这 11 个测试在 CI 中 skip——
build_dag与SmartMetadataPlugin类在 CI 中无覆盖;完整 80 个只在本地 Airflow venv 跑过。后续:加一个 Airflow CI job,或明确接受门禁-only 的契约覆盖。不要把“本地 80 全过”等同于 CI 覆盖。各步验收
/openmetadata)、health/health-auth/csrf-token、Basic + 权限 fail closedautomations/execute.py(server 发加密 Workflow、按名重取解密版);真实门禁 7/7(协议级 MySQL stub + OM stub)步 7
plugin.py、无 entry points 声明)——步 7 门禁逼它现形。新建plugin.py(SmartMetadataPlugin,单 blueprint/api/v2/openmetadata+ Admin 视图)与views/rest_api.py,pyproject.toml加[project.entry-points."airflow.plugins"]。csrf对象@csrf.exempt,csrf-token 与 status 不豁免;csrf-token 路由优先返回 Flask-WTF 会话 token)。另补 blueprint 认证 fallback 与默认 store 选择。docker/rebuild/airflow-entrypoint.sh,clean-room 重写官方行为(同 env 默认值、同三进程形、同每次airflow db migrate、同口令文件合并 upsert)。Bai 17:18:admin/admin 默认;口令经环境变量传给内嵌 Python;mkdir -p logs。docker/rebuild/Dockerfile.airflow(底apache/airflow:3.3.2-python3.12;USER 序列与官方同;约束文件只 pin 插件安装,全部是门禁 venv 里与 Airflow 3.3.2 同跑过的版本;FAB provider 显式安装;mysqlclient==2.1.1+ ingestion[postgres,mysql,kafka,snowflake];构建时airflow db migrate && rm -f airflow.db)+.dockerignore+ 约束文件。airflowservice(Bai 17:18:8080:8080全开、无资源限制、DB 口令airflow_pass;depends_onmysql healthy;healthcheck 用插件公开/health)。server 开关仍"false",本 PR 不翻开关、不部署。postgres.py:314改调password_of+ 新测试(与步 6 的 MySQL 缺陷同类)。U 系列处置
2.0.0-SNAPSHOT。automations/execute.py,按名重取。部署说明(合入后)
"false")、不部署。airflowservice 到产品 compose(compose 里实际没有 airflow service,只有两处注释提到它),再翻PIPELINE_SERVICE_CLIENT_ENABLED为"true"+ 4 个 env var,建 airflow_db/user,重建 server,逐个 deploy 已有 pipeline,全链 live 验证。docker build(Dockerfile.airflow)首次真实验证在部署时;FAB Admin 视图的可达 URL 未断言(server 契约不依赖它)。复核状态