Skip to content

Commit

Permalink
Added back support for preemptible setting
Browse files Browse the repository at this point in the history
  • Loading branch information
pgm committed Nov 3, 2023
1 parent fdbaade commit 075d697
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions cli/sparklespray/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,16 @@ def consume(name: str, default : Union[NoDefault, T]=NO_DEFAULT, parser : Callab
),
)

config.max_preemptable_attempts_scale = consume(
"max_preemptable_attempts_scale", 2, int
)
preemptible_yn = consume("preemptible", "y")
assert preemptible_yn.lower() in ['y', 'n'], f"expected preemptible should be either y or n but value was: {preemptible_yn}"
if preemptible_yn.lower() == "n":
assert "max_preemptable_attempts_scale" not in config_dict, f"Cannot specify both preemptible=n and max_preemptable_attempts_scale"

config.max_preemptable_attempts_scale = 0
else:
config.max_preemptable_attempts_scale = consume(
"max_preemptable_attempts_scale", 2, int
)

# config.
# allowed_parameters = set(
Expand Down

0 comments on commit 075d697

Please sign in to comment.