-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix multiple issues in Microsoft AzureContainerInstancesOperator #15634
Fix multiple issues in Microsoft AzureContainerInstancesOperator #15634
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
|
Thanks @BKronenbitter. Would you mind adding/extending unit tests to cover the failure scenarios ? |
Thanks for your quick reaction. Let me address the individual fixes separately:
|
Just to give you a bit of context, we rely on automated testing heavily. And our philosophy is that with every single change we want to add unit tests so that the coverage grows and probability of regression goes down. Adding any change without tests almost by definition goes in the other direction, so almost any change that has no unit tests (and touches the python code) will end up with a request to add them.
We usually mock any calls like that - example here where sleep command have been mocked: https://github.com/apache/airflow/blob/master/tests/cli/commands/test_webserver_command.py In this particular case we would like to add a test where we have at least two loops where state changes and sleep is called in-between. All that can be mocked rather easily.
Coool
Agree.
I think mocking here should help as well. |
Thanks a lot for the explanation. I added/changed tests according to your comment. They all fail in the current master and pass with fixes. |
Sorry for the failing static check. I was not aware, that it was skipped locally. Should be fixed now and all static checks are succeeding locally. |
The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*. |
The Workflow run is cancelling this PR. Building image for the PR has been cancelled |
Hi, I am confused by the output of the failing checks:
I am not sure, to what degree these errors are caused by the changes in the PR. |
Apparently temporary error.
Yep. That's one of the reason why those tests are quarantined. They fail occassionally.
That was also apparently temporary failure.
Likely None. I will close/reopen to trigger the build again. |
@@ -339,8 +340,8 @@ def _monitor_logging(self, resource_group: str, name: str) -> int: | |||
"Exception while getting logs from container instance, retrying..." | |||
) | |||
|
|||
if state == "Terminated": | |||
self.log.error("Container exited with detail_status %s", detail_status) | |||
if state in ["Terminated"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably just left over from testing. I can change that back of course.
The Workflow run is cancelling this PR. Building images for the PR has failed. Follow the workflow link to check the reason. |
How do we proceed now? Is there anything I can do from my side to resolve the issues. |
@potiuk Please feel gently poked. I think, I addressed all the comments and am basically waiting on your feedback. |
There are some failures resulting from your changes being behind main (409 commits). can you please rebase to latest main ? (and ping me please then) |
f852f40
to
a7088d6
Compare
@potiuk Thanks for the quick answer. The rebase is done. The build of some of the containers is now failing. This issue seems to be present also in the main branch. |
Should be fixed now |
@potiuk I think, everything is as it should be right now. |
Hey @BKronenbitter - can you please rebase again (one last time I hope). we had some changes in main that require rebasing (busy time). |
Apologies for the hassle. |
a7088d6
to
284b2a5
Compare
No problem, done. |
Running build :P |
As surprising as it is... pylint started to detect some errors . I think @ashb you were quite right that pylint is not worth it.. @BKronenbitter - can you please add |
BTW. I just started a vote (after @ashb hinting/lobbying for it for quite a while despite my reservations) to remove pylint ... It brings us more harm than good... |
…t importantly run sleep during main loop while executing.
c749ec7
to
7d9e66b
Compare
Done, I added the exception to the whole files, since everything else ended up in a mess of individual exceptions. |
Yeah. I hope we will finally get rid of pylint. Been proponent of it for quite some time but I see how much pain it causes and stopped liking it. |
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease. |
Awesome work, congrats on your first merged pull request! |
After having worked with with Airflow in Azure using the AzureContainerInstancesOperator I encountered some issues.