Skip to content

Commit

Permalink
grant spark user rw access
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianhao-Gu committed Sep 12, 2024
1 parent b97d95b commit e2ac159
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/jupyterhub_config/custom_spawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ def _ensure_user_directory(self, user_dir: Path, username: str):
# Set directory permissions to 750: Owner (rwx), Group (r-x), Others (---)
os.chmod(user_dir, 0o750)

# Grand spark_user read/write access to the user's home directory
self.log.info(f'Granting read/write access to spark_user for {username}')
subprocess.run(['sudo', 'setfacl', '-m', f'u:spark_user:rwX', user_dir], check=True)
subprocess.run(['sudo', 'setfacl', '-m', f'u:root:rwX', user_dir], check=True)

else:
self.log.info(f'Reusing user directory for {username}')

Expand Down

0 comments on commit e2ac159

Please sign in to comment.