Skip to content

Remove hardcoded 0x777 file mode #1834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions checkpoint/orbax/checkpoint/_src/path/atomicity.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __call__(
path: epath.Path,
parents: bool = False,
exist_ok: bool = False,
mode: int = step_lib.WORLD_READABLE_MODE,
mode: int = step_lib.NON_WORLD_READABLE_MODE,
**kwargs,
) -> Awaitable[None]:
"""Creates the directory at path."""
Expand All @@ -99,7 +99,7 @@ async def _create_tmp_directory(
tmp_dir: epath.Path,
*,
primary_host: Optional[int] = 0,
path_permission_mode: int = step_lib.WORLD_READABLE_MODE,
path_permission_mode: int = step_lib.NON_WORLD_READABLE_MODE,
checkpoint_metadata_store: Optional[
checkpoint_metadata.MetadataStore
] = None,
Expand Down Expand Up @@ -392,7 +392,7 @@ async def create(
Raises:
FileExistsError: if tmp directory already exists.
"""
mode = step_lib.WORLD_READABLE_MODE
mode = step_lib.NON_WORLD_READABLE_MODE
mode = (
file_options.path_permission_mode or self._path_permission_mode or mode
)
Expand Down
2 changes: 2 additions & 0 deletions checkpoint/orbax/checkpoint/_src/path/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@

# This file mode gives full permissions to OWNER, GROUP and OTHER.
WORLD_READABLE_MODE = 0o777
# This file mode removes permission bits for OTHER in the POSIX file mode.
NON_WORLD_READABLE_MODE = 0o770

MetadataT = TypeVar('MetadataT', bound='Metadata')

Expand Down