Skip to content

Commit 944aaa0

Browse files
authored
Disable dependency logging in local envs (#35404)
1 parent 6ac5009 commit 944aaa0

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

sdks/python/apache_beam/options/pipeline_options.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,15 @@ class StandardOptions(PipelineOptions):
615615
'apache_beam.runners.test.TestDataflowRunner',
616616
)
617617

618+
LOCAL_RUNNERS = (
619+
'BundleBasedDirectRunner',
620+
'DirectRunner',
621+
'SwitchingDirectRunner',
622+
'FnApiRunner',
623+
'PrismRunner',
624+
'TestDirectRunner',
625+
)
626+
618627
KNOWN_RUNNER_NAMES = [path.split('.')[-1] for path in ALL_KNOWN_RUNNERS]
619628

620629
@classmethod

sdks/python/apache_beam/runners/portability/sdk_container_builder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ def _build(self):
9393

9494
def _prepare_dependencies(self):
9595
with tempfile.TemporaryDirectory() as tmp:
96-
artifacts = Stager.create_job_resources(self._options, tmp)
96+
artifacts = Stager.create_job_resources(
97+
self._options, tmp, log_submission_env_dependencies=False)
9798
resources = Stager.extract_staging_tuple_iter(artifacts)
9899
# make a copy of the staged artifacts into the temp source folder.
99100
file_names = []

sdks/python/apache_beam/transforms/environments.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
from apache_beam import coders
4343
from apache_beam.options.pipeline_options import PortableOptions
4444
from apache_beam.options.pipeline_options import SetupOptions
45+
from apache_beam.options.pipeline_options import StandardOptions
4546
from apache_beam.portability import common_urns
4647
from apache_beam.portability import python_urns
4748
from apache_beam.portability.api import beam_runner_api_pb2
@@ -923,11 +924,16 @@ def python_sdk_dependencies(options, tmp_dir=None):
923924
tmp_dir = tempfile.mkdtemp()
924925
skip_prestaged_dependencies = options.view_as(
925926
SetupOptions).prebuild_sdk_container_engine is not None
927+
runner = options.view_as(
928+
StandardOptions).runner or StandardOptions.DEFAULT_RUNNER
929+
log_submission_env_dependencies = runner.split(
930+
'.')[-1] not in StandardOptions.LOCAL_RUNNERS
926931
return stager.Stager.create_job_resources(
927932
options,
928933
tmp_dir,
929934
pypi_requirements=[
930935
artifact[0] + artifact[1]
931936
for artifact in PyPIArtifactRegistry.get_artifacts()
932937
],
933-
skip_prestaged_dependencies=skip_prestaged_dependencies)
938+
skip_prestaged_dependencies=skip_prestaged_dependencies,
939+
log_submission_env_dependencies=log_submission_env_dependencies)

0 commit comments

Comments
 (0)