-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Support deleting the local log files when using remote logging #29772
Conversation
…d log is successfully uploaded
…nd log is successfully uploaded
…nd log is successfully uploaded
d0baba8
to
d8086b5
Compare
We should mention it in the docs (probably in remote logging part) otherwise users won't be aware they can set this |
Yes. I agree right now it is not at all obvious how to do it (you really need to copy local settings and add new keyword parameters and somehow know that they are there (many of our users are kinda scared to look at the source code to find out how thing really are and expect documentation to tell them what they can do 🤷 ), I would say it would be worth to actually add an option Also you will be able to copy the local_settings from latest airflow version, add configuration (even if you do not upgrade) and new providers and - surprisingly - it will also work, because you do not have to have new airflow ot read new value from the config. I think for the future - compatibility, this could be even described in the docs how to approach it - copy the relevant part of settings, add configuration, and then when you migrate in the future, it will just work (TM). WDYT? |
I agree, I'll add this to the doc |
Yes, I thought about this, and I had two different options to add the config:
|
I think it's OK if this config will be As for providers, we can check for Airflow version in providers... for example:
|
I just realized that there is not conf to pass kwargs to TaskHandler class, and that the I'm wondering if we add a new conf
My initial idea was based on this conf, but now the only solution to override the conf |
… remote task handlers
…g to method in order to simplify testing
… improve existing tests
Looks like there are still some failing tests @hussein-awala |
@o-nikolas I fixed the failing tests, can you take a look? |
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.
LGTM
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.
I've never loved how much copy/paste is involved with changes to the remote loggers. We should really create a nice base class/interface for that stuff. But that shouldn't block this useful contribution. Thanks for the work!
(left just a couple nits on wording)
Co-authored-by: Niko Oliveira <[email protected]>
I think it's difficult with the decoupling policy we have for providers. |
Ehh, ya, but I think it's possible. We've done this with executors and they will soon live in entirely different provider packages. But either way, not a blocker for this PR |
Can you open a followup issue and describe the task? |
Sure, will do 👍 |
closes: #16142
In this PR, I add a new parameter
delete_local_copy
forS3TaskHandler
,GCSTaskHandler
andOSSTaskHandler
(WasbTaskHandler
already has it), to support deleting the local copy of logs after uploading it to remote logging location.To avoid adding unnecessary extra dependency between these providers and the Airflow core, I didn't create a new Airflow config as discussed in the issue, so users can still upgrade providers versions and use this feature without the need to upgrade the Airflow version.