File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
.github/triage/jax_toolbox_triage Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1+ import hashlib
12import logging
23import pathlib
34import secrets
45import subprocess
56import typing
67
8+ # Used to make sure the {url: name} mapping is consistent within a process, but that
9+ # names are not re-used by different invocations of the triage tool. Using a consistent
10+ # mapping is a simple way of avoiding re-creating the container multiple times, e.g.
11+ # for .exists()
12+ _process_token = secrets .token_bytes ()
713
814class PyxisContainer :
915 def __init__ (
@@ -16,7 +22,7 @@ def __init__(
1622 self ._logger = logger
1723 mount_str = "," .join (map (lambda t : f"{ t [0 ]} :{ t [1 ]} " , mounts ))
1824 self ._mount_args = [f"--container-mounts={ mount_str } " ] if mount_str else []
19- self ._name = secrets . token_urlsafe ()
25+ self ._name = hashlib . sha256 ( url . encode () + _process_token ). hexdigest ()
2026 self ._url = url
2127
2228 def __enter__ (self ):
You can’t perform that action at this time.
0 commit comments