SBGrid Developer Best Practices
SBGrid is commonly deployed on shared multi-user systems. The SBGrid installation directory is not writeable by standard users. We support a variety of operating systems and hardware. Follow our guidelines below to facilitate inclusion of your software in SBGrid.
- User-Space Configuration: Direct all configuration, logs, and cache files to user-writable locations (e.g.,
$HOMEor$XDG_CONFIG_HOME). Avoid writing to installation directories and allow users to specify custom data/model paths. - Flexible Dependency Resolution: Avoid hardcoding absolute paths or RPATHs. Use specific versioning for requirements to ensure stability across different cluster environments.
- Scheduler Integration: Respect resource limits (CPU/GPU) defined by workload managers like Slurm. Query environment variables rather than hardcoding resource counts to ensure cooperative execution.
- Network Constraints: Avoid deploying outward-facing webservers or persistent background daemons. Compute nodes are shared resources and typically operate behind restrictive firewalls.
- I/O Optimization: Design for parallel file systems by minimizing small-file metadata operations and prioritizing batched I/O to maintain system-wide performance.
- Relocatable Installations: Ensure the software is prefix-independent. Use relative paths for internal assets so the installation remains functional if moved to a different directory by administrators.