You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by al...@apache.org on 2017/06/16 16:43:52 UTC
[1/2] beam git commit: Fixed handling of use_public_ips. Added test.
Repository: beam
Updated Branches:
refs/heads/master 901e96813 -> f2a32b2ca
Fixed handling of use_public_ips. Added test.
Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/c597a020
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/c597a020
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/c597a020
Branch: refs/heads/master
Commit: c597a020c87f272a5920bf29195d9e314af2f828
Parents: 901e968
Author: Marian Dvorsky <ma...@google.com>
Authored: Fri Jun 16 15:57:13 2017 +0200
Committer: Ahmet Altay <al...@google.com>
Committed: Fri Jun 16 09:43:35 2017 -0700
----------------------------------------------------------------------
.../apache_beam/options/pipeline_options.py | 9 +++++++-
.../runners/dataflow/internal/apiclient_test.py | 24 ++++++++++++++++++++
2 files changed, 32 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/beam/blob/c597a020/sdks/python/apache_beam/options/pipeline_options.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/options/pipeline_options.py b/sdks/python/apache_beam/options/pipeline_options.py
index 283b340..8644e51 100644
--- a/sdks/python/apache_beam/options/pipeline_options.py
+++ b/sdks/python/apache_beam/options/pipeline_options.py
@@ -465,7 +465,14 @@ class WorkerOptions(PipelineOptions):
parser.add_argument(
'--use_public_ips',
default=None,
- help='Whether to assign public IP addresses to the worker machines.')
+ action='store_true',
+ help='Whether to assign public IP addresses to the worker VMs.')
+ parser.add_argument(
+ '--no_use_public_ips',
+ dest='use_public_ips',
+ default=None,
+ action='store_false',
+ help='Whether to assign only private IP addresses to the worker VMs.')
def validate(self, validator):
errors = []
http://git-wip-us.apache.org/repos/asf/beam/blob/c597a020/sdks/python/apache_beam/runners/dataflow/internal/apiclient_test.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/runners/dataflow/internal/apiclient_test.py b/sdks/python/apache_beam/runners/dataflow/internal/apiclient_test.py
index 67cf77f..55211f7 100644
--- a/sdks/python/apache_beam/runners/dataflow/internal/apiclient_test.py
+++ b/sdks/python/apache_beam/runners/dataflow/internal/apiclient_test.py
@@ -122,6 +122,30 @@ class UtilTest(unittest.TestCase):
self.assertEqual(
metric_update.floatingPointMean.count.lowBits, accumulator.count)
+ def test_default_ip_configuration(self):
+ pipeline_options = PipelineOptions(
+ ['--temp_location', 'gs://any-location/temp'])
+ env = apiclient.Environment([], pipeline_options, '2.0.0')
+ self.assertEqual(env.proto.workerPools[0].ipConfiguration, None)
+
+ def test_public_ip_configuration(self):
+ pipeline_options = PipelineOptions(
+ ['--temp_location', 'gs://any-location/temp',
+ '--use_public_ips'])
+ env = apiclient.Environment([], pipeline_options, '2.0.0')
+ self.assertEqual(
+ env.proto.workerPools[0].ipConfiguration,
+ dataflow.WorkerPool.IpConfigurationValueValuesEnum.WORKER_IP_PUBLIC)
+
+ def test_private_ip_configuration(self):
+ pipeline_options = PipelineOptions(
+ ['--temp_location', 'gs://any-location/temp',
+ '--no_use_public_ips'])
+ env = apiclient.Environment([], pipeline_options, '2.0.0')
+ self.assertEqual(
+ env.proto.workerPools[0].ipConfiguration,
+ dataflow.WorkerPool.IpConfigurationValueValuesEnum.WORKER_IP_PRIVATE)
+
if __name__ == '__main__':
unittest.main()
[2/2] beam git commit: This closes #3379
Posted by al...@apache.org.
This closes #3379
Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/f2a32b2c
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/f2a32b2c
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/f2a32b2c
Branch: refs/heads/master
Commit: f2a32b2ca61430d3cc2085166b758e7637d69a28
Parents: 901e968 c597a02
Author: Ahmet Altay <al...@google.com>
Authored: Fri Jun 16 09:43:42 2017 -0700
Committer: Ahmet Altay <al...@google.com>
Committed: Fri Jun 16 09:43:42 2017 -0700
----------------------------------------------------------------------
.../apache_beam/options/pipeline_options.py | 9 +++++++-
.../runners/dataflow/internal/apiclient_test.py | 24 ++++++++++++++++++++
2 files changed, 32 insertions(+), 1 deletion(-)
----------------------------------------------------------------------