You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/09/21 15:33:43 UTC

[GitHub] [airflow] hanna-liashchuk opened a new pull request, #26560: [ISSUE-18468] add container_name option for SparkKubernetesSensor

hanna-liashchuk opened a new pull request, #26560:
URL: https://github.com/apache/airflow/pull/26560

   closes: ISSUE-18468 and ISSUE-23114
   
   In case if a SparkApplications has a sidecar container, SparkKubernetesSensor fails to retrieve logs for the application because the container name is not specified. According to [this](https://github.com/GoogleCloudPlatform/spark-on-k8s-operator/blob/master/pkg/config/constants.go#L306) constants, Spark driver container always named "spark-kubernetes-driver".  
   
   Error message look like this:
   ```
   [2022-09-20, 17:06:41 EEST] {{spark_kubernetes.py:89}} WARNING - Could not read logs for pod XXXX. It may have been disposed.
   Make sure timeToLiveSeconds is set on your SparkApplication spec.
   underlying exception: (400)
   Reason: Bad Request
   HTTP response headers: HTTPHeaderDict({'Audit-Id': '86d533f0-a61e-4126-a4fa-a11d03c40ec0', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'Date': 'Tue, 20 Sep 2022 14:06:41 GMT', 'Content-Length': '268'})
   HTTP response body: b'{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"a container name must be specified for pod XXXX, choose one of: [spark-kubernetes-driver minio-sidekick]","reason":"BadRequest","code":400}\n'
   
   [2022-09-20, 17:06:41 EEST] {{spark_kubernetes.py:115}} INFO - Spark application ended successfully
   ```
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   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](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
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


[GitHub] [airflow] bbenzikry commented on pull request #26560: add container_name option for SparkKubernetesSensor

Posted by GitBox <gi...@apache.org>.
bbenzikry commented on PR #26560:
URL: https://github.com/apache/airflow/pull/26560#issuecomment-1269053357

   Hi @hanna-liashchuk thanks for taking the time to work on this. 
   
   One thing in this regard is that the container name should probably be overridable
   This will be good both for custom spark distros and provides a bit of future-proofing in case the default does change upstream


-- 
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


[GitHub] [airflow] hanna-liashchuk commented on pull request #26560: add container_name option for SparkKubernetesSensor

Posted by GitBox <gi...@apache.org>.
hanna-liashchuk commented on PR #26560:
URL: https://github.com/apache/airflow/pull/26560#issuecomment-1269672127

   @bbenzikry, I was aiming to do it as a parameter for SparkKubernetesSensor, by analogy with other input parameters, so the user can specify it if it's different from the default. Do I miss some parts of this implementation?  Please advice 
   Thanks 


-- 
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


[GitHub] [airflow] hanna-liashchuk commented on pull request #26560: [ISSUE-18468] add container_name option for SparkKubernetesSensor

Posted by GitBox <gi...@apache.org>.
hanna-liashchuk commented on PR #26560:
URL: https://github.com/apache/airflow/pull/26560#issuecomment-1253926081

   hi @jedcunningham, could you please take a look at my PR? 


-- 
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


[GitHub] [airflow] bbenzikry commented on pull request #26560: add container_name option for SparkKubernetesSensor

Posted by GitBox <gi...@apache.org>.
bbenzikry commented on PR #26560:
URL: https://github.com/apache/airflow/pull/26560#issuecomment-1271868917

   @hanna-liashchuk , what I meant by the comment isn't necessarily a code issue or a blocker for the PR ( sorry if that was the implication ) but just that it should be taken into consideration. 
   For example, one thing I thought of was that given a different container name, if there's an error - some output should be added to explain the reasoning, as a helpful indicator to the sensor user. 
   In addition, a differing container name should probably be reflected in a test case. 


-- 
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


[GitHub] [airflow] boring-cyborg[bot] commented on pull request #26560: add container_name option for SparkKubernetesSensor

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on PR #26560:
URL: https://github.com/apache/airflow/pull/26560#issuecomment-1272808171

   Awesome work, congrats on your first merged pull request!
   


-- 
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


[GitHub] [airflow] boring-cyborg[bot] commented on pull request #26560: [ISSUE-18468] add container_name option for SparkKubernetesSensor

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on PR #26560:
URL: https://github.com/apache/airflow/pull/26560#issuecomment-1253879138

   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]( 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).
   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


[GitHub] [airflow] potiuk merged pull request #26560: add container_name option for SparkKubernetesSensor

Posted by GitBox <gi...@apache.org>.
potiuk merged PR #26560:
URL: https://github.com/apache/airflow/pull/26560


-- 
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