Skip to content

Commit 3df0089

Browse files
committed
bug fix: validating config caused bootDiskSizeGb to not work due to INI parser appears to drop capitalization
1 parent 028b67d commit 3df0089

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

sparklespray/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '3.8.0'
1+
__version__ = "3.8.1"

sparklespray/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ def load_config_from_dict(config):
145145
"account",
146146
"service_account_key",
147147
"credentials",
148-
"bootDiskSizeGb",
148+
"bootdisksizegb", # deprecated name, replaced with boot_volume_in_gb
149+
"boot_volume_in_gb",
149150
"preemptible",
150151
"local_work_dir",
151152
"gpu_count",

sparklespray/submit.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
class SubmitConfig(BaseModel):
3737
preemptible: bool
38-
bootDiskSizeGb: float
38+
boot_volume_in_gb: float
3939
default_url_prefix: str
4040
machine_type: str
4141
image: str
@@ -196,7 +196,7 @@ def submit(jq: JobQueue, io: IO, cluster: Cluster, job_id: str, spec: dict, conf
196196
skip_kube_submit = True
197197

198198
preemptible = config.preemptible
199-
bootDiskSizeGb = config.bootDiskSizeGb
199+
boot_volume_in_gb = config.boot_volume_in_gb
200200
default_url_prefix = config.default_url_prefix
201201
gpu_count = config.gpu_count
202202

@@ -240,7 +240,7 @@ def submit(jq: JobQueue, io: IO, cluster: Cluster, job_id: str, spec: dict, conf
240240
consume_exe_args = ["--cluster", cluster_name, "--projectId", project,
241241
"--zones", ",".join(config.zones), "--port", str(monitor_port)]
242242

243-
machine_specs = MachineSpec(boot_volume_in_gb=bootDiskSizeGb,
243+
machine_specs = MachineSpec(boot_volume_in_gb=boot_volume_in_gb,
244244
mount_point=config.mount_point,
245245
machine_type=config.machine_type,
246246
gpu_count=gpu_count)
@@ -402,8 +402,14 @@ def add_submit_cmd(subparser):
402402
help="Number of gpus on your VM", default=0)
403403

404404

405-
def _get_bootDiskSizeGb(config):
406-
bootDiskSizeGb_flag = config.get("bootDiskSizeGb", "20")
405+
def _get_boot_volume_in_gb(config):
406+
bootDiskSizeGb_flag = config.get("bootDiskSizeGb")
407+
if bootDiskSizeGb_flag is None:
408+
bootDiskSizeGb_flag = config.get("bootdisksizegb")
409+
if bootDiskSizeGb_flag is None:
410+
bootDiskSizeGb_flag = config.get("boot_volume_in_gb")
411+
if bootDiskSizeGb_flag is None:
412+
bootDiskSizeGb_flag = "20"
407413
bootDiskSizeGb = int(bootDiskSizeGb_flag)
408414
assert bootDiskSizeGb >= 10
409415
return bootDiskSizeGb
@@ -426,7 +432,7 @@ def submit_cmd(jq, io, cluster, args, config):
426432
"setting 'preemptible' in config must either by 'y' or 'n' but was: {}".format(preemptible_flag))
427433
preemptible = preemptible_flag == 'y'
428434

429-
bootDiskSizeGb = _get_bootDiskSizeGb(config)
435+
boot_volume_in_gb = _get_boot_volume_in_gb(config)
430436
default_url_prefix = config.get("default_url_prefix", "")
431437
work_dir = config.get("local_work_dir", os.path.expanduser(
432438
"~/.sparkles-cache/local_work_dir"))
@@ -522,7 +528,7 @@ def submit_cmd(jq, io, cluster, args, config):
522528
log.debug("spec: %s", json.dumps(spec, indent=2))
523529

524530
submit_config = SubmitConfig(preemptible=preemptible,
525-
bootDiskSizeGb=bootDiskSizeGb,
531+
boot_volume_in_gb=boot_volume_in_gb,
526532
default_url_prefix=default_url_prefix,
527533
machine_type=machine_type,
528534
image=spec['image'],

sparklespray/validate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def _test_datastore_api(job_store: JobStore, job_id: str):
3131

3232

3333
def validate_cmd(jq: JobQueue, io: IO, cluster: Cluster, config: dict):
34-
from .submit import _get_bootDiskSizeGb
34+
from .submit import _get_boot_volume_in_gb
3535

3636
print(f"Validating config, using sparklespray {sparklespray.__version__}")
3737

@@ -67,7 +67,7 @@ def __repr__(self):
6767
logging_url = config["default_url_prefix"] + "/node-logs"
6868

6969
cluster.test_image(
70-
config["default_image"], sample_url, logging_url, _get_bootDiskSizeGb(config)
70+
config["default_image"], sample_url, logging_url, _get_boot_volume_in_gb(config)
7171
)
7272

7373
print("Verification successful!")

0 commit comments

Comments
 (0)