dstack icon indicating copy to clipboard operation
dstack copied to clipboard

[Feature]: Allow running services and models without a gateway

Open peterschmidt85 opened this issue 1 year ago • 3 comments

Use case:

  • As a user, I want to run a service/model and make it accessible to my project team.
  • I don't want to set up a domain.
  • I don't want to make the endpoint public.

Suggestion:

  • In addition to the existing ability to create "managed" gateways (public IP address, custom domain), allow the dstack server to handle service/model traffic directly.

Motivation:

  • So far, services have primarily been used for development, but the need to set up a domain and create a public endpoint poses a significant barrier. If the dstack server could run services/models out of the box, it would greatly simplify usage for both individuals and companies.

peterschmidt85 avatar Aug 21 '24 10:08 peterschmidt85

Another reason why this issue is important is that in our documentation, we often use tasks for deploying models because it doesn’t require creating a gateway, which is also not supported for all backends. However, when a model is running as a task, the user cannot use the UI to interact with the model.

peterschmidt85 avatar Aug 23 '24 16:08 peterschmidt85

Implementation progress

  • [ ] Python-based reverse proxy for services
    • [x] HTTP proxying
    • [x] Request/response streaming
    • [ ] Websocket proxying
    • [x] Proxying to multiple service replicas
    • [x] Auth
    • [ ] Configuring whether path prefix is stripped
  • [x] Running services without a gateway
  • [x] OpenAI endpoint
  • [x] #1954
  • [x] Configuring which gateway to use for the run
  • [ ] Collecting stats for replicas autoscaling
  • [x] Using the new proxy implementation on gateways
    • [x] Nginx- and certbot- related logic
    • [x] Installation and updates

Usage instructions for the current version

  1. Make sure your project doesn't have a default gateway or set gateway: false in your service configuration.
  2. Run the service.
  3. Your service is now available at <dstack-server-base-url>/proxy/services/<project-name>/<run-name>/. If the service defines a model mapping, the OpenAI-compatible API is available at <dstack-server-base-url>/proxy/models/<project-name>/

jvstme avatar Sep 26 '24 14:09 jvstme

Plus, ensure the UI can leverage the built-in proxy

peterschmidt85 avatar Sep 26 '24 14:09 peterschmidt85

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Dec 08 '24 02:12 github-actions[bot]

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Jan 23 '25 01:01 github-actions[bot]

Gateways have become optional in dstack 0.18.23, so we will close this issue. The remaining technical debt has been moved to separate issues to allow for more granular prioritization:

  • #2252
  • #2251
  • #2250
  • #2238
  • #2237
  • #2232
  • #2231

jvstme avatar Jan 31 '25 13:01 jvstme