Skip to content

Commit

Permalink
added kubernetes for auto-scaled cluster settings
Browse files Browse the repository at this point in the history
  • Loading branch information
AlfiyaRF committed Jan 3, 2024
1 parent 65a7285 commit f07d630
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ export const LaunchClusterTooltip = {
childNodeInstanceFamily: 'child node instance family',
gpuScaling: 'gpu scaling',
enableGridEngine: 'enable grid engine',
enableSlurm: 'enable slurm'
enableSlurm: 'enable slurm',
enableKube: 'enable kube'
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ export function slurmEnabled (parameters) {
export function autoScaledClusterEnabled (parameters) {
return booleanParameterIsSetToValue(parameters, CP_CAP_AUTOSCALE) && (
gridEngineEnabled(parameters) ||
slurmEnabled(parameters)
slurmEnabled(parameters) ||
kubeEnabled(parameters)
);
}

Expand Down Expand Up @@ -124,6 +125,7 @@ export function getSkippedSystemParametersList (controller) {
controller.state.gridEngineEnabled ||
controller.state.sparkEnabled ||
controller.state.slurmEnabled ||
controller.state.kubeEnabled ||
controller.state.hybridAutoScaledClusterEnabled
)) {
return [
Expand Down Expand Up @@ -304,6 +306,7 @@ class ConfigureClusterDialog extends React.Component {
const details = [
ctrl.state.gridEngineEnabled ? 'GridEngine' : false,
ctrl.state.slurmEnabled ? 'Slurm' : false,
ctrl.state.kubeEnabled ? 'Kubernetes' : false,
ctrl.state.hybridAutoScaledClusterEnabled ? 'hybrid' : false,
ctrl.state.gpuScalingConfiguration ? 'GPU' : false
].filter(Boolean).join(' ');
Expand Down Expand Up @@ -392,8 +395,7 @@ class ConfigureClusterDialog extends React.Component {
get selectedClusterType () {
if (this.state.launchCluster) {
return this.state.autoScaledCluster &&
!this.state.sparkEnabled &&
!this.state.kubeEnabled
!this.state.sparkEnabled
? CLUSTER_TYPE.autoScaledCluster
: CLUSTER_TYPE.fixedCluster;
} else {
Expand Down Expand Up @@ -558,15 +560,26 @@ class ConfigureClusterDialog extends React.Component {
};

onChangeEnableKube = (e) => {
this.setState({
gridEngineEnabled: false,
sparkEnabled: false,
slurmEnabled: false,
kubeEnabled: e.target.checked,
hybridAutoScaledClusterEnabled: false,
gpuScalingConfiguration: undefined,
childNodeInstanceConfiguration: undefined
});
if (this.state.launchCluster && this.state.autoScaledCluster) {
this.setState({
gridEngineEnabled: !e.target.checked,
sparkEnabled: false,
slurmEnabled: false,
kubeEnabled: e.target.checked,
gpuScalingConfiguration: undefined,
childNodeInstanceConfiguration: undefined
});
} else {
this.setState({
gridEngineEnabled: false,
sparkEnabled: false,
slurmEnabled: false,
kubeEnabled: e.target.checked,
hybridAutoScaledClusterEnabled: false,
gpuScalingConfiguration: undefined,
childNodeInstanceConfiguration: undefined
});
}
};

onChangeEnableHybridAutoScaledCluster = (e) => {
Expand All @@ -580,7 +593,6 @@ class ConfigureClusterDialog extends React.Component {
const gpuScalingConfigurationEnabled = !!gpuScalingConfiguration;
this.setState({
sparkEnabled: false,
kubeEnabled: false,
hybridAutoScaledClusterEnabled: e.target.checked,
gpuScalingConfiguration: gpuScalingConfigurationEnabled
? getGPUScalingDefaultConfiguration({provider, hybrid: e.target.checked}, preferences)
Expand Down Expand Up @@ -932,7 +944,7 @@ class ConfigureClusterDialog extends React.Component {
const renderGPUScalingConfigurationToggle = () => {
const {preferences, cloudRegionProvider} = this.props;
const configuration = getScalingConfigurationForProvider(cloudRegionProvider, preferences);
if (!configuration || this.state.slurmEnabled) {
if (!configuration || this.state.slurmEnabled || this.state.kubeEnabled) {
return [];
}
const {
Expand All @@ -958,7 +970,7 @@ class ConfigureClusterDialog extends React.Component {
const renderGPUScalingConfiguration = () => {
const {preferences, cloudRegionProvider} = this.props;
const configuration = getScalingConfigurationForProvider(cloudRegionProvider, preferences);
if (!configuration || this.state.slurmEnabled) {
if (!configuration || this.state.slurmEnabled || this.state.kubeEnabled) {
return [];
}
const {
Expand Down Expand Up @@ -1032,6 +1044,15 @@ class ConfigureClusterDialog extends React.Component {
</Checkbox>
{renderTooltip(LaunchClusterTooltip.autoScaledCluster.enableSlurm)}
</Row>,
<Row key="enable kube" type="flex" align="middle" style={{marginTop: 5}}>
<Checkbox
style={{marginLeft: LEFT_MARGIN}}
checked={this.state.kubeEnabled}
onChange={this.onChangeEnableKube}>
Enable Kubernetes
</Checkbox>
{renderTooltip(LaunchClusterTooltip.autoScaledCluster.enableKube)}
</Row>,
<Row key="enable hybrid" type="flex" align="middle" style={{marginTop: 15}}>
<Checkbox
style={{marginLeft: LEFT_MARGIN}}
Expand Down Expand Up @@ -1077,7 +1098,7 @@ class ConfigureClusterDialog extends React.Component {
};

render () {
const {sparkEnabled, kubeEnabled} = this.state;
const {sparkEnabled} = this.state;
return (
<Modal
title={
Expand All @@ -1098,7 +1119,7 @@ class ConfigureClusterDialog extends React.Component {
<Radio.Button value={CLUSTER_TYPE.singleNode}>Single node</Radio.Button>
<Radio.Button value={CLUSTER_TYPE.fixedCluster}>Cluster</Radio.Button>
<Radio.Button
disabled={sparkEnabled || kubeEnabled}
disabled={sparkEnabled}
value={CLUSTER_TYPE.autoScaledCluster}
>
Auto-scaled cluster
Expand Down

0 comments on commit f07d630

Please sign in to comment.