tvalentyn commented on a change in pull request #14390:
URL: https://github.com/apache/beam/pull/14390#discussion_r614375016
##########
File path: sdks/python/apache_beam/runners/dataflow/dataflow_runner_test.py
##########
@@ -863,6 +863,30 @@ def test_pack_combiners_enabled_by_experiment(self):
self._test_pack_combiners(
PipelineOptions(self.default_properties), expect_packed=True)
+ def test_resource_hints_translation(self):
+ runner = DataflowRunner()
+ self.default_properties.append('--resource_hint=accelerator=some_gpu')
+ self.default_properties.append('--resource_hint=min_ram=20GB')
+ with beam.Pipeline(runner=runner,
+ options=PipelineOptions(self.default_properties)) as p:
+ # pylint: disable=expression-not-assigned
+ (
+ p
+ | beam.Create([1])
+ | 'MapWithHints' >> beam.Map(lambda x: x + 1).with_resource_hints(
+ min_ram='10GB',
+
accelerator='type:nvidia-tesla-k80;count:1;install-nvidia-drivers'
+ ))
+
+ step = self._find_step(runner.job, 'MapWithHints')
+ self.assertEqual(
+ step['properties']['resource_hints'],
+ {
+ 'beam:resources:min_ram_bytes:v1': '20000000000',
Review comment:
@edre - fyi, this is a sample (URN, value) after it is converted into
v1beta3.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]