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

  1. Navigate to the dashboard directory:

    cd /path/to/slurm-node-dashboard
    
  2. Run the update script:

    ./infra/update.sh
    

    The 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
  3. 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 .env exists: Your existing configuration is preserved. If .env.production also exists, it's moved to a timestamped backup to prevent conflicts.
  • If .env doesn't exist: The script creates .env from .env.production and 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:

  1. Pull the latest code:

    git pull
    
  2. Remove build artifacts (recommended for clean rebuild):

    rm -rf .next node_modules package-lock.json
    
  3. Install dependencies:

    npm install
    
  4. Build the application:

    npm run build
    
  5. 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 .env file 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:

  1. Check file permissions:

    chmod +x infra/update.sh
    
  2. Review git status:

    git status
    
  3. Resolve any merge conflicts manually, then run the script again

  4. Check npm logs for dependency issues:

    npm cache clean --force
    npm install
    

Build Fails

If the build process fails:

  1. Check Node.js version:

    node --version  # Should be v20+
    
  2. Clear build cache:

    rm -rf .next
    npm run build
    
  3. Review error messages in the build output for specific issues

Environment File Issues

If you have problems with environment variables:

  1. Check for duplicate files:

    ls -la .env*
    

    Only .env should exist in production (not .env.production)

  2. Compare with example:

    # If you have a backup
    diff .env .env.production.backup_*
    
  3. Verify required variables are set in your .env file

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.