Hosting Dash Applications in Grace

EveryoneUpdated 14 Aug 2025MLOps essentials
Hosting Dash Applications in GRACE
Overview

Grace allows you to host applications such as React or Dash apps. This guide walks through the steps of developing a simple Dash application and hosting it on the Grace platform.

User Guide
Step 1: Prepare Your Dash App
  1. In your workspace, create a project folder (e.g., test_app).
  2. Inside the folder, create two files:
    • app.py – contains the Dash app code.
    • requirements.txt – lists the Python packages required to run the app.
  3. Example Setup
    • app.py:
      • Minimal Dash code (e.g., sample from the Dash Plotly website).
      • Must specify: server instance, debug=True, and port=5080.
    • requirements.txt:
      • dash
      • plotly
      • numpy
  4. Tip: Pin package versions to avoid conflicts (e.g., dash==2.11.1).
Step 2: Test Your App Locally
  1. Before hosting on Grace:
    • Use Visual Studio Code (connected to Grace) to run and debug your app.
    • Ensure the app functions as expected locally.
Step 3: Create a Snapshot in Grace
  1. Navigate to MLOps → Applications from the side ribbon.
  2. Go to the Snapshots tab.
  3. Click Create Snapshot.
  4. Select the test_app folder.
  5. Choose Application Type: Dash (or React if applicable).
  6. Provide a name (e.g., test_123).
  7. Select a runtime image: e.g., Dash Python 3.11.
  8. Version = 1.
  9. Optional settings:
    • Debug Mode – useful for auto-refresh during code changes.
    • Long-Running Callbacks – prevents timeout issues for heavy workloads.
  10. Click Prepare to build the snapshot.
Step 4: Deploy the Application
  1. Once the snapshot is ready, click Deploy.
  2. Configure deployment options:
    • Select the snapshot.
    • Assign a name to the application.
    • Choose resources (CPU type, memory).
    • (Optional) Add identification token or user authentication.
  3. Click Deploy.
Step 5: Access the Hosted App
  1. Once deployment finishes, click the URL provided.
  2. The app opens in your browser and is now hosted on Grace.
Summary
Step Description
Prepare App Create app.py and requirements.txt with Dash code & dependencies
Test Locally Run in VS Code before hosting
Create Snapshot Define app type, runtime, version, debug/long-running options
Deploy Application Allocate resources, authentication, and launch the app
Access App Use the provided URL to interact with the hosted Dash application
Next Steps
  • Extend your Dash app to include interactive dashboards or machine learning models.
  • Use Grace’s deployment features for scaling apps and handling real-world workloads.
GRACE_MLOPs_apps_v.1.57.html Displaying GRACE_MLOPs_apps_v.1.57.html.