Skip to content

mason: expose app scaling and sticky routing - #515

Open
shivam5 wants to merge 1 commit into
databricks:mainfrom
shivam5:mason-routing-autoscaling
Open

mason: expose app scaling and sticky routing#515
shivam5 wants to merge 1 commit into
databricks:mainfrom
shivam5:mason-routing-autoscaling

Conversation

@shivam5

@shivam5 shivam5 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add --compute-min-instances and --compute-max-instances to mason deploy
  • require the Apps API's paired min/max contract and reject inverted bounds locally
  • apply instance bounds when creating a new app or updating an existing app
  • document Databricks Apps sticky routing/session affinity directly in mason deploy --help
  • update the Mason demo command and deploy help example

Help output

Databricks Apps provides best-effort sticky routing (session affinity) for
horizontally scaled deployments. Browsers preserve the routing cookie
automatically.

API clients must reuse a stable UUID in this cookie on every request:
  __Host-databricks-app-router=<uuid>

--compute-min-instances INTEGER RANGE
                                Minimum number of Databricks Apps instances.
                                Must be set with --compute-max-instances.
--compute-max-instances INTEGER RANGE
                                Maximum number of Databricks Apps instances.
                                Must be set with --compute-min-instances.

Testing

  • uv run pytest -q (225 passed)
  • uv run ruff check
  • uv run ruff format --check
  • uv run ty check
  • uv run mason deploy --help

help="Workspace destination for the synced source (defaults to a per-user path).",
)
@click.option(
"--compute-min-instances",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should we shorten to just --min-instances?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@elainewang-db elainewang-db left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

were you able to test this live and deploy updates the apps scaling properly? my claude hit some issues with this, not sure if it was an apps side blocker or my own setup

help="Workspace destination for the synced source (defaults to a per-user path).",
)
@click.option(
"--compute-min-instances",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment on lines +378 to +384
help="Minimum number of Databricks Apps instances. Must be set with --compute-max-instances.",
)
@click.option(
"--compute-max-instances",
type=click.IntRange(min=1),
default=None,
help="Maximum number of Databricks Apps instances. Must be set with --compute-min-instances.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo?

Suggested change
help="Minimum number of Databricks Apps instances. Must be set with --compute-max-instances.",
)
@click.option(
"--compute-max-instances",
type=click.IntRange(min=1),
default=None,
help="Maximum number of Databricks Apps instances. Must be set with --compute-min-instances.",
help="Minimum number of Databricks Apps instances. Must be set with --compute-min-instances.",
)
@click.option(
"--compute-max-instances",
type=click.IntRange(min=1),
default=None,
help="Maximum number of Databricks Apps instances. Must be set with --compute-max-instances.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also remove Apps references?

__Host-databricks-app-router=<uuid>
"""
_validate_deployment_name(name)
compute_args = _compute_scaling_args(compute_min_instances, compute_max_instances)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the apps runtime support both min and max count today even though they don't support autoscaling yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants