From 89f57f60756e80d1e795db174979caf12ed62707 Mon Sep 17 00:00:00 2001 From: Enric Tejedor Saavedra Date: Wed, 10 Jan 2024 22:38:48 +0100 Subject: [PATCH] Disable Spark clusters if selected platform is Alma9 This setting is currently necessary because: - The SWAN Spark extensions are still not fully functional with JupyterLab 4 in the Alma9 image - The Spark clusters that are selectable from SWAN have not migrated to Alma9 yet, and therefore using an Alma9 client with CentOS7 on the server side can cause conflicts. --- .../templates/options_form_template.html | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/SwanSpawner/swanspawner/templates/options_form_template.html b/SwanSpawner/swanspawner/templates/options_form_template.html index da3f3d0..acb28b8 100644 --- a/SwanSpawner/swanspawner/templates/options_form_template.html +++ b/SwanSpawner/swanspawner/templates/options_form_template.html @@ -138,6 +138,8 @@ // adjust clusters option for lcg var selectCluster = document.getElementById('clusterOptions'); selectCluster.innerHTML = ''; + // Make sure Spark cluster options are enabled on LCG release change + selectCluster.removeAttribute('disabled'); for( var i = 0 ; i < lcgData.clusters.length ; i++ ){ var lcgCluster = lcgData.clusters[i]; @@ -170,6 +172,27 @@ } } + /** + * Modifies the selection of Spark clusters depending on the chosen platform + */ + function adjust_spark() { + var platformOptions = document.getElementById('platformOptions'); + var clusterOptions = document.getElementById('clusterOptions'); + + var isAlma = platformOptions.selectedOptions[0].text.startsWith('AlmaLinux 9'); + + if (isAlma) { + // Disable Spark cluster selection, since Spark is still not supported + // on Alma9 + clusterOptions.setAttribute('disabled', ''); + clusterOptions.selectedIndex = 0; + } + else { + // On CentOS7, make sure cluster selection is enabled + clusterOptions.removeAttribute('disabled'); + } + } + window.onload = adjust_form; //--> @@ -194,7 +217,7 @@ The combination of compiler version and flags. - +