Skip to content

CLI: add --no-profile option#4043

Merged
un-def merged 2 commits into
masterfrom
pr_cli_no_profile
Jul 20, 2026
Merged

CLI: add --no-profile option#4043
un-def merged 2 commits into
masterfrom
pr_cli_no_profile

Conversation

@un-def

@un-def un-def commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Disables default profile loading. Mutually exclusive with --profile.

Supported by the following commands:

  • dstack apply (run configurations only)
  • dstack preset create|apply
  • dstack offer

Disables default profile loading. Mutually exclusive with `--profile`.

Supported by the following commands:
* `dstack apply` (run configurations only)
* `dstack preset create|apply`
* `dstack offer`
@un-def
un-def requested a review from peterschmidt85 July 17, 2026 13:06

@peterschmidt85 peterschmidt85 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.

Look good to me from UX point of view

But also think of supporting NO_DSTACK_PROFILE=1 for consistency?

@un-def

un-def commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

But also think of supporting NO_DSTACK_PROFILE=1 for consistency?

A bit tricky in terms of precedence, I landed on:

--no-profile > --profile=name > DSTACK_NO_PROFILE=1 > DSTACK_PROFILE=name

That is,

dstack offer → default profile loaded
DSTACK_NO_PROFILE=1 dstack offer → no profile loaded
DSTACK_NO_PROFILE=1 DSTACK_PROFILE=my-profile dstack offer → no profile loaded
DSTACK_NO_PROFILE=1 dstack offer --profile my-profilemy-profile loaded
DSTACK_NO_PROFILE=1 DSTACK_PROFILE=other-profile dstack offer --profile my-profilemy-profile loaded
DSTACK_PROFILE=my-profile dstack offer --no-profile → no profile loaded

@peterschmidt85

Copy link
Copy Markdown
Contributor

A bit tricky in terms of precedence, I landed on:

Can be made mutually exclusive?

@un-def

un-def commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

Can be made mutually exclusive?

--profile and --no-profile are mutually exclusive, DSTACK_PROFILE and DSTACK_NO_PROFILE are not – unlike the command line, it's possible that the process environment is not in user's full control, e.g., they can set but cannot unset a variable, so, I'd rather not make them mutually exclusive unless there is a strong reason to do so.

@un-def
un-def merged commit fa13473 into master Jul 20, 2026
24 checks passed
@un-def
un-def deleted the pr_cli_no_profile branch July 20, 2026 10:09
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.

2 participants