Skip to content

Added logging device and logging device options#41416

Merged
Lee-W merged 15 commits into
apache:mainfrom
geraj1010:main
Aug 27, 2024
Merged

Added logging device and logging device options#41416
Lee-W merged 15 commits into
apache:mainfrom
geraj1010:main

Conversation

@geraj1010

@geraj1010 geraj1010 commented Aug 13, 2024

Copy link
Copy Markdown
Contributor

Closes: #40533

Updated the DockerSwarmOperator with logging device and logging device options parameters as requested. I restricted support for only 'json-file' and 'gelf', since that is all I was able to test locally. I can include support for other logging drivers (e.g. fluentd) if it makes sense. Also, I wasn't sure if I should have a check in place for valid logging options. Happy to explore if it makes sense. Here is some info on the GELF logging driver and its options, https://docs.docker.com/engine/logging/drivers/gelf/.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg

boring-cyborg Bot commented Aug 13, 2024

Copy link
Copy Markdown

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 Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, 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.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@Lee-W Lee-W changed the title #40533 - Added logging device and logging device options Added logging device and logging device options Aug 13, 2024
Comment thread airflow/providers/docker/operators/docker_swarm.py Outdated
Comment thread airflow/providers/docker/operators/docker_swarm.py Outdated
@Lee-W

Lee-W commented Aug 16, 2024

Copy link
Copy Markdown
Member

We might need to add some unit tests to this change as well

@geraj1010

Copy link
Copy Markdown
Contributor Author

@Lee-W I'm not quite sure what kind of unit tests would be valid here, since this is an operator update. The operator doesn't return anything to check. I do have a test DAG if that counts, but you would need to have Docker Swarm and Graylog setup to test.

@geraj1010

Copy link
Copy Markdown
Contributor Author

@Lee-W
I have added two unit tests for checking if logging_driver works and for entering an invalid/unsupported logging_driver value.

@Lee-W Lee-W left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mostly looks good. The only remaining issue is one small problem, and we might need to add "gelf" to the spell check valid word, as it's not recognized and fails the CI.

Comment thread tests/providers/docker/operators/test_docker_swarm.py Outdated

@Lee-W Lee-W left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There are still some minor issues. You can run pre-commit locally and get them resolved. I think we're really close to merge 👍

Comment thread .pre-commit-config.yaml Outdated
@geraj1010

Copy link
Copy Markdown
Contributor Author

@Lee-W I have update the spelling_wordlist.txt, but the Static checks is still failing. Is there anything else I need to do?

Comment thread .pre-commit-config.yaml Outdated
@Lee-W Lee-W merged commit 938ab82 into apache:main Aug 27, 2024
@boring-cyborg

boring-cyborg Bot commented Aug 27, 2024

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

potiuk added a commit to potiuk/airflow that referenced this pull request Sep 4, 2024
Seems that apache#41416 PR has been somehow (?) deleted and when we try
to generate issue links for it, the issue generation fails (and it
is not an issue as well). This change should workaround that by
skipping the PR.
potiuk added a commit that referenced this pull request Sep 4, 2024
Seems that #41416 PR has been somehow (?) deleted and when we try
to generate issue links for it, the issue generation fails (and it
is not an issue as well). This change should workaround that by
skipping the PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow setting log_driver when using DockerSwarmOperator

3 participants