You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jayceslesar (via GitHub)" <gi...@apache.org> on 2023/12/23 00:45:50 UTC
[PR] feat(EcsRunTaskOperator): add `count` param [airflow]
jayceslesar opened a new pull request, #36383:
URL: https://github.com/apache/airflow/pull/36383
Noticed that this was missing from `EcsRunTaskOperator` as an option.
Reference: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs/client/run_task.html
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(EcsRunTaskOperator): add `count` param [airflow]
Posted by "jayceslesar (via GitHub)" <gi...@apache.org>.
jayceslesar commented on PR #36383:
URL: https://github.com/apache/airflow/pull/36383#issuecomment-1868316538
@Taragolis thanks for the feedback! I see what you mean that it will need to be reworked. A specific use case I can relate to this feature is long-running ECS tasks that are running a similar job where each task in ECS would be processing a something from a queue -- in my case it was a backfill where the task would essentially query a DB for what needed to be backfilled, run the backfill for that result, and then query again either until a timeout on the task or there were no results left in that DB. Maybe a better pattern to create a single task for each entry returned from the query initially but just giving a use case.
I also see what you mean how the polling logic would need to change for the multiple tasks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(EcsRunTaskOperator): add `count` param [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #36383:
URL: https://github.com/apache/airflow/pull/36383#issuecomment-1868154325
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 (ruff, mypy and type annotations). Our [pre-commits]( https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) 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](https://github.com/apache/airflow/blob/main/docs/apache-airflow/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
- Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/BREEZE.rst) 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](https://www.apache.org/foundation/policies/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]( https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#coding-style-and-best-practices).
- 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(EcsRunTaskOperator): add `count` param [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #36383: feat(EcsRunTaskOperator): add `count` param
URL: https://github.com/apache/airflow/pull/36383
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(EcsRunTaskOperator): add `count` param [airflow]
Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on code in PR #36383:
URL: https://github.com/apache/airflow/pull/36383#discussion_r1435628529
##########
airflow/providers/amazon/aws/operators/ecs.py:
##########
@@ -635,6 +639,8 @@ def _start_task(self):
run_opts["tags"] = [{"key": k, "value": v} for (k, v) in self.tags.items()]
if self.propagate_tags is not None:
run_opts["propagateTags"] = self.propagate_tags
+ if self.count is not None:
+ run_opts["count"] = count
Review Comment:
It will raise
```console
Traceback (most recent call last):
File "/opt/airflow/airflow/models/taskinstance.py", line 433, in _execute_task
result = execute_callable(context=context, **execute_callable_kwargs)
File "/opt/airflow/airflow/providers/amazon/aws/operators/ecs.py", line 549, in execute
self._start_task()
File "/opt/airflow/airflow/providers/amazon/aws/operators/ecs.py", line 643, in _start_task
run_opts["count"] = count
NameError: name 'count' is not defined
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(EcsRunTaskOperator): add `count` param [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #36383:
URL: https://github.com/apache/airflow/pull/36383#issuecomment-1930994895
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org