Skip to content

Commit

Permalink
fix: ask whether we run as prod in local launch
Browse files Browse the repository at this point in the history
User was no longer asked whether they wanted to run on prod or not. In
other words, it was not convenient to run as local.overhang.io.
  • Loading branch information
regisb committed Aug 16, 2023
1 parent 67009fb commit b51fdb4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions changelog.d/20230816_184458_regis_fix_local_non_prod.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [Bugfix] Ask whether user wants to run locally during `tutor local launch`. (by @regisb)
10 changes: 5 additions & 5 deletions tutor/commands/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ def launch(
skip_build: bool,
) -> None:
context_name = context.obj.NAME
run_for_prod = context_name != "dev"
run_for_prod = False if context_name == "dev" else None

utils.warn_macos_docker_memory()

# Upgrade has to run before configuration
interactive_upgrade(context, not non_interactive, run_for_prod)
interactive_configuration(context, not non_interactive, run_for_prod)
interactive_upgrade(context, not non_interactive, run_for_prod=run_for_prod)
interactive_configuration(context, not non_interactive, run_for_prod=run_for_prod)

config = tutor_config.load(context.obj.root)

Expand Down Expand Up @@ -136,7 +136,7 @@ def launch(


def interactive_upgrade(
context: click.Context, interactive: bool, run_for_prod: bool
context: click.Context, interactive: bool, run_for_prod: t.Optional[bool]
) -> None:
"""
Piece of code that is only used in launch.
Expand Down Expand Up @@ -187,7 +187,7 @@ def interactive_upgrade(


def interactive_configuration(
context: click.Context, interactive: bool, run_for_prod: bool
context: click.Context, interactive: bool, run_for_prod: t.Optional[bool] = None
) -> None:
click.echo(fmt.title("Interactive platform configuration"))
config = tutor_config.load_minimal(context.obj.root)
Expand Down

0 comments on commit b51fdb4

Please sign in to comment.