Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taskslots #126

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions cfa_azure/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def set_pool_info(
dedicated_nodes=1,
low_priority_nodes=0,
cache_blobfuse: bool = True,
task_slots_per_node: int = 1
) -> None:
"""Sets the scaling mode of the client, either "fixed" or "autoscale".
If "fixed" is selected, debug must be turned off.
Expand All @@ -122,6 +123,7 @@ def set_pool_info(
dedicated_nodes (int, optional): number of dedicated nodes for the pool. Defaults to 1.
low_priority_nodes (int, optional): number of low priority nodes for the pool. Defaults to 0.
cache_blobfuse (bool): True to use blobfuse caching, False to download data from blobfuse every time. Defaults to True.
task_slots_per_node (int): number of task slots per node. Default 1.
"""
# check if debug and scaling mode match, otherwise alert the user
if self.debug is True and mode == "autoscale":
Expand Down Expand Up @@ -163,18 +165,19 @@ def set_pool_info(
self.low_priority_nodes = low_priority_nodes
# create batch_json with fixed
self.pool_parameters = helpers.get_pool_parameters(
mode,
self.container_image_name,
self.registry_url,
self.container_registry_server,
self.config,
self.mount_config,
autoscale_formula_path,
timeout,
dedicated_nodes,
low_priority_nodes,
use_default_autoscale_formula,
max_autoscale_nodes,
mode = mode,
container_image_name= self.container_image_name,
container_registry_url=self.registry_url,
container_registry_server=self.container_registry_server,
config=self.config,
mount_config=self.mount_config,
autoscale_formula_path=autoscale_formula_path,
timeout=timeout,
dedicated_nodes=dedicated_nodes,
low_priority_nodes=low_priority_nodes,
use_default_autoscale_formula=use_default_autoscale_formula,
max_autoscale_nodes=max_autoscale_nodes,
task_slots_per_node= task_slots_per_node
)
logger.debug("pool parameters generated")
else:
Expand Down
5 changes: 4 additions & 1 deletion cfa_azure/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,7 @@ def get_pool_parameters(
low_priority_nodes: int = 0,
use_default_autoscale_formula: bool = False,
max_autoscale_nodes: int = 3,
task_slots_per_node: int = 1
):
"""creates a pool parameter dictionary to be used with pool creation.

Expand All @@ -1215,6 +1216,8 @@ def get_pool_parameters(
dedicated_nodes (int, optional): number of dedicated nodes. Defaults to 1.
low_priority_nodes (int, optional): number of low priority nodes. Defaults to 0.
use_default_autoscale_formula (bool, optional)
max_autoscale_nodes (int): maximum number of nodes to use with autoscaling. Default 3.
task_slots_per_node (int): number of task slots per node. Default is 1.

Returns:
dict: dict of pool parameters for pool creation
Expand Down Expand Up @@ -1260,7 +1263,7 @@ def get_pool_parameters(
"properties": {
"vmSize": config["Batch"]["pool_vm_size"],
"interNodeCommunication": "Disabled",
"taskSlotsPerNode": 1,
"taskSlotsPerNode": task_slots_per_node,
"taskSchedulingPolicy": {"nodeFillType": "Spread"},
"deploymentConfiguration": get_deployment_config(
container_image_name,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cfa_azure"
version = "0.3.3"
version = "0.3.4"
description = "module for use with Azure and Azure Batch"
authors = ["Ryan Raasch <[email protected]>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="cfa_azure",
version="0.3.3",
version="0.3.4",
description="module for use with Azure and Azure Batch",
packages=find_packages(exclude=["tests", "venv"]),
author="Ryan Raasch",
Expand Down