From commits-return-13786-archive-asf-public=cust-asf.ponee.io@airflow.incubator.apache.org Wed Apr 11 03:15:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 131FF18067B for ; Wed, 11 Apr 2018 03:15:03 +0200 (CEST) Received: (qmail 31502 invoked by uid 500); 11 Apr 2018 01:15:02 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 31482 invoked by uid 99); 11 Apr 2018 01:15:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Apr 2018 01:15:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 3C495180290 for ; Wed, 11 Apr 2018 01:15:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id MSobqdUVhdG8 for ; Wed, 11 Apr 2018 01:15:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 5244B5F666 for ; Wed, 11 Apr 2018 01:15:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id B7107E0842 for ; Wed, 11 Apr 2018 01:15:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 7F15C241C6 for ; Wed, 11 Apr 2018 01:15:00 +0000 (UTC) Date: Wed, 11 Apr 2018 01:15:00 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AIRFLOW-2162) Run DAG as user other than airflow does NOT have access to AIRFLOW_ environment variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AIRFLOW-2162?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16= 433262#comment-16433262 ]=20 ASF subversion and git services commented on AIRFLOW-2162: ---------------------------------------------------------- Commit 354492bc597130f43c76e7bec4bc894fb6deb7fe in incubator-airflow's bran= ch refs/heads/master from [~johnarnold] [ https://git-wip-us.apache.org/repos/asf?p=3Dincubator-airflow.git;h=3D354= 492b ] [AIRFLOW-2162] When impersonating another user, pass env variables to sudo > Run DAG as user other than airflow does NOT have access to AIRFLOW_ envir= onment variables > -------------------------------------------------------------------------= ---------------- > > Key: AIRFLOW-2162 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2162 > Project: Apache Airflow > Issue Type: Bug > Components: configuration > Reporter: Sebastian Radloff > Assignee: John Arnold > Priority: Minor > Labels: configuration > > When running airflow with LocalExecutor, I inject airflow environment=C2= =A0variables that are supposed to override what is in the airflow.cfg, acco= rding to the documentation [https://airflow.apache.org/configuration.html. > I|https://airflow.apache.org/configuration.html.]f you specify to run you= r=C2=A0DAGs as another linux=C2=A0user, root for example, this is what airf= low executes under the hood: > {code:java} > ['bash', '-c', u'sudo -H -u root airflow run docker_sample docker_op_test= er 2018-03-01T15:14:55.699668 --job_id 2 --raw -sd DAGS_FOLDER/docker-opera= tor.py --cfg_path /tmp/tmpignV9B'] > {code} > =C2=A0 > It uses sudo=C2=A0and switches to the root linux=C2=A0user, unfortunately= , it won't have access to the environment variables injected to override th= e config. This is important for people who are trying to inject variables i= nto a docker container at run time while wishing to maintain a level of sec= urity around database credentials. > I think a decent proposal made by [~ashb] in gitter, would be to=C2=A0aut= omatically pass all environment variables starting with *AIRFLOW__* to any = user. Please lmk=C2=A0if y'all=C2=A0want any help on the documentation or p= oint me in the right direction and I=C2=A0could create a PR.=C2=A0 > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)