Skip to content

Commit

Permalink
SwanSpawner: Move analytix cluster to Alma9 platform only
Browse files Browse the repository at this point in the history
  • Loading branch information
PMax5 authored and etejedor committed Jun 21, 2024
1 parent 21dd583 commit 03cc741
Showing 1 changed file with 8 additions and 29 deletions.
37 changes: 8 additions & 29 deletions SwanSpawner/swanspawner/templates/options_form_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,6 @@
for( var i = 0 ; i < lcgData.clusters.length ; i++ ){
var lcgCluster = lcgData.clusters[i];

if (lcgCluster.value === "k8s" || lcgCluster.value === "hadoop-qa") {
continue;
}

var selectClusterOption = document.createElement("option");
selectClusterOption.value = lcgCluster.value;
selectClusterOption.text = lcgCluster.text;
Expand All @@ -174,43 +170,26 @@

selectCondor.add(selectCondorOption);
}

adjust_spark();
}


/**
* Modifies the selection of Spark clusters depending on the chosen platform
*/
function adjust_spark() {
var platformOptions = document.getElementById('platformOptions');

function removeCluster(cluster) {
var clusterOptions = document.getElementById('clusterOptions');
for (var i = 0; i < clusterOptions.options.length; i++) {
if (clusterOptions.options[i].value === cluster) {
clusterOptions.remove(i);
break;
}
}
}

function addCluster(clusterValue, clusterName) {
var selectClusterOption = document.createElement("option");
selectClusterOption.value = clusterValue;
selectClusterOption.text = clusterName;
clusterOptions.add(selectClusterOption);
}
var clusterOptions = document.getElementById('clusterOptions');

var isAlma = platformOptions.selectedOptions[0].text.startsWith('AlmaLinux 9');

if (isAlma) {
// On Alma9, make sure cluster selection is enabled
clusterOptions.removeAttribute('disabled');
} else {
clusterOptions.setAttribute('disabled', '');
clusterOptions.selectedIndex = 0;
removeCluster("analytix")
addCluster("k8s", "Cloud Containers (K8s)")
addCluster("hadoop-qa", "QA")
}
else {
addCluster("analytix", "General Purpose (Analytix)")
removeCluster("k8s")
removeCluster("hadoop-qa")
}
}

Expand Down

0 comments on commit 03cc741

Please sign in to comment.