in integration/src/integration.py [0:0]
def generate_clusters(basic_properties: Dict, skip_stage_resources: bool = False, nfs_address: str = "") -> None:
nfs_address = nfs_address or get_nfs_ip()
# clear out prior clusters
for fil in os.listdir(CLUSTERS_DIR):
os.remove(os.path.join(CLUSTERS_DIR, fil))
version_helper_path = os.path.realpath(
"../slurm/install/slurm_supported_version.py"
)
supported_slurm_versions = (
check_output([sys.executable, version_helper_path], cwd=CWD).decode().split()
)
for slurm_version in supported_slurm_versions:
for base_cluster_name, cluster_def in CLUSTER_DEFS.items():
if cluster_def.get("__slurm_versionless__"):
if slurm_version != supported_slurm_versions[0]:
continue
for key in list(cluster_def.keys()):
value = cluster_def[key]
if value == "$cli_nfs_address":
cluster_def[key] = nfs_address
cluster_name = f"{base_cluster_name}-{slurm_version}"
cluster_properties = dict(basic_properties)
with open(f"clusters/{cluster_name}.json", "w") as f:
cluster_properties.update(cluster_def)
cluster_properties["configuration_slurm_version"] = slurm_version + "-1"
json.dump(cluster_properties, f, indent=2)
_add_cluster_init(
cluster_properties["SchedulerImageName"],
cluster_name,
skip_stage_resources,
)