Migrate Edge calls for Worker to FastAPI part 2 - Logs routes#44330
Merged
potiuk merged 3 commits intoapache:mainfrom Nov 30, 2024
Merged
Migrate Edge calls for Worker to FastAPI part 2 - Logs routes#44330potiuk merged 3 commits intoapache:mainfrom
potiuk merged 3 commits intoapache:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Copilot reviewed 8 out of 23 changed files in this pull request and generated no suggestions.
Files not reviewed (15)
- docs/spelling_wordlist.txt: Language not supported
- providers/src/airflow/providers/edge/CHANGELOG.rst: Language not supported
- providers/tests/edge/models/test_edge_logs.py: Evaluated as low risk
- providers/src/airflow/providers/edge/cli/api_client.py: Evaluated as low risk
- providers/src/airflow/providers/edge/cli/edge_command.py: Evaluated as low risk
- providers/src/airflow/providers/edge/models/edge_logs.py: Evaluated as low risk
- providers/src/airflow/providers/edge/models/edge_worker.py: Evaluated as low risk
- providers/src/airflow/providers/edge/provider.yaml: Evaluated as low risk
- providers/src/airflow/providers/edge/executors/edge_executor.py: Evaluated as low risk
- providers/src/airflow/providers/edge/worker_api/routes/rpc_api.py: Evaluated as low risk
- providers/src/airflow/providers/edge/worker_api/app.py: Evaluated as low risk
- providers/tests/edge/cli/test_edge_command.py: Evaluated as low risk
- providers/src/airflow/providers/edge/init.py: Evaluated as low risk
- providers/src/airflow/providers/edge/worker_api/routes/_v2_compat.py: Evaluated as low risk
- providers/src/airflow/providers/edge/worker_api/routes/logs.py: Evaluated as low risk
Comments skipped due to low confidence (4)
providers/src/airflow/providers/edge/worker_api/routes/_v2_routes.py:98
- [nitpick] The comment should be more descriptive to explain why a string is used for map_index and how it should be converted to an integer.
map_index: str, # Note: Connexion can not have negative numbers in path parameters, use string therefore
providers/src/airflow/providers/edge/worker_api/routes/_v2_routes.py:126
- Add validation to ensure log_chunk_time is a valid datetime string.
log_chunk_time=body["log_chunk_time"]
providers/src/airflow/providers/edge/worker_api/routes/worker.py:60
- The error message could be more descriptive to help the user understand why their request was rejected.
raise HTTPException(status.HTTP_400_BAD_REQUEST, f"Edge Worker runs on Airflow {airflow_on_worker} and the core runs on {airflow_version}. Rejecting access due to difference.")
providers/src/airflow/providers/edge/worker_api/routes/worker.py:159
- The
Stats.incrmethod is called twice with different parameters. This might be redundant and could be optimized.
Stats.incr(f"edge_worker.heartbeat_count.{worker_name}", 1, 1)
Stats.incr("edge_worker.heartbeat_count", 1, 1, tags={"worker_name": worker_name})
8af06e0 to
74f099c
Compare
a4e286d to
ba54d4c
Compare
kaxil
reviewed
Nov 29, 2024
kaxil
reviewed
Nov 29, 2024
kaxil
reviewed
Nov 29, 2024
providers/src/airflow/providers/edge/worker_api/routes/_v2_routes.py
Outdated
Show resolved
Hide resolved
kaxil
reviewed
Nov 29, 2024
kaxil
reviewed
Nov 29, 2024
kaxil
approved these changes
Nov 29, 2024
potiuk
approved these changes
Nov 29, 2024
ba54d4c to
7ff228f
Compare
1fd46a2 to
2311429
Compare
potiuk
approved these changes
Nov 30, 2024
Member
|
Re-reviewed... Looks good :) |
Contributor
There was a problem hiding this comment.
Copilot reviewed 5 out of 14 changed files in this pull request and generated 2 suggestions.
Files not reviewed (9)
- providers/src/airflow/providers/edge/CHANGELOG.rst: Language not supported
- providers/src/airflow/providers/edge/openapi/edge_worker_api_v1.yaml: Language not supported
- providers/tests/edge/models/test_edge_logs.py: Evaluated as low risk
- providers/src/airflow/providers/edge/init.py: Evaluated as low risk
- providers/src/airflow/providers/edge/cli/edge_command.py: Evaluated as low risk
- providers/src/airflow/providers/edge/worker_api/app.py: Evaluated as low risk
- providers/tests/edge/cli/test_edge_command.py: Evaluated as low risk
- providers/src/airflow/providers/edge/models/edge_logs.py: Evaluated as low risk
- providers/src/airflow/providers/edge/provider.yaml: Evaluated as low risk
got686-yandex
pushed a commit
to got686-yandex/airflow
that referenced
this pull request
Jan 30, 2025
…#44330) * Migrate Edge calls for Worker to FastAPI 2 - Logs route * Review feedback, use SessionDep from FastAPI * Fix pytest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up PR as incremental part of #44311
Note: Only the last commit is the relevant change, the first commit is from #44311
To prepare EdgeWorker to be independent of AIP-44 Internal API, this PR is the third step in adding/migrating to FastAPI. The calls to "Logs" API to (1) get log path and (2) push log chunks are now real REST API calls, not using internal API.
I would separate the other internal API calls to follow-up PRs as this is already quite large. Especially cause for ongoing Airflow 2.10 Connexion API + Swagger manually need to be generated whereas the main workstream for Airflow 3 uses FastAPI.