Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 85C29200D48 for ; Wed, 29 Nov 2017 23:54:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 84264160C17; Wed, 29 Nov 2017 22:54:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CABEE160C04 for ; Wed, 29 Nov 2017 23:54:05 +0100 (CET) Received: (qmail 98219 invoked by uid 500); 29 Nov 2017 22:54:05 -0000 Mailing-List: contact commits-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.apache.org Delivered-To: mailing list commits@beam.apache.org Received: (qmail 98209 invoked by uid 99); 29 Nov 2017 22:54:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Nov 2017 22:54:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 68456C3D59 for ; Wed, 29 Nov 2017 22:54:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.01 X-Spam-Level: X-Spam-Status: No, score=-99.01 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KB_WAM_FROM_NAME_SINGLEWORD=0.2, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, URI_TRY_3LD=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 7WZShd4UuFz0 for ; Wed, 29 Nov 2017 22:54:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id EE3695F588 for ; Wed, 29 Nov 2017 22:54:02 +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 0A432E12E3 for ; Wed, 29 Nov 2017 22:54:02 +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 61CE42105F for ; Wed, 29 Nov 2017 22:54:01 +0000 (UTC) Date: Wed, 29 Nov 2017 22:54:01 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: commits@beam.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (BEAM-3184) Not able to access GCS API when submitting Python jobs behind corporate firewall MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 29 Nov 2017 22:54:06 -0000 [ https://issues.apache.org/jira/browse/BEAM-3184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16271706#comment-16271706 ] ASF GitHub Bot commented on BEAM-3184: -------------------------------------- charlesccychen commented on a change in pull request #4136: [BEAM-3184] Added ProxyInfoFromEnvironmentVar() & GetNewHttp() methods for GCS URL: https://github.com/apache/beam/pull/4136#discussion_r153940122 ########## File path: sdks/python/apache_beam/io/gcp/gcsio.py ########## @@ -87,6 +87,39 @@ MAX_BATCH_OPERATION_SIZE = 100 +def proxy_info_from_environment_var(proxy_env_var): + """Reads proxy info from the environment and converts to httplib2.ProxyInfo. + Args: + proxy_env_var: environment variable string to read, http_proxy or + https_proxy (in lower case). + Example: http://myproxy.domain.com:8080 + Returns: + httplib2.ProxyInfo constructed from the environment string. + """ + proxy_url = os.environ.get(proxy_env_var) + if not proxy_url or not proxy_env_var.lower().startswith('http'): + return httplib2.ProxyInfo(httplib2.socks.PROXY_TYPE_HTTP, None, 0) + logging.warn("Ignoring proxy_env_var, incorrect format") + proxy_protocol = proxy_env_var.lower().split('_')[0] Review comment: Where does the underscore come from? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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 > Not able to access GCS API when submitting Python jobs behind corporate firewall > -------------------------------------------------------------------------------- > > Key: BEAM-3184 > URL: https://issues.apache.org/jira/browse/BEAM-3184 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core > Reporter: David Sabater > Original Estimate: 2m > Remaining Estimate: 2m > > We should modify gcsio.py module in Python sdk to add methods to pick up proxy settings from environment variables in httplib2 library. This will allow submitting jobs from behind a corporate proxy. > I do have the fix implemented in my forked repository. > https://github.com/dsdinter/beam/commit/83a54b5b5695783967a175c4623af31997e52b35 -- This message was sent by Atlassian JIRA (v6.4.14#64029)