Skip to content

Commit

Permalink
Disable Spark clusters if selected platform is Alma9
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
etejedor committed Jan 12, 2024
1 parent 0f95d7a commit 89f57f6
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion SwanSpawner/swanspawner/templates/options_form_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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;
//-->
</script>
Expand All @@ -194,7 +217,7 @@
<span class='nb'>The combination of compiler version and flags.</span>
</div>
</label>
<select id="platformOptions" name="platform"></select>
<select id="platformOptions" name="platform" onchange="adjust_spark();"></select>
<br>
<label for="scriptenvOption">Environment script <a href="#" onclick="toggle_visibility('scriptenvDetails');"><span class='nbs'>more...</span></a>
<div style="display:none;" id="scriptenvDetails">
Expand Down

0 comments on commit 89f57f6

Please sign in to comment.