feat(utils) - Utility Scripts for Virtual Machines - #1
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces utility scripts for managing users and packages on shared virtual machines/development environments. The scripts provide functions for user management (creation, deletion, SSH setup) and global package installation (conda, poetry, uv) with shared caching configurations.
Key changes:
- User administration functions for creating/deleting users with custom directories and group management
- Package administration functions for installing Python package managers globally with shared caches
- Environment setup utilities for configuring user-specific cache directories and shell profiles
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/vm_admin/user_admin.sh | User management functions including creation, deletion, SSH setup, and environment configuration |
| scripts/vm_admin/opt_admin.sh | Global package manager installation functions for conda, poetry, and uv with shared cache setup |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| sudo chown -R root:"$group_owner" "$python_install_dir" | ||
| sudo chmod -R 2775 "$python_install_dir" |
There was a problem hiding this comment.
The chown and chmod operations on lines 94-95 should target $python_bin_dir instead of $python_install_dir, as the mkdir operation on line 93 creates the $python_bin_dir directory.
| sudo chown -R root:"$group_owner" "$python_install_dir" | |
| sudo chmod -R 2775 "$python_install_dir" | |
| sudo chown -R root:"$group_owner" "$python_bin_dir" | |
| sudo chmod -R 2775 "$python_bin_dir" |
| sudo ln -s "$userdir" "$scratch_link" | ||
| sudo chown -h "$username:$username" "$scratch_link" | ||
|
|
||
| add_user_to_groups "$username" "${groups[@]}" |
There was a problem hiding this comment.
The function call will fail if the groups array is empty because add_user_to_groups returns 1 when no groups are specified, but this is inside the conditional block that only executes when userdir is set. Consider moving this outside the conditional or handling the empty groups case differently.
| sudo chown -R root:"$group_owner" "$python_install_dir" | ||
| sudo chmod -R 2775 "$python_install_dir" |
There was a problem hiding this comment.
should this be $python_bin_dir?
Utility scripts for setting up users and packages on shared VMs/development environments