[ 
https://issues.apache.org/jira/browse/BEAM-13685?focusedWorklogId=711666&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-711666
 ]

ASF GitHub Bot logged work on BEAM-13685:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 19/Jan/22 21:20
            Start Date: 19/Jan/22 21:20
    Worklog Time Spent: 10m 
      Work Description: KevinGG commented on a change in pull request #16555:
URL: https://github.com/apache/beam/pull/16555#discussion_r788143922



##########
File path: 
sdks/python/apache_beam/runners/interactive/interactive_environment.py
##########
@@ -359,10 +359,14 @@ def get_cache_manager(self, pipeline, 
create_if_absent=False):
     manager for the pipeline."""
     cache_manager = self._cache_managers.get(str(id(pipeline)), None)
     if not cache_manager and create_if_absent:
-      cache_dir = tempfile.mkdtemp(
-          suffix=str(id(pipeline)),
-          prefix='it-',
-          dir=os.environ.get('TEST_TMPDIR', None))
+      from apache_beam.runners.interactive import interactive_beam as ib
+      if ib.options.specified_cache_dir:
+        cache_dir = ib.options.specified_cache_dir

Review comment:
       Should we add a prefix check here?
   
   For example:
   
   - if the path starts with "gs://", treat it as a GCS bucket (we may add a 
GCS file check later and log warnings if something isn't right).
   - else treat it as a local path, create a temp dir under that path and log 
warning if something is wrong.
   `cache_dir = tempfile.mkdtemp(dir=cache_dir)`
   
   Ideally, pipelines should not share a common directory to store cache files, 
so the ib.options.specified_cache_dir should only serve as a parent path for 
each cache manager's own files.
   




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 711666)
    Time Spent: 2h 40m  (was: 2.5h)

> Enable users to specify cache directory under Interactive Beam options
> ----------------------------------------------------------------------
>
>                 Key: BEAM-13685
>                 URL: https://issues.apache.org/jira/browse/BEAM-13685
>             Project: Beam
>          Issue Type: Task
>          Components: runner-py-interactive
>            Reporter: Victor Chen
>            Assignee: Victor Chen
>            Priority: P2
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> - Adds specified_cache_dir option under interactive_beam.py and 
> interactive_options.py
>  - Integrates new specified_cache_dir from interactive_beam.py into 
> cache_manager.py and streaming_cache.py
>  - Includes unit tests under cache_manager_test.py and streaming_cache_test.py



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to