Skip to content

fix: namespace temp directories by username to avoid multi-user conflicts#152

Closed
Alm0stSurely wants to merge 1 commit intoaqlaboratory:mainfrom
Alm0stSurely:fix/tmp-multiuser-namespacing
Closed

fix: namespace temp directories by username to avoid multi-user conflicts#152
Alm0stSurely wants to merge 1 commit intoaqlaboratory:mainfrom
Alm0stSurely:fix/tmp-multiuser-namespacing

Conversation

@Alm0stSurely
Copy link
Copy Markdown

Problem

As reported in #150, OpenFold3 uses hardcoded paths under /tmp/ for temporary directories. On multi-user machines, this causes PermissionError when user A creates a directory (e.g., /tmp/of3_colabfold_msas/) and user B tries to write to it.

Affected paths:

Default path Location
/tmp/of3_colabfold_msas/ openfold3/core/data/tools/colabfold_msa_server.py:1000
/tmp/of3_template_data/ openfold3/core/data/pipelines/preprocessing/template.py:1605
/tmp/ramdisk/ openfold3/core/data/tools/jackhmmer.py:206

Analysis

The issue occurs because:

  1. Directories are created with default permissions (755)
  2. The paths are identical for all users on the same machine
  3. When user A creates the directory first, user B gets a permission denied error

Solution

Namespace the temporary directories by username, following the pattern used by pytest (/tmp/pytest-of-{user}/):

/tmp/of3-{username}/colabfold_msas/
/tmp/of3-{username}/template_data/
/tmp/of3-{username}/ramdisk/

This ensures each user gets their own isolated directory hierarchy, preventing permission conflicts while maintaining backward compatibility (users can still override via configuration).

Changes

  • colabfold_msa_server.py: Added getpass import, namespaced the default MSA output directory
  • template.py: Added getpass import, namespaced the default template data directory
  • jackhmmer.py: Added getpass and tempfile imports, namespaced the ramdisk directory with automatic directory creation

Testing

  • Verified syntax with python3 -m py_compile on all modified files
  • Tested path generation logic confirms proper user isolation
  • Confirmed no hardcoded /tmp paths remain in the modified files

Notes

…icts

Fixes aqlaboratory#150. Replaces hardcoded /tmp paths with user-namespaced directories
to prevent PermissionError when multiple users run OpenFold3 on the same machine.

Changes:
- colabfold_msa_server.py: /tmp/of3_colabfold_msas/ → /tmp/of3-<user>/colabfold_msas/
- template.py: /tmp/of3_template_data/ → /tmp/of3-<user>/template_data/
- jackhmmer.py: /tmp/ramdisk/ → /tmp/of3-<user>/ramdisk/

Pattern follows pytest's approach: /tmp/pytest-of-<user>/
@jandom
Copy link
Copy Markdown
Collaborator

jandom commented Mar 31, 2026

Thank you for this contribution, we've combined it with #151 and both are superseded by #158

@jandom jandom closed this Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Multi-user machine /tmp/of3-directories cause errors

2 participants