You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "wei.he (JIRA)" <ji...@apache.org> on 2016/07/22 07:58:20 UTC

[jira] [Updated] (AIRFLOW-357) how should I use the right owner task in airflow?

     [ https://issues.apache.org/jira/browse/AIRFLOW-357?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

wei.he updated AIRFLOW-357:
---------------------------
    Description: 
I dont understand the "owner" in airflow. the comment of ower is "the owner of the task, using the unix username is recommended". I wrote some the following code.

Default_args = {
'owner': 'max',
'depends_on_past': False,
'start_date': datetime(2016, 7, 14),
'email': ['max@test.com'],
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
'retry_delay': timedelta(minutes=5), 
dag = DAG('dmp-annalect', default_args=default_args,
                    schedule_interval='30 0 * * *')


task1_pigjob_basedata = """
{local_dir}/src/basedata/basedata.sh > {local_dir}/log/basedata/run_log &
""".format(local_dir=WORKSPACE)

task1_pigjob_basedata = BashOperator(
task_id='task1_pigjob_basedata_impclk',owner='max',
bash_command=pigjob_basedata_impclk,
dag=dag)

 I used the command "airflow test dagid taskid 2016-07-20" , But I got a error, ... {bash_operator.py:77} INFO - put: Permission denied: user=airflow, ....

I thought that my job ran with "max" user, but apperently , ran test using 'airflow' user .

I hope if I run my task using 'max' user, how should I do.

Thanks


  was:
I dont understand the "owner" in airflow. the comment of ower is "the owner of the task, using the unix username is recommended". I wrote some the following code.

Default_args = {
'owner': 'max',
'depends_on_past': False,
'start_date': datetime(2016, 7, 14),
'email': ['max@test.com'],
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
'retry_delay': timedelta(minutes=5), 
dag = DAG('dmp-annalect', default_args=default_args,
                    schedule_interval='30 0 * * *')
task1_pigjob_basedata = """
{local_dir}/src/basedata/basedata.sh > {local_dir}/log/basedata/run_log &
""".format(local_dir=WORKSPACE)

task1_pigjob_basedata = BashOperator(
task_id='task1_pigjob_basedata_impclk',owner='max',
bash_command=pigjob_basedata_impclk,
dag=dag)

 I used the command "airflow test dagid taskid 2016-07-20" , But I got a error, ... {bash_operator.py:77} INFO - put: Permission denied: user=airflow, ....

I thought that my job ran with "max" user, but apperently , ran test using 'airflow' user .

I hope if I run my task using 'max' user, how should I do.

Thanks



> how should I use the right owner task in airflow?
> -------------------------------------------------
>
>                 Key: AIRFLOW-357
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-357
>             Project: Apache Airflow
>          Issue Type: Bug
>    Affects Versions: Airflow 1.7.1
>            Reporter: wei.he
>
> I dont understand the "owner" in airflow. the comment of ower is "the owner of the task, using the unix username is recommended". I wrote some the following code.
> Default_args = {
> 'owner': 'max',
> 'depends_on_past': False,
> 'start_date': datetime(2016, 7, 14),
> 'email': ['max@test.com'],
> 'email_on_failure': False,
> 'email_on_retry': False,
> 'retries': 1,
> 'retry_delay': timedelta(minutes=5), 
> dag = DAG('dmp-annalect', default_args=default_args,
>                     schedule_interval='30 0 * * *')
> task1_pigjob_basedata = """
> {local_dir}/src/basedata/basedata.sh > {local_dir}/log/basedata/run_log &
> """.format(local_dir=WORKSPACE)
> task1_pigjob_basedata = BashOperator(
> task_id='task1_pigjob_basedata_impclk',owner='max',
> bash_command=pigjob_basedata_impclk,
> dag=dag)
>  I used the command "airflow test dagid taskid 2016-07-20" , But I got a error, ... {bash_operator.py:77} INFO - put: Permission denied: user=airflow, ....
> I thought that my job ran with "max" user, but apperently , ran test using 'airflow' user .
> I hope if I run my task using 'max' user, how should I do.
> Thanks



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)