Updating the Dashboard
How to update your HPC Dashboard installation to the latest version
Updating the Dashboard
Keeping your HPC Dashboard up to date ensures you have the latest features, security patches, and bug fixes. This guide covers the update process using the provided update script.
Update Script
The dashboard includes an infra/update.sh script that automates the update process. This script handles pulling the latest code, cleaning build artifacts, managing environment files, and rebuilding the application.
Using the Update Script
-
Navigate to the dashboard directory:
cd /path/to/slurm-node-dashboard -
Run the update script:
./infra/update.shThe script will:
- Pull the latest changes from the git repository
- Remove build artifacts (.next, node_modules, package-lock.json)
- Handle .env file setup automatically
- Install any new or updated dependencies
- Rebuild the application
-
Start the updated dashboard:
npm run start
Update Script Options
Skip Git Pull
If you want to rebuild without pulling new code (useful for testing local changes):
./infra/update.sh --skip-pull
How the Script Handles Environment Files
The update script intelligently manages your environment configuration:
- If
.envexists: Your existing configuration is preserved. If.env.productionalso exists, it's moved to a timestamped backup to prevent conflicts. - If
.envdoesn't exist: The script creates.envfrom.env.productionand prompts you to configure it.
Environment Configuration:
After running the update script for the first time, make sure to edit your .env file with your specific cluster configuration.
Manual Update Process
If you prefer to update manually or need more control over the process:
-
Pull the latest code:
git pull -
Remove build artifacts (recommended for clean rebuild):
rm -rf .next node_modules package-lock.json -
Install dependencies:
npm install -
Build the application:
npm run build -
Start the dashboard:
npm run start
PM2 Users:
If you're using PM2 for process management, replace npm run start with pm2 restart slurm-dashboard (or your process name).
Best Practices
Before Updating
- Backup your configuration: Make a copy of your
.envfile and any custom configurations - Check the release notes: Review changes and breaking updates in the GitHub repository
- Plan for downtime: Schedule updates during low-usage periods
After Updating
- Verify functionality: Test key features after the update
- Check logs: Review PM2 logs for any errors or warnings
- Update documentation: Note the version and update date in your records
Environment Variables
When updating, always compare your .env file with .env.production to identify new configuration options:
diff .env .env.production
Add any new required environment variables to your .env file.
Troubleshooting
Update Script Fails
If the update script encounters errors:
-
Check file permissions:
chmod +x infra/update.sh -
Review git status:
git status -
Resolve any merge conflicts manually, then run the script again
-
Check npm logs for dependency issues:
npm cache clean --force npm install
Build Fails
If the build process fails:
-
Check Node.js version:
node --version # Should be v20+ -
Clear build cache:
rm -rf .next npm run build -
Review error messages in the build output for specific issues
Environment File Issues
If you have problems with environment variables:
-
Check for duplicate files:
ls -la .env*Only
.envshould exist in production (not.env.production) -
Compare with example:
# If you have a backup diff .env .env.production.backup_* -
Verify required variables are set in your
.envfile
Version Management
Checking Current Version
View the current version in the dashboard footer or check package.json:
grep version package.json
Rolling Back
If you need to revert to a previous version:
git log --oneline
git checkout <commit-hash>
npm install
npm run build
pm2 restart slurm-dashboard
Rollback Caution:
Rolling back may cause compatibility issues if database schema changes occurred. Always backup before major updates.
Staying Informed
Stay updated on new releases:
- Watch the GitHub repository
- Check the releases page for version notes
- Subscribe to repository notifications
For additional support, visit the GitHub Issues page.