Skip to content

Commit 6589cd4

Browse files
committed
Move local repo registry out of ~lsst.
The directory may be reset during certain kinds of reboots, while the repo itself is not.
1 parent a569c0c commit 6589cd4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

python/activator/repo_tracker.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
_log.setLevel(logging.DEBUG)
4444

4545

46+
# Absolute path on this worker's system where local repos may be created
47+
local_repos = os.environ.get("LOCAL_REPOS", "/tmp")
48+
49+
4650
class LocalRepoTracker:
4751
"""A mapping of process IDs to repo locations.
4852
@@ -56,7 +60,10 @@ class LocalRepoTracker:
5660
"""
5761
_instance: typing.Self | None = None
5862

59-
_BACKEND_FILE = os.path.join(os.path.expanduser("~"), ".repo.tracker.csv")
63+
# Temp space is guaranteed to be in persistent storage (local disk
64+
# in unit tests, ephemeral in container). The same is NOT true for
65+
# ~ or /app.
66+
_BACKEND_FILE = os.path.join(local_repos, ".repo.tracker.csv")
6067

6168
@staticmethod
6269
def get() -> typing.Self:

0 commit comments

Comments
 (0)