Skip to content
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

Add support for configs, secrets, networks and replicas for DockerSwarmOperator #17474

Merged
merged 18 commits into from
Aug 19, 2021
Merged

Add support for configs, secrets, networks and replicas for DockerSwarmOperator #17474

merged 18 commits into from
Aug 19, 2021

Conversation

enima2684
Copy link
Contributor

This PR adds the following functionality to the DockerSwarmOperator :

  • support for setting secrets and configs exposed to the started service
  • support for specifying networks that can be joined by the containers of the service
  • support for specifying the number of replicas for the swarm service

This features are essential in order to run the DockerSwarmOperator on a production environment with shared secrets, configs and networks.

The issue #7955 also mentions the need for this features.

P.S: this is my first contribution to Airflow. Tried to follow the contribution guidelines. Forgive any missed step and looking forward for your feedback !


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@boring-cyborg
Copy link

boring-cyborg bot commented Aug 6, 2021

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/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it’s a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: [email protected]
    Slack: https://s.apache.org/airflow-slack

@enima2684 enima2684 marked this pull request as draft August 8, 2021 12:34
@enima2684 enima2684 marked this pull request as ready for review August 8, 2021 12:34
airflow/providers/docker/operators/docker_swarm.py Outdated Show resolved Hide resolved
@enima2684 enima2684 requested a review from uranusjr August 10, 2021 08:02
@uranusjr
Copy link
Member

uranusjr commented Aug 10, 2021

We now have

  • from docker import types
  • from docker.types import ...
  • from docker.types.services import ...

Around the same proximity. They should be somewhat unified. I think from docker import types can be used to access everything?

@enima2684
Copy link
Contributor Author

Fixed the imports as asked :)

@github-actions
Copy link

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Aug 10, 2021
Copy link
Contributor

@akki akki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great feature addition!

Left a couple of comments - hope they're helpful.

@enima2684
Copy link
Contributor Author

Hi @akki,
Thanks for your review and comments :)
I think we have covered them all and needed fixes are done.
Can you please approve the PR if all ok for you ?
Many thanks

@ashb ashb merged commit 4da4c18 into apache:main Aug 19, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Aug 19, 2021

Awesome work, congrats on your first merged pull request!

@akki
Copy link
Contributor

akki commented Aug 21, 2021

Great. Congrats @enima2684 & welcome to the committers clan! 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers okay to merge It's ok to merge this PR as it does not require more tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants