-
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
[AIRFLOW-4843] Allow orchestration via Docker Swarm (SwarmOperator) #5489
Conversation
Add support for running Docker containers via Docker Swarm which allows the task to run on any machine (node) which is a part of your Swarm cluster More details: https://issues.apache.org/jira/browse/AIRFLOW-4843 Built with <3 at Agoda!
@mik-laj Thanks, your examples helped me understand the pylint errors better. I've fixed them now and also moved the operator class to |
@potiuk Can you look at - this, our Docker expert? |
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.
Very nice and well documented. I like it. Just a few comments to address.
@potiuk Apologies for taking this long (got stuck with something else). I have addressed your above comments. Please have a look. The build (doc) failure doesn't seem related to my code. Furthermore, I see the same error in another build of a totally un-related PR so I guess it's Travis itself which has some issues. Please let me know if this looks good to you now. Thanks :) |
ad95515
to
b1fc817
Compare
Codecov Report
@@ Coverage Diff @@
## master #5489 +/- ##
==========================================
+ Coverage 79% 79.02% +0.02%
==========================================
Files 489 492 +3
Lines 30726 30762 +36
==========================================
+ Hits 24275 24311 +36
Misses 6451 6451
Continue to review full report at Codecov.
|
Just forced push to trigger Travis again - it's green now! Would anyone like to review this now and let me know their feedback please? |
I looked at this code and the _execute method seems to me unreadable. It seems to me that it is worth creating two private methods, pull_images, run_images. WDYT? |
@mik-laj Regarding pull image part of the code, I think it is fairly short and straightforward to remain inside Thanks for reviewing, much appreciated! :) |
@mik-laj I went ahead and updated the PR to incorporate your suggestions as explained in my last comment. |
@akki
|
No additional approvals are needed. |
This is great! Any chance to add the ability to pass extra arguments to the TaskTemplate and ContainerSpec? For example, it would be handy to be able to specify labels and placement constraints. |
@acordiner thanks. If the feature is supported by the Python Docker client API, it should be pretty straightforward to add it. |
@akki - Great! Yes, they're part of the API: |
@acordiner |
@akki Do you have an idea of how to get logs from the tasks to show up in the webinterface with this? In only get start and stop but output from the task itself is not captured..
|
@hredestig I wrote a patch for that a few weeks ago but couldn't send it back upstream. Thanks for pointing out. |
Thanks, sure, made AIRFLOW-5850 |
@hredestig You can find the PR here - #6552. Please see if it looks good to you. Also, for anyone wondering what this feature/commit is about, I wrote a little bit here - https://medium.com/analytics-vidhya/orchestrating-airflow-tasks-with-docker-swarm-69b5fb2723a7. |
…pache#5489) * [AIRFLOW-4843] Allow orchestration via Docker Swarm (SwarmOperator) Add support for running Docker containers via Docker Swarm which allows the task to run on any machine (node) which is a part of your Swarm cluster More details: https://issues.apache.org/jira/browse/AIRFLOW-4843 Built with <3 at Agoda! (cherry picked from commit 3e2a027)
…5489) * [AIRFLOW-4843] Allow orchestration via Docker Swarm (SwarmOperator) Add support for running Docker containers via Docker Swarm which allows the task to run on any machine (node) which is a part of your Swarm cluster More details: https://issues.apache.org/jira/browse/AIRFLOW-4843 Built with <3 at Agoda! (cherry picked from commit 3e2a027)
…5489) * [AIRFLOW-4843] Allow orchestration via Docker Swarm (SwarmOperator) Add support for running Docker containers via Docker Swarm which allows the task to run on any machine (node) which is a part of your Swarm cluster More details: https://issues.apache.org/jira/browse/AIRFLOW-4843 Built with <3 at Agoda! (cherry picked from commit 3e2a027)
…5489) * [AIRFLOW-4843] Allow orchestration via Docker Swarm (SwarmOperator) Add support for running Docker containers via Docker Swarm which allows the task to run on any machine (node) which is a part of your Swarm cluster More details: https://issues.apache.org/jira/browse/AIRFLOW-4843 Built with <3 at Agoda! (cherry picked from commit 3e2a027)
Make sure you have checked all steps below.
Jira
Description
Added in issue - https://issues.apache.org/jira/browse/AIRFLOW-4843
Tests
SwarmOperatorTestCase
Commits
Documentation
Code Quality
flake8