beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ahmet Altay (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (BEAM-1068) Service Account Credentials File Specified via Pipeline Option Ignored
Date Thu, 13 Apr 2017 23:02:41 GMT

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

Ahmet Altay resolved BEAM-1068.
-------------------------------
    Resolution: Fixed

> Service Account Credentials File Specified via Pipeline Option Ignored
> ----------------------------------------------------------------------
>
>                 Key: BEAM-1068
>                 URL: https://issues.apache.org/jira/browse/BEAM-1068
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py
>         Environment: CentOS Linux release 7.1.1503 (Core)
> Python 2.7.5
>            Reporter: Stephen Reichling
>            Assignee: Ahmet Altay
>            Priority: Minor
>             Fix For: First stable release
>
>
> When writing a pipeline that authenticates with Google Dataflow APIs using a service
account, specifying the path to that service account's credentials file in the {{PipelineOptions}}
object passed in to the pipeline does not work, it only works when passed as a command-line
flag.
> For example, if I write code like so:
> {code}
> pipelineOptions = options.PipelineOptions()
> gcOptions = pipelineOptions.view_as(options.GoogleCloudOptions)
> gcOptions.service_account_name = 'My Service Account Name'
> gcOptions.service_account_key_file = '/some/path/keyfile.p12'
> pipeline = beam.Pipeline(options=pipelineOptions)
> # ... add stages to the pipeline
> p.run()
> {code}
> and execute it like so:
> {{python ./my_pipeline.py}}
> ...the service account I specify will not be used.
> Only if I were to execute the code like so:
> {{python ./my_pipeline.py --service_account_name 'My Service Account Name' --service_account_key_file
/some/path/keyfile.p12}}
> ...does it actually use the service account.
> The problem appears to be rooted in `auth.py` which reconstructs the {{PipelineOptions}}
object directly from {{sys.argv}} rather than using the instance passed in to the pipeline:
https://github.com/apache/incubator-beam/blob/9ded359daefc6040d61a1f33c77563474fcb09b6/sdks/python/apache_beam/internal/auth.py#L129-L130



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message