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 2020/12/09 21:07:03 UTC

[GitHub] [airflow] Gaurang033 opened a new issue #12972: Airflow cluster Policy is not working in 1.10.10

Gaurang033 opened a new issue #12972:
URL: https://github.com/apache/airflow/issues/12972


   <!--
   
   Welcome to Apache Airflow!  For a smooth issue process, try to answer the following questions.
   Don't worry if they're not all applicable; just try to include what you can :-)
   
   If you need to include code snippets or logs, please put them in fenced code
   blocks.  If they're super-long, please use the details tag like
   <details><summary>super-long log</summary> lots of stuff </details>
   
   Please delete these comment blocks before submitting the issue.
   
   -->
   
   <!--
   
   IMPORTANT!!!
   
   PLEASE CHECK "SIMILAR TO X EXISTING ISSUES" OPTION IF VISIBLE
   NEXT TO "SUBMIT NEW ISSUE" BUTTON!!!
   
   PLEASE CHECK IF THIS ISSUE HAS BEEN REPORTED PREVIOUSLY USING SEARCH!!!
   
   Please complete the next sections or the issue will be closed.
   These questions are the first thing we need to know to understand the context.
   
   -->
    
   **Apache Airflow version**: 1.10.10
   
   
   **Kubernetes version (if you are using kubernetes)** (use `kubectl version`):
   
   **Environment**:
   
   - **Cloud provider or hardware configuration**: Amazone EC2
   - **OS** (e.g. from /etc/os-release):
   NAME="Amazon Linux AMI"
   VERSION="2018.03"
   ID="amzn"
   ID_LIKE="rhel fedora"
   VERSION_ID="2018.03"
   PRETTY_NAME="Amazon Linux AMI 2018.03"
   ANSI_COLOR="0;33"
   CPE_NAME="cpe:/o:amazon:linux:2018.03:ga"
   HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
   
   - **Kernel** (e.g. `uname -a`): Linux ip-10-164-7-11 4.14.154-99.181.amzn1.x86_64
   - **Install tools**:
   - **Others**:
   
   **What happened**:
   I am trying to setup the cluster policy. However it's not working. This is a very simple code which should fail all the jobs. However, I job gets successful without any exception. 
   
   File is located at **/root/airflow/config/airflow_local_settings.py**
   
   ```python
   class PolicyError(Exception):
       pass
   
   
   def cluster_policy(task):
       print("task_instance_mutation_hook")
       raise PolicyError
   
   
   def task_instance_mutation_hook(ti):
       print("task_instance_mutation_hook")
       raise PolicyError
   ```
   
   <!-- (please include exact error messages if you can) -->
   
   **What you expected to happen**:
   If I run job it should fail with PolicyError exception 
   
   <!-- What do you think went wrong? -->
   Job is successful. 
   
   **How to reproduce it**:
   Try to place the above file at mentioned location and run the job. it should fail. 
   <!---
   
   As minimally and precisely as possible. Keep in mind we do not have access to your cluster or dags.
   
   If you are using kubernetes, please attempt to recreate the issue using minikube or kind.
   
   ## Install minikube/kind
   
   - Minikube https://minikube.sigs.k8s.io/docs/start/
   - Kind https://kind.sigs.k8s.io/docs/user/quick-start/
   
   If this is a UI bug, please provide a screenshot of the bug or a link to a youtube video of the bug in action
   
   You can include images using the .md style of
   ![alt text](http://url/to/img.png)
   
   To record a screencast, mac users can use QuickTime and then create an unlisted youtube video with the resulting .mov file.
   
   --->
   
   
   **Anything else we need to know**:
   
   <!--
   
   How often does this problem occur? Once? Every time etc?
   
   Any relevant logs to include? Put them here in side a detail tag:
   <details><summary>x.log</summary> lots of stuff </details>
   
   -->
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] turbaszek commented on issue #12972: Airflow cluster Policy is not working in 1.10.10

Posted by GitBox <gi...@apache.org>.
turbaszek commented on issue #12972:
URL: https://github.com/apache/airflow/issues/12972#issuecomment-742622880


   As far as I'm aware we don't have something like `cluster_policy` we have `policy`:
   http://airflow.apache.org/docs/apache-airflow/1.10.12/concepts.html#mutate-tasks-after-dag-loaded
   https://github.com/apache/airflow/blob/6416d898060706787861ff8ecbc4363152a35f45/airflow/settings.py#L172-L188
   
   
   The docs seems to be slightly misleading. 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ashb closed issue #12972: Airflow cluster Policy is not working in 1.10.10

Posted by GitBox <gi...@apache.org>.
ashb closed issue #12972:
URL: https://github.com/apache/airflow/issues/12972


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] Gaurang033 commented on issue #12972: Airflow cluster Policy is not working in 1.10.10

Posted by GitBox <gi...@apache.org>.
Gaurang033 commented on issue #12972:
URL: https://github.com/apache/airflow/issues/12972#issuecomment-742581918


   @ashb yes, I realize that, I upgraded to 1.10.12 and I can say those error messages. 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] turbaszek edited a comment on issue #12972: Airflow cluster Policy is not working in 1.10.10

Posted by GitBox <gi...@apache.org>.
turbaszek edited a comment on issue #12972:
URL: https://github.com/apache/airflow/issues/12972#issuecomment-742622880


   As far as I'm aware we don't have something like `cluster_policy` function we have `policy` function (which is usually called cluster policy):
   http://airflow.apache.org/docs/apache-airflow/1.10.12/concepts.html#mutate-tasks-after-dag-loaded
   https://github.com/apache/airflow/blob/6416d898060706787861ff8ecbc4363152a35f45/airflow/settings.py#L172-L188
   
   
   The docs seems to be slightly misleading. 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ashb commented on issue #12972: Airflow cluster Policy is not working in 1.10.10

Posted by GitBox <gi...@apache.org>.
ashb commented on issue #12972:
URL: https://github.com/apache/airflow/issues/12972#issuecomment-742062801


   That's because cluster policy wasn't introduced until 1.10.12:
   
   http://airflow.apache.org/docs/apache-airflow/1.10.12/concepts.html#cluster-policies-for-custom-task-checks


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org