You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2023/12/06 19:51:40 UTC
[PR] Remove Airflow sources from CI image when running compatibility check [airflow]
potiuk opened a new pull request, #36094:
URL: https://github.com/apache/airflow/pull/36094
When we are running compatibility checks, we should not mount airflow from sources (not even skipping it), because if we removed a provider, it will be imported from the mounted sources and the provider might still be there.
Instead of mounting airflow sources we use "none" which effectively removes sources of airflow from CI image - instead airflow is entirely used from packages that are build during preparation of the compatibility check (airflow from tag in git, and providers from the PR).
<!--
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.
-->
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of an existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
<!-- Please keep an empty line above the dashes. -->
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move Breeze installation of Airflow in CI image to Python [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #36094:
URL: https://github.com/apache/airflow/pull/36094#issuecomment-1847628929
We will also need to merge this one https://github.com/apache/airflow/pull/36129 - before, so that users will not have to rebuild image in order to use the new `--use-airflow-version` code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move Breeze installation of Airflow in CI image to Python [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #36094:
URL: https://github.com/apache/airflow/pull/36094#issuecomment-1846154781
cc: @vincbeck @eladkal @amoghrajesh @ashb - but it's one-but-last step to remove all the remainders of bash scripts we had for the CI.
The remaining part (which I did not want to touch before 2.8.0 is out) is about the docker scripts that are used while building the images.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move Breeze installation of Airflow in CI image to Python [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #36094:
URL: https://github.com/apache/airflow/pull/36094#issuecomment-1846150521
I will likely need a few more rounds of fixes, but this is something I got to while iterating on the fix.
- 800 lines of bash code replaced by much more approachable Python code :). Much easier to test with click integration and well, being python.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move Breeze installation of Airflow in CI image to Python [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #36094:
URL: https://github.com/apache/airflow/pull/36094#issuecomment-1847526986
Still a few nits but I am getting really close
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move Breeze installation of Airflow in CI image to Python [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #36094:
URL: https://github.com/apache/airflow/pull/36094#discussion_r1419695530
##########
scripts/in_container/install_airflow_and_providers.py:
##########
@@ -0,0 +1,448 @@
+#!/usr/bin/env python3
+
+# 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.
+
+from __future__ import annotations
+
+import re
+import shlex
+import subprocess
+import sys
+from contextlib import contextmanager
+from pathlib import Path
+from typing import NamedTuple
+
+import rich_click as click
+from rich.console import Console
+
+console = Console(width=400, color_system="standard")
+
+AIRFLOW_SOURCE_DIR = Path(__file__).resolve().parents[1]
+DIST_FOLDER = Path("/dist")
+
+
+@contextmanager
+def ci_group(group_name: str, github_actions: bool):
+ if github_actions:
+ console.print(f"::group::{group_name[:50]}[/]", markup=False)
+ console.print(group_name, markup=False)
+ else:
+ console.print(group_name, markup=False)
Review Comment:
```suggestion
if github_actions:
console.print(f"::group::{group_name[:50]}[/]", markup=False)
console.print(group_name, markup=False)
```
##########
scripts/in_container/install_airflow_and_providers.py:
##########
@@ -0,0 +1,448 @@
+#!/usr/bin/env python3
+
+# 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.
+
+from __future__ import annotations
+
+import re
+import shlex
+import subprocess
+import sys
+from contextlib import contextmanager
+from pathlib import Path
+from typing import NamedTuple
+
+import rich_click as click
+from rich.console import Console
+
+console = Console(width=400, color_system="standard")
+
+AIRFLOW_SOURCE_DIR = Path(__file__).resolve().parents[1]
+DIST_FOLDER = Path("/dist")
+
+
+@contextmanager
+def ci_group(group_name: str, github_actions: bool):
+ if github_actions:
+ console.print(f"::group::{group_name[:50]}[/]", markup=False)
+ console.print(group_name, markup=False)
+ else:
+ console.print(group_name, markup=False)
+ try:
+ yield
+ finally:
Review Comment:
I am trying to understand this code
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move Breeze installation of Airflow in CI image to Python [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #36094:
URL: https://github.com/apache/airflow/pull/36094#discussion_r1419731071
##########
scripts/in_container/install_airflow_and_providers.py:
##########
@@ -0,0 +1,448 @@
+#!/usr/bin/env python3
+
+# 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.
+
+from __future__ import annotations
+
+import re
+import shlex
+import subprocess
+import sys
+from contextlib import contextmanager
+from pathlib import Path
+from typing import NamedTuple
+
+import rich_click as click
+from rich.console import Console
+
+console = Console(width=400, color_system="standard")
+
+AIRFLOW_SOURCE_DIR = Path(__file__).resolve().parents[1]
+DIST_FOLDER = Path("/dist")
+
+
+@contextmanager
+def ci_group(group_name: str, github_actions: bool):
+ if github_actions:
+ console.print(f"::group::{group_name[:50]}[/]", markup=False)
+ console.print(group_name, markup=False)
+ else:
+ console.print(group_name, markup=False)
Review Comment:
Yep . obviously :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move Breeze installation of Airflow in CI image to Python [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #36094:
URL: https://github.com/apache/airflow/pull/36094#issuecomment-1847758044
Finally !
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move Breeze installation of Airflow in CI image to Python [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #36094:
URL: https://github.com/apache/airflow/pull/36094#discussion_r1419723479
##########
scripts/in_container/install_airflow_and_providers.py:
##########
@@ -0,0 +1,448 @@
+#!/usr/bin/env python3
+
+# 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.
+
+from __future__ import annotations
+
+import re
+import shlex
+import subprocess
+import sys
+from contextlib import contextmanager
+from pathlib import Path
+from typing import NamedTuple
+
+import rich_click as click
+from rich.console import Console
+
+console = Console(width=400, color_system="standard")
+
+AIRFLOW_SOURCE_DIR = Path(__file__).resolve().parents[1]
+DIST_FOLDER = Path("/dist")
+
+
+@contextmanager
+def ci_group(group_name: str, github_actions: bool):
+ if github_actions:
+ console.print(f"::group::{group_name[:50]}[/]", markup=False)
+ console.print(group_name, markup=False)
+ else:
+ console.print(group_name, markup=False)
+ try:
+ yield
+ finally:
Review Comment:
It's just the way how to hide the output of a single command in GITHUB_ACTIONS in a "foldable" output .
anything inside the context manager will be by default hidden in smth like this:
```
> GROUP NAME
```
And when you click on the group you will be able to see defaults. You can see plenty of those in our builds :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move Breeze installation of Airflow in CI image to Python [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #36094:
URL: https://github.com/apache/airflow/pull/36094#discussion_r1419729586
##########
scripts/in_container/install_airflow_and_providers.py:
##########
@@ -0,0 +1,448 @@
+#!/usr/bin/env python3
+
+# 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.
+
+from __future__ import annotations
+
+import re
+import shlex
+import subprocess
+import sys
+from contextlib import contextmanager
+from pathlib import Path
+from typing import NamedTuple
+
+import rich_click as click
+from rich.console import Console
+
+console = Console(width=400, color_system="standard")
+
+AIRFLOW_SOURCE_DIR = Path(__file__).resolve().parents[1]
+DIST_FOLDER = Path("/dist")
+
+
+@contextmanager
+def ci_group(group_name: str, github_actions: bool):
+ if github_actions:
+ console.print(f"::group::{group_name[:50]}[/]", markup=False)
+ console.print(group_name, markup=False)
+ else:
+ console.print(group_name, markup=False)
+ try:
+ yield
+ finally:
Review Comment:
More info on this feature of GA here: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move Breeze installation of Airflow in CI image to Python [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #36094:
URL: https://github.com/apache/airflow/pull/36094#discussion_r1419728083
##########
scripts/in_container/install_airflow_and_providers.py:
##########
@@ -0,0 +1,448 @@
+#!/usr/bin/env python3
+
+# 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.
+
+from __future__ import annotations
+
+import re
+import shlex
+import subprocess
+import sys
+from contextlib import contextmanager
+from pathlib import Path
+from typing import NamedTuple
+
+import rich_click as click
+from rich.console import Console
+
+console = Console(width=400, color_system="standard")
+
+AIRFLOW_SOURCE_DIR = Path(__file__).resolve().parents[1]
+DIST_FOLDER = Path("/dist")
+
+
+@contextmanager
+def ci_group(group_name: str, github_actions: bool):
+ if github_actions:
+ console.print(f"::group::{group_name[:50]}[/]", markup=False)
+ console.print(group_name, markup=False)
+ else:
+ console.print(group_name, markup=False)
+ try:
+ yield
+ finally:
Review Comment:
Say https://github.com/apache/airflow/actions/runs/7134269185/job/19428722538#step:6:239
<img width="942" alt="Screenshot 2023-12-07 at 23 28 53" src="https://github.com/apache/airflow/assets/595491/9df6e2a2-2b6d-4b21-8c61-6d13ae5f9407">
Every thringle on the left you see is such a group - and by clcking it, you can unfold the details.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move Breeze installation of Airflow in CI image to Python [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #36094:
URL: https://github.com/apache/airflow/pull/36094
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org